7 Please see the @ref authors page for contact details.
8 @link Evas.h Evas API @endlink
10 @link Evas.h Evas API @endlink
12 @section toc Table of Contents
19 @li @ref intro_example
22 @section intro What is Evas?
24 Evas is a clean display canvas API for several target display systems
25 that can draw anti-aliased text, smooth super and sub-sampled scaled
26 images, alpha-blend objects and much more.
28 It abstracts any need to know much about what the characteristics of
29 your display system are or what graphics calls are used to draw them
30 and how. It deals on an object level where all you do is create and
31 manipulate objects in a canvas, set their properties, and the rest is
34 Evas optimises the rendering pipeline to minimise effort in redrawing
35 changes made to the canvas and so takes this work out of the
36 programmers hand, saving a lot of time and energy.
38 It's small and lean, designed to work on embedded systems all the way
39 to large and powerful multi-cpu workstations. It can be compiled to
40 only have the features you need for your target platform if you so
41 wish, thus keeping it small and lean. It has several display
42 back-ends, letting it display on several display systems, making it
43 portable for cross-device and cross-platform development.
45 @subsection intro_not_evas What Evas is not?
47 Evas is not a widget set or widget toolkit, however it is their
48 base. See Elementary (http://docs.enlightenment.org/auto/elementary/)
49 for a toolkit based on Evas, Edje, Ecore and other Enlightenment
52 It is not dependent or aware of main loops, input or output
53 systems. Input should be polled from various sources and fed to
54 Evas. Similarly, it will not create windows or report windows updates
55 to your system, rather just drawing the pixels and reporting to the
56 user the areas that were changed. Of course these operations are quite
57 common and thus they are ready to use in Ecore, particularly in
58 Ecore_Evas (http://docs.enlightenment.org/auto/ecore/).
61 @section work How does Evas work?
63 Evas is a canvas display library. This is markedly different from most
64 display and windowing systems as a canvas is structural and is also a
65 state engine, whereas most display and windowing systems are immediate
66 mode display targets. Evas handles the logic between a structural
67 display via its state engine, and controls the target windowing system
68 in order to produce rendered results of the current canvas' state on
71 Immediate mode display systems retain very little, or no state. A
72 program will execute a series of commands, as in the pseudo code:
75 draw line from position (0, 0) to position (100, 200);
77 draw rectangle from position (10, 30) to position (50, 500);
79 bitmap_handle = create_bitmap();
80 scale bitmap_handle to size 100 x 100;
81 draw image bitmap_handle at position (10, 30);
84 The series of commands is executed by the windowing system and the
85 results are displayed on the screen (normally). Once the commands are
86 executed the display system has little or no idea of how to reproduce
87 this image again, and so has to be instructed by the application how
88 to redraw sections of the screen whenever needed. Each successive
89 command will be executed as instructed by the application and either
90 emulated by software or sent to the graphics hardware on the device to
93 The advantage of such a system is that it is simple, and gives a
94 program tight control over how something looks and is drawn. Given the
95 increasing complexity of displays and demands by users to have better
96 looking interfaces, more and more work is needing to be done at this
97 level by the internals of widget sets, custom display widgets and
98 other programs. This means more and more logic and display rendering
99 code needs to be written time and time again, each time the
100 application needs to figure out how to minimise redraws so that
101 display is fast and interactive, and keep track of redraw logic. The
102 power comes at a high-price, lots of extra code and work. Programmers
103 not very familiar with graphics programming will often make mistakes
104 at this level and produce code that is sub optimal. Those familiar
105 with this kind of programming will simply get bored by writing the
106 same code again and again.
108 For example, if in the above scene, the windowing system requires the
109 application to redraw the area from 0, 0 to 50, 50 (also referred as
110 "expose event"), then the programmer must calculate manually the
111 updates and repaint it again:
114 Redraw from position (0, 0) to position (50, 50):
116 // what was in area (0, 0, 50, 50)?
118 // 1. intersection part of line (0, 0) to (100, 200)?
119 draw line from position (0, 0) to position (25, 50);
121 // 2. intersection part of rectangle (10, 30) to (50, 500)?
122 draw rectangle from position (10, 30) to position (50, 50)
124 // 3. intersection part of image at (10, 30), size 100 x 100?
125 bitmap_subimage = subregion from position (0, 0) to position (40, 20)
126 draw image bitmap_subimage at position (10, 30);
129 The clever reader might have noticed that, if all elements in the
130 above scene are opaque, then the system is doing useless paints: part
131 of the line is behind the rectangle, and part of the rectangle is
132 behind the image. These useless paints tend to be very costly, as
133 pixels tend to be 4 bytes in size, thus an overlapping region of 100 x
134 100 pixels is around 40000 useless writes! The developer could write
135 code to calculate the overlapping areas and avoid painting then, but
136 then it should be mixed with the "expose event" handling mentioned
137 above and quickly one realizes the initially simpler method became
140 Evas is a structural system in which the programmer creates and
141 manages display objects and their properties, and as a result of this
142 higher level state management, the canvas is able to redraw the set of
143 objects when needed to represent the current state of the canvas.
145 For example, the pseudo code:
148 line_handle = create_line();
149 set line_handle from position (0, 0) to position (100, 200);
152 rectangle_handle = create_rectangle();
153 move rectangle_handle to position (10, 30);
154 resize rectangle_handle to size 40 x 470;
155 show rectangle_handle;
157 bitmap_handle = create_bitmap();
158 scale bitmap_handle to size 100 x 100;
159 move bitmap_handle to position (10, 30);
165 This may look longer, but when the display needs to be refreshed or
166 updated, the programmer only moves, resizes, shows, hides etc. the
167 objects that need to change. The programmer simply thinks at the
168 object logic level, and the canvas software does the rest of the work
169 for them, figuring out what actually changed in the canvas since it
170 was last drawn, how to most efficiently redraw the canvas and its
171 contents to reflect the current state, and then it can go off and do
172 the actual drawing of the canvas.
174 This lets the programmer think in a more natural way when dealing with
175 a display, and saves time and effort of working out how to load and
176 display images, render given the current display system etc. Since
177 Evas also is portable across different display systems, this also
178 gives the programmer the ability to have their code ported and
179 displayed on different display systems with very little work.
181 Evas can be seen as a display system that stands somewhere between a
182 widget set and an immediate mode display system. It retains basic
183 display logic, but does very little high-level logic such as
184 scrollbars, sliders, push buttons etc.
187 @section compiling How to compile using Evas ?
189 Evas is a library your application links to. The procedure for this is
190 very simple. You simply have to compile your application with the
191 appropriate compiler flags that the @c pkg-config script outputs. For
194 Compiling C or C++ files into object files:
197 gcc -c -o main.o main.c `pkg-config --cflags evas`
200 Linking object files into a binary executable:
203 gcc -o my_application main.o `pkg-config --libs evas`
206 You simply have to make sure that @c pkg-config is in your shell's @c
207 PATH (see the manual page for your appropriate shell) and @c evas.pc
208 in @c /usr/lib/pkgconfig or its path in the @c PKG_CONFIG_PATH
209 environment variable. It's that simple to link and use Evas once you
210 have written your code to use it.
212 Since the program is linked to Evas, it is now able to use any
213 advertised API calls to display graphics in a canvas managed by it, as
214 well as use the API calls provided to manage data.
216 You should make sure you add any extra compile and link flags to your
217 compile commands that your application may need as well. The above
218 example is only guaranteed to make Evas add it's own requirements.
221 @section install How is it installed?
233 @section next_steps Next Steps
235 After you understood what Evas is and installed it in your system you
236 should proceed understanding the programming interface for all
237 objects, then see the specific for the most used elements. We'd
238 recommend you to take a while to learn Ecore
239 (http://docs.enlightenment.org/auto/ecore/) and Edje
240 (http://docs.enlightenment.org/auto/edje/) as they will likely save
241 you tons of work compared to using just Evas directly.
245 @li @ref Evas_Object_Group, where you'll get how to basically
246 manipulate generic objects lying on an Evas canvas, handle canvas
247 and object events, etc.
248 @li @ref Evas_Object_Rectangle, to learn about the most basic object
249 type on Evas -- the rectangle.
250 @li @ref Evas_Object_Polygon, to learn how to create polygon elements
252 @li @ref Evas_Line_Group, to learn how to create line elements on the
254 @li @ref Evas_Object_Image, to learn about image objects, over which
255 Evas can do a plethora of operations.
256 @li @ref Evas_Object_Text, to learn how to create textual elements on
258 @li @ref Evas_Object_Textblock, to learn how to create multiline
259 textual elements on the canvas.
260 @li @ref Evas_Smart_Object_Group and @ref Evas_Smart_Group, to define
261 new objects that provide @b custom functions to handle clipping,
262 hiding, moving, resizing, color setting and more. These could
263 be as simple as a group of objects that move together (see @ref
264 Evas_Smart_Object_Clipped) up to implementations of what
265 ends to be a widget, providing some intelligence (thus the name)
266 to Evas objects -- like a button or check box, for example.
268 @section intro_example Introductory Example
270 @include evas-buffer-simple.c
274 @page authors Authors
275 @author Carsten Haitzler <raster@@rasterman.com>
276 @author Till Adam <till@@adam-lilienthal.de>
277 @author Steve Ireland <sireland@@pobox.com>
278 @author Brett Nash <nash@@nash.id.au>
279 @author Tilman Sauerbeck <tilman@@code-monkey.de>
280 @author Corey Donohoe <atmos@@atmos.org>
281 @author Yuri Hudobin <glassy_ape@@users.sourceforge.net>
282 @author Nathan Ingersoll <ningerso@@d.umn.edu>
283 @author Willem Monsuwe <willem@@stack.nl>
284 @author Jose O Gonzalez <jose_ogp@@juno.com>
285 @author Bernhard Nemec <Bernhard.Nemec@@viasyshc.com>
286 @author Jorge Luis Zapata Muga <jorgeluis.zapata@@gmail.com>
287 @author Cedric Bail <cedric.bail@@free.fr>
288 @author Gustavo Sverzut Barbieri <barbieri@@profusion.mobi>
289 @author Vincent Torri <vtorri@@univ-evry.fr>
290 @author Tim Horton <hortont424@@gmail.com>
291 @author Tom Hacohen <tom@@stosb.com>
292 @author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
293 @author Iván Briano <ivan@@profusion.mobi>
294 @author Gustavo Lima Chaves <glima@@profusion.mobi>
295 @author Samsung Electronics
297 @author Sung W. Park <sungwoo@@gmail.com>
298 @author Jiyoun Park <jy0703.park@@samsung.com>
299 @author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
300 @author Thierry el Borgi <thierry@@substantiel.fr>
301 @author Shilpa Singh <shilpa.singh@@samsung.com> <shilpasingh.o@@gmail.com>
302 @author ChunEon Park <hermet@@hermet.pe.kr>
303 @author Christopher 'devilhorns' Michael <cpmichael1@@comcast.net>
304 @author Seungsoo Woo <om101.woo@@samsung.com>
305 @author Youness Alaoui <kakaroto@@kakaroto.homelinux.net>
306 @author Jim Kukunas <james.t.kukunas@@linux.intel.com>
307 @author Nicolas Aguirre <aguirre.nicolas@@gmail.com>
308 @author Rafal Krypa <r.krypa@@samsung.com>
309 @author Hyoyoung Chang <hyoyoung@@gmail.com>
310 @author Jérôme Pinot <ngc891@@gmail.com>
311 @author Rafael Antognolli <antognolli@@profusion.mobi>
313 Please contact <enlightenment-devel@lists.sourceforge.net> to get in
314 contact with the developers and maintainers.
329 # ifdef EFL_EVAS_BUILD
331 # define EAPI __declspec(dllexport)
334 # endif /* ! DLL_EXPORT */
336 # define EAPI __declspec(dllimport)
337 # endif /* ! EFL_EVAS_BUILD */
341 # define EAPI __attribute__ ((visibility("default")))
348 #endif /* ! _WIN32 */
354 #define EVAS_VERSION_MAJOR 1
355 #define EVAS_VERSION_MINOR 6
357 typedef struct _Evas_Version
365 EAPI extern Evas_Version * evas_version;
369 * @brief These routines are used for Evas library interaction.
371 * @todo check boolean return values and convert to Eina_Bool
372 * @todo change all api to use EINA_SAFETY_*
373 * @todo finish api documentation
376 /* BiDi exposed stuff */
378 typedef enum _Evas_BiDi_Direction
380 EVAS_BIDI_DIRECTION_NATURAL,
381 EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL,
382 EVAS_BIDI_DIRECTION_LTR,
383 EVAS_BIDI_DIRECTION_RTL
384 } Evas_BiDi_Direction;
387 * Identifier of callbacks to be set for Evas canvases or Evas
390 * The following figure illustrates some Evas callbacks:
392 * @image html evas-callbacks.png
393 * @image rtf evas-callbacks.png
394 * @image latex evas-callbacks.eps
396 * @see evas_object_event_callback_add()
397 * @see evas_event_callback_add()
399 typedef enum _Evas_Callback_Type
402 * The following events are only for use with Evas objects, with
403 * evas_object_event_callback_add():
405 EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
406 EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
407 EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
408 EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
409 EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
410 EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
411 EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
412 EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
413 EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
414 EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
415 EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
416 EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
417 EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
418 EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
419 EVAS_CALLBACK_SHOW, /**< Show Event */
420 EVAS_CALLBACK_HIDE, /**< Hide Event */
421 EVAS_CALLBACK_MOVE, /**< Move Event */
422 EVAS_CALLBACK_RESIZE, /**< Resize Event */
423 EVAS_CALLBACK_RESTACK, /**< Restack Event */
424 EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
425 EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
426 EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
427 EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
430 * The following events are only for use with Evas canvases, with
431 * evas_event_callback_add():
433 EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
434 EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
435 EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
436 EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
437 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
438 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
441 * More Evas object event types - see evas_object_event_callback_add():
443 EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanism in Evas that throw out original image data) */
445 EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target @since 1.2 */
446 EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target @since 1.2 */
448 EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
449 } Evas_Callback_Type; /**< The types of events triggering a callback */
452 * @def EVAS_CALLBACK_PRIORITY_BEFORE
453 * Slightly more prioritized than default.
456 #define EVAS_CALLBACK_PRIORITY_BEFORE -100
458 * @def EVAS_CALLBACK_PRIORITY_DEFAULT
459 * Default callback priority level
462 #define EVAS_CALLBACK_PRIORITY_DEFAULT 0
464 * @def EVAS_CALLBACK_PRIORITY_AFTER
465 * Slightly less prioritized than default.
468 #define EVAS_CALLBACK_PRIORITY_AFTER 100
471 * @typedef Evas_Callback_Priority
473 * Callback priority value. Range is -32k - 32k. The lower the number, the
474 * bigger the priority.
476 * @see EVAS_CALLBACK_PRIORITY_AFTER
477 * @see EVAS_CALLBACK_PRIORITY_BEFORE
478 * @see EVAS_CALLBACK_PRIORITY_DEFAULT
482 typedef short Evas_Callback_Priority;
485 * Flags for Mouse Button events
487 typedef enum _Evas_Button_Flags
489 EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
490 EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
491 EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
492 } Evas_Button_Flags; /**< Flags for Mouse Button events */
497 typedef enum _Evas_Event_Flags
499 EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
500 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 */
501 EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
502 } Evas_Event_Flags; /**< Flags for Events */
505 * State of Evas_Coord_Touch_Point
507 typedef enum _Evas_Touch_Point_State
509 EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
510 EVAS_TOUCH_POINT_UP, /**< Touch point is released */
511 EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
512 EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
513 EVAS_TOUCH_POINT_CANCEL /**< Touch point is cancelled */
514 } Evas_Touch_Point_State;
517 * Flags for Font Hinting
518 * @ingroup Evas_Font_Group
520 typedef enum _Evas_Font_Hinting_Flags
522 EVAS_FONT_HINTING_NONE, /**< No font hinting */
523 EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
524 EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
525 } Evas_Font_Hinting_Flags; /**< Flags for Font Hinting */
528 * Colorspaces for pixel data supported by Evas
529 * @ingroup Evas_Object_Image
531 typedef enum _Evas_Colorspace
533 EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
534 /* these are not currently supported - but planned for the future */
535 EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
536 EVAS_COLORSPACE_YCBCR422P709_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
537 EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
538 EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
539 EVAS_COLORSPACE_YCBCR422601_PL, /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
540 EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
541 EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
542 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
545 * How to pack items into cells in a table.
546 * @ingroup Evas_Object_Table
548 * @see evas_object_table_homogeneous_set() for an explanation of the function of
551 typedef enum _Evas_Object_Table_Homogeneous_Mode
553 EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
554 EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
555 EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
556 } Evas_Object_Table_Homogeneous_Mode; /**< Table cell pack mode. */
558 typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle; /**< A generic rectangle handle */
559 typedef struct _Evas_Point Evas_Point; /**< integer point */
561 typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
562 typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
564 typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
565 typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
568 * @typedef Evas_Smart_Class
570 * A smart object's @b base class definition
572 * @ingroup Evas_Smart_Group
574 typedef struct _Evas_Smart_Class Evas_Smart_Class;
577 * @typedef Evas_Smart_Interface
579 * A smart object's @b base interface definition
581 * An Evas interface is exactly like the OO-concept: an 'contract' or
582 * API a given object is declared to support. A smart object may have
583 * more than one interface, thus extending the behavior it gets from
588 * @ingroup Evas_Smart_Group
590 typedef struct _Evas_Smart_Interface Evas_Smart_Interface;
593 * @typedef Evas_Smart_Cb_Description
595 * A smart object callback description, used to provide introspection
597 * @ingroup Evas_Smart_Group
599 typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
604 * An opaque handle to map points
606 * @see evas_map_new()
607 * @see evas_map_free()
608 * @see evas_map_dup()
610 * @ingroup Evas_Object_Group_Map
612 typedef struct _Evas_Map Evas_Map;
617 * An opaque handle to an Evas canvas.
622 * @ingroup Evas_Canvas
624 typedef struct _Evas Evas;
627 * @typedef Evas_Object
628 * An Evas Object handle.
629 * @ingroup Evas_Object_Group
631 typedef struct _Evas_Object Evas_Object;
633 typedef void Evas_Performance; /**< An Evas Performance handle */
634 typedef struct _Evas_Modifier Evas_Modifier; /**< An opaque type containing information on which modifier keys are registered in an Evas canvas */
635 typedef struct _Evas_Lock Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
636 typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */
637 typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
640 * @typedef Evas_Video_Surface
642 * A generic datatype for video specific surface information
643 * @see evas_object_image_video_surface_set
644 * @see evas_object_image_video_surface_get
647 typedef struct _Evas_Video_Surface Evas_Video_Surface;
649 typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */
651 typedef int Evas_Coord;
652 typedef int Evas_Font_Size;
653 typedef int Evas_Angle;
655 struct _Evas_Coord_Rectangle /**< A rectangle in Evas_Coord */
657 Evas_Coord x; /**< top-left x co-ordinate of rectangle */
658 Evas_Coord y; /**< top-left y co-ordinate of rectangle */
659 Evas_Coord w; /**< width of rectangle */
660 Evas_Coord h; /**< height of rectangle */
668 struct _Evas_Coord_Point
673 struct _Evas_Coord_Precision_Point
679 struct _Evas_Position
682 Evas_Coord_Point canvas;
685 struct _Evas_Precision_Position
688 Evas_Coord_Precision_Point canvas;
691 typedef enum _Evas_Aspect_Control
693 EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
694 EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
695 EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
696 EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
697 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 */
698 } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
700 typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
701 typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */
702 typedef struct _Evas_Device Evas_Device; /**< A source device handle - where the event came from */
703 typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */
704 typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */
705 typedef struct _Evas_Event_Mouse_In Evas_Event_Mouse_In; /**< Event structure for #EVAS_CALLBACK_MOUSE_IN event callbacks */
706 typedef struct _Evas_Event_Mouse_Out Evas_Event_Mouse_Out; /**< Event structure for #EVAS_CALLBACK_MOUSE_OUT event callbacks */
707 typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move; /**< Event structure for #EVAS_CALLBACK_MOUSE_MOVE event callbacks */
708 typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel; /**< Event structure for #EVAS_CALLBACK_MOUSE_WHEEL event callbacks */
709 typedef struct _Evas_Event_Multi_Down Evas_Event_Multi_Down; /**< Event structure for #EVAS_CALLBACK_MULTI_DOWN event callbacks */
710 typedef struct _Evas_Event_Multi_Up Evas_Event_Multi_Up; /**< Event structure for #EVAS_CALLBACK_MULTI_UP event callbacks */
711 typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event structure for #EVAS_CALLBACK_MULTI_MOVE event callbacks */
712 typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
713 typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
714 typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
716 typedef enum _Evas_Load_Error
718 EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
719 EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
720 EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
721 EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an existing file (or path) */
722 EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
723 EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
724 EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
725 } Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
727 typedef enum _Evas_Alloc_Error
729 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
730 EVAS_ALLOC_ERROR_FATAL = 1, /**< Allocation failed despite attempts to free up memory */
731 EVAS_ALLOC_ERROR_RECOVERED = 2 /**< Allocation succeeded, but extra memory had to be found by freeing up speculative resources */
732 } Evas_Alloc_Error; /**< Possible allocation errors returned by evas_alloc_error() */
734 typedef enum _Evas_Fill_Spread
736 EVAS_TEXTURE_REFLECT = 0, /**< image fill tiling mode - tiling reflects */
737 EVAS_TEXTURE_REPEAT = 1, /**< tiling repeats */
738 EVAS_TEXTURE_RESTRICT = 2, /**< tiling clamps - range offset ignored */
739 EVAS_TEXTURE_RESTRICT_REFLECT = 3, /**< tiling clamps and any range offset reflects */
740 EVAS_TEXTURE_RESTRICT_REPEAT = 4, /**< tiling clamps and any range offset repeats */
741 EVAS_TEXTURE_PAD = 5 /**< tiling extends with end values */
742 } Evas_Fill_Spread; /**< Fill types used for evas_object_image_fill_spread_set() */
744 typedef enum _Evas_Pixel_Import_Pixel_Format
746 EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
747 EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
748 EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding with contiguous planes in the order Y, U and V */
749 } Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
751 struct _Evas_Pixel_Import_Source
753 Evas_Pixel_Import_Pixel_Format format; /**< pixel format type ie ARGB32, YUV420P_601 etc. */
754 int w, h; /**< width and height of source in pixels */
755 void **rows; /**< an array of pointers (size depends on format) pointing to left edge of each scanline */
758 /* magic version number to know what the native surf struct looks like */
759 #define EVAS_NATIVE_SURFACE_VERSION 2
761 typedef enum _Evas_Native_Surface_Type
763 EVAS_NATIVE_SURFACE_NONE,
764 EVAS_NATIVE_SURFACE_X11,
765 EVAS_NATIVE_SURFACE_OPENGL
766 } Evas_Native_Surface_Type;
768 struct _Evas_Native_Surface
771 Evas_Native_Surface_Type type;
775 void *visual; /**< visual of the pixmap to use (Visual) */
776 unsigned long pixmap; /**< pixmap id to use (Pixmap) */
780 unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
781 unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
782 unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
783 unsigned int format; /**< same as 'format' for glTexImage2D() */
784 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) */
790 * @def EVAS_VIDEO_SURFACE_VERSION
791 * Magic version number to know what the video surf struct looks like
794 #define EVAS_VIDEO_SURFACE_VERSION 1
796 typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
797 typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
799 struct _Evas_Video_Surface
803 Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
804 Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
805 Evas_Video_Cb show; /**< Show the video overlay surface */
806 Evas_Video_Cb hide; /**< Hide the video overlay surface */
807 Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
813 #define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
814 #define EVAS_LAYER_MAX 32767 /**< top-most layer number */
816 #define EVAS_COLOR_SPACE_ARGB 0 /**< Not used for anything */
817 #define EVAS_COLOR_SPACE_AHSV 1 /**< Not used for anything */
818 #define EVAS_TEXT_INVALID -1 /**< Not used for anything */
819 #define EVAS_TEXT_SPECIAL -2 /**< Not used for anything */
821 #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() */
822 #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() */
823 #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) */
824 #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) */
825 #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 */
826 #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 */
829 * How the object should be rendered to output.
830 * @ingroup Evas_Object_Group_Extras
832 typedef enum _Evas_Render_Op
834 EVAS_RENDER_BLEND = 0, /**< default op: d = d*(1-sa) + s */
835 EVAS_RENDER_BLEND_REL = 1, /**< d = d*(1 - sa) + s*da */
836 EVAS_RENDER_COPY = 2, /**< d = s */
837 EVAS_RENDER_COPY_REL = 3, /**< d = s*da */
838 EVAS_RENDER_ADD = 4, /* d = d + s */
839 EVAS_RENDER_ADD_REL = 5, /**< d = d + s*da */
840 EVAS_RENDER_SUB = 6, /**< d = d - s */
841 EVAS_RENDER_SUB_REL = 7, /* d = d - s*da */
842 EVAS_RENDER_TINT = 8, /**< d = d*s + d*(1 - sa) + s*(1 - da) */
843 EVAS_RENDER_TINT_REL = 9, /**< d = d*(1 - sa + s) */
844 EVAS_RENDER_MASK = 10, /**< d = d*sa */
845 EVAS_RENDER_MUL = 11 /**< d = d*s */
846 } Evas_Render_Op; /**< How the object should be rendered to output. */
848 typedef enum _Evas_Border_Fill_Mode
850 EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
851 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 */
852 EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid, even if it has transparency on it */
853 } Evas_Border_Fill_Mode; /**< How an image's center region (the complement to the border region) should be rendered by Evas */
855 typedef enum _Evas_Image_Scale_Hint
857 EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */
858 EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */
859 EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
860 } Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
862 typedef enum _Evas_Image_Animated_Loop_Hint
864 EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
865 EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
866 EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
867 } Evas_Image_Animated_Loop_Hint;
869 typedef enum _Evas_Engine_Render_Mode
871 EVAS_RENDER_MODE_BLOCKING = 0,
872 EVAS_RENDER_MODE_NONBLOCKING = 1,
873 } Evas_Engine_Render_Mode;
875 typedef enum _Evas_Image_Content_Hint
877 EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */
878 EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */
879 EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */
880 } Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */
882 struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
884 int magic; /**< Magic number */
887 struct _Evas_Event_Mouse_Down /** Mouse button press event */
889 int button; /**< Mouse button number that went down (1 - 32) */
891 Evas_Point output; /**< The X/Y location of the cursor */
892 Evas_Coord_Point canvas; /**< The X/Y location of the cursor */
895 Evas_Modifier *modifiers; /**< modifier keys pressed during the event */
898 Evas_Button_Flags flags; /**< button flags set during the event */
899 unsigned int timestamp;
900 Evas_Event_Flags event_flags;
904 struct _Evas_Event_Mouse_Up /** Mouse button release event */
906 int button; /**< Mouse button number that was raised (1 - 32) */
909 Evas_Coord_Point canvas;
912 Evas_Modifier *modifiers;
915 Evas_Button_Flags flags;
916 unsigned int timestamp;
917 Evas_Event_Flags event_flags;
921 struct _Evas_Event_Mouse_In /** Mouse enter event */
923 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
926 Evas_Coord_Point canvas;
929 Evas_Modifier *modifiers;
931 unsigned int timestamp;
932 Evas_Event_Flags event_flags;
936 struct _Evas_Event_Mouse_Out /** Mouse leave event */
938 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
941 Evas_Coord_Point canvas;
944 Evas_Modifier *modifiers;
946 unsigned int timestamp;
947 Evas_Event_Flags event_flags;
951 struct _Evas_Event_Mouse_Move /** Mouse button down event */
953 int buttons; /**< Button pressed mask, Bits set to 1 are buttons currently pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */
955 Evas_Position cur, prev;
958 Evas_Modifier *modifiers;
960 unsigned int timestamp;
961 Evas_Event_Flags event_flags;
965 struct _Evas_Event_Mouse_Wheel /** Wheel event */
967 int direction; /* 0 = default up/down wheel FIXME: more wheel types */
968 int z; /* ...,-2,-1 = down, 1,2,... = up */
971 Evas_Coord_Point canvas;
974 Evas_Modifier *modifiers;
976 unsigned int timestamp;
977 Evas_Event_Flags event_flags;
981 struct _Evas_Event_Multi_Down /** Multi button press event */
983 int device; /**< Multi device number that went down (1 or more for extra touches) */
984 double radius, radius_x, radius_y;
985 double pressure, angle;
988 Evas_Coord_Precision_Point canvas;
991 Evas_Modifier *modifiers;
994 Evas_Button_Flags flags;
995 unsigned int timestamp;
996 Evas_Event_Flags event_flags;
1000 struct _Evas_Event_Multi_Up /** Multi button release event */
1002 int device; /**< Multi device number that went up (1 or more for extra touches) */
1003 double radius, radius_x, radius_y;
1004 double pressure, angle;
1007 Evas_Coord_Precision_Point canvas;
1010 Evas_Modifier *modifiers;
1013 Evas_Button_Flags flags;
1014 unsigned int timestamp;
1015 Evas_Event_Flags event_flags;
1019 struct _Evas_Event_Multi_Move /** Multi button down event */
1021 int device; /**< Multi device number that moved (1 or more for extra touches) */
1022 double radius, radius_x, radius_y;
1023 double pressure, angle;
1025 Evas_Precision_Position cur;
1028 Evas_Modifier *modifiers;
1030 unsigned int timestamp;
1031 Evas_Event_Flags event_flags;
1035 struct _Evas_Event_Key_Down /** Key press event */
1037 char *keyname; /**< the name string of the key pressed */
1039 Evas_Modifier *modifiers;
1042 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
1043 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1044 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 */
1045 unsigned int timestamp;
1046 Evas_Event_Flags event_flags;
1050 struct _Evas_Event_Key_Up /** Key release event */
1052 char *keyname; /**< the name string of the key released */
1054 Evas_Modifier *modifiers;
1057 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
1058 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
1059 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 */
1060 unsigned int timestamp;
1061 Evas_Event_Flags event_flags;
1065 struct _Evas_Event_Hold /** Hold change event */
1067 int hold; /**< The hold flag */
1070 unsigned int timestamp;
1071 Evas_Event_Flags event_flags;
1076 * How the mouse pointer should be handled by Evas.
1078 * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button
1079 * is pressed down over an object and held, with the mouse pointer
1080 * being moved outside of it, the pointer still behaves as being bound
1081 * to that object, albeit out of its drawing region. When the button
1082 * is released, the event will be fed to the object, that may check if
1083 * the final position is over it or not and do something about it.
1085 * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will
1086 * always be bound to the object right below it.
1088 * @ingroup Evas_Object_Group_Extras
1090 typedef enum _Evas_Object_Pointer_Mode
1092 EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */
1093 EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */
1094 EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */
1095 } Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */
1097 typedef void (*Evas_Smart_Cb)(void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
1098 typedef void (*Evas_Event_Cb)(void *data, Evas *e, void *event_info); /**< Evas event callback function signature */
1099 typedef Eina_Bool (*Evas_Object_Event_Post_Cb)(void *data, Evas *e);
1100 typedef void (*Evas_Object_Event_Cb)(void *data, Evas *e, Evas_Object *obj, void *event_info); /**< Evas object event callback function signature */
1101 typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type type, void *event_info);
1104 * @defgroup Evas_Group Top Level Functions
1106 * Functions that affect Evas as a whole.
1112 * @return The init counter value.
1114 * This function initializes Evas and increments a counter of the
1115 * number of calls to it. It returns the new counter's value.
1117 * @see evas_shutdown().
1119 * Most EFL users wouldn't be using this function directly, because
1120 * they wouldn't access Evas directly by themselves. Instead, they
1121 * would be using higher level helpers, like @c ecore_evas_init().
1122 * See http://docs.enlightenment.org/auto/ecore/.
1124 * You should be using this if your use is something like the
1125 * following. The buffer engine is just one of the many ones Evas
1128 * @dontinclude evas-buffer-simple.c
1131 * And being the canvas creation something like:
1132 * @skip static Evas *create_canvas
1133 * @until evas_output_viewport_set(canvas,
1135 * Note that this is code creating an Evas canvas with no usage of
1136 * Ecore helpers at all -- no linkage with Ecore on this scenario,
1137 * thus. Again, this wouldn't be on Evas common usage for most
1138 * developers. See the full @ref Example_Evas_Buffer_Simple "example".
1140 * @ingroup Evas_Group
1142 EAPI int evas_init(void);
1147 * @return Evas' init counter value.
1149 * This function finalizes Evas, decrementing the counter of the
1150 * number of calls to the function evas_init(). This new value for the
1151 * counter is returned.
1155 * If you were the sole user of Evas, by means of evas_init(), you can
1156 * check if it's being properly shut down by expecting a return value
1159 * Example code follows.
1160 * @dontinclude evas-buffer-simple.c
1161 * @skip // NOTE: use ecore_evas_buffer_new
1162 * @until evas_shutdown
1163 * Where that function would contain:
1164 * @skip evas_free(canvas)
1165 * @until evas_free(canvas)
1167 * Most users would be using ecore_evas_shutdown() instead, like told
1168 * in evas_init(). See the full @ref Example_Evas_Buffer_Simple
1171 * @ingroup Evas_Group
1173 EAPI int evas_shutdown(void);
1176 * Return if any allocation errors have occurred during the prior function
1177 * @return The allocation error flag
1179 * This function will return if any memory allocation errors occurred during,
1180 * and what kind they were. The return value will be one of
1181 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
1182 * with each meaning something different.
1184 * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function
1185 * worked as expected.
1187 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
1188 * its job and will have exited as cleanly as possible. The programmer
1189 * should consider this as a sign of very low memory and should try and safely
1190 * recover from the prior functions failure (or try free up memory elsewhere
1191 * and try again after more memory is freed).
1193 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was
1194 * recovered from by evas finding memory of its own it has allocated and
1195 * freeing what it sees as not really usefully allocated memory. What is freed
1196 * may vary. Evas may reduce the resolution of images, free cached images or
1197 * fonts, trhow out pre-rendered data, reduce the complexity of change lists
1198 * etc. Evas and the program will function as per normal after this, but this
1199 * is a sign of low memory, and it is suggested that the program try and
1200 * identify memory it doesn't need, and free it.
1204 * extern Evas_Object *object;
1205 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
1207 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
1208 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
1210 * fprintf(stderr, "ERROR: Completely unable to attach callback. Must\n");
1211 * fprintf(stderr, " destroy object now as it cannot be used.\n");
1212 * evas_object_del(object);
1214 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1215 * my_memory_cleanup();
1217 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
1219 * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n");
1220 * my_memory_cleanup();
1224 * @ingroup Evas_Group
1226 EAPI Evas_Alloc_Error evas_alloc_error(void);
1229 * @brief Get evas' internal asynchronous events read file descriptor.
1231 * @return The canvas' asynchronous events read file descriptor.
1233 * Evas' asynchronous events are meant to be dealt with internally,
1234 * i. e., when building stuff to be glued together into the EFL
1235 * infrastructure -- a module, for example. The context which demands
1236 * its use is when calculations need to be done out of the main
1237 * thread, asynchronously, and some action must be performed after
1240 * An example of actual use of this API is for image asynchronous
1241 * preload inside evas. If the canvas was instantiated through
1242 * ecore-evas usage, ecore itself will take care of calling those
1243 * events' processing.
1245 * This function returns the read file descriptor where to get the
1246 * asynchronous events of the canvas. Naturally, other mainloops,
1247 * apart from ecore, may make use of it.
1249 * @ingroup Evas_Group
1251 EAPI int evas_async_events_fd_get(void) EINA_WARN_UNUSED_RESULT;
1254 * @brief Trigger the processing of all events waiting on the file
1255 * descriptor returned by evas_async_events_fd_get().
1257 * @return The number of events processed.
1259 * All asynchronous events queued up by evas_async_events_put() are
1260 * processed here. More precisely, the callback functions, informed
1261 * together with other event parameters, when queued, get called (with
1262 * those parameters), in that order.
1264 * @ingroup Evas_Group
1266 EAPI int evas_async_events_process(void);
1269 * Insert asynchronous events on the canvas.
1271 * @param target The target to be affected by the events.
1272 * @param type The type of callback function.
1273 * @param event_info Information about the event.
1274 * @param func The callback function pointer.
1276 * This is the way, for a routine running outside evas' main thread,
1277 * to report an asynchronous event. A callback function is informed,
1278 * whose call is to happen after evas_async_events_process() is
1281 * @ingroup Evas_Group
1283 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);
1286 * @defgroup Evas_Canvas Canvas Functions
1288 * Low level Evas canvas functions. Sub groups will present more high
1289 * level ones, though.
1291 * Most of these functions deal with low level Evas actions, like:
1292 * @li create/destroy raw canvases, not bound to any displaying engine
1293 * @li tell a canvas i got focused (in a windowing context, for example)
1294 * @li tell a canvas a region should not be calculated anymore in rendering
1295 * @li tell a canvas to render its contents, immediately
1297 * Most users will be using Evas by means of the @c Ecore_Evas
1298 * wrapper, which deals with all the above mentioned issues
1299 * automatically for them. Thus, you'll be looking at this section
1300 * only if you're building low level stuff.
1302 * The groups within present you functions that deal with the canvas
1303 * directly, too, and not yet with its @b objects. They are the
1304 * functions you need to use at a minimum to get a working canvas.
1306 * Some of the functions in this group are exemplified @ref
1307 * Example_Evas_Events "here".
1311 * Creates a new empty evas.
1313 * Note that before you can use the evas, you will to at a minimum:
1314 * @li Set its render method with @ref evas_output_method_set .
1315 * @li Set its viewport size with @ref evas_output_viewport_set .
1316 * @li Set its size of the canvas with @ref evas_output_size_set .
1317 * @li Ensure that the render engine is given the correct settings
1318 * with @ref evas_engine_info_set .
1320 * This function should only fail if the memory allocation fails
1322 * @note this function is very low level. Instead of using it
1323 * directly, consider using the high level functions in
1324 * Ecore_Evas such as @c ecore_evas_new(). See
1325 * http://docs.enlightenment.org/auto/ecore/.
1327 * @attention it is recommended that one calls evas_init() before
1328 * creating new canvas.
1330 * @return A new uninitialised Evas canvas on success. Otherwise, @c NULL.
1331 * @ingroup Evas_Canvas
1333 EAPI Evas *evas_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
1336 * Frees the given evas and any objects created on it.
1338 * Any objects with 'free' callbacks will have those callbacks called
1341 * @param e The given evas.
1343 * @ingroup Evas_Canvas
1345 EAPI void evas_free(Evas *e) EINA_ARG_NONNULL(1);
1348 * Inform to the evas that it got the focus.
1350 * @param e The evas to change information.
1351 * @ingroup Evas_Canvas
1353 EAPI void evas_focus_in(Evas *e);
1356 * Inform to the evas that it lost the focus.
1358 * @param e The evas to change information.
1359 * @ingroup Evas_Canvas
1361 EAPI void evas_focus_out(Evas *e);
1364 * Get the focus state known by the given evas
1366 * @param e The evas to query information.
1367 * @ingroup Evas_Canvas
1369 EAPI Eina_Bool evas_focus_state_get(const Evas *e);
1372 * Push the nochange flag up 1
1374 * This tells evas, that while the nochange flag is greater than 0, do not
1375 * mark objects as "changed" when making changes.
1377 * @param e The evas to change information.
1378 * @ingroup Evas_Canvas
1380 EAPI void evas_nochange_push(Evas *e);
1383 * Pop the nochange flag down 1
1385 * This tells evas, that while the nochange flag is greater than 0, do not
1386 * mark objects as "changed" when making changes.
1388 * @param e The evas to change information.
1389 * @ingroup Evas_Canvas
1391 EAPI void evas_nochange_pop(Evas *e);
1394 * Attaches a specific pointer to the evas for fetching later
1396 * @param e The canvas to attach the pointer to
1397 * @param data The pointer to attach
1398 * @ingroup Evas_Canvas
1400 EAPI void evas_data_attach_set(Evas *e, void *data) EINA_ARG_NONNULL(1);
1403 * Returns the pointer attached by evas_data_attach_set()
1405 * @param e The canvas to attach the pointer to
1406 * @return The pointer attached
1407 * @ingroup Evas_Canvas
1409 EAPI void *evas_data_attach_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1412 * Add a damage rectangle.
1414 * @param e The given canvas pointer.
1415 * @param x The rectangle's left position.
1416 * @param y The rectangle's top position.
1417 * @param w The rectangle's width.
1418 * @param h The rectangle's height.
1420 * This is the function by which one tells evas that a part of the
1421 * canvas has to be repainted.
1423 * @note All newly created Evas rectangles get the default color values of 255 255 255 255 (opaque white).
1425 * @ingroup Evas_Canvas
1427 EAPI void evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1430 * Add an "obscured region" to an Evas canvas.
1432 * @param e The given canvas pointer.
1433 * @param x The rectangle's top left corner's horizontal coordinate.
1434 * @param y The rectangle's top left corner's vertical coordinate
1435 * @param w The rectangle's width.
1436 * @param h The rectangle's height.
1438 * This is the function by which one tells an Evas canvas that a part
1439 * of it <b>must not</b> be repainted. The region must be
1440 * rectangular and its coordinates inside the canvas viewport are
1441 * passed in the call. After this call, the region specified won't
1442 * participate in any form in Evas' calculations and actions during
1443 * its rendering updates, having its displaying content frozen as it
1444 * was just after this function took place.
1446 * We call it "obscured region" because the most common use case for
1447 * this rendering (partial) freeze is something else (most probably
1448 * other canvas) being on top of the specified rectangular region,
1449 * thus shading it completely from the user's final scene in a
1450 * display. To avoid unnecessary processing, one should indicate to the
1451 * obscured canvas not to bother about the non-important area.
1453 * The majority of users won't have to worry about this function, as
1454 * they'll be using just one canvas in their applications, with
1455 * nothing inset or on top of it in any form.
1457 * To make this region one that @b has to be repainted again, call the
1458 * function evas_obscured_clear().
1460 * @note This is a <b>very low level function</b>, which most of
1461 * Evas' users wouldn't care about.
1463 * @note This function does @b not flag the canvas as having its state
1464 * changed. If you want to re-render it afterwards expecting new
1465 * contents, you have to add "damage" regions yourself (see
1466 * evas_damage_rectangle_add()).
1468 * @see evas_obscured_clear()
1469 * @see evas_render_updates()
1471 * Example code follows.
1472 * @dontinclude evas-events.c
1473 * @skip add an obscured
1474 * @until evas_obscured_clear(evas);
1476 * In that example, pressing the "Ctrl" and "o" keys will impose or
1477 * remove an obscured region in the middle of the canvas. You'll get
1478 * the same contents at the time the key was pressed, if toggling it
1479 * on, until you toggle it off again (make sure the animation is
1480 * running on to get the idea better). See the full @ref
1481 * Example_Evas_Events "example".
1483 * @ingroup Evas_Canvas
1485 EAPI void evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
1488 * Remove all "obscured regions" from an Evas canvas.
1490 * @param e The given canvas pointer.
1492 * This function removes all the rectangles from the obscured regions
1493 * list of the canvas @p e. It takes obscured areas added with
1494 * evas_obscured_rectangle_add() and make them again a regions that @b
1495 * have to be repainted on rendering updates.
1497 * @note This is a <b>very low level function</b>, which most of
1498 * Evas' users wouldn't care about.
1500 * @note This function does @b not flag the canvas as having its state
1501 * changed. If you want to re-render it afterwards expecting new
1502 * contents, you have to add "damage" regions yourself (see
1503 * evas_damage_rectangle_add()).
1505 * @see evas_obscured_rectangle_add() for an example
1506 * @see evas_render_updates()
1508 * @ingroup Evas_Canvas
1510 EAPI void evas_obscured_clear(Evas *e) EINA_ARG_NONNULL(1);
1513 * Force immediate renderization of the given Evas canvas.
1515 * @param e The given canvas pointer.
1516 * @return A newly allocated list of updated rectangles of the canvas
1517 * (@c Eina_Rectangle structs). Free this list with
1518 * evas_render_updates_free().
1520 * This function forces an immediate renderization update of the given
1523 * @note This is a <b>very low level function</b>, which most of
1524 * Evas' users wouldn't care about. One would use it, for example, to
1525 * grab an Evas' canvas update regions and paint them back, using the
1526 * canvas' pixmap, on a displaying system working below Evas.
1528 * @note Evas is a stateful canvas. If no operations changing its
1529 * state took place since the last rendering action, you won't see no
1530 * changes and this call will be a no-op.
1532 * Example code follows.
1533 * @dontinclude evas-events.c
1534 * @skip add an obscured
1535 * @until d.obscured = !d.obscured;
1537 * See the full @ref Example_Evas_Events "example".
1539 * @ingroup Evas_Canvas
1541 EAPI Eina_List *evas_render_updates(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1544 * Free the rectangles returned by evas_render_updates().
1546 * @param updates The list of updated rectangles of the canvas.
1548 * This function removes the region from the render updates list. It
1549 * makes the region doesn't be render updated anymore.
1551 * @see evas_render_updates() for an example
1553 * @ingroup Evas_Canvas
1555 EAPI void evas_render_updates_free(Eina_List *updates);
1558 * Force renderization of the given canvas.
1560 * @param e The given canvas pointer.
1562 * @ingroup Evas_Canvas
1564 EAPI void evas_render(Evas *e) EINA_ARG_NONNULL(1);
1567 * Update the canvas internal objects but not triggering immediate
1570 * @param e The given canvas pointer.
1572 * This function updates the canvas internal objects not triggering
1573 * renderization. To force renderization function evas_render() should
1578 * @ingroup Evas_Canvas
1580 EAPI void evas_norender(Evas *e) EINA_ARG_NONNULL(1);
1583 * Make the canvas discard internally cached data used for rendering.
1585 * @param e The given canvas pointer.
1587 * This function flushes the arrays of delete, active and render objects.
1588 * Other things it may also discard are: shared memory segments,
1589 * temporary scratch buffers, cached data to avoid re-compute of that data etc.
1591 * @ingroup Evas_Canvas
1593 EAPI void evas_render_idle_flush(Evas *e) EINA_ARG_NONNULL(1);
1596 * Make the canvas discard as much data as possible used by the engine at
1599 * @param e The given canvas pointer.
1601 * This function will unload images, delete textures and much more, where
1602 * possible. You may also want to call evas_render_idle_flush() immediately
1603 * prior to this to perhaps discard a little more, though evas_render_dump()
1604 * should implicitly delete most of what evas_render_idle_flush() might
1607 * @ingroup Evas_Canvas
1609 EAPI void evas_render_dump(Evas *e) EINA_ARG_NONNULL(1);
1612 * @defgroup Evas_Output_Method Render Engine Functions
1614 * Functions that are used to set the render engine for a given
1615 * function, and then get that engine working.
1617 * The following code snippet shows how they can be used to
1618 * initialise an evas that uses the X11 software engine:
1621 * Evas_Engine_Info_Software_X11 *einfo;
1622 * extern Display *display;
1623 * extern Window win;
1627 * evas = evas_new();
1628 * evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
1629 * evas_output_size_set(evas, 640, 480);
1630 * evas_output_viewport_set(evas, 0, 0, 640, 480);
1631 * einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
1632 * einfo->info.display = display;
1633 * einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
1634 * einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
1635 * einfo->info.drawable = win;
1636 * einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
1637 * evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
1640 * @ingroup Evas_Canvas
1644 * Look up a numeric ID from a string name of a rendering engine.
1646 * @param name the name string of an engine
1647 * @return A numeric (opaque) ID for the rendering engine
1648 * @ingroup Evas_Output_Method
1650 * This function looks up a numeric return value for the named engine
1651 * in the string @p name. This is a normal C string, NUL byte
1652 * terminated. The name is case sensitive. If the rendering engine is
1653 * available, a numeric ID for that engine is returned that is not
1654 * 0. If the engine is not available, 0 is returned, indicating an
1657 * The programmer should NEVER rely on the numeric ID of an engine
1658 * unless it is returned by this function. Programs should NOT be
1659 * written accessing render method ID's directly, without first
1660 * obtaining it from this function.
1662 * @attention it is mandatory that one calls evas_init() before
1663 * looking up the render method.
1672 * evas = evas_new();
1675 * fprintf(stderr, "ERROR: Canvas creation failed. Fatal error.\n");
1678 * engine_id = evas_render_method_lookup("software_x11");
1681 * fprintf(stderr, "ERROR: Requested rendering engine is absent.\n");
1684 * evas_output_method_set(evas, engine_id);
1687 EAPI int evas_render_method_lookup(const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1690 * List all the rendering engines compiled into the copy of the Evas library
1692 * @return A linked list whose data members are C strings of engine names
1693 * @ingroup Evas_Output_Method
1695 * Calling this will return a handle (pointer) to an Evas linked
1696 * list. Each node in the linked list will have the data pointer be a
1697 * (char *) pointer to the name string of the rendering engine
1698 * available. The strings should never be modified, neither should the
1699 * list be modified. This list should be cleaned up as soon as the
1700 * program no longer needs it using evas_render_method_list_free(). If
1701 * no engines are available from Evas, @c NULL will be returned.
1705 * Eina_List *engine_list, *l;
1706 * char *engine_name;
1708 * engine_list = evas_render_method_list();
1711 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1714 * printf("Available Evas Engines:\n");
1715 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1716 * printf("%s\n", engine_name);
1717 * evas_render_method_list_free(engine_list);
1720 EAPI Eina_List *evas_render_method_list(void) EINA_WARN_UNUSED_RESULT;
1723 * This function should be called to free a list of engine names
1725 * @param list The Eina_List base pointer for the engine list to be freed
1726 * @ingroup Evas_Output_Method
1728 * When this function is called it will free the engine list passed in
1729 * as @p list. The list should only be a list of engines generated by
1730 * calling evas_render_method_list(). If @p list is NULL, nothing will
1735 * Eina_List *engine_list, *l;
1736 * char *engine_name;
1738 * engine_list = evas_render_method_list();
1741 * fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
1744 * printf("Available Evas Engines:\n");
1745 * EINA_LIST_FOREACH(engine_list, l, engine_name)
1746 * printf("%s\n", engine_name);
1747 * evas_render_method_list_free(engine_list);
1750 EAPI void evas_render_method_list_free(Eina_List *list);
1753 * Sets the output engine for the given evas.
1755 * Once the output engine for an evas is set, any attempt to change it
1756 * will be ignored. The value for @p render_method can be found using
1757 * @ref evas_render_method_lookup .
1759 * @param e The given evas.
1760 * @param render_method The numeric engine value to use.
1762 * @attention it is mandatory that one calls evas_init() before
1763 * setting the output method.
1765 * @ingroup Evas_Output_Method
1767 EAPI void evas_output_method_set(Evas *e, int render_method) EINA_ARG_NONNULL(1);
1770 * Retrieves the number of the output engine used for the given evas.
1771 * @param e The given evas.
1772 * @return The ID number of the output engine being used. @c 0 is
1773 * returned if there is an error.
1774 * @ingroup Evas_Output_Method
1776 EAPI int evas_output_method_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1779 * Retrieves the current render engine info struct from the given evas.
1781 * The returned structure is publicly modifiable. The contents are
1782 * valid until either @ref evas_engine_info_set or @ref evas_render
1785 * This structure does not need to be freed by the caller.
1787 * @param e The given evas.
1788 * @return A pointer to the Engine Info structure. @c NULL is returned if
1789 * an engine has not yet been assigned.
1790 * @ingroup Evas_Output_Method
1792 EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1795 * Applies the engine settings for the given evas from the given @c
1796 * Evas_Engine_Info structure.
1798 * To get the Evas_Engine_Info structure to use, call @ref
1799 * evas_engine_info_get . Do not try to obtain a pointer to an
1800 * @c Evas_Engine_Info structure in any other way.
1802 * You will need to call this function at least once before you can
1803 * create objects on an evas or render that evas. Some engines allow
1804 * their settings to be changed more than once.
1806 * Once called, the @p info pointer should be considered invalid.
1808 * @param e The pointer to the Evas Canvas
1809 * @param info The pointer to the Engine Info to use
1810 * @return @c EINA_TRUE if no error occurred, @c EINA_FALSE otherwise.
1811 * @ingroup Evas_Output_Method
1813 EAPI Eina_Bool evas_engine_info_set(Evas *e, Evas_Engine_Info *info) EINA_ARG_NONNULL(1);
1816 * @defgroup Evas_Output_Size Output and Viewport Resizing Functions
1818 * Functions that set and retrieve the output and viewport size of an
1821 * @ingroup Evas_Canvas
1825 * Sets the output size of the render engine of the given evas.
1827 * The evas will render to a rectangle of the given size once this
1828 * function is called. The output size is independent of the viewport
1829 * size. The viewport will be stretched to fill the given rectangle.
1831 * The units used for @p w and @p h depend on the engine used by the
1834 * @param e The given evas.
1835 * @param w The width in output units, usually pixels.
1836 * @param h The height in output units, usually pixels.
1837 * @ingroup Evas_Output_Size
1839 EAPI void evas_output_size_set(Evas *e, int w, int h) EINA_ARG_NONNULL(1);
1842 * Retrieve the output size of the render engine of the given evas.
1844 * The output size is given in whatever the output units are for the
1847 * If either @p w or @p h is @c NULL, then it is ignored. If @p e is
1848 * invalid, the returned results are undefined.
1850 * @param e The given evas.
1851 * @param w The pointer to an integer to store the width in.
1852 * @param h The pointer to an integer to store the height in.
1853 * @ingroup Evas_Output_Size
1855 EAPI void evas_output_size_get(const Evas *e, int *w, int *h) EINA_ARG_NONNULL(1);
1858 * Sets the output viewport of the given evas in evas units.
1860 * The output viewport is the area of the evas that will be visible to
1861 * the viewer. The viewport will be stretched to fit the output
1862 * target of the evas when rendering is performed.
1864 * @note The coordinate values do not have to map 1-to-1 with the output
1865 * target. However, it is generally advised that it is done for ease
1868 * @param e The given evas.
1869 * @param x The top-left corner x value of the viewport.
1870 * @param y The top-left corner y value of the viewport.
1871 * @param w The width of the viewport. Must be greater than 0.
1872 * @param h The height of the viewport. Must be greater than 0.
1873 * @ingroup Evas_Output_Size
1875 EAPI void evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
1878 * Get the render engine's output viewport co-ordinates in canvas units.
1879 * @param e The pointer to the Evas Canvas
1880 * @param x The pointer to a x variable to be filled in
1881 * @param y The pointer to a y variable to be filled in
1882 * @param w The pointer to a width variable to be filled in
1883 * @param h The pointer to a height variable to be filled in
1884 * @ingroup Evas_Output_Size
1886 * Calling this function writes the current canvas output viewport
1887 * size and location values into the variables pointed to by @p x, @p
1888 * y, @p w and @p h. On success the variables have the output
1889 * location and size values written to them in canvas units. Any of @p
1890 * x, @p y, @p w or @p h that are @c NULL will not be written to. If @p e
1891 * is invalid, the results are undefined.
1895 * extern Evas *evas;
1896 * Evas_Coord x, y, width, height;
1898 * evas_output_viewport_get(evas, &x, &y, &w, &h);
1901 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);
1904 * Sets the output framespace size of the render engine of the given evas.
1906 * The framespace size is used in the Wayland engines to denote space where
1907 * the output is not drawn. This is mainly used in ecore_evas to draw borders
1909 * The units used for @p w and @p h depend on the engine used by the
1912 * @param e The given evas.
1913 * @param x The left coordinate in output units, usually pixels.
1914 * @param y The top coordinate in output units, usually pixels.
1915 * @param w The width in output units, usually pixels.
1916 * @param h The height in output units, usually pixels.
1917 * @ingroup Evas_Output_Size
1920 EAPI void evas_output_framespace_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
1923 * Get the render engine's output framespace co-ordinates in canvas units.
1925 * @param e The pointer to the Evas Canvas
1926 * @param x The pointer to a x variable to be filled in
1927 * @param y The pointer to a y variable to be filled in
1928 * @param w The pointer to a width variable to be filled in
1929 * @param h The pointer to a height variable to be filled in
1930 * @ingroup Evas_Output_Size
1933 EAPI void evas_output_framespace_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
1936 * @defgroup Evas_Coord_Mapping_Group Coordinate Mapping Functions
1938 * Functions that are used to map coordinates from the canvas to the
1939 * screen or the screen to the canvas.
1941 * @ingroup Evas_Canvas
1945 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1947 * @param e The pointer to the Evas Canvas
1948 * @param x The screen/output x co-ordinate
1949 * @return The screen co-ordinate translated to canvas unit co-ordinates
1950 * @ingroup Evas_Coord_Mapping_Group
1952 * This function takes in a horizontal co-ordinate as the @p x
1953 * parameter and converts it into canvas units, accounting for output
1954 * size, viewport size and location, returning it as the function
1955 * return value. If @p e is invalid, the results are undefined.
1959 * extern Evas *evas;
1960 * extern int screen_x;
1961 * Evas_Coord canvas_x;
1963 * canvas_x = evas_coord_screen_x_to_world(evas, screen_x);
1966 EAPI Evas_Coord evas_coord_screen_x_to_world(const Evas *e, int x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1969 * Convert/scale an ouput screen co-ordinate into canvas co-ordinates
1971 * @param e The pointer to the Evas Canvas
1972 * @param y The screen/output y co-ordinate
1973 * @return The screen co-ordinate translated to canvas unit co-ordinates
1974 * @ingroup Evas_Coord_Mapping_Group
1976 * This function takes in a vertical co-ordinate as the @p y parameter
1977 * and converts it into canvas units, accounting for output size,
1978 * viewport size and location, returning it as the function return
1979 * value. If @p e is invalid, the results are undefined.
1983 * extern Evas *evas;
1984 * extern int screen_y;
1985 * Evas_Coord canvas_y;
1987 * canvas_y = evas_coord_screen_y_to_world(evas, screen_y);
1990 EAPI Evas_Coord evas_coord_screen_y_to_world(const Evas *e, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
1993 * Convert/scale a canvas co-ordinate into output screen co-ordinates
1995 * @param e The pointer to the Evas Canvas
1996 * @param x The canvas x co-ordinate
1997 * @return The output/screen co-ordinate translated to output co-ordinates
1998 * @ingroup Evas_Coord_Mapping_Group
2000 * This function takes in a horizontal co-ordinate as the @p x
2001 * parameter and converts it into output units, accounting for output
2002 * size, viewport size and location, returning it as the function
2003 * return value. If @p e is invalid, the results are undefined.
2007 * extern Evas *evas;
2009 * extern Evas_Coord canvas_x;
2011 * screen_x = evas_coord_world_x_to_screen(evas, canvas_x);
2014 EAPI int evas_coord_world_x_to_screen(const Evas *e, Evas_Coord x) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2017 * Convert/scale a canvas co-ordinate into output screen co-ordinates
2019 * @param e The pointer to the Evas Canvas
2020 * @param y The canvas y co-ordinate
2021 * @return The output/screen co-ordinate translated to output co-ordinates
2022 * @ingroup Evas_Coord_Mapping_Group
2024 * This function takes in a vertical co-ordinate as the @p x parameter
2025 * and converts it into output units, accounting for output size,
2026 * viewport size and location, returning it as the function return
2027 * value. If @p e is invalid, the results are undefined.
2031 * extern Evas *evas;
2033 * extern Evas_Coord canvas_y;
2035 * screen_y = evas_coord_world_y_to_screen(evas, canvas_y);
2038 EAPI int evas_coord_world_y_to_screen(const Evas *e, Evas_Coord y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2041 * @defgroup Evas_Pointer_Group Pointer (Mouse) Functions
2043 * Functions that deal with the status of the pointer (mouse cursor).
2045 * @ingroup Evas_Canvas
2049 * This function returns the current known pointer co-ordinates
2051 * @param e The pointer to the Evas Canvas
2052 * @param x The pointer to an integer to be filled in
2053 * @param y The pointer to an integer to be filled in
2054 * @ingroup Evas_Pointer_Group
2056 * This function returns the current known screen/output co-ordinates
2057 * of the mouse pointer and sets the contents of the integers pointed
2058 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2059 * valid canvas the results of this function are undefined.
2063 * extern Evas *evas;
2064 * int mouse_x, mouse_y;
2066 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2067 * printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
2070 EAPI void evas_pointer_output_xy_get(const Evas *e, int *x, int *y) EINA_ARG_NONNULL(1);
2073 * This function returns the current known pointer co-ordinates
2075 * @param e The pointer to the Evas Canvas
2076 * @param x The pointer to a Evas_Coord to be filled in
2077 * @param y The pointer to a Evas_Coord to be filled in
2078 * @ingroup Evas_Pointer_Group
2080 * This function returns the current known canvas unit co-ordinates of
2081 * the mouse pointer and sets the contents of the Evas_Coords pointed
2082 * to by @p x and @p y to contain these co-ordinates. If @p e is not a
2083 * valid canvas the results of this function are undefined.
2087 * extern Evas *evas;
2088 * Evas_Coord mouse_x, mouse_y;
2090 * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
2091 * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y);
2094 EAPI void evas_pointer_canvas_xy_get(const Evas *e, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
2097 * Returns a bitmask with the mouse buttons currently pressed, set to 1
2099 * @param e The pointer to the Evas Canvas
2100 * @return A bitmask of the currently depressed buttons on the canvas
2101 * @ingroup Evas_Pointer_Group
2103 * Calling this function will return a 32-bit integer with the
2104 * appropriate bits set to 1 that correspond to a mouse button being
2105 * depressed. This limits Evas to a mouse devices with a maximum of 32
2106 * buttons, but that is generally in excess of any host system's
2107 * pointing device abilities.
2109 * A canvas by default begins with no mouse buttons being pressed and
2110 * only calls to evas_event_feed_mouse_down(),
2111 * evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and
2112 * evas_event_feed_mouse_up_data() will alter that.
2114 * The least significant bit corresponds to the first mouse button
2115 * (button 1) and the most significant bit corresponds to the last
2116 * mouse button (button 32).
2118 * If @p e is not a valid canvas, the return value is undefined.
2122 * extern Evas *evas;
2123 * int button_mask, i;
2125 * button_mask = evas_pointer_button_down_mask_get(evas);
2126 * printf("Buttons currently pressed:\n");
2127 * for (i = 0; i < 32; i++)
2129 * if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
2133 EAPI int evas_pointer_button_down_mask_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2136 * Returns whether the mouse pointer is logically inside the canvas
2138 * @param e The pointer to the Evas Canvas
2139 * @return An integer that is 1 if the mouse is inside the canvas, 0 otherwise
2140 * @ingroup Evas_Pointer_Group
2142 * When this function is called it will return a value of either 0 or
2143 * 1, depending on if evas_event_feed_mouse_in(),
2144 * evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(),
2145 * evas_event_feed_mouse_out_data() have been called to feed in a
2146 * mouse enter event into the canvas.
2148 * A return value of 1 indicates the mouse is logically inside the
2149 * canvas, and 0 implies it is logically outside the canvas.
2151 * A canvas begins with the mouse being assumed outside (0).
2153 * If @p e is not a valid canvas, the return value is undefined.
2157 * extern Evas *evas;
2159 * if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
2160 * else printf("Mouse is out!\n");
2163 EAPI Eina_Bool evas_pointer_inside_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2164 EAPI void evas_sync(Evas *e) EINA_ARG_NONNULL(1);
2167 * @defgroup Evas_Canvas_Events Canvas Events
2169 * Functions relating to canvas events, which are mainly reports on
2170 * its internal states changing (an object got focused, the rendering
2173 * Some of the functions in this group are exemplified @ref
2174 * Example_Evas_Events "here".
2176 * @ingroup Evas_Canvas
2180 * @addtogroup Evas_Canvas_Events
2185 * Add (register) a callback function to a given canvas event.
2187 * @param e Canvas to attach a callback to
2188 * @param type The type of event that will trigger the callback
2189 * @param func The (callback) function to be called when the event is
2191 * @param data The data pointer to be passed to @p func
2193 * This function adds a function callback to the canvas @p e when the
2194 * event of type @p type occurs on it. The function pointer is @p
2197 * In the event of a memory allocation error during the addition of
2198 * the callback to the canvas, evas_alloc_error() should be used to
2199 * determine the nature of the error, if any, and the program should
2200 * sensibly try and recover.
2202 * A callback function must have the ::Evas_Event_Cb prototype
2203 * definition. The first parameter (@p data) in this definition will
2204 * have the same value passed to evas_event_callback_add() as the @p
2205 * data parameter, at runtime. The second parameter @p e is the canvas
2206 * pointer on which the event occurred. The third parameter @p
2207 * event_info is a pointer to a data structure that may or may not be
2208 * passed to the callback, depending on the event type that triggered
2209 * the callback. This is so because some events don't carry extra
2210 * context with them, but others do.
2212 * The event type @p type to trigger the function may be one of
2213 * #EVAS_CALLBACK_RENDER_FLUSH_PRE, #EVAS_CALLBACK_RENDER_FLUSH_POST,
2214 * #EVAS_CALLBACK_CANVAS_FOCUS_IN, #EVAS_CALLBACK_CANVAS_FOCUS_OUT,
2215 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and
2216 * #EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of
2217 * event that will trigger the callback to be called. Only the last
2218 * two of the event types listed here provide useful event information
2219 * data -- a pointer to the recently focused Evas object. For the
2220 * others the @p event_info pointer is going to be @c NULL.
2223 * @dontinclude evas-events.c
2224 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE
2225 * @until two canvas event callbacks
2227 * Looking to the callbacks registered above,
2228 * @dontinclude evas-events.c
2229 * @skip called when our rectangle gets focus
2230 * @until let's have our events back
2232 * we see that the canvas flushes its rendering pipeline
2233 * (#EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the @c _resize_cb
2234 * routine takes place: it has to redraw that image at a different
2235 * size. Also, the callback on an object being focused comes just
2236 * after we focus it explicitly, on code.
2238 * See the full @ref Example_Evas_Events "example".
2240 * @note Be careful not to add the same callback multiple times, if
2241 * that's not what you want, because Evas won't check if a callback
2242 * existed before exactly as the one being registered (and thus, call
2243 * it more than once on the event, in this case). This would make
2244 * sense if you passed different functions and/or callback data, only.
2246 EAPI void evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
2249 * Add (register) a callback function to a given canvas event with a
2250 * non-default priority set. Except for the priority field, it's exactly the
2251 * same as @ref evas_event_callback_add
2253 * @param e Canvas to attach a callback to
2254 * @param type The type of event that will trigger the callback
2255 * @param priority The priority of the callback, lower values called first.
2256 * @param func The (callback) function to be called when the event is
2258 * @param data The data pointer to be passed to @p func
2260 * @see evas_event_callback_add
2263 EAPI void evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
2266 * Delete a callback function from the canvas.
2268 * @param e Canvas to remove a callback from
2269 * @param type The type of event that was triggering the callback
2270 * @param func The function that was to be called when the event was triggered
2271 * @return The data pointer that was to be passed to the callback
2273 * This function removes the most recently added callback from the
2274 * canvas @p e which was triggered by the event type @p type and was
2275 * calling the function @p func when triggered. If the removal is
2276 * successful it will also return the data pointer that was passed to
2277 * evas_event_callback_add() when the callback was added to the
2278 * canvas. If not successful @c NULL will be returned.
2284 * void focus_in_callback(void *data, Evas *e, void *event_info);
2286 * my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
2289 EAPI void *evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
2292 * Delete (unregister) a callback function registered to a given
2295 * @param e Canvas to remove an event callback from
2296 * @param type The type of event that was triggering the callback
2297 * @param func The function that was to be called when the event was
2299 * @param data The data pointer that was to be passed to the callback
2300 * @return The data pointer that was to be passed to the callback
2302 * This function removes <b>the first</b> added callback from the
2303 * canvas @p e matching the event type @p type, the registered
2304 * function pointer @p func and the callback data pointer @p data. If
2305 * the removal is successful it will also return the data pointer that
2306 * was passed to evas_event_callback_add() (that will be the same as
2307 * the parameter) when the callback(s) was(were) added to the
2308 * canvas. If not successful @c NULL will be returned. A common use
2309 * would be to remove an exact match of a callback.
2312 * @dontinclude evas-events.c
2313 * @skip evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
2314 * @until _object_focus_in_cb, NULL);
2316 * See the full @ref Example_Evas_Events "example".
2318 * @note For deletion of canvas events callbacks filtering by just
2319 * type and function pointer, user evas_event_callback_del().
2321 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);
2324 * Push a callback on the post-event callback stack
2326 * @param e Canvas to push the callback on
2327 * @param func The function that to be called when the stack is unwound
2328 * @param data The data pointer to be passed to the callback
2330 * Evas has a stack of callbacks that get called after all the callbacks for
2331 * an event have triggered (all the objects it triggers on and all the callbacks
2332 * in each object triggered). When all these have been called, the stack is
2333 * unwond from most recently to least recently pushed item and removed from the
2334 * stack calling the callback set for it.
2336 * This is intended for doing reverse logic-like processing, example - when a
2337 * child object that happens to get the event later is meant to be able to
2338 * "steal" functions from a parent and thus on unwind of this stack have its
2339 * function called first, thus being able to set flags, or return 0 from the
2340 * post-callback that stops all other post-callbacks in the current stack from
2341 * being called (thus basically allowing a child to take control, if the event
2342 * callback prepares information ready for taking action, but the post callback
2343 * actually does the action).
2346 EAPI void evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2349 * Remove a callback from the post-event callback stack
2351 * @param e Canvas to push the callback on
2352 * @param func The function that to be called when the stack is unwound
2354 * This removes a callback from the stack added with
2355 * evas_post_event_callback_push(). The first instance of the function in
2356 * the callback stack is removed from being executed when the stack is
2357 * unwound. Further instances may still be run on unwind.
2359 EAPI void evas_post_event_callback_remove(Evas *e, Evas_Object_Event_Post_Cb func);
2362 * Remove a callback from the post-event callback stack
2364 * @param e Canvas to push the callback on
2365 * @param func The function that to be called when the stack is unwound
2366 * @param data The data pointer to be passed to the callback
2368 * This removes a callback from the stack added with
2369 * evas_post_event_callback_push(). The first instance of the function and data
2370 * in the callback stack is removed from being executed when the stack is
2371 * unwound. Further instances may still be run on unwind.
2373 EAPI void evas_post_event_callback_remove_full(Evas *e, Evas_Object_Event_Post_Cb func, const void *data);
2376 * @defgroup Evas_Event_Freezing_Group Input Events Freezing Functions
2378 * Functions that deal with the freezing of input event processing of
2381 * There might be scenarios during a graphical user interface
2382 * program's use when the developer wishes the users wouldn't be able
2383 * to deliver input events to this application. It may, for example,
2384 * be the time for it to populate a view or to change some
2385 * layout. Assuming proper behavior with user interaction during this
2386 * exact time would be hard, as things are in a changing state. The
2387 * programmer can then tell the canvas to ignore input events,
2388 * bringing it back to normal behavior when he/she wants.
2390 * Most of the time use of freezing events is done like this:
2392 * evas_event_freeze(my_evas_canvas);
2393 * function_that_does_work_which_cant_be_interrupted_by_events();
2394 * evas_event_thaw(my_evas_canvas);
2397 * Some of the functions in this group are exemplified @ref
2398 * Example_Evas_Events "here".
2400 * @ingroup Evas_Canvas_Events
2404 * @addtogroup Evas_Event_Freezing_Group
2409 * Set the default set of flags an event begins with
2411 * @param e The canvas to set the default event flags of
2412 * @param flags The default flags to use
2414 * Events in evas can have an event_flags member. This starts out with
2415 * and initial value (no flags). this lets you set the default flags that
2416 * an event begins with to be @p flags
2420 EAPI void evas_event_default_flags_set(Evas *e, Evas_Event_Flags flags) EINA_ARG_NONNULL(1);
2423 * Get the defaulty set of flags an event begins with
2425 * @param e The canvas to get the default event flags from
2426 * @return The default event flags for that canvas
2428 * This gets the default event flags events are produced with when fed in.
2430 * @see evas_event_default_flags_set()
2433 EAPI Evas_Event_Flags evas_event_default_flags_get(const Evas *e) EINA_ARG_NONNULL(1);
2436 * Freeze all input events processing.
2438 * @param e The canvas to freeze input events processing on.
2440 * This function will indicate to Evas that the canvas @p e is to have
2441 * all input event processing frozen until a matching
2442 * evas_event_thaw() function is called on the same canvas. All events
2443 * of this kind during the freeze will get @b discarded. Every freeze
2444 * call must be matched by a thaw call in order to completely thaw out
2445 * a canvas (i.e. these calls may be nested). The most common use is
2446 * when you don't want the user to interact with your user interface
2447 * when you're populating a view or changing the layout.
2450 * @dontinclude evas-events.c
2451 * @skip freeze input for 3 seconds
2453 * @dontinclude evas-events.c
2454 * @skip let's have our events back
2457 * See the full @ref Example_Evas_Events "example".
2459 * If you run that example, you'll see the canvas ignoring all input
2460 * events for 3 seconds, when the "f" key is pressed. In a more
2461 * realistic code we would be freezing while a toolkit or Edje was
2462 * doing some UI changes, thawing it back afterwards.
2464 EAPI void evas_event_freeze(Evas *e) EINA_ARG_NONNULL(1);
2467 * Thaw a canvas out after freezing (for input events).
2469 * @param e The canvas to thaw out.
2471 * This will thaw out a canvas after a matching evas_event_freeze()
2472 * call. If this call completely thaws out a canvas, i.e., there's no
2473 * other unbalanced call to evas_event_freeze(), events will start to
2474 * be processed again, but any "missed" events will @b not be
2477 * See evas_event_freeze() for an example.
2479 EAPI void evas_event_thaw(Evas *e) EINA_ARG_NONNULL(1);
2482 * Return the freeze count on input events of a given canvas.
2484 * @param e The canvas to fetch the freeze count from.
2486 * This returns the number of times the canvas has been told to freeze
2487 * input events. It is possible to call evas_event_freeze() multiple
2488 * times, and these must be matched by evas_event_thaw() calls. This
2489 * call allows the program to discover just how many times things have
2490 * been frozen in case it may want to break out of a deep freeze state
2491 * where the count is high.
2495 * extern Evas *evas;
2497 * while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
2501 EAPI int evas_event_freeze_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2504 * After thaw of a canvas, re-evaluate the state of objects and call callbacks
2506 * @param e The canvas to evaluate after a thaw
2508 * This is normally called after evas_event_thaw() to re-evaluate mouse
2509 * containment and other states and thus also call callbacks for mouse in and
2510 * out on new objects if the state change demands it.
2512 EAPI void evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1);
2519 * @defgroup Evas_Event_Feeding_Group Input Events Feeding Functions
2521 * Functions to tell Evas that input events happened and should be
2524 * @warning Most of the time these functions are @b not what you're looking for.
2525 * These functions should only be used if you're not working with ecore evas(or
2526 * another input handling system). If you're not using ecore evas please
2527 * consider using it, in most situation it will make life a lot easier.
2529 * As explained in @ref intro_not_evas, Evas does not know how to poll
2530 * for input events, so the developer should do it and then feed such
2531 * events to the canvas to be processed. This is only required if
2532 * operating Evas directly. Modules such as Ecore_Evas do that for
2535 * Some of the functions in this group are exemplified @ref
2536 * Example_Evas_Events "here".
2538 * @ingroup Evas_Canvas_Events
2542 * @addtogroup Evas_Event_Feeding_Group
2547 * Get the number of mouse or multi presses currently active
2549 * @p e The given canvas pointer.
2550 * @return The numer of presses (0 if none active).
2554 EAPI int evas_event_down_count_get(const Evas *e) EINA_ARG_NONNULL(1);
2557 * Mouse down event feed.
2559 * @param e The given canvas pointer.
2560 * @param b The button number.
2561 * @param flags The evas button flags.
2562 * @param timestamp The timestamp of the mouse down event.
2563 * @param data The data for canvas.
2565 * This function will set some evas properties that is necessary when
2566 * the mouse button is pressed. It prepares information to be treated
2567 * by the callback function.
2570 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);
2573 * Mouse up event feed.
2575 * @param e The given canvas pointer.
2576 * @param b The button number.
2577 * @param flags evas button flags.
2578 * @param timestamp The timestamp of the mouse up event.
2579 * @param data The data for canvas.
2581 * This function will set some evas properties that is necessary when
2582 * the mouse button is released. It prepares information to be treated
2583 * by the callback function.
2586 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);
2589 * Mouse move event feed.
2591 * @param e The given canvas pointer.
2592 * @param x The horizontal position of the mouse pointer.
2593 * @param y The vertical position of the mouse pointer.
2594 * @param timestamp The timestamp of the mouse up event.
2595 * @param data The data for canvas.
2597 * This function will set some evas properties that is necessary when
2598 * the mouse is moved from its last position. It prepares information
2599 * to be treated by the callback function.
2602 EAPI void evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2605 * Mouse in event feed.
2607 * @param e The given canvas pointer.
2608 * @param timestamp The timestamp of the mouse up event.
2609 * @param data The data for canvas.
2611 * This function will set some evas properties that is necessary when
2612 * the mouse in event happens. It prepares information to be treated
2613 * by the callback function.
2616 EAPI void evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2619 * Mouse out event feed.
2621 * @param e The given canvas pointer.
2622 * @param timestamp Timestamp of the mouse up event.
2623 * @param data The data for canvas.
2625 * This function will set some evas properties that is necessary when
2626 * the mouse out event happens. It prepares information to be treated
2627 * by the callback function.
2630 EAPI void evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2631 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);
2632 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);
2633 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);
2636 * Mouse cancel event feed.
2638 * @param e The given canvas pointer.
2639 * @param timestamp The timestamp of the mouse up event.
2640 * @param data The data for canvas.
2642 * This function will call evas_event_feed_mouse_up() when a
2643 * mouse cancel event happens.
2646 EAPI void evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2649 * Mouse wheel event feed.
2651 * @param e The given canvas pointer.
2652 * @param direction The wheel mouse direction.
2653 * @param z How much mouse wheel was scrolled up or down.
2654 * @param timestamp The timestamp of the mouse up event.
2655 * @param data The data for canvas.
2657 * This function will set some evas properties that is necessary when
2658 * the mouse wheel is scrolled up or down. It prepares information to
2659 * be treated by the callback function.
2662 EAPI void evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2665 * Key down event feed
2667 * @param e The canvas to thaw out
2668 * @param keyname Name of the key
2669 * @param key The key pressed.
2670 * @param string A String
2671 * @param compose The compose string
2672 * @param timestamp Timestamp of the mouse up event
2673 * @param data Data for canvas.
2675 * This function will set some evas properties that is necessary when
2676 * a key is pressed. It prepares information to be treated by the
2677 * callback function.
2680 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);
2685 * @param e The canvas to thaw out
2686 * @param keyname Name of the key
2687 * @param key The key released.
2688 * @param string string
2689 * @param compose compose
2690 * @param timestamp Timestamp of the mouse up event
2691 * @param data Data for canvas.
2693 * This function will set some evas properties that is necessary when
2694 * a key is released. It prepares information to be treated by the
2695 * callback function.
2698 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);
2703 * @param e The given canvas pointer.
2704 * @param hold The hold.
2705 * @param timestamp The timestamp of the mouse up event.
2706 * @param data The data for canvas.
2708 * This function makes the object to stop sending events.
2711 EAPI void evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
2716 * @param e The given canvas pointer.
2717 * @param event_copy the event to refeed
2718 * @param event_type Event type
2720 * This function re-feeds the event pointed by event_copy
2722 * This function call evas_event_feed_* functions, so it can
2723 * cause havoc if not used wisely. Please use it responsibly.
2725 EAPI void evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
2736 * @defgroup Evas_Image_Group Image Functions
2738 * Functions that deals with images at canvas level.
2740 * @ingroup Evas_Canvas
2744 * @addtogroup Evas_Image_Group
2749 * Flush the image cache of the canvas.
2751 * @param e The given evas pointer.
2753 * This function flushes image cache of canvas.
2756 EAPI void evas_image_cache_flush(Evas *e) EINA_ARG_NONNULL(1);
2759 * Reload the image cache
2761 * @param e The given evas pointer.
2763 * This function reloads the image cache of canvas.
2766 EAPI void evas_image_cache_reload(Evas *e) EINA_ARG_NONNULL(1);
2769 * Set the image cache.
2771 * @param e The given evas pointer.
2772 * @param size The cache size.
2774 * This function sets the image cache of canvas in bytes.
2777 EAPI void evas_image_cache_set(Evas *e, int size) EINA_ARG_NONNULL(1);
2780 * Get the image cache
2782 * @param e The given evas pointer.
2784 * This function returns the image cache size of canvas in bytes.
2787 EAPI int evas_image_cache_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2790 * Get the maximum image size evas can possibly handle
2792 * @param e The given evas pointer.
2793 * @param maxw Pointer to hold the return value in pixels of the maxumum width
2794 * @param maxh Pointer to hold the return value in pixels of the maximum height
2796 * This function returns the larges image or surface size that evas can handle
2797 * in pixels, and if there is one, returns @c EINA_TRUE. It returns
2798 * @c EINA_FALSE if no extra constraint on maximum image size exists. You still
2799 * should check the return values of @p maxw and @p maxh as there may still be
2800 * a limit, just a much higher one.
2804 EAPI Eina_Bool evas_image_max_size_get(const Evas *e, int *maxw, int *maxh) EINA_ARG_NONNULL(1);
2811 * @defgroup Evas_Font_Group Font Functions
2813 * Functions that deals with fonts.
2815 * @ingroup Evas_Canvas
2819 * Changes the font hinting for the given evas.
2821 * @param e The given evas.
2822 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2823 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2824 * @ingroup Evas_Font_Group
2826 EAPI void evas_font_hinting_set(Evas *e, Evas_Font_Hinting_Flags hinting) EINA_ARG_NONNULL(1);
2829 * Retrieves the font hinting used by the given evas.
2831 * @param e The given evas to query.
2832 * @return The hinting in use, one of #EVAS_FONT_HINTING_NONE,
2833 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2834 * @ingroup Evas_Font_Group
2836 EAPI Evas_Font_Hinting_Flags evas_font_hinting_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2839 * Checks if the font hinting is supported by the given evas.
2841 * @param e The given evas to query.
2842 * @param hinting The hinting to use, one of #EVAS_FONT_HINTING_NONE,
2843 * #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
2844 * @return @c EINA_TRUE if it is supported, @c EINA_FALSE otherwise.
2845 * @ingroup Evas_Font_Group
2847 EAPI Eina_Bool evas_font_hinting_can_hint(const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2850 * Force the given evas and associated engine to flush its font cache.
2852 * @param e The given evas to flush font cache.
2853 * @ingroup Evas_Font_Group
2855 EAPI void evas_font_cache_flush(Evas *e) EINA_ARG_NONNULL(1);
2858 * Changes the size of font cache of the given evas.
2860 * @param e The given evas to flush font cache.
2861 * @param size The size, in bytes.
2863 * @ingroup Evas_Font_Group
2865 EAPI void evas_font_cache_set(Evas *e, int size) EINA_ARG_NONNULL(1);
2868 * Changes the size of font cache of the given evas.
2870 * @param e The given evas to flush font cache.
2871 * @return The size, in bytes.
2873 * @ingroup Evas_Font_Group
2875 EAPI int evas_font_cache_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2878 * List of available font descriptions known or found by this evas.
2880 * The list depends on Evas compile time configuration, such as
2881 * fontconfig support, and the paths provided at runtime as explained
2882 * in @ref Evas_Font_Path_Group.
2884 * @param e The evas instance to query.
2885 * @return a newly allocated list of strings. Do not change the
2886 * strings. Be sure to call evas_font_available_list_free()
2887 * after you're done.
2889 * @ingroup Evas_Font_Group
2891 EAPI Eina_List *evas_font_available_list(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2894 * Free list of font descriptions returned by evas_font_dir_available_list().
2896 * @param e The evas instance that returned such list.
2897 * @param available the list returned by evas_font_dir_available_list().
2899 * @ingroup Evas_Font_Group
2901 EAPI void evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
2904 * @defgroup Evas_Font_Path_Group Font Path Functions
2906 * Functions that edit the paths being used to load fonts.
2908 * @ingroup Evas_Font_Group
2912 * Removes all font paths loaded into memory for the given evas.
2913 * @param e The given evas.
2914 * @ingroup Evas_Font_Path_Group
2916 EAPI void evas_font_path_clear(Evas *e) EINA_ARG_NONNULL(1);
2919 * Appends a font path to the list of font paths used by the given evas.
2920 * @param e The given evas.
2921 * @param path The new font path.
2922 * @ingroup Evas_Font_Path_Group
2924 EAPI void evas_font_path_append(Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2927 * Prepends a font path to the list of font paths used by the given evas.
2928 * @param e The given evas.
2929 * @param path The new font path.
2930 * @ingroup Evas_Font_Path_Group
2932 EAPI void evas_font_path_prepend(Evas *e, const char *path) EINA_ARG_NONNULL(1, 2);
2935 * Retrieves the list of font paths used by the given evas.
2936 * @param e The given evas.
2937 * @return The list of font paths used.
2938 * @ingroup Evas_Font_Path_Group
2940 EAPI const Eina_List *evas_font_path_list(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
2943 * @defgroup Evas_Object_Group Generic Object Functions
2945 * Functions that manipulate generic Evas objects.
2947 * All Evas displaying units are Evas objects. One handles them all by
2948 * means of the handle ::Evas_Object. Besides Evas treats their
2949 * objects equally, they have @b types, which define their specific
2950 * behavior (and individual API).
2952 * Evas comes with a set of built-in object types:
2960 * These functions apply to @b any Evas object, whichever type that
2963 * @note The built-in types which are most used are rectangles, text
2964 * and images. In fact, with these ones one can create 2D interfaces
2965 * of arbitrary complexity and EFL makes it easy.
2969 * @defgroup Evas_Object_Group_Basic Basic Object Manipulation
2971 * Almost every evas object created will have some generic function used to
2972 * manipulate it. That's because there are a number of basic actions to be done
2973 * to objects that are irrespective of the object's type, things like:
2974 * @li Showing/Hiding
2975 * @li Setting(and getting) geometry
2976 * @li Bring up or down a layer
2977 * @li Color management
2978 * @li Handling focus
2980 * @li Reference counting
2982 * All of this issues are handled through the functions here grouped. Examples
2983 * of these function can be seen in @ref Example_Evas_Object_Manipulation(which
2984 * deals with the most common ones) and in @ref Example_Evas_Stacking(which
2985 * deals with stacking functions).
2987 * @ingroup Evas_Object_Group
2991 * @addtogroup Evas_Object_Group_Basic
2996 * Clip one object to another.
2998 * @param obj The object to be clipped
2999 * @param clip The object to clip @p obj by
3001 * This function will clip the object @p obj to the area occupied by
3002 * the object @p clip. This means the object @p obj will only be
3003 * visible within the area occupied by the clipping object (@p clip).
3005 * The color of the object being clipped will be multiplied by the
3006 * color of the clipping one, so the resulting color for the former
3007 * will be <code>RESULT = (OBJ * CLIP) / (255 * 255)</code>, per color
3008 * element (red, green, blue and alpha).
3010 * Clipping is recursive, so clipping objects may be clipped by
3011 * others, and their color will in term be multiplied. You may @b not
3012 * set up circular clipping lists (i.e. object 1 clips object 2, which
3013 * clips object 1): the behavior of Evas is undefined in this case.
3015 * Objects which do not clip others are visible in the canvas as
3016 * normal; <b>those that clip one or more objects become invisible
3017 * themselves</b>, only affecting what they clip. If an object ceases
3018 * to have other objects being clipped by it, it will become visible
3021 * The visibility of an object affects the objects that are clipped by
3022 * it, so if the object clipping others is not shown (as in
3023 * evas_object_show()), the objects clipped by it will not be shown
3026 * If @p obj was being clipped by another object when this function is
3027 * called, it gets implicitly removed from the old clipper's domain
3028 * and is made now to be clipped by its new clipper.
3030 * The following figure illustrates some clipping in Evas:
3032 * @image html clipping.png
3033 * @image rtf clipping.png
3034 * @image latex clipping.eps
3036 * @note At the moment the <b>only objects that can validly be used to
3037 * clip other objects are rectangle objects</b>. All other object
3038 * types are invalid and the result of using them is undefined. The
3039 * clip object @p clip must be a valid object, but can also be @c
3040 * NULL, in which case the effect of this function is the same as
3041 * calling evas_object_clip_unset() on the @p obj object.
3044 * @dontinclude evas-object-manipulation.c
3045 * @skip solid white clipper (note that it's the default color for a
3046 * @until evas_object_show(d.clipper);
3048 * See the full @ref Example_Evas_Object_Manipulation "example".
3050 EAPI void evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) EINA_ARG_NONNULL(1, 2);
3053 * Get the object clipping @p obj (if any).
3055 * @param obj The object to get the clipper from
3057 * This function returns the object clipping @p obj. If @p obj is
3058 * not being clipped at all, @c NULL is returned. The object @p obj
3059 * must be a valid ::Evas_Object.
3061 * See also evas_object_clip_set(), evas_object_clip_unset() and
3062 * evas_object_clipees_get().
3065 * @dontinclude evas-object-manipulation.c
3066 * @skip if (evas_object_clip_get(d.img) == d.clipper)
3069 * See the full @ref Example_Evas_Object_Manipulation "example".
3071 EAPI Evas_Object *evas_object_clip_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3074 * Disable/cease clipping on a clipped @p obj object.
3076 * @param obj The object to cease clipping on
3078 * This function disables clipping for the object @p obj, if it was
3079 * already clipped, i.e., its visibility and color get detached from
3080 * the previous clipper. If it wasn't, this has no effect. The object
3081 * @p obj must be a valid ::Evas_Object.
3083 * See also evas_object_clip_set() (for an example),
3084 * evas_object_clipees_get() and evas_object_clip_get().
3087 EAPI void evas_object_clip_unset(Evas_Object *obj);
3090 * Return a list of objects currently clipped by @p obj.
3092 * @param obj The object to get a list of clippees from
3093 * @return a list of objects being clipped by @p obj
3095 * This returns the internal list handle that contains all objects
3096 * clipped by the object @p obj. If none are clipped by it, the call
3097 * returns @c NULL. This list is only valid until the clip list is
3098 * changed and should be fetched again with another call to
3099 * evas_object_clipees_get() if any objects being clipped by this
3100 * object are unclipped, clipped by a new object, deleted or get the
3101 * clipper deleted. These operations will invalidate the list
3102 * returned, so it should not be used anymore after that point. Any
3103 * use of the list after this may have undefined results, possibly
3104 * leading to crashes. The object @p obj must be a valid
3107 * See also evas_object_clip_set(), evas_object_clip_unset() and
3108 * evas_object_clip_get().
3112 * extern Evas_Object *obj;
3113 * Evas_Object *clipper;
3115 * clipper = evas_object_clip_get(obj);
3118 * Eina_List *clippees, *l;
3119 * Evas_Object *obj_tmp;
3121 * clippees = evas_object_clipees_get(clipper);
3122 * printf("Clipper clips %i objects\n", eina_list_count(clippees));
3123 * EINA_LIST_FOREACH(clippees, l, obj_tmp)
3124 * evas_object_show(obj_tmp);
3128 EAPI const Eina_List *evas_object_clipees_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3131 * Sets or unsets a given object as the currently focused one on its
3134 * @param obj The object to be focused or unfocused.
3135 * @param focus @c EINA_TRUE, to set it as focused or @c EINA_FALSE,
3136 * to take away the focus from it.
3138 * Changing focus only affects where (key) input events go. There can
3139 * be only one object focused at any time. If @p focus is @c EINA_TRUE,
3140 * @p obj will be set as the currently focused object and it will
3141 * receive all keyboard events that are not exclusive key grabs on
3145 * @dontinclude evas-events.c
3146 * @skip evas_object_focus_set
3147 * @until evas_object_focus_set
3149 * See the full example @ref Example_Evas_Events "here".
3151 * @see evas_object_focus_get
3152 * @see evas_focus_get
3153 * @see evas_object_key_grab
3154 * @see evas_object_key_ungrab
3156 EAPI void evas_object_focus_set(Evas_Object *obj, Eina_Bool focus) EINA_ARG_NONNULL(1);
3159 * Retrieve whether an object has the focus.
3161 * @param obj The object to retrieve focus information from.
3162 * @return @c EINA_TRUE if the object has the focus, @c EINA_FALSE otherwise.
3164 * If the passed object is the currently focused one, @c EINA_TRUE is
3165 * returned. @c EINA_FALSE is returned, otherwise.
3168 * @dontinclude evas-events.c
3170 * @until something is bad
3172 * See the full example @ref Example_Evas_Events "here".
3174 * @see evas_object_focus_set
3175 * @see evas_focus_get
3176 * @see evas_object_key_grab
3177 * @see evas_object_key_ungrab
3179 EAPI Eina_Bool evas_object_focus_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3182 * Sets the layer of its canvas that the given object will be part of.
3184 * @param obj The given Evas object.
3185 * @param l The number of the layer to place the object on.
3186 * Must be between #EVAS_LAYER_MIN and #EVAS_LAYER_MAX.
3188 * If you don't use this function, you'll be dealing with an @b unique
3189 * layer of objects, the default one. Additional layers are handy when
3190 * you don't want a set of objects to interfere with another set with
3191 * regard to @b stacking. Two layers are completely disjoint in that
3194 * This is a low-level function, which you'd be using when something
3195 * should be always on top, for example.
3197 * @warning Be careful, it doesn't make sense to change the layer of
3198 * smart objects' children. Smart objects have a layer of their own,
3199 * which should contain all their children objects.
3201 * @see evas_object_layer_get()
3203 EAPI void evas_object_layer_set(Evas_Object *obj, short l) EINA_ARG_NONNULL(1);
3206 * Retrieves the layer of its canvas that the given object is part of.
3208 * @param obj The given Evas object to query layer from
3209 * @return Number of its layer
3211 * @see evas_object_layer_set()
3213 EAPI short evas_object_layer_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3216 * Sets the name of the given Evas object to the given name.
3218 * @param obj The given object.
3219 * @param name The given name.
3221 * There might be occasions where one would like to name his/her
3225 * @dontinclude evas-events.c
3226 * @skip d.bg = evas_object_rectangle_add(d.canvas);
3227 * @until evas_object_name_set(d.bg, "our dear rectangle");
3229 * See the full @ref Example_Evas_Events "example".
3231 EAPI void evas_object_name_set(Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
3234 * Retrieves the name of the given Evas object.
3236 * @param obj The given object.
3237 * @return The name of the object or @c NULL, if no name has been given
3241 * @dontinclude evas-events.c
3242 * @skip fprintf(stdout, "An object got focused: %s\n",
3243 * @until evas_focus_get
3245 * See the full @ref Example_Evas_Events "example".
3247 EAPI const char *evas_object_name_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3250 * Increments object reference count to defer its deletion.
3252 * @param obj The given Evas object to reference
3254 * This increments the reference count of an object, which if greater
3255 * than 0 will defer deletion by evas_object_del() until all
3256 * references are released back (counter back to 0). References cannot
3257 * go below 0 and unreferencing past that will result in the reference
3258 * count being limited to 0. References are limited to <c>2^32 - 1</c>
3259 * for an object. Referencing it more than this will result in it
3260 * being limited to this value.
3262 * @see evas_object_unref()
3263 * @see evas_object_del()
3265 * @note This is a <b>very simple</b> reference counting mechanism! For
3266 * instance, Evas is not ready to check for pending references on a
3267 * canvas deletion, or things like that. This is useful on scenarios
3268 * where, inside a code block, callbacks exist which would possibly
3269 * delete an object we are operating on afterwards. Then, one would
3270 * evas_object_ref() it on the beginning of the block and
3271 * evas_object_unref() it on the end. It would then be deleted at this
3272 * point, if it should be.
3276 * evas_object_ref(obj);
3279 * evas_object_smart_callback_call(obj, SIG_SELECTED, NULL);
3280 * // more action here...
3281 * evas_object_unref(obj);
3284 * @ingroup Evas_Object_Group_Basic
3287 EAPI void evas_object_ref(Evas_Object *obj);
3290 * Decrements object reference count.
3292 * @param obj The given Evas object to unreference
3294 * This decrements the reference count of an object. If the object has
3295 * had evas_object_del() called on it while references were more than
3296 * 0, it will be deleted at the time this function is called and puts
3297 * the counter back to 0. See evas_object_ref() for more information.
3299 * @see evas_object_ref() (for an example)
3300 * @see evas_object_del()
3302 * @ingroup Evas_Object_Group_Basic
3305 EAPI void evas_object_unref(Evas_Object *obj);
3308 * Get the object reference count.
3310 * @param obj The given Evas object to query
3312 * This gets the reference count for an object (normally 0 until it is
3313 * referenced). Values of 1 or greater mean that someone is holding a
3314 * reference to this object that needs to be unreffed before it can be
3317 * @see evas_object_ref()
3318 * @see evas_object_unref()
3319 * @see evas_object_del()
3321 * @ingroup Evas_Object_Group_Basic
3324 EAPI int evas_object_ref_get(const Evas_Object *obj);
3327 * Marks the given Evas object for deletion (when Evas will free its
3330 * @param obj The given Evas object.
3332 * This call will mark @p obj for deletion, which will take place
3333 * whenever it has no more references to it (see evas_object_ref() and
3334 * evas_object_unref()).
3336 * At actual deletion time, which may or may not be just after this
3337 * call, ::EVAS_CALLBACK_DEL and ::EVAS_CALLBACK_FREE callbacks will
3338 * be called. If the object currently had the focus, its
3339 * ::EVAS_CALLBACK_FOCUS_OUT callback will also be called.
3341 * @see evas_object_ref()
3342 * @see evas_object_unref()
3344 * @ingroup Evas_Object_Group_Basic
3346 EAPI void evas_object_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
3349 * Move the given Evas object to the given location inside its
3352 * @param obj The given Evas object.
3353 * @param x X position to move the object to, in canvas units.
3354 * @param y Y position to move the object to, in canvas units.
3356 * Besides being moved, the object's ::EVAS_CALLBACK_MOVE callback
3359 * @note Naturally, newly created objects are placed at the canvas'
3360 * origin: <code>0, 0</code>.
3363 * @dontinclude evas-object-manipulation.c
3364 * @skip evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
3365 * @until evas_object_show
3367 * See the full @ref Example_Evas_Object_Manipulation "example".
3369 * @ingroup Evas_Object_Group_Basic
3371 EAPI void evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
3374 * Changes the size of the given Evas object.
3376 * @param obj The given Evas object.
3377 * @param w The new width of the Evas object.
3378 * @param h The new height of the Evas object.
3380 * Besides being resized, the object's ::EVAS_CALLBACK_RESIZE callback
3383 * @note Newly created objects have zeroed dimensions. Then, you most
3384 * probably want to use evas_object_resize() on them after they are
3387 * @note Be aware that resizing an object changes its drawing area,
3388 * but that does imply the object is rescaled! For instance, images
3389 * are filled inside their drawing area using the specifications of
3390 * evas_object_image_fill_set(). Thus to scale the image to match
3391 * exactly your drawing area, you need to change the
3392 * evas_object_image_fill_set() as well.
3394 * @note This is more evident in images, but text, textblock, lines
3395 * and polygons will behave similarly. Check their specific APIs to
3396 * know how to achieve your desired behavior. Consider the following
3400 * // rescale image to fill exactly its area without tiling:
3401 * evas_object_resize(img, w, h);
3402 * evas_object_image_fill_set(img, 0, 0, w, h);
3405 * @ingroup Evas_Object_Group_Basic
3407 EAPI void evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
3410 * Retrieves the position and (rectangular) size of the given Evas
3413 * @param obj The given Evas object.
3414 * @param x Pointer to an integer in which to store the X coordinate
3416 * @param y Pointer to an integer in which to store the Y coordinate
3418 * @param w Pointer to an integer in which to store the width of the
3420 * @param h Pointer to an integer in which to store the height of the
3423 * The position, naturally, will be relative to the top left corner of
3424 * the canvas' viewport.
3426 * @note Use @c NULL pointers on the geometry components you're not
3427 * interested in: they'll be ignored by the function.
3430 * @dontinclude evas-events.c
3431 * @skip int w, h, cw, ch;
3434 * See the full @ref Example_Evas_Events "example".
3436 * @ingroup Evas_Object_Group_Basic
3438 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);
3441 * Makes the given Evas object visible.
3443 * @param obj The given Evas object.
3445 * Besides becoming visible, the object's ::EVAS_CALLBACK_SHOW
3446 * callback will be called.
3448 * @see evas_object_hide() for more on object visibility.
3449 * @see evas_object_visible_get()
3451 * @ingroup Evas_Object_Group_Basic
3453 EAPI void evas_object_show(Evas_Object *obj) EINA_ARG_NONNULL(1);
3456 * Makes the given Evas object invisible.
3458 * @param obj The given Evas object.
3460 * Hidden objects, besides not being shown at all in your canvas,
3461 * won't be checked for changes on the canvas rendering
3462 * process. Furthermore, they will not catch input events. Thus, they
3463 * are much ligher (in processing needs) than an object that is
3464 * invisible due to indirect causes, such as being clipped or out of
3465 * the canvas' viewport.
3467 * Besides becoming hidden, @p obj object's ::EVAS_CALLBACK_SHOW
3468 * callback will be called.
3470 * @note All objects are created in the hidden state! If you want them
3471 * shown, use evas_object_show() after their creation.
3473 * @see evas_object_show()
3474 * @see evas_object_visible_get()
3477 * @dontinclude evas-object-manipulation.c
3478 * @skip if (evas_object_visible_get(d.clipper))
3481 * See the full @ref Example_Evas_Object_Manipulation "example".
3483 * @ingroup Evas_Object_Group_Basic
3485 EAPI void evas_object_hide(Evas_Object *obj) EINA_ARG_NONNULL(1);
3488 * Retrieves whether or not the given Evas object is visible.
3490 * @param obj The given Evas object.
3491 * @return @c EINA_TRUE if the object is visible, @c EINA_FALSE
3494 * This retrieves an object's visibility as the one enforced by
3495 * evas_object_show() and evas_object_hide().
3497 * @note The value returned isn't, by any means, influenced by
3498 * clippers covering @p obj, it being out of its canvas' viewport or
3499 * stacked below other object.
3501 * @see evas_object_show()
3502 * @see evas_object_hide() (for an example)
3504 * @ingroup Evas_Object_Group_Basic
3506 EAPI Eina_Bool evas_object_visible_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3509 * Sets the general/main color of the given Evas object to the given
3512 * @param obj The given Evas object.
3513 * @param r The red component of the given color.
3514 * @param g The green component of the given color.
3515 * @param b The blue component of the given color.
3516 * @param a The alpha component of the given color.
3518 * @see evas_object_color_get() (for an example)
3519 * @note These color values are expected to be premultiplied by @p a.
3521 * @ingroup Evas_Object_Group_Basic
3523 EAPI void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
3526 * Retrieves the general/main color of the given Evas object.
3528 * @param obj The given Evas object to retrieve color from.
3529 * @param r Pointer to an integer in which to store the red component
3531 * @param g Pointer to an integer in which to store the green
3532 * component of the color.
3533 * @param b Pointer to an integer in which to store the blue component
3535 * @param a Pointer to an integer in which to store the alpha
3536 * component of the color.
3538 * Retrieves the “main” color's RGB component (and alpha channel)
3539 * values, <b>which range from 0 to 255</b>. For the alpha channel,
3540 * which defines the object's transparency level, 0 means totally
3541 * transparent, while 255 means opaque. These color values are
3542 * premultiplied by the alpha value.
3544 * Usually you’ll use this attribute for text and rectangle objects,
3545 * where the “main” color is their unique one. If set for objects
3546 * which themselves have colors, like the images one, those colors get
3547 * modulated by this one.
3549 * @note All newly created Evas rectangles get the default color
3550 * values of <code>255 255 255 255</code> (opaque white).
3552 * @note Use @c NULL pointers on the components you're not interested
3553 * in: they'll be ignored by the function.
3556 * @dontinclude evas-object-manipulation.c
3557 * @skip int alpha, r, g, b;
3560 * See the full @ref Example_Evas_Object_Manipulation "example".
3562 * @ingroup Evas_Object_Group_Basic
3564 EAPI void evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
3567 * Retrieves the Evas canvas that the given object lives on.
3569 * @param obj The given Evas object.
3570 * @return A pointer to the canvas where the object is on.
3572 * This function is most useful at code contexts where you need to
3573 * operate on the canvas but have only the object pointer.
3575 * @ingroup Evas_Object_Group_Basic
3577 EAPI Evas *evas_object_evas_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3580 * Retrieves the type of the given Evas object.
3582 * @param obj The given object.
3583 * @return The type of the object.
3585 * For Evas' builtin types, the return strings will be one of:
3586 * - <c>"rectangle"</c>,
3588 * - <c>"polygon"</c>,
3590 * - <c>"textblock"</c> and
3593 * For Evas smart objects (see @ref Evas_Smart_Group), the name of the
3594 * smart class itself is returned on this call. For the built-in smart
3595 * objects, these names are:
3596 * - <c>"EvasObjectSmartClipped"</c>, for the clipped smart object
3597 * - <c>"Evas_Object_Box"</c>, for the box object and
3598 * - <c>"Evas_Object_Table"</c>, for the table object.
3601 * @dontinclude evas-object-manipulation.c
3602 * @skip d.img = evas_object_image_filled_add(d.canvas);
3603 * @until border on the
3605 * See the full @ref Example_Evas_Object_Manipulation "example".
3607 EAPI const char *evas_object_type_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3610 * Raise @p obj to the top of its layer.
3612 * @param obj the object to raise
3614 * @p obj will, then, be the highest one in the layer it belongs
3615 * to. Object on other layers won't get touched.
3617 * @see evas_object_stack_above()
3618 * @see evas_object_stack_below()
3619 * @see evas_object_lower()
3621 EAPI void evas_object_raise(Evas_Object *obj) EINA_ARG_NONNULL(1);
3624 * Lower @p obj to the bottom of its layer.
3626 * @param obj the object to lower
3628 * @p obj will, then, be the lowest one in the layer it belongs
3629 * to. Objects on other layers won't get touched.
3631 * @see evas_object_stack_above()
3632 * @see evas_object_stack_below()
3633 * @see evas_object_raise()
3635 EAPI void evas_object_lower(Evas_Object *obj) EINA_ARG_NONNULL(1);
3638 * Stack @p obj immediately above @p above
3640 * @param obj the object to stack
3641 * @param above the object above which to stack
3643 * Objects, in a given canvas, are stacked in the order they get added
3644 * to it. This means that, if they overlap, the highest ones will
3645 * cover the lowest ones, in that order. This function is a way to
3646 * change the stacking order for the objects.
3648 * This function is intended to be used with <b>objects belonging to
3649 * the same layer</b> in a given canvas, otherwise it will fail (and
3650 * accomplish nothing).
3652 * If you have smart objects on your canvas and @p obj is a member of
3653 * one of them, then @p above must also be a member of the same
3656 * Similarly, if @p obj is not a member of a smart object, @p above
3657 * must not be either.
3659 * @see evas_object_layer_get()
3660 * @see evas_object_layer_set()
3661 * @see evas_object_stack_below()
3663 EAPI void evas_object_stack_above(Evas_Object *obj, Evas_Object *above) EINA_ARG_NONNULL(1, 2);
3666 * Stack @p obj immediately below @p below
3668 * @param obj the object to stack
3669 * @param below the object below which to stack
3671 * Objects, in a given canvas, are stacked in the order they get added
3672 * to it. This means that, if they overlap, the highest ones will
3673 * cover the lowest ones, in that order. This function is a way to
3674 * change the stacking order for the objects.
3676 * This function is intended to be used with <b>objects belonging to
3677 * the same layer</b> in a given canvas, otherwise it will fail (and
3678 * accomplish nothing).
3680 * If you have smart objects on your canvas and @p obj is a member of
3681 * one of them, then @p below must also be a member of the same
3684 * Similarly, if @p obj is not a member of a smart object, @p below
3685 * must not be either.
3687 * @see evas_object_layer_get()
3688 * @see evas_object_layer_set()
3689 * @see evas_object_stack_below()
3691 EAPI void evas_object_stack_below(Evas_Object *obj, Evas_Object *below) EINA_ARG_NONNULL(1, 2);
3694 * Get the Evas object stacked right above @p obj
3696 * @param obj an #Evas_Object
3697 * @return the #Evas_Object directly above @p obj, if any, or @c NULL,
3700 * This function will traverse layers in its search, if there are
3701 * objects on layers above the one @p obj is placed at.
3703 * @see evas_object_layer_get()
3704 * @see evas_object_layer_set()
3705 * @see evas_object_below_get()
3708 EAPI Evas_Object *evas_object_above_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3711 * Get the Evas object stacked right below @p obj
3713 * @param obj an #Evas_Object
3714 * @return the #Evas_Object directly below @p obj, if any, or @c NULL,
3717 * This function will traverse layers in its search, if there are
3718 * objects on layers below the one @p obj is placed at.
3720 * @see evas_object_layer_get()
3721 * @see evas_object_layer_set()
3722 * @see evas_object_below_get()
3724 EAPI Evas_Object *evas_object_below_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
3731 * @defgroup Evas_Object_Group_Events Object Events
3733 * Objects generate events when they are moved, resized, when their
3734 * visibility change, when they are deleted and so on. These methods
3735 * allow one to be notified about and to handle such events.
3737 * Objects also generate events on input (keyboard and mouse), if they
3738 * accept them (are visible, focused, etc).
3740 * For each of those events, Evas provides a way for one to register
3741 * callback functions to be issued just after they happen.
3743 * The following figure illustrates some Evas (event) callbacks:
3745 * @image html evas-callbacks.png
3746 * @image rtf evas-callbacks.png
3747 * @image latex evas-callbacks.eps
3749 * These events have their values in the #Evas_Callback_Type
3750 * enumeration, which has also ones happening on the canvas level (see
3751 * @ref Evas_Canvas_Events ).
3753 * Examples on this group of functions can be found @ref
3754 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
3756 * @ingroup Evas_Object_Group
3760 * @addtogroup Evas_Object_Group_Events
3765 * Add (register) a callback function to a given Evas object event.
3767 * @param obj Object to attach a callback to
3768 * @param type The type of event that will trigger the callback
3769 * @param func The function to be called when the event is triggered
3770 * @param data The data pointer to be passed to @p func
3772 * This function adds a function callback to an object when the event
3773 * of type @p type occurs on object @p obj. The function is @p func.
3775 * In the event of a memory allocation error during addition of the
3776 * callback to the object, evas_alloc_error() should be used to
3777 * determine the nature of the error, if any, and the program should
3778 * sensibly try and recover.
3780 * A callback function must have the ::Evas_Object_Event_Cb prototype
3781 * definition. The first parameter (@p data) in this definition will
3782 * have the same value passed to evas_object_event_callback_add() as
3783 * the @p data parameter, at runtime. The second parameter @p e is the
3784 * canvas pointer on which the event occurred. The third parameter is
3785 * a pointer to the object on which event occurred. Finally, the
3786 * fourth parameter @p event_info is a pointer to a data structure
3787 * that may or may not be passed to the callback, depending on the
3788 * event type that triggered the callback. This is so because some
3789 * events don't carry extra context with them, but others do.
3791 * The event type @p type to trigger the function may be one of
3792 * #EVAS_CALLBACK_MOUSE_IN, #EVAS_CALLBACK_MOUSE_OUT,
3793 * #EVAS_CALLBACK_MOUSE_DOWN, #EVAS_CALLBACK_MOUSE_UP,
3794 * #EVAS_CALLBACK_MOUSE_MOVE, #EVAS_CALLBACK_MOUSE_WHEEL,
3795 * #EVAS_CALLBACK_MULTI_DOWN, #EVAS_CALLBACK_MULTI_UP,
3796 * #EVAS_CALLBACK_MULTI_MOVE, #EVAS_CALLBACK_FREE,
3797 * #EVAS_CALLBACK_KEY_DOWN, #EVAS_CALLBACK_KEY_UP,
3798 * #EVAS_CALLBACK_FOCUS_IN, #EVAS_CALLBACK_FOCUS_OUT,
3799 * #EVAS_CALLBACK_SHOW, #EVAS_CALLBACK_HIDE, #EVAS_CALLBACK_MOVE,
3800 * #EVAS_CALLBACK_RESIZE, #EVAS_CALLBACK_RESTACK, #EVAS_CALLBACK_DEL,
3801 * #EVAS_CALLBACK_HOLD, #EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3802 * #EVAS_CALLBACK_IMAGE_PRELOADED or #EVAS_CALLBACK_IMAGE_UNLOADED.
3804 * This determines the kind of event that will trigger the callback.
3805 * What follows is a list explaining better the nature of each type of
3806 * event, along with their associated @p event_info pointers:
3808 * - #EVAS_CALLBACK_MOUSE_IN: @p event_info is a pointer to an
3809 * #Evas_Event_Mouse_In struct\n\n
3810 * This event is triggered when the mouse pointer enters the area
3811 * (not shaded by other objects) of the object @p obj. This may
3812 * occur by the mouse pointer being moved by
3813 * evas_event_feed_mouse_move() calls, or by the object being shown,
3814 * raised, moved, resized, or other objects being moved out of the
3815 * way, hidden or lowered, whatever may cause the mouse pointer to
3816 * get on top of @p obj, having been on top of another object
3819 * - #EVAS_CALLBACK_MOUSE_OUT: @p event_info is a pointer to an
3820 * #Evas_Event_Mouse_Out struct\n\n
3821 * This event is triggered exactly like #EVAS_CALLBACK_MOUSE_IN is,
3822 * but it occurs when the mouse pointer exits an object's area. Note
3823 * that no mouse out events will be reported if the mouse pointer is
3824 * implicitly grabbed to an object (mouse buttons are down, having
3825 * been pressed while the pointer was over that object). In these
3826 * cases, mouse out events will be reported once all buttons are
3827 * released, if the mouse pointer has left the object's area. The
3828 * indirect ways of taking off the mouse pointer from an object,
3829 * like cited above, for #EVAS_CALLBACK_MOUSE_IN, also apply here,
3832 * - #EVAS_CALLBACK_MOUSE_DOWN: @p event_info is a pointer to an
3833 * #Evas_Event_Mouse_Down struct\n\n
3834 * This event is triggered by a mouse button being pressed while the
3835 * mouse pointer is over an object. If the pointer mode for Evas is
3836 * #EVAS_OBJECT_POINTER_MODE_AUTOGRAB (default), this causes this
3837 * object to <b>passively grab the mouse</b> until all mouse buttons
3838 * have been released: all future mouse events will be reported to
3839 * only this object until no buttons are down. That includes mouse
3840 * move events, mouse in and mouse out events, and further button
3841 * presses. When all buttons are released, event propagation will
3842 * occur as normal (see #Evas_Object_Pointer_Mode).
3844 * - #EVAS_CALLBACK_MOUSE_UP: @p event_info is a pointer to an
3845 * #Evas_Event_Mouse_Up struct\n\n
3846 * This event is triggered by a mouse button being released while
3847 * the mouse pointer is over an object's area (or when passively
3848 * grabbed to an object).
3850 * - #EVAS_CALLBACK_MOUSE_MOVE: @p event_info is a pointer to an
3851 * #Evas_Event_Mouse_Move struct\n\n
3852 * This event is triggered by the mouse pointer being moved while
3853 * over an object's area (or while passively grabbed to an object).
3855 * - #EVAS_CALLBACK_MOUSE_WHEEL: @p event_info is a pointer to an
3856 * #Evas_Event_Mouse_Wheel struct\n\n
3857 * This event is triggered by the mouse wheel being rolled while the
3858 * mouse pointer is over an object (or passively grabbed to an
3861 * - #EVAS_CALLBACK_MULTI_DOWN: @p event_info is a pointer to an
3862 * #Evas_Event_Multi_Down struct
3864 * - #EVAS_CALLBACK_MULTI_UP: @p event_info is a pointer to an
3865 * #Evas_Event_Multi_Up struct
3867 * - #EVAS_CALLBACK_MULTI_MOVE: @p event_info is a pointer to an
3868 * #Evas_Event_Multi_Move struct
3870 * - #EVAS_CALLBACK_FREE: @p event_info is @c NULL \n\n
3871 * This event is triggered just before Evas is about to free all
3872 * memory used by an object and remove all references to it. This is
3873 * useful for programs to use if they attached data to an object and
3874 * want to free it when the object is deleted. The object is still
3875 * valid when this callback is called, but after it returns, there
3876 * is no guarantee on the object's validity.
3878 * - #EVAS_CALLBACK_KEY_DOWN: @p event_info is a pointer to an
3879 * #Evas_Event_Key_Down struct\n\n
3880 * This callback is called when a key is pressed and the focus is on
3881 * the object, or a key has been grabbed to a particular object
3882 * which wants to intercept the key press regardless of what object
3885 * - #EVAS_CALLBACK_KEY_UP: @p event_info is a pointer to an
3886 * #Evas_Event_Key_Up struct \n\n
3887 * This callback is called when a key is released and the focus is
3888 * on the object, or a key has been grabbed to a particular object
3889 * which wants to intercept the key release regardless of what
3890 * object has the focus.
3892 * - #EVAS_CALLBACK_FOCUS_IN: @p event_info is @c NULL \n\n
3893 * This event is called when an object gains the focus. When it is
3894 * called the object has already gained the focus.
3896 * - #EVAS_CALLBACK_FOCUS_OUT: @p event_info is @c NULL \n\n
3897 * This event is triggered when an object loses the focus. When it
3898 * is called the object has already lost the focus.
3900 * - #EVAS_CALLBACK_SHOW: @p event_info is @c NULL \n\n
3901 * This event is triggered by the object being shown by
3902 * evas_object_show().
3904 * - #EVAS_CALLBACK_HIDE: @p event_info is @c NULL \n\n
3905 * This event is triggered by an object being hidden by
3906 * evas_object_hide().
3908 * - #EVAS_CALLBACK_MOVE: @p event_info is @c NULL \n\n
3909 * This event is triggered by an object being
3910 * moved. evas_object_move() can trigger this, as can any
3911 * object-specific manipulations that would mean the object's origin
3914 * - #EVAS_CALLBACK_RESIZE: @p event_info is @c NULL \n\n
3915 * This event is triggered by an object being resized. Resizes can
3916 * be triggered by evas_object_resize() or by any object-specific
3917 * calls that may cause the object to resize.
3919 * - #EVAS_CALLBACK_RESTACK: @p event_info is @c NULL \n\n
3920 * This event is triggered by an object being re-stacked. Stacking
3921 * changes can be triggered by
3922 * evas_object_stack_below()/evas_object_stack_above() and others.
3924 * - #EVAS_CALLBACK_DEL: @p event_info is @c NULL.
3926 * - #EVAS_CALLBACK_HOLD: @p event_info is a pointer to an
3927 * #Evas_Event_Hold struct
3929 * - #EVAS_CALLBACK_CHANGED_SIZE_HINTS: @p event_info is @c NULL.
3931 * - #EVAS_CALLBACK_IMAGE_PRELOADED: @p event_info is @c NULL.
3933 * - #EVAS_CALLBACK_IMAGE_UNLOADED: @p event_info is @c NULL.
3935 * @note Be careful not to add the same callback multiple times, if
3936 * that's not what you want, because Evas won't check if a callback
3937 * existed before exactly as the one being registered (and thus, call
3938 * it more than once on the event, in this case). This would make
3939 * sense if you passed different functions and/or callback data, only.
3942 * @dontinclude evas-events.c
3943 * @skip evas_object_event_callback_add(
3946 * See the full example @ref Example_Evas_Events "here".
3949 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);
3952 * Add (register) a callback function to a given Evas object event with a
3953 * non-default priority set. Except for the priority field, it's exactly the
3954 * same as @ref evas_object_event_callback_add
3956 * @param obj Object to attach a callback to
3957 * @param type The type of event that will trigger the callback
3958 * @param priority The priority of the callback, lower values called first.
3959 * @param func The function to be called when the event is triggered
3960 * @param data The data pointer to be passed to @p func
3962 * @see evas_object_event_callback_add
3965 EAPI void evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 4);
3968 * Delete a callback function from an object
3970 * @param obj Object to remove a callback from
3971 * @param type The type of event that was triggering the callback
3972 * @param func The function that was to be called when the event was triggered
3973 * @return The data pointer that was to be passed to the callback
3975 * This function removes the most recently added callback from the
3976 * object @p obj which was triggered by the event type @p type and was
3977 * calling the function @p func when triggered. If the removal is
3978 * successful it will also return the data pointer that was passed to
3979 * evas_object_event_callback_add() when the callback was added to the
3980 * object. If not successful @c NULL will be returned.
3984 * extern Evas_Object *object;
3986 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
3988 * my_data = evas_object_event_callback_del(object, EVAS_CALLBACK_MOUSE_UP, up_callback);
3991 EAPI void *evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
3994 * Delete (unregister) a callback function registered to a given
3995 * Evas object event.
3997 * @param obj Object to remove a callback from
3998 * @param type The type of event that was triggering the callback
3999 * @param func The function that was to be called when the event was
4001 * @param data The data pointer that was to be passed to the callback
4002 * @return The data pointer that was to be passed to the callback
4004 * This function removes the most recently added callback from the
4005 * object @p obj, which was triggered by the event type @p type and was
4006 * calling the function @p func with data @p data, when triggered. If
4007 * the removal is successful it will also return the data pointer that
4008 * was passed to evas_object_event_callback_add() (that will be the
4009 * same as the parameter) when the callback was added to the
4010 * object. In errors, @c NULL will be returned.
4012 * @note For deletion of Evas object events callbacks filtering by
4013 * just type and function pointer, user
4014 * evas_object_event_callback_del().
4018 * extern Evas_Object *object;
4020 * void up_callback(void *data, Evas *e, Evas_Object *obj, void *event_info);
4022 * my_data = evas_object_event_callback_del_full(object, EVAS_CALLBACK_MOUSE_UP, up_callback, data);
4025 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);
4028 * Set whether an Evas object is to pass (ignore) events.
4030 * @param obj the Evas object to operate on
4031 * @param pass whether @p obj is to pass events (@c EINA_TRUE) or not
4034 * If @p pass is @c EINA_TRUE, it will make events on @p obj to be @b
4035 * ignored. They will be triggered on the @b next lower object (that
4036 * is not set to pass events), instead (see evas_object_below_get()).
4038 * If @p pass is @c EINA_FALSE, events will be processed on that
4041 * @see evas_object_pass_events_get() for an example
4042 * @see evas_object_repeat_events_set()
4043 * @see evas_object_propagate_events_set()
4044 * @see evas_object_freeze_events_set()
4046 EAPI void evas_object_pass_events_set(Evas_Object *obj, Eina_Bool pass) EINA_ARG_NONNULL(1);
4049 * Determine whether an object is set to pass (ignore) events.
4051 * @param obj the Evas object to get information from.
4052 * @return pass whether @p obj is set to pass events (@c EINA_TRUE) or not
4056 * @dontinclude evas-stacking.c
4057 * @skip if (strcmp(ev->keyname, "p") == 0)
4060 * See the full @ref Example_Evas_Stacking "example".
4062 * @see evas_object_pass_events_set()
4063 * @see evas_object_repeat_events_get()
4064 * @see evas_object_propagate_events_get()
4065 * @see evas_object_freeze_events_get()
4067 EAPI Eina_Bool evas_object_pass_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4070 * Set whether an Evas object is to repeat events.
4072 * @param obj the Evas object to operate on
4073 * @param repeat whether @p obj is to repeat events (@c EINA_TRUE) or not
4076 * If @p repeat is @c EINA_TRUE, it will make events on @p obj to also
4077 * be repeated for the @b next lower object in the objects' stack (see
4078 * see evas_object_below_get()).
4080 * If @p repeat is @c EINA_FALSE, events occurring on @p obj will be
4081 * processed only on it.
4084 * @dontinclude evas-stacking.c
4085 * @skip if (strcmp(ev->keyname, "r") == 0)
4088 * See the full @ref Example_Evas_Stacking "example".
4090 * @see evas_object_repeat_events_get()
4091 * @see evas_object_pass_events_set()
4092 * @see evas_object_propagate_events_set()
4093 * @see evas_object_freeze_events_set()
4095 EAPI void evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1);
4098 * Determine whether an object is set to repeat events.
4100 * @param obj the given Evas object pointer
4101 * @return whether @p obj is set to repeat events (@c EINA_TRUE)
4102 * or not (@c EINA_FALSE)
4104 * @see evas_object_repeat_events_set() for an example
4105 * @see evas_object_pass_events_get()
4106 * @see evas_object_propagate_events_get()
4107 * @see evas_object_freeze_events_get()
4109 EAPI Eina_Bool evas_object_repeat_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4112 * Set whether events on a smart object's member should get propagated
4115 * @param obj the smart object's child to operate on
4116 * @param prop whether to propagate events (@c EINA_TRUE) or not
4119 * This function has @b no effect if @p obj is not a member of a smart
4122 * If @p prop is @c EINA_TRUE, events occurring on this object will be
4123 * propagated on to the smart object of which @p obj is a member. If
4124 * @p prop is @c EINA_FALSE, events occurring on this object will @b
4125 * not be propagated on to the smart object of which @p obj is a
4126 * member. The default value is @c EINA_TRUE.
4128 * @see evas_object_propagate_events_get()
4129 * @see evas_object_repeat_events_set()
4130 * @see evas_object_pass_events_set()
4131 * @see evas_object_freeze_events_set()
4133 EAPI void evas_object_propagate_events_set(Evas_Object *obj, Eina_Bool prop) EINA_ARG_NONNULL(1);
4136 * Retrieve whether an Evas object is set to propagate events.
4138 * @param obj the given Evas object pointer
4139 * @return whether @p obj is set to propagate events (@c EINA_TRUE)
4140 * or not (@c EINA_FALSE)
4142 * @see evas_object_propagate_events_set()
4143 * @see evas_object_repeat_events_get()
4144 * @see evas_object_pass_events_get()
4145 * @see evas_object_freeze_events_get()
4147 EAPI Eina_Bool evas_object_propagate_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4150 * Set whether an Evas object is to freeze (discard) events.
4152 * @param obj the Evas object to operate on
4153 * @param freeze pass whether @p obj is to freeze events (@c EINA_TRUE) or not
4156 * If @p freeze is @c EINA_TRUE, it will make events on @p obj to be @b
4157 * discarded. Unlike evas_object_pass_events_set(), events will not be
4158 * passed to @b next lower object. This API can be used for blocking
4159 * events while @p obj is on transiting.
4161 * If @p freeze is @c EINA_FALSE, events will be processed on that
4164 * @see evas_object_freeze_events_get()
4165 * @see evas_object_pass_events_set()
4166 * @see evas_object_repeat_events_set()
4167 * @see evas_object_propagate_events_set()
4170 EAPI void evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) EINA_ARG_NONNULL(1);
4173 * Determine whether an object is set to freeze (discard) events.
4175 * @param obj the Evas object to get information from.
4176 * @return freeze whether @p obj is set to freeze events (@c EINA_TRUE) or
4177 * not (@c EINA_FALSE)
4179 * @see evas_object_freeze_events_set()
4180 * @see evas_object_pass_events_get()
4181 * @see evas_object_repeat_events_get()
4182 * @see evas_object_propagate_events_get()
4185 EAPI Eina_Bool evas_object_freeze_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
4192 * @defgroup Evas_Object_Group_Map UV Mapping (Rotation, Perspective, 3D...)
4194 * Evas allows different transformations to be applied to all kinds of
4195 * objects. These are applied by means of UV mapping.
4197 * With UV mapping, one maps points in the source object to a 3D space
4198 * positioning at target. This allows rotation, perspective, scale and
4199 * lots of other effects, depending on the map that is used.
4201 * Each map point may carry a multiplier color. If properly
4202 * calculated, these can do shading effects on the object, producing
4205 * As usual, Evas provides both the raw and easy to use methods. The
4206 * raw methods allow developers to create their maps somewhere else,
4207 * possibly loading them from some file format. The easy to use methods
4208 * calculate the points given some high-level parameters such as
4209 * rotation angle, ambient light, and so on.
4211 * @note applying mapping will reduce performance, so use with
4212 * care. The impact on performance depends on engine in
4213 * use. Software is quite optimized, but not as fast as OpenGL.
4215 * @section sec-map-points Map points
4216 * @subsection subsec-rotation Rotation
4218 * A map consists of a set of points, currently only four are supported. Each
4219 * of these points contains a set of canvas coordinates @c x and @c y that
4220 * can be used to alter the geometry of the mapped object, and a @c z
4221 * coordinate that indicates the depth of that point. This last coordinate
4222 * does not normally affect the map, but it's used by several of the utility
4223 * functions to calculate the right position of the point given other
4226 * The coordinates for each point are set with evas_map_point_coord_set().
4227 * The following image shows a map set to match the geometry of an existing
4230 * @image html map-set-map-points-1.png
4231 * @image rtf map-set-map-points-1.png
4232 * @image latex map-set-map-points-1.eps
4234 * This is a common practice, so there are a few functions that help make it
4237 * evas_map_util_points_populate_from_geometry() sets the coordinates of each
4238 * point in the given map to match the rectangle defined by the function
4241 * evas_map_util_points_populate_from_object() and
4242 * evas_map_util_points_populate_from_object_full() both take an object and
4243 * set the map points to match its geometry. The difference between the two
4244 * is that the first function sets the @c z value of all points to 0, while
4245 * the latter receives the value to set in said coordinate as a parameter.
4247 * The following lines of code all produce the same result as in the image
4250 * evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
4251 * // Assuming o is our original object
4252 * evas_object_move(o, 100, 100);
4253 * evas_object_resize(o, 200, 200);
4254 * evas_map_util_points_populate_from_object(m, o);
4255 * evas_map_util_points_populate_from_object_full(m, o, 0);
4258 * Several effects can be applied to an object by simply setting each point
4259 * of the map to the right coordinates. For example, a simulated perspective
4260 * could be achieve as follows.
4262 * @image html map-set-map-points-2.png
4263 * @image rtf map-set-map-points-2.png
4264 * @image latex map-set-map-points-2.eps
4266 * As said before, the @c z coordinate is unused here so when setting points
4267 * by hand, its value is of no importance.
4269 * @image html map-set-map-points-3.png
4270 * @image rtf map-set-map-points-3.png
4271 * @image latex map-set-map-points-3.eps
4273 * In all three cases above, setting the map to be used by the object is the
4276 * evas_object_map_set(o, m);
4277 * evas_object_map_enable_set(o, EINA_TRUE);
4280 * Doing things this way, however, is a lot of work that can be avoided by
4281 * using the provided utility functions, as described in the next section.
4283 * @section map-utils Utility functions
4285 * Utility functions take an already set up map and alter it to produce a
4286 * specific effect. For example, to rotate an object around its own center
4287 * you would need to take the rotation angle, the coordinates of each corner
4288 * of the object and do all the math to get the new set of coordinates that
4289 * need to tbe set in the map.
4291 * Or you can use this code:
4293 * evas_object_geometry_get(o, &x, &y, &w, &h);
4294 * m = evas_map_new(4);
4295 * evas_map_util_points_populate_from_object(m, o);
4296 * evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
4297 * evas_object_map_set(o, m);
4298 * evas_object_map_enable_set(o, EINA_TRUE);
4302 * Which will rotate the object around its center point in a 45 degree angle
4303 * in the clockwise direction, taking it from this
4305 * @image html map-rotation-2d-1.png
4306 * @image rtf map-rotation-2d-1.png
4307 * @image latex map-rotation-2d-1.eps
4311 * @image html map-rotation-2d-2.png
4312 * @image rtf map-rotation-2d-2.png
4313 * @image latex map-rotation-2d-2.eps
4315 * Objects may be rotated around any other point just by setting the last two
4316 * paramaters of the evas_map_util_rotate() function to the right values. A
4317 * circle of roughly the diameter of the object overlaid on each image shows
4318 * where the center of rotation is set for each example.
4320 * For example, this code
4322 * evas_object_geometry_get(o, &x, &y, &w, &h);
4323 * m = evas_map_new(4);
4324 * evas_map_util_points_populate_from_object(m, o);
4325 * evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
4326 * evas_object_map_set(o, m);
4327 * evas_object_map_enable_set(o, EINA_TRUE);
4331 * produces something like
4333 * @image html map-rotation-2d-3.png
4334 * @image rtf map-rotation-2d-3.png
4335 * @image latex map-rotation-2d-3.eps
4339 * evas_output_size_get(evas, &w, &h);
4340 * m = evas_map_new(4);
4341 * evas_map_util_points_populate_from_object(m, o);
4342 * evas_map_util_rotate(m, 45, w, h);
4343 * evas_object_map_set(o, m);
4344 * evas_object_map_enable_set(o, EINA_TRUE);
4348 * rotates the object around the center of the window
4350 * @image html map-rotation-2d-4.png
4351 * @image rtf map-rotation-2d-4.png
4352 * @image latex map-rotation-2d-4.eps
4354 * @subsection subsec-3d 3D Maps
4356 * Maps can also be used to achieve the effect of 3-dimensionality. When doing
4357 * this, the @c z coordinate of each point counts, with higher values meaning
4358 * the point is further into the screen, and smaller values (negative, usually)
4359 * meaning the point is closwer towards the user.
4361 * Thinking in 3D also introduces the concept of back-face of an object. An
4362 * object is said to be facing the user when all its points are placed in a
4363 * clockwise fashion. The next image shows this, with each point showing the
4364 * with which is identified within the map.
4366 * @image html map-point-order-face.png
4367 * @image rtf map-point-order-face.png
4368 * @image latex map-point-order-face.eps
4370 * Rotating this map around the @c Y axis would leave the order of the points
4371 * in a counter-clockwise fashion, as seen in the following image.
4373 * @image html map-point-order-back.png
4374 * @image rtf map-point-order-back.png
4375 * @image latex map-point-order-back.eps
4377 * This way we can say that we are looking at the back face of the object.
4378 * This will have stronger implications later when we talk about lighting.
4380 * To know if a map is facing towards the user or not it's enough to use
4381 * the evas_map_util_clockwise_get() function, but this is normally done
4382 * after all the other operations are applied on the map.
4384 * @subsection subsec-3d-rot 3D rotation and perspective
4386 * Much like evas_map_util_rotate(), there's the function
4387 * evas_map_util_3d_rotate() that transforms the map to apply a 3D rotation
4388 * to an object. As in its 2D counterpart, the rotation can be applied around
4389 * any point in the canvas, this time with a @c z coordinate too. The rotation
4390 * can also be around any of the 3 axis.
4392 * Starting from this simple setup
4394 * @image html map-3d-basic-1.png
4395 * @image rtf map-3d-basic-1.png
4396 * @image latex map-3d-basic-1.eps
4398 * and setting maps so that the blue square to rotate on all axis around a
4399 * sphere that uses the object as its center, and the red square to rotate
4400 * around the @c Y axis, we get the following. A simple overlay over the image
4401 * shows the original geometry of each object and the axis around which they
4402 * are being rotated, with the @c Z one not appearing due to being orthogonal
4405 * @image html map-3d-basic-2.png
4406 * @image rtf map-3d-basic-2.png
4407 * @image latex map-3d-basic-2.eps
4409 * which doesn't look very real. This can be helped by adding perspective
4410 * to the transformation, which can be simply done by calling
4411 * evas_map_util_3d_perspective() on the map after its position has been set.
4412 * The result in this case, making the vanishing point the center of each
4415 * @image html map-3d-basic-3.png
4416 * @image rtf map-3d-basic-3.png
4417 * @image latex map-3d-basic-3.eps
4419 * @section sec-color Color and lighting
4421 * Each point in a map can be set to a color, which will be multiplied with
4422 * the objects own color and linearly interpolated in between adjacent points.
4423 * This is done with evas_map_point_color_set() for each point of the map,
4424 * or evas_map_util_points_color_set() to set every point to the same color.
4426 * When using 3D effects, colors can be used to improve the looks of them by
4427 * simulating a light source. The evas_map_util_3d_lighting() function makes
4428 * this task easier by taking the coordinates of the light source and its
4429 * color, along with the color of the ambient light. Evas then sets the color
4430 * of each point based on the distance to the light source, the angle with
4431 * which the object is facing the light and the ambient light. Here, the
4432 * orientation of each point as explained before, becomes more important.
4433 * If the map is defined counter-clockwise, the object will be facing away
4434 * from the user and thus become obscured, since no light would be reflecting
4437 * @image html map-light.png
4438 * @image rtf map-light.png
4439 * @image latex map-light.eps
4440 * @note Object facing the light source
4442 * @image html map-light2.png
4443 * @image rtf map-light2.png
4444 * @image latex map-light2.eps
4445 * @note Same object facing away from the user
4447 * @section Image mapping
4449 * @image html map-uv-mapping-1.png
4450 * @image rtf map-uv-mapping-1.png
4451 * @image latex map-uv-mapping-1.eps
4453 * Images need some special handling when mapped. Evas can easily take care
4454 * of objects and do almost anything with them, but it's completely oblivious
4455 * to the content of images, so each point in the map needs to be told to what
4456 * pixel in the source image it belongs. Failing to do may sometimes result
4457 * in the expected behavior, or it may look like a partial work.
4459 * The next image illustrates one possibility of a map being set to an image
4460 * object, without setting the right UV mapping for each point. The objects
4461 * themselves are mapped properly to their new geometry, but the image content
4462 * may not be displayed correctly within the mapped object.
4464 * @image html map-uv-mapping-2.png
4465 * @image rtf map-uv-mapping-2.png
4466 * @image latex map-uv-mapping-2.eps
4468 * Once Evas knows how to handle the source image within the map, it will
4469 * transform it as needed. This is done with evas_map_point_image_uv_set(),
4470 * which tells the map to which pixel in image it maps.
4472 * To match our example images to the maps above all we need is the size of
4473 * each image, which can always be found with evas_object_image_size_get().
4476 * evas_map_point_image_uv_set(m, 0, 0, 0);
4477 * evas_map_point_image_uv_set(m, 1, 150, 0);
4478 * evas_map_point_image_uv_set(m, 2, 150, 200);
4479 * evas_map_point_image_uv_set(m, 3, 0, 200);
4480 * evas_object_map_set(o, m);
4481 * evas_object_map_enable_set(o, EINA_TRUE);
4483 * evas_map_point_image_uv_set(m, 0, 0, 0);
4484 * evas_map_point_image_uv_set(m, 1, 120, 0);
4485 * evas_map_point_image_uv_set(m, 2, 120, 160);
4486 * evas_map_point_image_uv_set(m, 3, 0, 160);
4487 * evas_object_map_set(o2, m);
4488 * evas_object_map_enable_set(o2, EINA_TRUE);
4493 * @image html map-uv-mapping-3.png
4494 * @image rtf map-uv-mapping-3.png
4495 * @image latex map-uv-mapping-3.eps
4497 * Maps can also be set to use part of an image only, or even map them inverted,
4498 * and combined with evas_object_image_source_set() it can be used to achieve
4499 * more interesting results.
4502 * evas_object_image_size_get(evas_object_image_source_get(o), &w, &h);
4503 * evas_map_point_image_uv_set(m, 0, 0, h);
4504 * evas_map_point_image_uv_set(m, 1, w, h);
4505 * evas_map_point_image_uv_set(m, 2, w, h / 3);
4506 * evas_map_point_image_uv_set(m, 3, 0, h / 3);
4507 * evas_object_map_set(o, m);
4508 * evas_object_map_enable_set(o, EINA_TRUE);
4511 * @image html map-uv-mapping-4.png
4512 * @image rtf map-uv-mapping-4.png
4513 * @image latex map-uv-mapping-4.eps
4516 * @li @ref Example_Evas_Map_Overview
4518 * @ingroup Evas_Object_Group
4524 * Enable or disable the map that is set.
4526 * Enable or disable the use of map for the object @p obj.
4527 * On enable, the object geometry will be saved, and the new geometry will
4528 * change (position and size) to reflect the map geometry set.
4530 * If the object doesn't have a map set (with evas_object_map_set()), the
4531 * initial geometry will be undefined. It is advised to always set a map
4532 * to the object first, and then call this function to enable its use.
4534 * @param obj object to enable the map on
4535 * @param enabled enabled state
4537 EAPI void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled);
4540 * Get the map enabled state
4542 * This returns the currently enabled state of the map on the object indicated.
4543 * The default map enable state is off. You can enable and disable it with
4544 * evas_object_map_enable_set().
4546 * @param obj object to get the map enabled state from
4547 * @return the map enabled state
4549 EAPI Eina_Bool evas_object_map_enable_get(const Evas_Object *obj);
4552 * Set current object transformation map.
4554 * This sets the map on a given object. It is copied from the @p map pointer,
4555 * so there is no need to keep the @p map object if you don't need it anymore.
4557 * A map is a set of 4 points which have canvas x, y coordinates per point,
4558 * with an optional z point value as a hint for perspective correction, if it
4559 * is available. As well each point has u and v coordinates. These are like
4560 * "texture coordinates" in OpenGL in that they define a point in the source
4561 * image that is mapped to that map vertex/point. The u corresponds to the x
4562 * coordinate of this mapped point and v, the y coordinate. Note that these
4563 * coordinates describe a bounding region to sample. If you have a 200x100
4564 * source image and want to display it at 200x100 with proper pixel
4565 * precision, then do:
4568 * Evas_Map *m = evas_map_new(4);
4569 * evas_map_point_coord_set(m, 0, 0, 0, 0);
4570 * evas_map_point_coord_set(m, 1, 200, 0, 0);
4571 * evas_map_point_coord_set(m, 2, 200, 100, 0);
4572 * evas_map_point_coord_set(m, 3, 0, 100, 0);
4573 * evas_map_point_image_uv_set(m, 0, 0, 0);
4574 * evas_map_point_image_uv_set(m, 1, 200, 0);
4575 * evas_map_point_image_uv_set(m, 2, 200, 100);
4576 * evas_map_point_image_uv_set(m, 3, 0, 100);
4577 * evas_object_map_set(obj, m);
4581 * Note that the map points a uv coordinates match the image geometry. If
4582 * the @p map parameter is NULL, the stored map will be freed and geometry
4583 * prior to enabling/setting a map will be restored.
4585 * @param obj object to change transformation map
4586 * @param map new map to use
4588 * @see evas_map_new()
4590 EAPI void evas_object_map_set(Evas_Object *obj, const Evas_Map *map);
4593 * Get current object transformation map.
4595 * This returns the current internal map set on the indicated object. It is
4596 * intended for read-only access and is only valid as long as the object is
4597 * not deleted or the map on the object is not changed. If you wish to modify
4598 * the map and set it back do the following:
4601 * const Evas_Map *m = evas_object_map_get(obj);
4602 * Evas_Map *m2 = evas_map_dup(m);
4603 * evas_map_util_rotate(m2, 30.0, 0, 0);
4604 * evas_object_map_set(obj);
4605 * evas_map_free(m2);
4608 * @param obj object to query transformation map.
4609 * @return map reference to map in use. This is an internal data structure, so
4612 * @see evas_object_map_set()
4614 EAPI const Evas_Map *evas_object_map_get(const Evas_Object *obj);
4617 * Populate source and destination map points to match exactly object.
4619 * Usually one initialize map of an object to match it's original
4620 * position and size, then transform these with evas_map_util_*
4621 * functions, such as evas_map_util_rotate() or
4622 * evas_map_util_3d_rotate(). The original set is done by this
4623 * function, avoiding code duplication all around.
4625 * @param m map to change all 4 points (must be of size 4).
4626 * @param obj object to use unmapped geometry to populate map coordinates.
4627 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4628 * will be used for all four points.
4630 * @see evas_map_util_points_populate_from_object()
4631 * @see evas_map_point_coord_set()
4632 * @see evas_map_point_image_uv_set()
4634 EAPI void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z);
4637 * Populate source and destination map points to match exactly object.
4639 * Usually one initialize map of an object to match it's original
4640 * position and size, then transform these with evas_map_util_*
4641 * functions, such as evas_map_util_rotate() or
4642 * evas_map_util_3d_rotate(). The original set is done by this
4643 * function, avoiding code duplication all around.
4645 * Z Point coordinate is assumed as 0 (zero).
4647 * @param m map to change all 4 points (must be of size 4).
4648 * @param obj object to use unmapped geometry to populate map coordinates.
4650 * @see evas_map_util_points_populate_from_object_full()
4651 * @see evas_map_util_points_populate_from_geometry()
4652 * @see evas_map_point_coord_set()
4653 * @see evas_map_point_image_uv_set()
4655 EAPI void evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *obj);
4658 * Populate source and destination map points to match given geometry.
4660 * Similar to evas_map_util_points_populate_from_object_full(), this
4661 * call takes raw values instead of querying object's unmapped
4662 * geometry. The given width will be used to calculate destination
4663 * points (evas_map_point_coord_set()) and set the image uv
4664 * (evas_map_point_image_uv_set()).
4666 * @param m map to change all 4 points (must be of size 4).
4667 * @param x Point X Coordinate
4668 * @param y Point Y Coordinate
4669 * @param w width to use to calculate second and third points.
4670 * @param h height to use to calculate third and fourth points.
4671 * @param z Point Z Coordinate hint (pre-perspective transform). This value
4672 * will be used for all four points.
4674 * @see evas_map_util_points_populate_from_object()
4675 * @see evas_map_point_coord_set()
4676 * @see evas_map_point_image_uv_set()
4678 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);
4681 * Set color of all points to given color.
4683 * This call is useful to reuse maps after they had 3d lightning or
4684 * any other colorization applied before.
4686 * @param m map to change the color of.
4687 * @param r red (0 - 255)
4688 * @param g green (0 - 255)
4689 * @param b blue (0 - 255)
4690 * @param a alpha (0 - 255)
4692 * @see evas_map_point_color_set()
4694 EAPI void evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a);
4697 * Change the map to apply the given rotation.
4699 * This rotates the indicated map's coordinates around the center coordinate
4700 * given by @p cx and @p cy as the rotation center. The points will have their
4701 * X and Y coordinates rotated clockwise by @p degrees degrees (360.0 is a
4702 * full rotation). Negative values for degrees will rotate counter-clockwise
4703 * by that amount. All coordinates are canvas global coordinates.
4705 * @param m map to change.
4706 * @param degrees amount of degrees from 0.0 to 360.0 to rotate.
4707 * @param cx rotation's center horizontal position.
4708 * @param cy rotation's center vertical position.
4710 * @see evas_map_point_coord_set()
4711 * @see evas_map_util_zoom()
4713 EAPI void evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
4716 * Change the map to apply the given zooming.
4718 * Like evas_map_util_rotate(), this zooms the points of the map from a center
4719 * point. That center is defined by @p cx and @p cy. The @p zoomx and @p zoomy
4720 * parameters specify how much to zoom in the X and Y direction respectively.
4721 * A value of 1.0 means "don't zoom". 2.0 means "double the size". 0.5 is
4722 * "half the size" etc. All coordinates are canvas global coordinates.
4724 * @param m map to change.
4725 * @param zoomx horizontal zoom to use.
4726 * @param zoomy vertical zoom to use.
4727 * @param cx zooming center horizontal position.
4728 * @param cy zooming center vertical position.
4730 * @see evas_map_point_coord_set()
4731 * @see evas_map_util_rotate()
4733 EAPI void evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
4736 * Rotate the map around 3 axes in 3D
4738 * This will rotate not just around the "Z" axis as in evas_map_util_rotate()
4739 * (which is a convenience call for those only wanting 2D). This will rotate
4740 * around the X, Y and Z axes. The Z axis points "into" the screen with low
4741 * values at the screen and higher values further away. The X axis runs from
4742 * left to right on the screen and the Y axis from top to bottom. Like with
4743 * evas_map_util_rotate() you provide a center point to rotate around (in 3D).
4745 * @param m map to change.
4746 * @param dx amount of degrees from 0.0 to 360.0 to rotate around X axis.
4747 * @param dy amount of degrees from 0.0 to 360.0 to rotate around Y axis.
4748 * @param dz amount of degrees from 0.0 to 360.0 to rotate around Z axis.
4749 * @param cx rotation's center horizontal position.
4750 * @param cy rotation's center vertical position.
4751 * @param cz rotation's center vertical position.
4753 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);
4756 * Perform lighting calculations on the given Map
4758 * This is used to apply lighting calculations (from a single light source)
4759 * to a given map. The R, G and B values of each vertex will be modified to
4760 * reflect the lighting based on the lixth point coordinates, the light
4761 * color and the ambient color, and at what angle the map is facing the
4762 * light source. A surface should have its points be declared in a
4763 * clockwise fashion if the face is "facing" towards you (as opposed to
4764 * away from you) as faces have a "logical" side for lighting.
4766 * @image html map-light3.png
4767 * @image rtf map-light3.png
4768 * @image latex map-light3.eps
4769 * @note Grey object, no lighting used
4771 * @image html map-light4.png
4772 * @image rtf map-light4.png
4773 * @image latex map-light4.eps
4774 * @note Lights out! Every color set to 0
4776 * @image html map-light5.png
4777 * @image rtf map-light5.png
4778 * @image latex map-light5.eps
4779 * @note Ambient light to full black, red light coming from close at the
4780 * bottom-left vertex
4782 * @image html map-light6.png
4783 * @image rtf map-light6.png
4784 * @image latex map-light6.eps
4785 * @note Same light as before, but not the light is set to 0 and ambient light
4788 * @image html map-light7.png
4789 * @image rtf map-light7.png
4790 * @image latex map-light7.eps
4791 * @note Both lights are on
4793 * @image html map-light8.png
4794 * @image rtf map-light8.png
4795 * @image latex map-light8.eps
4796 * @note Both lights again, but this time both are the same color.
4798 * @param m map to change.
4799 * @param lx X coordinate in space of light point
4800 * @param ly Y coordinate in space of light point
4801 * @param lz Z coordinate in space of light point
4802 * @param lr light red value (0 - 255)
4803 * @param lg light green value (0 - 255)
4804 * @param lb light blue value (0 - 255)
4805 * @param ar ambient color red value (0 - 255)
4806 * @param ag ambient color green value (0 - 255)
4807 * @param ab ambient color blue value (0 - 255)
4809 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);
4812 * Apply a perspective transform to the map
4814 * This applies a given perspective (3D) to the map coordinates. X, Y and Z
4815 * values are used. The px and py points specify the "infinite distance" point
4816 * in the 3D conversion (where all lines converge to like when artists draw
4817 * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
4818 * mapping between spatial coordinates and screen coordinates. Any points
4819 * on this z value will not have their X and Y values modified in the transform.
4820 * Those further away (Z value higher) will shrink into the distance, and
4821 * those less than this value will expand and become bigger. The @p foc value
4822 * determines the "focal length" of the camera. This is in reality the distance
4823 * between the camera lens plane itself (at or closer than this rendering
4824 * results are undefined) and the "z0" z value. This allows for some "depth"
4825 * control and @p foc must be greater than 0.
4827 * @param m map to change.
4828 * @param px The perspective distance X coordinate
4829 * @param py The perspective distance Y coordinate
4830 * @param z0 The "0" z plane value
4831 * @param foc The focal distance
4833 EAPI void evas_map_util_3d_perspective(Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
4836 * Get the clockwise state of a map
4838 * This determines if the output points (X and Y. Z is not used) are
4839 * clockwise or anti-clockwise. This can be used for "back-face culling". This
4840 * is where you hide objects that "face away" from you. In this case objects
4841 * that are not clockwise.
4843 * @param m map to query.
4844 * @return 1 if clockwise, 0 otherwise
4846 EAPI Eina_Bool evas_map_util_clockwise_get(Evas_Map *m);
4849 * Create map of transformation points to be later used with an Evas object.
4851 * This creates a set of points (currently only 4 is supported. no other
4852 * number for @p count will work). That is empty and ready to be modified
4853 * with evas_map calls.
4855 * @param count number of points in the map.
4856 * @return a newly allocated map or @c NULL on errors.
4858 * @see evas_map_free()
4859 * @see evas_map_dup()
4860 * @see evas_map_point_coord_set()
4861 * @see evas_map_point_image_uv_set()
4862 * @see evas_map_util_points_populate_from_object_full()
4863 * @see evas_map_util_points_populate_from_object()
4865 * @see evas_object_map_set()
4867 EAPI Evas_Map *evas_map_new(int count);
4870 * Set the smoothing for map rendering
4872 * This sets smoothing for map rendering. If the object is a type that has
4873 * its own smoothing settings, then both the smooth settings for this object
4874 * and the map must be turned off. By default smooth maps are enabled.
4876 * @param m map to modify. Must not be NULL.
4877 * @param enabled enable or disable smooth map rendering
4879 EAPI void evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled);
4882 * get the smoothing for map rendering
4884 * This gets smoothing for map rendering.
4886 * @param m map to get the smooth from. Must not be NULL.
4888 EAPI Eina_Bool evas_map_smooth_get(const Evas_Map *m);
4891 * Set the alpha flag for map rendering
4893 * This sets alpha flag for map rendering. If the object is a type that has
4894 * its own alpha settings, then this will take precedence. Only image objects
4895 * have this currently.
4896 * Setting this off stops alpha blending of the map area, and is
4897 * useful if you know the object and/or all sub-objects is 100% solid.
4899 * @param m map to modify. Must not be NULL.
4900 * @param enabled enable or disable alpha map rendering
4902 EAPI void evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled);
4905 * get the alpha flag for map rendering
4907 * This gets the alpha flag for map rendering.
4909 * @param m map to get the alpha from. Must not be NULL.
4911 EAPI Eina_Bool evas_map_alpha_get(const Evas_Map *m);
4914 * Copy a previously allocated map.
4916 * This makes a duplicate of the @p m object and returns it.
4918 * @param m map to copy. Must not be NULL.
4919 * @return newly allocated map with the same count and contents as @p m.
4921 EAPI Evas_Map *evas_map_dup(const Evas_Map *m);
4924 * Free a previously allocated map.
4926 * This frees a givem map @p m and all memory associated with it. You must NOT
4927 * free a map returned by evas_object_map_get() as this is internal.
4929 * @param m map to free.
4931 EAPI void evas_map_free(Evas_Map *m);
4936 * Returns the number of points in a map. Should be at least 4.
4938 * @param m map to get size.
4939 * @return -1 on error, points otherwise.
4941 EAPI int evas_map_count_get(const Evas_Map *m) EINA_CONST;
4944 * Change the map point's coordinate.
4946 * This sets the fixed point's coordinate in the map. Note that points
4947 * describe the outline of a quadrangle and are ordered either clockwise
4948 * or anti-clock-wise. It is suggested to keep your quadrangles concave and
4949 * non-complex, though these polygon modes may work, they may not render
4950 * a desired set of output. The quadrangle will use points 0 and 1 , 1 and 2,
4951 * 2 and 3, and 3 and 0 to describe the edges of the quadrangle.
4953 * The X and Y and Z coordinates are in canvas units. Z is optional and may
4954 * or may not be honored in drawing. Z is a hint and does not affect the
4955 * X and Y rendered coordinates. It may be used for calculating fills with
4956 * perspective correct rendering.
4958 * Remember all coordinates are canvas global ones like with move and resize
4961 * @param m map to change point. Must not be @c NULL.
4962 * @param idx index of point to change. Must be smaller than map size.
4963 * @param x Point X Coordinate
4964 * @param y Point Y Coordinate
4965 * @param z Point Z Coordinate hint (pre-perspective transform)
4967 * @see evas_map_util_rotate()
4968 * @see evas_map_util_zoom()
4969 * @see evas_map_util_points_populate_from_object_full()
4970 * @see evas_map_util_points_populate_from_object()
4972 EAPI void evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
4975 * Get the map point's coordinate.
4977 * This returns the coordinates of the given point in the map.
4979 * @param m map to query point.
4980 * @param idx index of point to query. Must be smaller than map size.
4981 * @param x where to return the X coordinate.
4982 * @param y where to return the Y coordinate.
4983 * @param z where to return the Z coordinate.
4985 EAPI void evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
4988 * Change the map point's U and V texture source point
4990 * This sets the U and V coordinates for the point. This determines which
4991 * coordinate in the source image is mapped to the given point, much like
4992 * OpenGL and textures. Notes that these points do select the pixel, but
4993 * are double floating point values to allow for accuracy and sub-pixel
4996 * @param m map to change the point of.
4997 * @param idx index of point to change. Must be smaller than map size.
4998 * @param u the X coordinate within the image/texture source
4999 * @param v the Y coordinate within the image/texture source
5001 * @see evas_map_point_coord_set()
5002 * @see evas_object_map_set()
5003 * @see evas_map_util_points_populate_from_object_full()
5004 * @see evas_map_util_points_populate_from_object()
5006 EAPI void evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v);
5009 * Get the map point's U and V texture source points
5011 * This returns the texture points set by evas_map_point_image_uv_set().
5013 * @param m map to query point.
5014 * @param idx index of point to query. Must be smaller than map size.
5015 * @param u where to write the X coordinate within the image/texture source
5016 * @param v where to write the Y coordinate within the image/texture source
5018 EAPI void evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v);
5021 * Set the color of a vertex in the map
5023 * This sets the color of the vertex in the map. Colors will be linearly
5024 * interpolated between vertex points through the map. Color will multiply
5025 * the "texture" pixels (like GL_MODULATE in OpenGL). The default color of
5026 * a vertex in a map is white solid (255, 255, 255, 255) which means it will
5027 * have no affect on modifying the texture pixels.
5029 * @param m map to change the color of.
5030 * @param idx index of point to change. Must be smaller than map size.
5031 * @param r red (0 - 255)
5032 * @param g green (0 - 255)
5033 * @param b blue (0 - 255)
5034 * @param a alpha (0 - 255)
5036 * @see evas_map_util_points_color_set()
5037 * @see evas_map_point_coord_set()
5038 * @see evas_object_map_set()
5040 EAPI void evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a);
5043 * Get the color set on a vertex in the map
5045 * This gets the color set by evas_map_point_color_set() on the given vertex
5048 * @param m map to get the color of the vertex from.
5049 * @param idx index of point get. Must be smaller than map size.
5050 * @param r pointer to red return
5051 * @param g pointer to green return
5052 * @param b pointer to blue return
5053 * @param a pointer to alpha return (0 - 255)
5055 * @see evas_map_point_coord_set()
5056 * @see evas_object_map_set()
5058 EAPI void evas_map_point_color_get(const Evas_Map *m, int idx, int *r, int *g, int *b, int *a);
5064 * @defgroup Evas_Object_Group_Size_Hints Size Hints
5066 * Objects may carry hints, so that another object that acts as a
5067 * manager (see @ref Evas_Smart_Object_Group) may know how to properly
5068 * position and resize its subordinate objects. The Size Hints provide
5069 * a common interface that is recommended as the protocol for such
5072 * For example, box objects use alignment hints to align its
5073 * lines/columns inside its container, padding hints to set the
5074 * padding between each individual child, etc.
5076 * Examples on their usage:
5077 * - @ref Example_Evas_Size_Hints "evas-hints.c"
5078 * - @ref Example_Evas_Aspect_Hints "evas-aspect-hints.c"
5080 * @ingroup Evas_Object_Group
5084 * @addtogroup Evas_Object_Group_Size_Hints
5089 * Retrieves the hints for an object's minimum size.
5091 * @param obj The given Evas object to query hints from.
5092 * @param w Pointer to an integer in which to store the minimum width.
5093 * @param h Pointer to an integer in which to store the minimum height.
5095 * These are hints on the minimim sizes @p obj should have. This is
5096 * not a size enforcement in any way, it's just a hint that should be
5097 * used whenever appropriate.
5099 * @note Use @c NULL pointers on the hint components you're not
5100 * interested in: they'll be ignored by the function.
5102 * @see evas_object_size_hint_min_set() for an example
5104 EAPI void evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5107 * Sets the hints for an object's minimum size.
5109 * @param obj The given Evas object to query hints from.
5110 * @param w Integer to use as the minimum width hint.
5111 * @param h Integer to use as the minimum height hint.
5113 * This is not a size enforcement in any way, it's just a hint that
5114 * should be used whenever appropriate.
5116 * Values @c 0 will be treated as unset hint components, when queried
5120 * @dontinclude evas-hints.c
5121 * @skip evas_object_size_hint_min_set
5124 * In this example the minimum size hints change the behavior of an
5125 * Evas box when layouting its children. See the full @ref
5126 * Example_Evas_Size_Hints "example".
5128 * @see evas_object_size_hint_min_get()
5130 EAPI void evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5133 * Retrieves the hints for an object's maximum size.
5135 * @param obj The given Evas object to query hints from.
5136 * @param w Pointer to an integer in which to store the maximum width.
5137 * @param h Pointer to an integer in which to store the maximum height.
5139 * These are hints on the maximum sizes @p obj should have. This is
5140 * not a size enforcement in any way, it's just a hint that should be
5141 * used whenever appropriate.
5143 * @note Use @c NULL pointers on the hint components you're not
5144 * interested in: they'll be ignored by the function.
5146 * @see evas_object_size_hint_max_set()
5148 EAPI void evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5151 * Sets the hints for an object's maximum size.
5153 * @param obj The given Evas object to query hints from.
5154 * @param w Integer to use as the maximum width hint.
5155 * @param h Integer to use as the maximum height hint.
5157 * This is not a size enforcement in any way, it's just a hint that
5158 * should be used whenever appropriate.
5160 * Values @c -1 will be treated as unset hint components, when queried
5164 * @dontinclude evas-hints.c
5165 * @skip evas_object_size_hint_max_set
5168 * In this example the maximum size hints change the behavior of an
5169 * Evas box when layouting its children. See the full @ref
5170 * Example_Evas_Size_Hints "example".
5172 * @see evas_object_size_hint_max_get()
5174 EAPI void evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5177 * Retrieves the hints for an object's optimum size.
5179 * @param obj The given Evas object to query hints from.
5180 * @param w Pointer to an integer in which to store the requested width.
5181 * @param h Pointer to an integer in which to store the requested height.
5183 * These are hints on the optimum sizes @p obj should have. This is
5184 * not a size enforcement in any way, it's just a hint that should be
5185 * used whenever appropriate.
5187 * @note Use @c NULL pointers on the hint components you're not
5188 * interested in: they'll be ignored by the function.
5190 * @see evas_object_size_hint_request_set()
5192 EAPI void evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
5195 * Sets the hints for an object's optimum size.
5197 * @param obj The given Evas object to query hints from.
5198 * @param w Integer to use as the preferred width hint.
5199 * @param h Integer to use as the preferred height hint.
5201 * This is not a size enforcement in any way, it's just a hint that
5202 * should be used whenever appropriate.
5204 * Values @c 0 will be treated as unset hint components, when queried
5207 * @see evas_object_size_hint_request_get()
5209 EAPI void evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
5212 * Retrieves the hints for an object's aspect ratio.
5214 * @param obj The given Evas object to query hints from.
5215 * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
5216 * @param w Pointer to an integer in which to store the aspect's width
5218 * @param h Pointer to an integer in which to store the aspect's
5219 * height ratio term.
5221 * The different aspect ratio policies are documented in the
5222 * #Evas_Aspect_Control type. A container respecting these size hints
5223 * would @b resize its children accordingly to those policies.
5225 * For any policy, if any of the given aspect ratio terms are @c 0,
5226 * the object's container should ignore the aspect and scale @p obj to
5227 * occupy the whole available area. If they are both positive
5228 * integers, that proportion will be respected, under each scaling
5231 * These images illustrate some of the #Evas_Aspect_Control policies:
5233 * @image html any-policy.png
5234 * @image rtf any-policy.png
5235 * @image latex any-policy.eps
5237 * @image html aspect-control-none-neither.png
5238 * @image rtf aspect-control-none-neither.png
5239 * @image latex aspect-control-none-neither.eps
5241 * @image html aspect-control-both.png
5242 * @image rtf aspect-control-both.png
5243 * @image latex aspect-control-both.eps
5245 * @image html aspect-control-horizontal.png
5246 * @image rtf aspect-control-horizontal.png
5247 * @image latex aspect-control-horizontal.eps
5249 * This is not a size enforcement in any way, it's just a hint that
5250 * should be used whenever appropriate.
5252 * @note Use @c NULL pointers on the hint components you're not
5253 * interested in: they'll be ignored by the function.
5256 * @dontinclude evas-aspect-hints.c
5257 * @skip if (strcmp(ev->keyname, "c") == 0)
5260 * See the full @ref Example_Evas_Aspect_Hints "example".
5262 * @see evas_object_size_hint_aspect_set()
5264 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);
5267 * Sets the hints for an object's aspect ratio.
5269 * @param obj The given Evas object to query hints from.
5270 * @param aspect The policy/type of aspect ratio to apply to @p obj.
5271 * @param w Integer to use as aspect width ratio term.
5272 * @param h Integer to use as aspect height ratio term.
5274 * This is not a size enforcement in any way, it's just a hint that should
5275 * be used whenever appropriate.
5277 * If any of the given aspect ratio terms are @c 0,
5278 * the object's container will ignore the aspect and scale @p obj to
5279 * occupy the whole available area, for any given policy.
5281 * @see evas_object_size_hint_aspect_get() for more information.
5283 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);
5286 * Retrieves the hints for on object's alignment.
5288 * @param obj The given Evas object to query hints from.
5289 * @param x Pointer to a double in which to store the horizontal
5291 * @param y Pointer to a double in which to store the vertical
5294 * This is not a size enforcement in any way, it's just a hint that
5295 * should be used whenever appropriate.
5297 * @note Use @c NULL pointers on the hint components you're not
5298 * interested in: they'll be ignored by the function.
5299 * @note If @c obj is invalid, then the hint components will be set with 0.5
5301 * @see evas_object_size_hint_align_set() for more information
5303 EAPI void evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5306 * Sets the hints for an object's alignment.
5308 * @param obj The given Evas object to query hints from.
5309 * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
5310 * special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
5311 * @param y Double, ranging from @c 0.0 to @c 1.0 or with the
5312 * special value #EVAS_HINT_FILL, to use as vertical alignment hint.
5314 * These are hints on how to align an object <b>inside the boundaries
5315 * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
5316 * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
5317 * "justify" or "fill" by some users. In this case, maximum size hints
5318 * should be enforced with higher priority, if they are set. Also, any
5319 * padding hint set on objects should add up to the alignment space on
5320 * the final scene composition.
5322 * See documentation of possible users: in Evas, they are the @ref
5323 * Evas_Object_Box "box" and @ref Evas_Object_Table "table" smart
5326 * For the horizontal component, @c 0.0 means to the left, @c 1.0
5327 * means to the right. Analogously, for the vertical component, @c 0.0
5328 * to the top, @c 1.0 means to the bottom.
5330 * See the following figure:
5332 * @image html alignment-hints.png
5333 * @image rtf alignment-hints.png
5334 * @image latex alignment-hints.eps
5336 * This is not a size enforcement in any way, it's just a hint that
5337 * should be used whenever appropriate.
5340 * @dontinclude evas-hints.c
5341 * @skip evas_object_size_hint_align_set
5344 * In this example the alignment hints change the behavior of an Evas
5345 * box when layouting its children. See the full @ref
5346 * Example_Evas_Size_Hints "example".
5348 * @see evas_object_size_hint_align_get()
5349 * @see evas_object_size_hint_max_set()
5350 * @see evas_object_size_hint_padding_set()
5352 EAPI void evas_object_size_hint_align_set(Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5355 * Retrieves the hints for an object's weight.
5357 * @param obj The given Evas object to query hints from.
5358 * @param x Pointer to a double in which to store the horizontal weight.
5359 * @param y Pointer to a double in which to store the vertical weight.
5361 * Accepted values are zero or positive values. Some users might use
5362 * this hint as a boolean, but some might consider it as a @b
5363 * proportion, see documentation of possible users, which in Evas are
5364 * the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
5367 * This is not a size enforcement in any way, it's just a hint that
5368 * should be used whenever appropriate.
5370 * @note Use @c NULL pointers on the hint components you're not
5371 * interested in: they'll be ignored by the function.
5372 * @note If @c obj is invalid, then the hint components will be set with 0.0
5374 * @see evas_object_size_hint_weight_set() for an example
5376 EAPI void evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
5379 * Sets the hints for an object's weight.
5381 * @param obj The given Evas object to query hints from.
5382 * @param x Nonnegative double value to use as horizontal weight hint.
5383 * @param y Nonnegative double value to use as vertical weight hint.
5385 * This is not a size enforcement in any way, it's just a hint that
5386 * should be used whenever appropriate.
5388 * This is a hint on how a container object should @b resize a given
5389 * child within its area. Containers may adhere to the simpler logic
5390 * of just expanding the child object's dimensions to fit its own (see
5391 * the #EVAS_HINT_EXPAND helper weight macro) or the complete one of
5392 * taking each child's weight hint as real @b weights to how much of
5393 * its size to allocate for them in each axis. A container is supposed
5394 * to, after @b normalizing the weights of its children (with weight
5395 * hints), distribute the space it has to layout them by those factors
5396 * -- most weighted children get larger in this process than the least
5400 * @dontinclude evas-hints.c
5401 * @skip evas_object_size_hint_weight_set
5404 * In this example the weight hints change the behavior of an Evas box
5405 * when layouting its children. See the full @ref
5406 * Example_Evas_Size_Hints "example".
5408 * @see evas_object_size_hint_weight_get() for more information
5410 EAPI void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
5413 * Retrieves the hints for an object's padding space.
5415 * @param obj The given Evas object to query hints from.
5416 * @param l Pointer to an integer in which to store left padding.
5417 * @param r Pointer to an integer in which to store right padding.
5418 * @param t Pointer to an integer in which to store top padding.
5419 * @param b Pointer to an integer in which to store bottom padding.
5421 * Padding is extra space an object takes on each of its delimiting
5422 * rectangle sides, in canvas units. This space will be rendered
5423 * transparent, naturally, as in the following figure:
5425 * @image html padding-hints.png
5426 * @image rtf padding-hints.png
5427 * @image latex padding-hints.eps
5429 * This is not a size enforcement in any way, it's just a hint that
5430 * should be used whenever appropriate.
5432 * @note Use @c NULL pointers on the hint components you're not
5433 * interested in: they'll be ignored by the function.
5436 * @dontinclude evas-hints.c
5437 * @skip evas_object_size_hint_padding_set
5440 * In this example the padding hints change the behavior of an Evas box
5441 * when layouting its children. See the full @ref
5442 * Example_Evas_Size_Hints "example".
5444 * @see evas_object_size_hint_padding_set()
5446 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);
5449 * Sets the hints for an object's padding space.
5451 * @param obj The given Evas object to query hints from.
5452 * @param l Integer to specify left padding.
5453 * @param r Integer to specify right padding.
5454 * @param t Integer to specify top padding.
5455 * @param b Integer to specify bottom padding.
5457 * This is not a size enforcement in any way, it's just a hint that
5458 * should be used whenever appropriate.
5460 * @see evas_object_size_hint_padding_get() for more information
5462 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);
5469 * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
5471 * Miscellaneous functions that also apply to any object, but are less
5472 * used or not implemented by all objects.
5474 * Examples on this group of functions can be found @ref
5475 * Example_Evas_Stacking "here" and @ref Example_Evas_Events "here".
5477 * @ingroup Evas_Object_Group
5481 * @addtogroup Evas_Object_Group_Extras
5486 * Set an attached data pointer to an object with a given string key.
5488 * @param obj The object to attach the data pointer to
5489 * @param key The string key for the data to access it
5490 * @param data The pointer to the data to be attached
5492 * This attaches the pointer @p data to the object @p obj, given the
5493 * access string @p key. This pointer will stay "hooked" to the object
5494 * until a new pointer with the same string key is attached with
5495 * evas_object_data_set() or it is deleted with
5496 * evas_object_data_del(). On deletion of the object @p obj, the
5497 * pointers will not be accessible from the object anymore.
5499 * You can find the pointer attached under a string key using
5500 * evas_object_data_get(). It is the job of the calling application to
5501 * free any data pointed to by @p data when it is no longer required.
5503 * If @p data is @c NULL, the old value stored at @p key will be
5504 * removed but no new value will be stored. This is synonymous with
5505 * calling evas_object_data_del() with @p obj and @p key.
5507 * @note This function is very handy when you have data associated
5508 * specifically to an Evas object, being of use only when dealing with
5509 * it. Than you don't have the burden to a pointer to it elsewhere,
5510 * using this family of functions.
5516 * extern Evas_Object *obj;
5518 * my_data = malloc(500);
5519 * evas_object_data_set(obj, "name_of_data", my_data);
5520 * printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
5523 EAPI void evas_object_data_set(Evas_Object *obj, const char *key, const void *data) EINA_ARG_NONNULL(1, 2);
5526 * Return an attached data pointer on an Evas object by its given
5529 * @param obj The object to which the data was attached
5530 * @param key The string key the data was stored under
5531 * @return The data pointer stored, or @c NULL if none was stored
5533 * This function will return the data pointer attached to the object
5534 * @p obj, stored using the string key @p key. If the object is valid
5535 * and a data pointer was stored under the given key, that pointer
5536 * will be returned. If this is not the case, @c NULL will be
5537 * returned, signifying an invalid object or a non-existent key. It is
5538 * possible that a @c NULL pointer was stored given that key, but this
5539 * situation is non-sensical and thus can be considered an error as
5540 * well. @c NULL pointers are never stored as this is the return value
5541 * if an error occurs.
5547 * extern Evas_Object *obj;
5549 * my_data = evas_object_data_get(obj, "name_of_my_data");
5550 * if (my_data) printf("Data stored was %p\n", my_data);
5551 * else printf("No data was stored on the object\n");
5554 EAPI void *evas_object_data_get(const Evas_Object *obj, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
5557 * Delete an attached data pointer from an object.
5559 * @param obj The object to delete the data pointer from
5560 * @param key The string key the data was stored under
5561 * @return The original data pointer stored at @p key on @p obj
5563 * This will remove the stored data pointer from @p obj stored under
5564 * @p key and return this same pointer, if actually there was data
5565 * there, or @c NULL, if nothing was stored under that key.
5571 * extern Evas_Object *obj;
5573 * my_data = evas_object_data_del(obj, "name_of_my_data");
5576 EAPI void *evas_object_data_del(Evas_Object *obj, const char *key) EINA_ARG_NONNULL(1, 2);
5579 * Set pointer behavior.
5582 * @param setting desired behavior.
5584 * This function has direct effect on event callbacks related to
5587 * If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
5588 * is down at this object, events will be restricted to it as source,
5589 * mouse moves, for example, will be emitted even if outside this
5592 * If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
5593 * be emitted just when inside this object area.
5595 * The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
5597 * @ingroup Evas_Object_Group_Extras
5599 EAPI void evas_object_pointer_mode_set(Evas_Object *obj, Evas_Object_Pointer_Mode setting) EINA_ARG_NONNULL(1);
5602 * Determine how pointer will behave.
5604 * @return pointer behavior.
5605 * @ingroup Evas_Object_Group_Extras
5607 EAPI Evas_Object_Pointer_Mode evas_object_pointer_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5610 * Sets whether or not the given Evas object is to be drawn anti-aliased.
5612 * @param obj The given Evas object.
5613 * @param antialias 1 if the object is to be anti_aliased, 0 otherwise.
5614 * @ingroup Evas_Object_Group_Extras
5616 EAPI void evas_object_anti_alias_set(Evas_Object *obj, Eina_Bool antialias) EINA_ARG_NONNULL(1);
5619 * Retrieves whether or not the given Evas object is to be drawn anti_aliased.
5620 * @param obj The given Evas object.
5621 * @return @c 1 if the object is to be anti_aliased. @c 0 otherwise.
5622 * @ingroup Evas_Object_Group_Extras
5624 EAPI Eina_Bool evas_object_anti_alias_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5627 * Sets the scaling factor for an Evas object. Does not affect all
5630 * @param obj The given Evas object.
5631 * @param scale The scaling factor. <c>1.0</c> means no scaling,
5634 * This will multiply the object's dimension by the given factor, thus
5635 * altering its geometry (width and height). Useful when you want
5636 * scalable UI elements, possibly at run time.
5638 * @note Only text and textblock objects have scaling change
5639 * handlers. Other objects won't change visually on this call.
5641 * @see evas_object_scale_get()
5643 * @ingroup Evas_Object_Group_Extras
5645 EAPI void evas_object_scale_set(Evas_Object *obj, double scale) EINA_ARG_NONNULL(1);
5648 * Retrieves the scaling factor for the given Evas object.
5650 * @param obj The given Evas object.
5651 * @return The scaling factor.
5653 * @ingroup Evas_Object_Group_Extras
5655 * @see evas_object_scale_set()
5657 EAPI double evas_object_scale_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5660 * Sets the render_op to be used for rendering the Evas object.
5661 * @param obj The given Evas object.
5662 * @param op one of the Evas_Render_Op values.
5663 * @ingroup Evas_Object_Group_Extras
5665 EAPI void evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op op) EINA_ARG_NONNULL(1);
5668 * Retrieves the current value of the operation used for rendering the Evas object.
5669 * @param obj The given Evas object.
5670 * @return one of the enumerated values in Evas_Render_Op.
5671 * @ingroup Evas_Object_Group_Extras
5673 EAPI Evas_Render_Op evas_object_render_op_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5676 * Set whether to use precise (usually expensive) point collision
5677 * detection for a given Evas object.
5679 * @param obj The given object.
5680 * @param precise Whether to use precise point collision detection or
5681 * not. The default value is false.
5683 * Use this function to make Evas treat objects' transparent areas as
5684 * @b not belonging to it with regard to mouse pointer events. By
5685 * default, all of the object's boundary rectangle will be taken in
5688 * @warning By using precise point collision detection you'll be
5689 * making Evas more resource intensive.
5691 * Example code follows.
5692 * @dontinclude evas-events.c
5693 * @skip if (strcmp(ev->keyname, "p") == 0)
5696 * See the full example @ref Example_Evas_Events "here".
5698 * @see evas_object_precise_is_inside_get()
5699 * @ingroup Evas_Object_Group_Extras
5701 EAPI void evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
5704 * Determine whether an object is set to use precise point collision
5707 * @param obj The given object.
5708 * @return whether @p obj is set to use precise point collision
5709 * detection or not The default value is false.
5711 * @see evas_object_precise_is_inside_set() for an example
5713 * @ingroup Evas_Object_Group_Extras
5715 EAPI Eina_Bool evas_object_precise_is_inside_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5718 * Set a hint flag on the given Evas object that it's used as a "static
5721 * @param obj The given object.
5722 * @param is_static_clip @c EINA_TRUE if it's to be used as a static
5723 * clipper, @c EINA_FALSE otherwise.
5725 * This is a hint to Evas that this object is used as a big static
5726 * clipper and shouldn't be moved with children and otherwise
5727 * considered specially. The default value for new objects is
5730 * @see evas_object_static_clip_get()
5732 * @ingroup Evas_Object_Group_Extras
5734 EAPI void evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip) EINA_ARG_NONNULL(1);
5737 * Get the "static clipper" hint flag for a given Evas object.
5739 * @param obj The given object.
5740 * @return @c EINA_TRUE if it's set as a static clipper,
5741 * @c EINA_FALSE otherwise.
5743 * @see evas_object_static_clip_set() for more details
5745 * @ingroup Evas_Object_Group_Extras
5747 EAPI Eina_Bool evas_object_static_clip_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5754 * @defgroup Evas_Object_Group_Find Finding Objects
5756 * Functions that allows finding objects by their position, name or
5759 * @ingroup Evas_Object_Group
5763 * @addtogroup Evas_Object_Group_Find
5768 * Retrieve the object that currently has focus.
5770 * @param e The Evas canvas to query for focused object on.
5771 * @return The object that has focus or @c NULL if there is not one.
5773 * Evas can have (at most) one of its objects focused at a time.
5774 * Focused objects will be the ones having <b>key events</b> delivered
5775 * to, which the programmer can act upon by means of
5776 * evas_object_event_callback_add() usage.
5778 * @note Most users wouldn't be dealing directly with Evas' focused
5779 * objects. Instead, they would be using a higher level library for
5780 * that (like a toolkit, as Elementary) to handle focus and who's
5781 * receiving input for them.
5783 * This call returns the object that currently has focus on the canvas
5784 * @p e or @c NULL, if none.
5786 * @see evas_object_focus_set
5787 * @see evas_object_focus_get
5788 * @see evas_object_key_grab
5789 * @see evas_object_key_ungrab
5792 * @dontinclude evas-events.c
5793 * @skip evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
5794 * @until evas_object_focus_set(d.bg, EINA_TRUE);
5795 * @dontinclude evas-events.c
5796 * @skip called when our rectangle gets focus
5799 * In this example the @c event_info is exactly a pointer to that
5800 * focused rectangle. See the full @ref Example_Evas_Events "example".
5802 * @ingroup Evas_Object_Group_Find
5804 EAPI Evas_Object *evas_focus_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5807 * Retrieves the object on the given evas with the given name.
5808 * @param e The given evas.
5809 * @param name The given name.
5810 * @return If successful, the Evas object with the given name. Otherwise,
5813 * This looks for the evas object given a name by evas_object_name_set(). If
5814 * the name is not unique canvas-wide, then which one of the many objects
5815 * with that name is returned is undefined, so only use this if you can ensure
5816 * the object name is unique.
5818 * @ingroup Evas_Object_Group_Find
5820 EAPI Evas_Object *evas_object_name_find(const Evas *e, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5823 * Retrieves the object from children of the given object with the given name.
5824 * @param obj The parent (smart) object whose children to search.
5825 * @param name The given name.
5826 * @param recurse Set to the number of child levels to recurse (0 == don't recurse, 1 == only look at the children of @p obj or their immediate children, but no further etc.).
5827 * @return If successful, the Evas object with the given name. Otherwise,
5830 * This looks for the evas object given a name by evas_object_name_set(), but
5831 * it ONLY looks at the children of the object *p obj, and will only recurse
5832 * into those children if @p recurse is greater than 0. If the name is not
5833 * unique within immediate children (or the whole child tree) then it is not
5834 * defined which child object will be returned. If @p recurse is set to -1 then
5835 * it will recurse without limit.
5839 * @ingroup Evas_Object_Group_Find
5841 EAPI Evas_Object *evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5844 * Retrieve the Evas object stacked at the top of a given position in
5847 * @param e A handle to the canvas.
5848 * @param x The horizontal coordinate of the position
5849 * @param y The vertical coordinate of the position
5850 * @param include_pass_events_objects Boolean flag to include or not
5851 * objects which pass events in this calculation
5852 * @param include_hidden_objects Boolean flag to include or not hidden
5853 * objects in this calculation
5854 * @return The Evas object that is over all other objects at the given
5857 * This function will traverse all the layers of the given canvas,
5858 * from top to bottom, querying for objects with areas covering the
5859 * given position. The user can remove from from the query
5860 * objects which are hidden and/or which are set to pass events.
5862 * @warning This function will @b skip objects parented by smart
5863 * objects, acting only on the ones at the "top level", with regard to
5866 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);
5869 * Retrieve the Evas object stacked at the top at the position of the
5870 * mouse cursor, over a given canvas
5872 * @param e A handle to the canvas.
5873 * @return The Evas object that is over all other objects at the mouse
5874 * pointer's position
5876 * This function will traverse all the layers of the given canvas,
5877 * from top to bottom, querying for objects with areas covering the
5878 * mouse pointer's position, over @p e.
5880 * @warning This function will @b skip objects parented by smart
5881 * objects, acting only on the ones at the "top level", with regard to
5884 EAPI Evas_Object *evas_object_top_at_pointer_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5887 * Retrieve the Evas object stacked at the top of a given rectangular
5888 * region in a canvas
5890 * @param e A handle to the canvas.
5891 * @param x The top left corner's horizontal coordinate for the
5892 * rectangular region
5893 * @param y The top left corner's vertical coordinate for the
5894 * rectangular region
5895 * @param w The width of the rectangular region
5896 * @param h The height of the rectangular region
5897 * @param include_pass_events_objects Boolean flag to include or not
5898 * objects which pass events in this calculation
5899 * @param include_hidden_objects Boolean flag to include or not hidden
5900 * objects in this calculation
5901 * @return The Evas object that is over all other objects at the given
5902 * rectangular region.
5904 * This function will traverse all the layers of the given canvas,
5905 * from top to bottom, querying for objects with areas overlapping
5906 * with the given rectangular region inside @p e. The user can remove
5907 * from the query objects which are hidden and/or which are set to
5910 * @warning This function will @b skip objects parented by smart
5911 * objects, acting only on the ones at the "top level", with regard to
5914 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);
5917 * Retrieve a list of Evas objects lying over a given position in
5920 * @param e A handle to the canvas.
5921 * @param x The horizontal coordinate of the position
5922 * @param y The vertical coordinate of the position
5923 * @param include_pass_events_objects Boolean flag to include or not
5924 * objects which pass events in this calculation
5925 * @param include_hidden_objects Boolean flag to include or not hidden
5926 * objects in this calculation
5927 * @return The list of Evas objects that are over the given position
5930 * This function will traverse all the layers of the given canvas,
5931 * from top to bottom, querying for objects with areas covering the
5932 * given position. The user can remove from from the query
5933 * objects which are hidden and/or which are set to pass events.
5935 * @warning This function will @b skip objects parented by smart
5936 * objects, acting only on the ones at the "top level", with regard to
5939 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);
5940 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);
5943 * Get the lowest (stacked) Evas object on the canvas @p e.
5945 * @param e a valid canvas pointer
5946 * @return a pointer to the lowest object on it, if any, or @c NULL,
5949 * This function will take all populated layers in the canvas into
5950 * account, getting the lowest object for the lowest layer, naturally.
5952 * @see evas_object_layer_get()
5953 * @see evas_object_layer_set()
5954 * @see evas_object_below_get()
5955 * @see evas_object_above_get()
5957 * @warning This function will @b skip objects parented by smart
5958 * objects, acting only on the ones at the "top level", with regard to
5961 EAPI Evas_Object *evas_object_bottom_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5964 * Get the highest (stacked) Evas object on the canvas @p e.
5966 * @param e a valid canvas pointer
5967 * @return a pointer to the highest object on it, if any, or @c NULL,
5970 * This function will take all populated layers in the canvas into
5971 * account, getting the highest object for the highest layer,
5974 * @see evas_object_layer_get()
5975 * @see evas_object_layer_set()
5976 * @see evas_object_below_get()
5977 * @see evas_object_above_get()
5979 * @warning This function will @b skip objects parented by smart
5980 * objects, acting only on the ones at the "top level", with regard to
5983 EAPI Evas_Object *evas_object_top_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
5990 * @defgroup Evas_Object_Group_Interceptors Object Method Interceptors
5992 * Evas provides a way to intercept method calls. The interceptor
5993 * callback may opt to completely deny the call, or may check and
5994 * change the parameters before continuing. The continuation of an
5995 * intercepted call is done by calling the intercepted call again,
5996 * from inside the interceptor callback.
5998 * @ingroup Evas_Object_Group
6002 * @addtogroup Evas_Object_Group_Interceptors
6006 typedef void (*Evas_Object_Intercept_Show_Cb)(void *data, Evas_Object *obj);
6007 typedef void (*Evas_Object_Intercept_Hide_Cb)(void *data, Evas_Object *obj);
6008 typedef void (*Evas_Object_Intercept_Move_Cb)(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
6009 typedef void (*Evas_Object_Intercept_Resize_Cb)(void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
6010 typedef void (*Evas_Object_Intercept_Raise_Cb)(void *data, Evas_Object *obj);
6011 typedef void (*Evas_Object_Intercept_Lower_Cb)(void *data, Evas_Object *obj);
6012 typedef void (*Evas_Object_Intercept_Stack_Above_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
6013 typedef void (*Evas_Object_Intercept_Stack_Below_Cb)(void *data, Evas_Object *obj, Evas_Object *above);
6014 typedef void (*Evas_Object_Intercept_Layer_Set_Cb)(void *data, Evas_Object *obj, int l);
6015 typedef void (*Evas_Object_Intercept_Color_Set_Cb)(void *data, Evas_Object *obj, int r, int g, int b, int a);
6016 typedef void (*Evas_Object_Intercept_Clip_Set_Cb)(void *data, Evas_Object *obj, Evas_Object *clip);
6017 typedef void (*Evas_Object_Intercept_Clip_Unset_Cb)(void *data, Evas_Object *obj);
6020 * Set the callback function that intercepts a show event of a object.
6022 * @param obj The given canvas object pointer.
6023 * @param func The given function to be the callback function.
6024 * @param data The data passed to the callback function.
6026 * This function sets a callback function to intercepts a show event
6027 * of a canvas object.
6029 * @see evas_object_intercept_show_callback_del().
6032 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);
6035 * Unset the callback function that intercepts a show event of a
6038 * @param obj The given canvas object pointer.
6039 * @param func The given callback function.
6041 * This function sets a callback function to intercepts a show event
6042 * of a canvas object.
6044 * @see evas_object_intercept_show_callback_add().
6047 EAPI void *evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) EINA_ARG_NONNULL(1, 2);
6050 * Set the callback function that intercepts a hide event of a object.
6052 * @param obj The given canvas object pointer.
6053 * @param func The given function to be the callback function.
6054 * @param data The data passed to the callback function.
6056 * This function sets a callback function to intercepts a hide event
6057 * of a canvas object.
6059 * @see evas_object_intercept_hide_callback_del().
6062 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);
6065 * Unset the callback function that intercepts a hide event of a
6068 * @param obj The given canvas object pointer.
6069 * @param func The given callback function.
6071 * This function sets a callback function to intercepts a hide event
6072 * of a canvas object.
6074 * @see evas_object_intercept_hide_callback_add().
6077 EAPI void *evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) EINA_ARG_NONNULL(1, 2);
6080 * Set the callback function that intercepts a move event of a object.
6082 * @param obj The given canvas object pointer.
6083 * @param func The given function to be the callback function.
6084 * @param data The data passed to the callback function.
6086 * This function sets a callback function to intercepts a move event
6087 * of a canvas object.
6089 * @see evas_object_intercept_move_callback_del().
6092 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);
6095 * Unset the callback function that intercepts a move event of a
6098 * @param obj The given canvas object pointer.
6099 * @param func The given callback function.
6101 * This function sets a callback function to intercepts a move event
6102 * of a canvas object.
6104 * @see evas_object_intercept_move_callback_add().
6107 EAPI void *evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) EINA_ARG_NONNULL(1, 2);
6109 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);
6110 EAPI void *evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) EINA_ARG_NONNULL(1, 2);
6111 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);
6112 EAPI void *evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) EINA_ARG_NONNULL(1, 2);
6113 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);
6114 EAPI void *evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) EINA_ARG_NONNULL(1, 2);
6115 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);
6116 EAPI void *evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) EINA_ARG_NONNULL(1, 2);
6117 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);
6118 EAPI void *evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) EINA_ARG_NONNULL(1, 2);
6119 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);
6120 EAPI void *evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6121 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);
6122 EAPI void *evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6123 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);
6124 EAPI void *evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) EINA_ARG_NONNULL(1, 2);
6125 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);
6126 EAPI void *evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) EINA_ARG_NONNULL(1, 2);
6133 * @defgroup Evas_Object_Specific Specific Object Functions
6135 * Functions that work on specific objects.
6140 * @defgroup Evas_Object_Rectangle Rectangle Object Functions
6142 * @brief Function to create evas rectangle objects.
6144 * There is only one function to deal with rectangle objects, this may make this
6145 * function seem useless given there are no functions to manipulate the created
6146 * rectangle, however the rectangle is actually very useful and should be
6147 * manipulated using the generic @ref Evas_Object_Group "evas object functions".
6149 * The evas rectangle serves a number of key functions when working on evas
6155 * @section Background
6157 * One extremely common requirement of evas programs is to have a solid color
6158 * background, this can be accomplished with the following very simple code:
6160 * Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
6161 * //Here we set the rectangles red, green, blue and opacity levels
6162 * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6163 * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6164 * evas_object_show(bg);
6167 * This however will have issues if the @c evas_canvas is resized, however most
6168 * windows are created using ecore evas and that has a solution to using the
6169 * rectangle as a background:
6171 * Evas_Object *bg = evas_object_rectangle_add(ecore_evas_get(ee));
6172 * //Here we set the rectangles red, green, blue and opacity levels
6173 * evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
6174 * evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
6175 * evas_object_show(bg);
6176 * ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
6178 * So this gives us a white background to our window that will be resized
6181 * @section Debugging
6183 * Debugging is a major part of any programmers task and when debugging visual
6184 * issues with evas programs the rectangle is an extremely useful tool. The
6185 * rectangle's simplicity means that it's easier to pinpoint issues with it than
6186 * with more complex objects. Therefore a common technique to use when writing
6187 * an evas program and not getting the desired visual result is to replace the
6188 * misbehaving object for a solid color rectangle and seeing how it interacts
6189 * with the other elements, this often allows us to notice clipping, parenting
6190 * or positioning issues. Once the issues have been identified and corrected the
6191 * rectangle can be replaced for the original part and in all likelihood any
6192 * remaining issues will be specific to that object's type.
6194 * @section clipping Clipping
6196 * Clipping serves two main functions:
6197 * @li Limiting visibility(i.e. hiding portions of an object).
6198 * @li Applying a layer of color to an object.
6200 * @subsection hiding Limiting visibility
6202 * It is often necessary to show only parts of an object, while it may be
6203 * possible to create an object that corresponds only to the part that must be
6204 * shown(and it isn't always possible) it's usually easier to use a a clipper. A
6205 * clipper is a rectangle that defines what's visible and what is not. The way
6206 * to do this is to create a solid white rectangle(which is the default, no need
6207 * to call evas_object_color_set()) and give it a position and size of what
6208 * should be visible. The following code exemplifies showing the center half of
6209 * @c my_evas_object:
6211 * Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
6212 * evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
6213 * evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
6214 * evas_object_clip_set(my_evas_object, clipper);
6215 * evas_object_show(clipper);
6218 * @subsection color Layer of color
6220 * In the @ref clipping section we used a solid white clipper, which produced no
6221 * change in the color of the clipped object, it just hid what was outside the
6222 * clippers area. It is however sometimes desirable to change the of color an
6223 * object, this can be accomplished using a clipper that has a non-white color.
6224 * Clippers with color work by multiplying the colors of clipped object. The
6225 * following code will show how to remove all the red from an object:
6227 * Evas_Object *clipper = evas_object_rectangle_add(evas);
6228 * evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
6229 * evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
6230 * evas_object_color_set(clipper, 0, 255, 255, 255);
6231 * evas_object_clip_set(obj, clipper);
6232 * evas_object_show(clipper);
6235 * @warning We don't guarantee any proper results if you create a Rectangle
6236 * object without setting the evas engine.
6238 * For an example that more fully exercise the use of an evas object rectangle
6239 * see @ref Example_Evas_Object_Manipulation.
6241 * @ingroup Evas_Object_Specific
6245 * Adds a rectangle to the given evas.
6246 * @param e The given evas.
6247 * @return The new rectangle object.
6249 * @ingroup Evas_Object_Rectangle
6251 EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6254 * @defgroup Evas_Object_Image Image Object Functions
6256 * Here are grouped together functions used to create and manipulate
6257 * image objects. They are available to whichever occasion one needs
6258 * complex imagery on a GUI that could not be achieved by the other
6259 * Evas' primitive object types, or to make image manipulations.
6261 * Evas will support whichever image file types it was compiled with
6262 * support to (its image loaders) -- check your software packager for
6263 * that information and see
6264 * evas_object_image_extension_can_load_get().
6266 * @section Evas_Object_Image_Basics Image object basics
6268 * The most common use of image objects -- to display an image on the
6269 * canvas -- is achieved by a common function triplet:
6271 * img = evas_object_image_add(canvas);
6272 * evas_object_image_file_set(img, "path/to/img", NULL);
6273 * evas_object_image_fill_set(img, 0, 0, w, h);
6275 * The first function, naturally, is creating the image object. Then,
6276 * one must set an source file on it, so that it knows where to fetch
6277 * image data from. Next, one must set <b>how to fill the image
6278 * object's area</b> with that given pixel data. One could use just a
6279 * sub-region of the original image or even have it tiled repeatedly
6280 * on the image object. For the common case of having the whole source
6281 * image to be displayed on the image object, stretched to the
6282 * destination's size, there's also a function helper, to be used
6283 * instead of evas_object_image_fill_set():
6285 * evas_object_image_filled_set(img, EINA_TRUE);
6287 * See those functions' documentation for more details.
6289 * @section Evas_Object_Image_Scale Scale and resizing
6291 * Resizing of image objects will scale their respective source images
6292 * to their areas, if they are set to "fill" the object's area
6293 * (evas_object_image_filled_set()). If the user wants any control on
6294 * the aspect ratio of an image for different sizes, he/she has to
6295 * take care of that themselves. There are functions to make images to
6296 * get loaded scaled (up or down) in memory, already, if the user is
6297 * going to use them at pre-determined sizes and wants to save
6300 * Evas has even a scale cache, which will take care of caching scaled
6301 * versions of images with more often usage/hits. Finally, one can
6302 * have images being rescaled @b smoothly by Evas (more
6303 * computationally expensive) or not.
6305 * @section Evas_Object_Image_Performance Performance hints
6307 * When dealing with image objects, there are some tricks to boost the
6308 * performance of your application, if it does intense image loading
6309 * and/or manipulations, as in animations on a UI.
6311 * @subsection Evas_Object_Image_Load Load hints
6313 * In image viewer applications, for example, the user will be looking
6314 * at a given image, at full size, and will desire that the navigation
6315 * to the adjacent images on his/her album be fluid and fast. Thus,
6316 * while displaying a given image, the program can be on the
6317 * background loading the next and previous images already, so that
6318 * displaying them on the sequence is just a matter of repainting the
6319 * screen (and not decoding image data).
6321 * Evas addresses this issue with <b>image pre-loading</b>. The code
6322 * for the situation above would be something like the following:
6324 * prev = evas_object_image_filled_add(canvas);
6325 * evas_object_image_file_set(prev, "/path/to/prev", NULL);
6326 * evas_object_image_preload(prev, EINA_TRUE);
6328 * next = evas_object_image_filled_add(canvas);
6329 * evas_object_image_file_set(next, "/path/to/next", NULL);
6330 * evas_object_image_preload(next, EINA_TRUE);
6333 * If you're loading images which are too big, consider setting
6334 * previously it's loading size to something smaller, in case you
6335 * won't expose them in real size. It may speed up the loading
6338 * //to load a scaled down version of the image in memory, if that's
6339 * //the size you'll be displaying it anyway
6340 * evas_object_image_load_scale_down_set(img, zoom);
6342 * //optional: if you know you'll be showing a sub-set of the image's
6343 * //pixels, you can avoid loading the complementary data
6344 * evas_object_image_load_region_set(img, x, y, w, h);
6346 * Refer to Elementary's Photocam widget for a high level (smart)
6347 * object which does lots of loading speed-ups for you.
6349 * @subsection Evas_Object_Image_Animation Animation hints
6351 * If you want to animate image objects on a UI (what you'd get by
6352 * concomitant usage of other libraries, like Ecore and Edje), there
6353 * are also some tips on how to boost the performance of your
6354 * application. If the animation involves resizing of an image (thus,
6355 * re-scaling), you'd better turn off smooth scaling on it @b during
6356 * the animation, turning it back on afterwards, for less
6357 * computations. Also, in this case you'd better flag the image object
6358 * in question not to cache scaled versions of it:
6360 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
6362 * // resizing takes place in between
6364 * evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);
6367 * Finally, movement of opaque images through the canvas is less
6368 * expensive than of translucid ones, because of blending
6371 * @section Evas_Object_Image_Borders Borders
6373 * Evas provides facilities for one to specify an image's region to be
6374 * treated specially -- as "borders". This will make those regions be
6375 * treated specially on resizing scales, by keeping their aspect. This
6376 * makes setting frames around other objects on UIs easy.
6377 * See the following figures for a visual explanation:\n
6379 * <img src="image-borders.png" style="max-width: 100%;" />
6380 * <a href="image-borders.png">Full-size</a>
6382 * @image rtf image-borders.png
6383 * @image latex image-borders.eps width=\textwidth
6385 * <img src="border-effect.png" style="max-width: 100%;" />
6386 * <a href="border-effect.png">Full-size</a>
6388 * @image rtf border-effect.png
6389 * @image latex border-effect.eps width=\textwidth
6391 * @section Evas_Object_Image_Manipulation Manipulating pixels
6393 * Evas image objects can be used to manipulate raw pixels in many
6394 * ways. The meaning of the data in the pixel arrays will depend on
6395 * the image's color space, be warned (see next section). You can set
6396 * your own data as an image's pixel data, fetch an image's pixel data
6397 * for saving/altering, convert images between different color spaces
6398 * and even advanced operations like setting a native surface as image
6401 * @section Evas_Object_Image_Color_Spaces Color spaces
6403 * Image objects may return or accept "image data" in multiple
6404 * formats. This is based on the color space of an object. Here is a
6405 * rundown on formats:
6407 * - #EVAS_COLORSPACE_ARGB8888:
6408 * This pixel format is a linear block of pixels, starting at the
6409 * top-left row by row until the bottom right of the image or pixel
6410 * region. All pixels are 32-bit unsigned int's with the high-byte
6411 * being alpha and the low byte being blue in the format ARGB. Alpha
6412 * may or may not be used by evas depending on the alpha flag of the
6413 * image, but if not used, should be set to 0xff anyway.
6415 * This colorspace uses premultiplied alpha. That means that R, G
6416 * and B cannot exceed A in value. The conversion from
6417 * non-premultiplied colorspace is:
6419 * R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
6421 * So 50% transparent blue will be: 0x80000080. This will not be
6422 * "dark" - just 50% transparent. Values are 0 == black, 255 ==
6423 * solid or full red, green or blue.
6425 * - #EVAS_COLORSPACE_YCBCR422P601_PL:
6426 * This is a pointer-list indirected set of YUV (YCbCr) pixel
6427 * data. This means that the data returned or set is not actual
6428 * pixel data, but pointers TO lines of pixel data. The list of
6429 * pointers will first be N rows of pointers to the Y plane -
6430 * pointing to the first pixel at the start of each row in the Y
6431 * plane. N is the height of the image data in pixels. Each pixel in
6432 * the Y, U and V planes is 1 byte exactly, packed. The next N / 2
6433 * pointers will point to rows in the U plane, and the next N / 2
6434 * pointers will point to the V plane rows. U and V planes are half
6435 * the horizontal and vertical resolution of the Y plane.
6437 * Row order is top to bottom and row pixels are stored left to
6440 * There is a limitation that these images MUST be a multiple of 2
6441 * pixels in size horizontally or vertically. This is due to the U
6442 * and V planes being half resolution. Also note that this assumes
6443 * the itu601 YUV colorspace specification. This is defined for
6444 * standard television and mpeg streams. HDTV may use the itu709
6447 * Values are 0 to 255, indicating full or no signal in that plane
6450 * - #EVAS_COLORSPACE_YCBCR422P709_PL:
6451 * Not implemented yet.
6453 * - #EVAS_COLORSPACE_RGB565_A5P:
6454 * In the process of being implemented in 1 engine only. This may
6457 * This is a pointer to image data for 16-bit half-word pixel data
6458 * in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue),
6459 * with the high-byte containing red and the low byte containing
6460 * blue, per pixel. This data is packed row by row from the top-left
6461 * to the bottom right.
6463 * If the image has an alpha channel enabled there will be an extra
6464 * alpha plane after the color pixel plane. If not, then this data
6465 * will not exist and should not be accessed in any way. This plane
6466 * is a set of pixels with 1 byte per pixel defining the alpha
6467 * values of all pixels in the image from the top-left to the bottom
6468 * right of the image, row by row. Even though the values of the
6469 * alpha pixels can be 0 to 255, only values 0 through to 32 are
6470 * used, 32 being solid and 0 being transparent.
6472 * RGB values can be 0 to 31 for red and blue and 0 to 63 for green,
6473 * with 0 being black and 31 or 63 being full red, green or blue
6474 * respectively. This colorspace is also pre-multiplied like
6475 * EVAS_COLORSPACE_ARGB8888 so:
6477 * R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
6479 * - #EVAS_COLORSPACE_GRY8:
6480 * The image is just a alpha mask (8 bit's per pixel). This is used
6481 * for alpha masking.
6483 * @warning We don't guarantee any proper results if you create a Image object
6484 * without setting the evas engine.
6486 * Some examples on this group of functions can be found @ref
6487 * Example_Evas_Images "here".
6489 * @ingroup Evas_Object_Specific
6493 * @addtogroup Evas_Object_Image
6497 typedef void (*Evas_Object_Image_Pixels_Get_Cb)(void *data, Evas_Object *o);
6500 * Creates a new image object on the given Evas @p e canvas.
6502 * @param e The given canvas.
6503 * @return The created image object handle.
6505 * @note If you intend to @b display an image somehow in a GUI,
6506 * besides binding it to a real image file/source (with
6507 * evas_object_image_file_set(), for example), you'll have to tell
6508 * this image object how to fill its space with the pixels it can get
6509 * from the source. See evas_object_image_filled_add(), for a helper
6510 * on the common case of scaling up an image source to the whole area
6511 * of the image object.
6513 * @see evas_object_image_fill_set()
6517 * img = evas_object_image_add(canvas);
6518 * evas_object_image_file_set(img, "/path/to/img", NULL);
6521 EAPI Evas_Object *evas_object_image_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6524 * Creates a new image object that @b automatically scales its bound
6525 * image to the object's area, on both axis.
6527 * @param e The given canvas.
6528 * @return The created image object handle.
6530 * This is a helper function around evas_object_image_add() and
6531 * evas_object_image_filled_set(). It has the same effect of applying
6532 * those functions in sequence, which is a very common use case.
6534 * @note Whenever this object gets resized, the bound image will be
6537 * @see evas_object_image_add()
6538 * @see evas_object_image_filled_set()
6539 * @see evas_object_image_fill_set()
6541 EAPI Evas_Object *evas_object_image_filled_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
6544 * Sets the data for an image from memory to be loaded
6546 * This is the same as evas_object_image_file_set() but the file to be loaded
6547 * may exist at an address in memory (the data for the file, not the filename
6548 * itself). The @p data at the address is copied and stored for future use, so
6549 * no @p data needs to be kept after this call is made. It will be managed and
6550 * freed for you when no longer needed. The @p size is limited to 2 gigabytes
6551 * in size, and must be greater than 0. A @c NULL @p data pointer is also
6552 * invalid. Set the filename to @c NULL to reset to empty state and have the
6553 * image file data freed from memory using evas_object_image_file_set().
6555 * The @p format is optional (pass @c NULL if you don't need/use it). It is
6556 * used to help Evas guess better which loader to use for the data. It may
6557 * simply be the "extension" of the file as it would normally be on disk
6558 * such as "jpg" or "png" or "gif" etc.
6560 * @param obj The given image object.
6561 * @param data The image file data address
6562 * @param size The size of the image file data in bytes
6563 * @param format The format of the file (optional), or @c NULL if not needed
6564 * @param key The image key in file, or @c NULL.
6566 EAPI void evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
6569 * Set the source file from where an image object must fetch the real
6570 * image data (it may be an Eet file, besides pure image ones).
6572 * @param obj The given image object.
6573 * @param file The image file path.
6574 * @param key The image key in @p file (if its an Eet one), or @c
6577 * If the file supports multiple data stored in it (as Eet files do),
6578 * you can specify the key to be used as the index of the image in
6583 * img = evas_object_image_add(canvas);
6584 * evas_object_image_file_set(img, "/path/to/img", NULL);
6585 * err = evas_object_image_load_error_get(img);
6586 * if (err != EVAS_LOAD_ERROR_NONE)
6588 * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
6589 * valid_path, evas_load_error_str(err));
6593 * evas_object_image_fill_set(img, 0, 0, w, h);
6594 * evas_object_resize(img, w, h);
6595 * evas_object_show(img);
6599 EAPI void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
6602 * Retrieve the source file from where an image object is to fetch the
6603 * real image data (it may be an Eet file, besides pure image ones).
6605 * @param obj The given image object.
6606 * @param file Location to store the image file path.
6607 * @param key Location to store the image key (if @p file is an Eet
6610 * You must @b not modify the strings on the returned pointers.
6612 * @note Use @c NULL pointers on the file components you're not
6613 * interested in: they'll be ignored by the function.
6615 EAPI void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
6618 * Set the dimensions for an image object's border, a region which @b
6619 * won't ever be scaled together with its center.
6621 * @param obj The given image object.
6622 * @param l The border's left width.
6623 * @param r The border's right width.
6624 * @param t The border's top width.
6625 * @param b The border's bottom width.
6627 * When Evas is rendering, an image source may be scaled to fit the
6628 * size of its image object. This function sets an area from the
6629 * borders of the image inwards which is @b not to be scaled. This
6630 * function is useful for making frames and for widget theming, where,
6631 * for example, buttons may be of varying sizes, but their border size
6632 * must remain constant.
6634 * The units used for @p l, @p r, @p t and @p b are canvas units.
6636 * @note The border region itself @b may be scaled by the
6637 * evas_object_image_border_scale_set() function.
6639 * @note By default, image objects have no borders set, i. e. @c l, @c
6640 * r, @c t and @c b start as @c 0.
6642 * See the following figures for visual explanation:\n
6644 * <img src="image-borders.png" style="max-width: 100%;" />
6645 * <a href="image-borders.png">Full-size</a>
6647 * @image rtf image-borders.png
6648 * @image latex image-borders.eps width=\textwidth
6650 * <img src="border-effect.png" style="max-width: 100%;" />
6651 * <a href="border-effect.png">Full-size</a>
6653 * @image rtf border-effect.png
6654 * @image latex border-effect.eps width=\textwidth
6656 * @see evas_object_image_border_get()
6657 * @see evas_object_image_border_center_fill_set()
6659 EAPI void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
6662 * Retrieve the dimensions for an image object's border, a region
6663 * which @b won't ever be scaled together with its center.
6665 * @param obj The given image object.
6666 * @param l Location to store the border's left width in.
6667 * @param r Location to store the border's right width in.
6668 * @param t Location to store the border's top width in.
6669 * @param b Location to store the border's bottom width in.
6671 * @note Use @c NULL pointers on the border components you're not
6672 * interested in: they'll be ignored by the function.
6674 * See @ref evas_object_image_border_set() for more details.
6676 EAPI void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
6679 * Sets @b how the center part of the given image object (not the
6680 * borders) should be drawn when Evas is rendering it.
6682 * @param obj The given image object.
6683 * @param fill Fill mode of the center region of @p obj (a value in
6684 * #Evas_Border_Fill_Mode).
6686 * This function sets how the center part of the image object's source
6687 * image is to be drawn, which must be one of the values in
6688 * #Evas_Border_Fill_Mode. By center we mean the complementary part of
6689 * that defined by evas_object_image_border_set(). This one is very
6690 * useful for making frames and decorations. You would most probably
6691 * also be using a filled image (as in evas_object_image_filled_set())
6692 * to use as a frame.
6694 * @see evas_object_image_border_center_fill_get()
6696 EAPI void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1);
6699 * Retrieves @b how the center part of the given image object (not the
6700 * borders) is to be drawn when Evas is rendering it.
6702 * @param obj The given image object.
6703 * @return fill Fill mode of the center region of @p obj (a value in
6704 * #Evas_Border_Fill_Mode).
6706 * See @ref evas_object_image_fill_set() for more details.
6708 EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6711 * Set whether the image object's fill property should track the
6714 * @param obj The given image object.
6715 * @param setting @c EINA_TRUE, to make the fill property follow
6716 * object size or @c EINA_FALSE, otherwise.
6718 * If @p setting is @c EINA_TRUE, then every evas_object_resize() will
6719 * @b automatically trigger a call to evas_object_image_fill_set()
6720 * with the that new size (and @c 0, @c 0 as source image's origin),
6721 * so the bound image will fill the whole object's area.
6723 * @see evas_object_image_filled_add()
6724 * @see evas_object_image_fill_get()
6726 EAPI void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
6729 * Retrieve whether the image object's fill property should track the
6732 * @param obj The given image object.
6733 * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and
6734 * evas_object_fill_set() must be called manually).
6736 * @see evas_object_image_filled_set() for more information
6738 EAPI Eina_Bool evas_object_image_filled_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6741 * Sets the scaling factor (multiplier) for the borders of an image
6744 * @param obj The given image object.
6745 * @param scale The scale factor (default is @c 1.0 - i.e. no scaling)
6747 * @see evas_object_image_border_set()
6748 * @see evas_object_image_border_scale_get()
6750 EAPI void evas_object_image_border_scale_set(Evas_Object *obj, double scale);
6753 * Retrieves the scaling factor (multiplier) for the borders of an
6756 * @param obj The given image object.
6757 * @return The scale factor set for its borders
6759 * @see evas_object_image_border_set()
6760 * @see evas_object_image_border_scale_set()
6762 EAPI double evas_object_image_border_scale_get(const Evas_Object *obj);
6765 * Set how to fill an image object's drawing rectangle given the
6766 * (real) image bound to it.
6768 * @param obj The given image object to operate on.
6769 * @param x The x coordinate (from the top left corner of the bound
6770 * image) to start drawing from.
6771 * @param y The y coordinate (from the top left corner of the bound
6772 * image) to start drawing from.
6773 * @param w The width the bound image will be displayed at.
6774 * @param h The height the bound image will be displayed at.
6776 * Note that if @p w or @p h are smaller than the dimensions of
6777 * @p obj, the displayed image will be @b tiled around the object's
6778 * area. To have only one copy of the bound image drawn, @p x and @p y
6779 * must be 0 and @p w and @p h need to be the exact width and height
6780 * of the image object itself, respectively.
6782 * See the following image to better understand the effects of this
6783 * call. On this diagram, both image object and original image source
6784 * have @c a x @c a dimensions and the image itself is a circle, with
6785 * empty space around it:
6787 * @image html image-fill.png
6788 * @image rtf image-fill.png
6789 * @image latex image-fill.eps
6791 * @warning The default values for the fill parameters are @p x = 0,
6792 * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the
6793 * evas_object_image_filled_add() helper and want your image
6794 * displayed, you'll have to set valid values with this function on
6797 * @note evas_object_image_filled_set() is a helper function which
6798 * will @b override the values set here automatically, for you, in a
6801 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);
6804 * Retrieve how an image object is to fill its drawing rectangle,
6805 * given the (real) image bound to it.
6807 * @param obj The given image object.
6808 * @param x Location to store the x coordinate (from the top left
6809 * corner of the bound image) to start drawing from.
6810 * @param y Location to store the y coordinate (from the top left
6811 * corner of the bound image) to start drawing from.
6812 * @param w Location to store the width the bound image is to be
6814 * @param h Location to store the height the bound image is to be
6817 * @note Use @c NULL pointers on the fill components you're not
6818 * interested in: they'll be ignored by the function.
6820 * See @ref evas_object_image_fill_set() for more details.
6822 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);
6825 * Sets the tiling mode for the given evas image object's fill.
6826 * @param obj The given evas image object.
6827 * @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
6828 * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
6830 EAPI void evas_object_image_fill_spread_set(Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1);
6833 * Retrieves the spread (tiling mode) for the given image object's
6836 * @param obj The given evas image object.
6837 * @return The current spread mode of the image object.
6839 EAPI Evas_Fill_Spread evas_object_image_fill_spread_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6842 * Sets the size of the given image object.
6844 * @param obj The given image object.
6845 * @param w The new width of the image.
6846 * @param h The new height of the image.
6848 * This function will scale down or crop the image so that it is
6849 * treated as if it were at the given size. If the size given is
6850 * smaller than the image, it will be cropped. If the size given is
6851 * larger, then the image will be treated as if it were in the upper
6852 * left hand corner of a larger image that is otherwise transparent.
6854 EAPI void evas_object_image_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
6857 * Retrieves the size of the given image object.
6859 * @param obj The given image object.
6860 * @param w Location to store the width of the image in, or @c NULL.
6861 * @param h Location to store the height of the image in, or @c NULL.
6863 * See @ref evas_object_image_size_set() for more details.
6865 EAPI void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
6868 * Retrieves the row stride of the given image object.
6870 * @param obj The given image object.
6871 * @return The stride of the image (<b>in bytes</b>).
6873 * The row stride is the number of bytes between the start of a row
6874 * and the start of the next row for image data.
6876 EAPI int evas_object_image_stride_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6879 * Retrieves a number representing any error that occurred during the
6880 * last loading of the given image object's source image.
6882 * @param obj The given image object.
6883 * @return A value giving the last error that occurred. It should be
6884 * one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE
6885 * is returned if there was no error.
6887 EAPI Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6890 * Sets the raw image data of the given image object.
6892 * @param obj The given image object.
6893 * @param data The raw data, or @c NULL.
6895 * Note that the raw data must be of the same size (see
6896 * evas_object_image_size_set(), which has to be called @b before this
6897 * one) and colorspace (see evas_object_image_colorspace_set()) of the
6898 * image. If data is @c NULL, the current image data will be
6899 * freed. Naturally, if one does not set an image object's data
6900 * manually, it will still have one, allocated by Evas.
6902 * @see evas_object_image_data_get()
6904 EAPI void evas_object_image_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6907 * Get a pointer to the raw image data of the given image object.
6909 * @param obj The given image object.
6910 * @param for_writing Whether the data being retrieved will be
6911 * modified (@c EINA_TRUE) or not (@c EINA_FALSE).
6912 * @return The raw image data.
6914 * This function returns a pointer to an image object's internal pixel
6915 * buffer, for reading only or read/write. If you request it for
6916 * writing, the image will be marked dirty so that it gets redrawn at
6919 * Each time you call this function on an image object, its data
6920 * buffer will have an internal reference counter
6921 * incremented. Decrement it back by using
6922 * evas_object_image_data_set(). This is specially important for the
6923 * directfb Evas engine.
6925 * This is best suited for when you want to modify an existing image,
6926 * without changing its dimensions.
6928 * @note The contents' format returned by it depend on the color
6929 * space of the given image object.
6931 * @note You may want to use evas_object_image_data_update_add() to
6932 * inform data changes, if you did any.
6934 * @see evas_object_image_data_set()
6936 EAPI void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6939 * Converts the raw image data of the given image object to the
6940 * specified colorspace.
6942 * Note that this function does not modify the raw image data. If the
6943 * requested colorspace is the same as the image colorspace nothing is
6944 * done and @c NULL is returned. You should use
6945 * evas_object_image_colorspace_get() to check the current image
6948 * See @ref evas_object_image_colorspace_get.
6950 * @param obj The given image object.
6951 * @param to_cspace The colorspace to which the image raw data will be converted.
6952 * @return data A newly allocated data in the format specified by to_cspace.
6954 EAPI void *evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
6957 * Replaces the raw image data of the given image object.
6959 * @param obj The given image object.
6960 * @param data The raw data to replace.
6962 * This function lets the application replace an image object's
6963 * internal pixel buffer with an user-allocated one. For best results,
6964 * you should generally first call evas_object_image_size_set() with
6965 * the width and height for the new buffer.
6967 * This call is best suited for when you will be using image data with
6968 * different dimensions than the existing image data, if any. If you
6969 * only need to modify the existing image in some fashion, then using
6970 * evas_object_image_data_get() is probably what you are after.
6972 * Note that the caller is responsible for freeing the buffer when
6973 * finished with it, as user-set image data will not be automatically
6974 * freed when the image object is deleted.
6976 * See @ref evas_object_image_data_get() for more details.
6979 EAPI void evas_object_image_data_copy_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
6982 * Mark a sub-region of the given image object to be redrawn.
6984 * @param obj The given image object.
6985 * @param x X-offset of the region to be updated.
6986 * @param y Y-offset of the region to be updated.
6987 * @param w Width of the region to be updated.
6988 * @param h Height of the region to be updated.
6990 * This function schedules a particular rectangular region of an image
6991 * object to be updated (redrawn) at the next rendering cycle.
6993 EAPI void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
6996 * Enable or disable alpha channel usage on the given image object.
6998 * @param obj The given image object.
6999 * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data
7000 * or not (@c EINA_FALSE).
7002 * This function sets a flag on an image object indicating whether or
7003 * not to use alpha channel data. A value of @c EINA_TRUE makes it use
7004 * alpha channel data, and @c EINA_FALSE makes it ignore that
7005 * data. Note that this has nothing to do with an object's color as
7006 * manipulated by evas_object_color_set().
7008 * @see evas_object_image_alpha_get()
7010 EAPI void evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1);
7013 * Retrieve whether alpha channel data is being used on the given
7016 * @param obj The given image object.
7017 * @return Whether the alpha channel data is being used (@c EINA_TRUE)
7018 * or not (@c EINA_FALSE).
7020 * This function returns @c EINA_TRUE if the image object's alpha
7021 * channel is being used, or @c EINA_FALSE otherwise.
7023 * See @ref evas_object_image_alpha_set() for more details.
7025 EAPI Eina_Bool evas_object_image_alpha_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7028 * Sets whether to use high-quality image scaling algorithm on the
7029 * given image object.
7031 * @param obj The given image object.
7032 * @param smooth_scale Whether to use smooth scale or not.
7034 * When enabled, a higher quality image scaling algorithm is used when
7035 * scaling images to sizes other than the source image's original
7036 * one. This gives better results but is more computationally
7039 * @note Image objects get created originally with smooth scaling @b
7042 * @see evas_object_image_smooth_scale_get()
7044 EAPI void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1);
7047 * Retrieves whether the given image object is using high-quality
7048 * image scaling algorithm.
7050 * @param obj The given image object.
7051 * @return Whether smooth scale is being used.
7053 * See @ref evas_object_image_smooth_scale_set() for more details.
7055 EAPI Eina_Bool evas_object_image_smooth_scale_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7058 * Preload an image object's image data in the background
7060 * @param obj The given image object.
7061 * @param cancel @c EINA_FALSE will add it the preloading work queue,
7062 * @c EINA_TRUE will remove it (if it was issued before).
7064 * This function requests the preload of the data image in the
7065 * background. The work is queued before being processed (because
7066 * there might be other pending requests of this type).
7068 * Whenever the image data gets loaded, Evas will call
7069 * #EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on @p obj (what
7070 * may be immediately, if the data was already preloaded before).
7072 * Use @c EINA_TRUE for @p cancel on scenarios where you don't need
7073 * the image data preloaded anymore.
7075 * @note Any evas_object_show() call after evas_object_image_preload()
7076 * will make the latter to be @b cancelled, with the loading process
7077 * now taking place @b synchronously (and, thus, blocking the return
7078 * of the former until the image is loaded). It is highly advisable,
7079 * then, that the user preload an image with it being @b hidden, just
7080 * to be shown on the #EVAS_CALLBACK_IMAGE_PRELOADED event's callback.
7082 EAPI void evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1);
7085 * Reload an image object's image data.
7087 * @param obj The given image object pointer.
7089 * This function reloads the image data bound to image object @p obj.
7091 EAPI void evas_object_image_reload(Evas_Object *obj) EINA_ARG_NONNULL(1);
7094 * Save the given image object's contents to an (image) file.
7096 * @param obj The given image object.
7097 * @param file The filename to be used to save the image (extension
7099 * @param key The image key in the file (if an Eet one), or @c NULL,
7101 * @param flags String containing the flags to be used (@c NULL for
7104 * The extension suffix on @p file will determine which <b>saver
7105 * module</b> Evas is to use when saving, thus the final file's
7106 * format. If the file supports multiple data stored in it (Eet ones),
7107 * you can specify the key to be used as the index of the image in it.
7109 * You can specify some flags when saving the image. Currently
7110 * acceptable flags are @c quality and @c compress. Eg.: @c
7111 * "quality=100 compress=9"
7113 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);
7116 * Import pixels from given source to a given canvas image object.
7118 * @param obj The given canvas object.
7119 * @param pixels The pixel's source to be imported.
7121 * This function imports pixels from a given source to a given canvas image.
7124 EAPI Eina_Bool evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2);
7127 * Set the callback function to get pixels from a canvas' image.
7129 * @param obj The given canvas pointer.
7130 * @param func The callback function.
7131 * @param data The data pointer to be passed to @a func.
7133 * This functions sets a function to be the callback function that get
7134 * pixes from a image of the canvas.
7137 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);
7140 * Mark whether the given image object is dirty and needs to request its pixels.
7142 * @param obj The given image object.
7143 * @param dirty Whether the image is dirty.
7145 * This function will only properly work if a pixels get callback has been set.
7147 * @warning use this function if you really know what you are doing.
7149 * @see evas_object_image_pixels_get_callback_set()
7151 EAPI void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1);
7154 * Retrieves whether the given image object is dirty (needs to be redrawn).
7156 * @param obj The given image object.
7157 * @return Whether the image is dirty.
7159 EAPI Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7162 * Set the DPI resolution of an image object's source image.
7164 * @param obj The given canvas pointer.
7165 * @param dpi The new DPI resolution.
7167 * This function sets the DPI resolution of a given loaded canvas
7168 * image. Most useful for the SVG image loader.
7170 * @see evas_object_image_load_dpi_get()
7172 EAPI void evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1);
7175 * Get the DPI resolution of a loaded image object in the canvas.
7177 * @param obj The given canvas pointer.
7178 * @return The DPI resolution of the given canvas image.
7180 * This function returns the DPI resolution of the given canvas image.
7182 * @see evas_object_image_load_dpi_set() for more details
7184 EAPI double evas_object_image_load_dpi_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7187 * Set the size of a given image object's source image, when loading
7190 * @param obj The given canvas object.
7191 * @param w The new width of the image's load size.
7192 * @param h The new height of the image's load size.
7194 * This function sets a new (loading) size for the given canvas
7197 * @see evas_object_image_load_size_get()
7199 EAPI void evas_object_image_load_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1);
7202 * Get the size of a given image object's source image, when loading
7205 * @param obj The given image object.
7206 * @param w Where to store the new width of the image's load size.
7207 * @param h Where to store the new height of the image's load size.
7209 * @note Use @c NULL pointers on the size components you're not
7210 * interested in: they'll be ignored by the function.
7212 * @see evas_object_image_load_size_set() for more details
7214 EAPI void evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
7217 * Set the scale down factor of a given image object's source image,
7220 * @param obj The given image object pointer.
7221 * @param scale_down The scale down factor.
7223 * This function sets the scale down factor of a given canvas
7224 * image. Most useful for the SVG image loader.
7226 * @see evas_object_image_load_scale_down_get()
7228 EAPI void evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1);
7231 * get the scale down factor of a given image object's source image,
7234 * @param obj The given image object pointer.
7236 * @see evas_object_image_load_scale_down_set() for more details
7238 EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7241 * Inform a given image object to load a selective region of its
7244 * @param obj The given image object pointer.
7245 * @param x X-offset of the region to be loaded.
7246 * @param y Y-offset of the region to be loaded.
7247 * @param w Width of the region to be loaded.
7248 * @param h Height of the region to be loaded.
7250 * This function is useful when one is not showing all of an image's
7251 * area on its image object.
7253 * @note The image loader for the image format in question has to
7254 * support selective region loading in order to this function to take
7257 * @see evas_object_image_load_region_get()
7259 EAPI void evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
7262 * Retrieve the coordinates of a given image object's selective
7263 * (source image) load region.
7265 * @param obj The given image object pointer.
7266 * @param x Where to store the X-offset of the region to be loaded.
7267 * @param y Where to store the Y-offset of the region to be loaded.
7268 * @param w Where to store the width of the region to be loaded.
7269 * @param h Where to store the height of the region to be loaded.
7271 * @note Use @c NULL pointers on the coordinates you're not interested
7272 * in: they'll be ignored by the function.
7274 * @see evas_object_image_load_region_get()
7276 EAPI void evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
7279 * Define if the orientation information in the image file should be honored.
7281 * @param obj The given image object pointer.
7282 * @param enable @c EINA_TRUE means that it should honor the orientation information
7285 EAPI void evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1);
7288 * Get if the orientation information in the image file should be honored.
7290 * @param obj The given image object pointer.
7293 EAPI Eina_Bool evas_object_image_load_orientation_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7296 * Set the colorspace of a given image of the canvas.
7298 * @param obj The given image object pointer.
7299 * @param cspace The new color space.
7301 * This function sets the colorspace of given canvas image.
7304 EAPI void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1);
7307 * Get the colorspace of a given image of the canvas.
7309 * @param obj The given image object pointer.
7310 * @return The colorspace of the image.
7312 * This function returns the colorspace of given canvas image.
7315 EAPI Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7318 * Get the support state of a given image
7320 * @param obj The given image object pointer
7321 * @return The region support state
7324 * This function returns the state of the region support of given image
7326 EAPI Eina_Bool evas_object_image_region_support_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7329 * Set the native surface of a given image of the canvas
7331 * @param obj The given canvas pointer.
7332 * @param surf The new native surface.
7334 * This function sets a native surface of a given canvas image.
7337 EAPI void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2);
7340 * Get the native surface of a given image of the canvas
7342 * @param obj The given canvas pointer.
7343 * @return The native surface of the given canvas image.
7345 * This function returns the native surface of a given canvas image.
7348 EAPI Evas_Native_Surface *evas_object_image_native_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7351 * Set the video surface linked to a given image of the canvas
7353 * @param obj The given canvas pointer.
7354 * @param surf The new video surface.
7357 * This function link a video surface to a given canvas image.
7360 EAPI void evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1);
7363 * Get the video surface linekd to a given image of the canvas
7365 * @param obj The given canvas pointer.
7366 * @return The video surface of the given canvas image.
7369 * This function returns the video surface linked to a given canvas image.
7372 EAPI const Evas_Video_Surface *evas_object_image_video_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7375 * Set the scale hint of a given image of the canvas.
7377 * @param obj The given image object pointer.
7378 * @param hint The scale hint, a value in
7379 * #Evas_Image_Scale_Hint.
7381 * This function sets the scale hint value of the given image object
7382 * in the canvas, which will affect how Evas is to cache scaled
7383 * versions of its original source image.
7385 * @see evas_object_image_scale_hint_get()
7387 EAPI void evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
7390 * Get the scale hint of a given image of the canvas.
7392 * @param obj The given image object pointer.
7393 * @return The scale hint value set on @p obj, a value in
7394 * #Evas_Image_Scale_Hint.
7396 * This function returns the scale hint value of the given image
7397 * object of the canvas.
7399 * @see evas_object_image_scale_hint_set() for more details.
7401 EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7404 * Set the content hint setting of a given image object of the canvas.
7406 * @param obj The given canvas pointer.
7407 * @param hint The content hint value, one of the
7408 * #Evas_Image_Content_Hint ones.
7410 * This function sets the content hint value of the given image of the
7411 * canvas. For example, if you're on the GL engine and your driver
7412 * implementation supports it, setting this hint to
7413 * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies
7414 * at texture upload time, which is an "expensive" operation.
7416 * @see evas_object_image_content_hint_get()
7418 EAPI void evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
7421 * Get the content hint setting of a given image object of the canvas.
7423 * @param obj The given canvas pointer.
7424 * @return hint The content hint value set on it, one of the
7425 * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means
7428 * This function returns the content hint value of the given image of
7431 * @see evas_object_image_content_hint_set()
7433 EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7436 * Enable an image to be used as an alpha mask.
7438 * This will set any flags, and discard any excess image data not used as an
7441 * Note there is little point in using a image as alpha mask unless it has an
7444 * @param obj Object to use as an alpha mask.
7445 * @param ismask Use image as alphamask, must be true.
7447 EAPI void evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1);
7450 * Set the source object on an image object to used as a @b proxy.
7452 * @param obj Proxy (image) object.
7453 * @param src Source object to use for the proxy.
7454 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7456 * If an image object is set to behave as a @b proxy, it will mirror
7457 * the rendering contents of a given @b source object in its drawing
7458 * region, without affecting that source in any way. The source must
7459 * be another valid Evas object. Other effects may be applied to the
7460 * proxy, such as a map (see evas_object_map_set()) to create a
7461 * reflection of the original object (for example).
7463 * Any existing source object on @p obj will be removed after this
7464 * call. Setting @p src to @c NULL clears the proxy object (not in
7465 * "proxy state" anymore).
7467 * @warning You cannot set a proxy as another proxy's source.
7469 * @see evas_object_image_source_get()
7470 * @see evas_object_image_source_unset()
7472 EAPI Eina_Bool evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1);
7475 * Get the current source object of an image object.
7477 * @param obj Image object
7478 * @return Source object (if any), or @c NULL, if not in "proxy mode"
7481 * @see evas_object_image_source_set() for more details
7483 EAPI Evas_Object *evas_object_image_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
7486 * Clear the source object on a proxy image object.
7488 * @param obj Image object to clear source of.
7489 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
7491 * This is equivalent to calling evas_object_image_source_set() with a
7494 EAPI Eina_Bool evas_object_image_source_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
7497 * Check if a file extension may be supported by @ref Evas_Object_Image.
7499 * @param file The file to check
7500 * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7504 * If file is a Eina_Stringshare, use directly @ref evas_object_image_extension_can_load_fast_get.
7506 * This functions is threadsafe.
7508 EAPI Eina_Bool evas_object_image_extension_can_load_get(const char *file);
7511 * Check if a file extension may be supported by @ref Evas_Object_Image.
7513 * @param file The file to check, it should be an Eina_Stringshare.
7514 * @return @c EINA_TRUE if we may be able to open it, @c EINA_FALSE if it's
7518 * This functions is threadsafe.
7520 EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
7523 * Check if an image object can be animated (have multiple frames)
7525 * @param obj Image object
7526 * @return whether obj support animation
7528 * This returns if the image file of an image object is capable of animation
7529 * such as an animated gif file might. This is only useful to be called once
7530 * the image object file has been set.
7534 * extern Evas_Object *obj;
7536 * if (evas_object_image_animated_get(obj))
7540 * Evas_Image_Animated_Loop_Hint loop_type;
7543 * frame_count = evas_object_image_animated_frame_count_get(obj);
7544 * printf("This image has %d frames\n",frame_count);
7546 * duration = evas_object_image_animated_frame_duration_get(obj,1,0);
7547 * printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
7549 * loop_count = evas_object_image_animated_loop_count_get(obj);
7550 * printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
7552 * loop_type = evas_object_image_animated_loop_type_get(obj);
7553 * if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
7554 * printf("You had better set frame like 1->2->3->1->2->3...\n");
7555 * else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
7556 * printf("You had better set frame like 1->2->3->2->1->2...\n");
7558 * printf("Unknown loop type\n");
7560 * evas_object_image_animated_frame_set(obj,1);
7561 * printf("You set image object's frame to 1. You can see frame 1\n");
7565 * @see evas_object_image_animated_get()
7566 * @see evas_object_image_animated_frame_count_get()
7567 * @see evas_object_image_animated_loop_type_get()
7568 * @see evas_object_image_animated_loop_count_get()
7569 * @see evas_object_image_animated_frame_duration_get()
7570 * @see evas_object_image_animated_frame_set()
7573 EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
7576 * Get the total number of frames of the image object.
7578 * @param obj Image object
7579 * @return The number of frames
7581 * This returns total number of frames the image object supports (if animated)
7583 * @see evas_object_image_animated_get()
7584 * @see evas_object_image_animated_frame_count_get()
7585 * @see evas_object_image_animated_loop_type_get()
7586 * @see evas_object_image_animated_loop_count_get()
7587 * @see evas_object_image_animated_frame_duration_get()
7588 * @see evas_object_image_animated_frame_set()
7591 EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
7594 * Get the kind of looping the image object does.
7596 * @param obj Image object
7597 * @return Loop type of the image object
7599 * This returns the kind of looping the image object wants to do.
7601 * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like:
7602 * 1->2->3->1->2->3->1...
7603 * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to
7604 * display frames in a sequence like: 1->2->3->2->1->2->3->1...
7606 * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
7608 * @see evas_object_image_animated_get()
7609 * @see evas_object_image_animated_frame_count_get()
7610 * @see evas_object_image_animated_loop_type_get()
7611 * @see evas_object_image_animated_loop_count_get()
7612 * @see evas_object_image_animated_frame_duration_get()
7613 * @see evas_object_image_animated_frame_set()
7616 EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
7619 * Get the number times the animation of the object loops.
7621 * @param obj Image object
7622 * @return The number of loop of an animated image object
7624 * This returns loop count of image. The loop count is the number of times
7625 * the animation will play fully from first to last frame until the animation
7626 * should stop (at the final frame).
7628 * If 0 is returned, then looping should happen indefinitely (no limit to
7629 * the number of times it loops).
7631 * @see evas_object_image_animated_get()
7632 * @see evas_object_image_animated_frame_count_get()
7633 * @see evas_object_image_animated_loop_type_get()
7634 * @see evas_object_image_animated_loop_count_get()
7635 * @see evas_object_image_animated_frame_duration_get()
7636 * @see evas_object_image_animated_frame_set()
7639 EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
7642 * Get the duration of a sequence of frames.
7644 * @param obj Image object
7645 * @param start_frame The first frame
7646 * @param fram_num Number of frames in the sequence
7648 * This returns total duration that the specified sequence of frames should
7651 * If you set start_frame to 1 and frame_num 0, you get frame 1's duration
7652 * If you set start_frame to 1 and frame_num 1, you get frame 1's duration +
7655 * @see evas_object_image_animated_get()
7656 * @see evas_object_image_animated_frame_count_get()
7657 * @see evas_object_image_animated_loop_type_get()
7658 * @see evas_object_image_animated_loop_count_get()
7659 * @see evas_object_image_animated_frame_duration_get()
7660 * @see evas_object_image_animated_frame_set()
7663 EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num);
7666 * Set the frame to current frame of an image object
7668 * @param obj The given image object.
7669 * @param frame_num The index of current frame
7671 * This set image object's current frame to frame_num with 1 being the first
7674 * @see evas_object_image_animated_get()
7675 * @see evas_object_image_animated_frame_count_get()
7676 * @see evas_object_image_animated_loop_type_get()
7677 * @see evas_object_image_animated_loop_count_get()
7678 * @see evas_object_image_animated_frame_duration_get()
7679 * @see evas_object_image_animated_frame_set()
7682 EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
7688 * @defgroup Evas_Object_Text Text Object Functions
7690 * Functions that operate on single line, single style text objects.
7692 * For multiline and multiple style text, see @ref Evas_Object_Textblock.
7694 * See some @ref Example_Evas_Text "examples" on this group of functions.
7696 * @warning We don't guarantee any proper results if you create a Text object
7697 * without setting the evas engine.
7699 * @ingroup Evas_Object_Specific
7703 * @addtogroup Evas_Object_Text
7707 /* basic styles (4 bits allocated use 0->10 now, 5 left) */
7708 #define EVAS_TEXT_STYLE_MASK_BASIC 0xf
7711 * Text style type creation macro. Use style types on the 's'
7712 * arguments, being 'x' your style variable.
7714 #define EVAS_TEXT_STYLE_BASIC_SET(x, s) \
7715 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
7717 #define EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION (0x7 << 4)
7720 * Text style type creation macro. This one will impose shadow
7721 * directions on the style type variable -- use the @c
7722 * EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.
7724 #define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) \
7725 do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
7727 typedef enum _Evas_Text_Style_Type
7729 EVAS_TEXT_STYLE_PLAIN, /**< plain, standard text */
7730 EVAS_TEXT_STYLE_SHADOW, /**< text with shadow underneath */
7731 EVAS_TEXT_STYLE_OUTLINE, /**< text with an outline */
7732 EVAS_TEXT_STYLE_SOFT_OUTLINE, /**< text with a soft outline */
7733 EVAS_TEXT_STYLE_GLOW, /**< text with a glow effect */
7734 EVAS_TEXT_STYLE_OUTLINE_SHADOW, /**< text with both outline and shadow effects */
7735 EVAS_TEXT_STYLE_FAR_SHADOW, /**< text with (far) shadow underneath */
7736 EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, /**< text with outline and soft shadow effects combined */
7737 EVAS_TEXT_STYLE_SOFT_SHADOW, /**< text with (soft) shadow underneath */
7738 EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, /**< text with (far soft) shadow underneath */
7740 /* OR these to modify shadow direction (3 bits needed) */
7741 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), /**< shadow growing to bottom right */
7742 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4), /**< shadow growing to the bottom */
7743 EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4), /**< shadow growing to bottom left */
7744 EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4), /**< shadow growing to the left */
7745 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4), /**< shadow growing to top left */
7746 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4), /**< shadow growing to the top */
7747 EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4), /**< shadow growing to top right */
7748 EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< shadow growing to the right */
7749 } 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 */
7752 * Creates a new text object on the provided canvas.
7754 * @param e The canvas to create the text object on.
7755 * @return @c NULL on error, a pointer to a new text object on
7758 * Text objects are for simple, single line text elements. If you want
7759 * more elaborated text blocks, see @ref Evas_Object_Textblock.
7761 * @see evas_object_text_font_source_set()
7762 * @see evas_object_text_font_set()
7763 * @see evas_object_text_text_set()
7765 EAPI Evas_Object *evas_object_text_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
7768 * Set the font (source) file to be used on a given text object.
7770 * @param obj The text object to set font for.
7771 * @param font The font file's path.
7773 * This function allows the font file to be explicitly set for a given
7774 * text object, overriding system lookup, which will first occur in
7775 * the given file's contents.
7777 * @see evas_object_text_font_get()
7779 EAPI void evas_object_text_font_source_set(Evas_Object *obj, const char *font) EINA_ARG_NONNULL(1);
7782 * Get the font file's path which is being used on a given text
7785 * @param obj The text object to set font for.
7786 * @return The font file's path.
7788 * @see evas_object_text_font_get() for more details
7790 EAPI const char *evas_object_text_font_source_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7793 * Set the font family and size on a given text object.
7795 * @param obj The text object to set font for.
7796 * @param font The font (family) name.
7797 * @param size The font size, in points.
7799 * This function allows the font name and size of a text object to be
7800 * set. The @p font string has to follow fontconfig's convention on
7801 * naming fonts, as it's the underlying library used to query system
7802 * fonts by Evas (see the @c fc-list command's output, on your system,
7805 * @see evas_object_text_font_get()
7806 * @see evas_object_text_font_source_set()
7808 EAPI void evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size) EINA_ARG_NONNULL(1);
7811 * Retrieve the font family and size in use on a given text object.
7813 * @param obj The evas text object to query for font information.
7814 * @param font A pointer to the location to store the font name in.
7815 * @param size A pointer to the location to store the font size in.
7817 * This function allows the font name and size of a text object to be
7818 * queried. Be aware that the font name string is still owned by Evas
7819 * and should @b not have free() called on it by the caller of the
7822 * @see evas_object_text_font_set()
7824 EAPI void evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_Size *size) EINA_ARG_NONNULL(1);
7827 * Sets the text string to be displayed by the given text object.
7829 * @param obj The text object to set text string on.
7830 * @param text Text string to display on it.
7832 * @see evas_object_text_text_get()
7834 EAPI void evas_object_text_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
7837 * Retrieves the text string currently being displayed by the given
7840 * @param obj The given text object.
7841 * @return The text string currently being displayed on it.
7843 * @note Do not free() the return value.
7845 * @see evas_object_text_text_set()
7847 EAPI const char *evas_object_text_text_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7850 * @brief Sets the BiDi delimiters used in the textblock.
7852 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7853 * is useful for example in recipients fields of e-mail clients where bidi
7854 * oddities can occur when mixing RTL and LTR.
7856 * @param obj The given text object.
7857 * @param delim A null terminated string of delimiters, e.g ",|".
7860 EAPI void evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim);
7863 * @brief Gets the BiDi delimiters used in the textblock.
7865 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
7866 * is useful for example in recipients fields of e-mail clients where bidi
7867 * oddities can occur when mixing RTL and LTR.
7869 * @param obj The given text object.
7870 * @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
7873 EAPI const char *evas_object_text_bidi_delimiters_get(const Evas_Object *obj);
7875 EAPI Evas_Coord evas_object_text_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7876 EAPI Evas_Coord evas_object_text_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7877 EAPI Evas_Coord evas_object_text_max_ascent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7878 EAPI Evas_Coord evas_object_text_max_descent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7879 EAPI Evas_Coord evas_object_text_horiz_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7880 EAPI Evas_Coord evas_object_text_vert_advance_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7881 EAPI Evas_Coord evas_object_text_inset_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7884 * Retrieve position and dimension information of a character within a text @c Evas_Object.
7886 * This function is used to obtain the X, Y, width and height of a the character
7887 * located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
7888 * as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
7889 * @p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
7892 * @param obj The text object to retrieve position information for.
7893 * @param pos The character position to request co-ordinates for.
7894 * @param cx A pointer to an @c Evas_Coord to store the X value in (can be NULL).
7895 * @param cy A pointer to an @c Evas_Coord to store the Y value in (can be NULL).
7896 * @param cw A pointer to an @c Evas_Coord to store the Width value in (can be NULL).
7897 * @param ch A pointer to an @c Evas_Coord to store the Height value in (can be NULL).
7899 * @return @c EINA_FALSE on success, @c EINA_TRUE on error.
7901 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);
7902 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);
7905 * Returns the logical position of the last char in the text
7906 * up to the pos given. this is NOT the position of the last char
7907 * because of the possibility of RTL in the text.
7909 EAPI int evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
7912 * Retrieves the style on use on the given text object.
7914 * @param obj the given text object to set style on.
7915 * @return the style type in use.
7917 * @see evas_object_text_style_set() for more details.
7919 EAPI Evas_Text_Style_Type evas_object_text_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
7922 * Sets the style to apply on the given text object.
7924 * @param obj the given text object to set style on.
7925 * @param type a style type.
7927 * Text object styles are one of the values in
7928 * #Evas_Text_Style_Type. Some of those values are combinations of
7929 * more than one style, and some account for the direction of the
7930 * rendering of shadow effects.
7932 * @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
7933 * #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
7935 * The following figure illustrates the text styles:
7937 * @image html text-styles.png
7938 * @image rtf text-styles.png
7939 * @image latex text-styles.eps
7941 * @see evas_object_text_style_get()
7942 * @see evas_object_text_shadow_color_set()
7943 * @see evas_object_text_outline_color_set()
7944 * @see evas_object_text_glow_color_set()
7945 * @see evas_object_text_glow2_color_set()
7947 EAPI void evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type type) EINA_ARG_NONNULL(1);
7950 * Sets the shadow color for the given text object.
7952 * @param obj The given Evas text object.
7953 * @param r The red component of the given color.
7954 * @param g The green component of the given color.
7955 * @param b The blue component of the given color.
7956 * @param a The alpha component of the given color.
7958 * Shadow effects, which are fading colors decorating the text
7959 * underneath it, will just be shown if the object is set to one of
7960 * the following styles:
7962 * - #EVAS_TEXT_STYLE_SHADOW
7963 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
7964 * - #EVAS_TEXT_STYLE_FAR_SHADOW
7965 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
7966 * - #EVAS_TEXT_STYLE_SOFT_SHADOW
7967 * - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
7969 * One can also change the direction where the shadow grows to, with
7970 * evas_object_text_style_set().
7972 * @see evas_object_text_shadow_color_get()
7974 EAPI void evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
7977 * Retrieves the shadow color for the given text object.
7979 * @param obj The given Evas text object.
7980 * @param r Pointer to variable to hold the red component of the given
7982 * @param g Pointer to variable to hold the green component of the
7984 * @param b Pointer to variable to hold the blue component of the
7986 * @param a Pointer to variable to hold the alpha component of the
7989 * @note Use @c NULL pointers on the color components you're not
7990 * interested in: they'll be ignored by the function.
7992 * @see evas_object_text_shadow_color_set() for more details.
7994 EAPI void evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
7997 * Sets the glow color for the given text object.
7999 * @param obj The given Evas text object.
8000 * @param r The red component of the given color.
8001 * @param g The green component of the given color.
8002 * @param b The blue component of the given color.
8003 * @param a The alpha component of the given color.
8005 * Glow effects, which are glowing colors decorating the text's
8006 * surroundings, will just be shown if the object is set to the
8007 * #EVAS_TEXT_STYLE_GLOW style.
8009 * @note Glow effects are placed from a short distance of the text
8010 * itself, but no touching it. For glowing effects right on the
8011 * borders of the glyphs, see 'glow 2' effects
8012 * (evas_object_text_glow2_color_set()).
8014 * @see evas_object_text_glow_color_get()
8016 EAPI void evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8019 * Retrieves the glow color for the given text object.
8021 * @param obj The given Evas text object.
8022 * @param r Pointer to variable to hold the red component of the given
8024 * @param g Pointer to variable to hold the green component of the
8026 * @param b Pointer to variable to hold the blue component of the
8028 * @param a Pointer to variable to hold the alpha component of the
8031 * @note Use @c NULL pointers on the color components you're not
8032 * interested in: they'll be ignored by the function.
8034 * @see evas_object_text_glow_color_set() for more details.
8036 EAPI void evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8039 * Sets the 'glow 2' color for the given text object.
8041 * @param obj The given Evas text object.
8042 * @param r The red component of the given color.
8043 * @param g The green component of the given color.
8044 * @param b The blue component of the given color.
8045 * @param a The alpha component of the given color.
8047 * 'Glow 2' effects, which are glowing colors decorating the text's
8048 * (immediate) surroundings, will just be shown if the object is set
8049 * to the #EVAS_TEXT_STYLE_GLOW style. See also
8050 * evas_object_text_glow_color_set().
8052 * @see evas_object_text_glow2_color_get()
8054 EAPI void evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8057 * Retrieves the 'glow 2' color for the given text object.
8059 * @param obj The given Evas text object.
8060 * @param r Pointer to variable to hold the red component of the given
8062 * @param g Pointer to variable to hold the green component of the
8064 * @param b Pointer to variable to hold the blue component of the
8066 * @param a Pointer to variable to hold the alpha component of the
8069 * @note Use @c NULL pointers on the color components you're not
8070 * interested in: they'll be ignored by the function.
8072 * @see evas_object_text_glow2_color_set() for more details.
8074 EAPI void evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8077 * Sets the outline color for the given text object.
8079 * @param obj The given Evas text object.
8080 * @param r The red component of the given color.
8081 * @param g The green component of the given color.
8082 * @param b The blue component of the given color.
8083 * @param a The alpha component of the given color.
8085 * Outline effects (colored lines around text glyphs) will just be
8086 * shown if the object is set to one of the following styles:
8087 * - #EVAS_TEXT_STYLE_OUTLINE
8088 * - #EVAS_TEXT_STYLE_SOFT_OUTLINE
8089 * - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
8090 * - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
8092 * @see evas_object_text_outline_color_get()
8094 EAPI void evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
8097 * Retrieves the outline color for the given text object.
8099 * @param obj The given Evas text object.
8100 * @param r Pointer to variable to hold the red component of the given
8102 * @param g Pointer to variable to hold the green component of the
8104 * @param b Pointer to variable to hold the blue component of the
8106 * @param a Pointer to variable to hold the alpha component of the
8109 * @note Use @c NULL pointers on the color components you're not
8110 * interested in: they'll be ignored by the function.
8112 * @see evas_object_text_outline_color_set() for more details.
8114 EAPI void evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
8117 * Gets the text style pad of a text object.
8119 * @param obj The given text object.
8120 * @param l The left pad (or @c NULL).
8121 * @param r The right pad (or @c NULL).
8122 * @param t The top pad (or @c NULL).
8123 * @param b The bottom pad (or @c NULL).
8126 EAPI void evas_object_text_style_pad_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
8129 * Retrieves the direction of the text currently being displayed in the
8131 * @param obj The given evas text object.
8132 * @return the direction of the text
8134 EAPI Evas_BiDi_Direction evas_object_text_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
8141 * @defgroup Evas_Object_Textblock Textblock Object Functions
8143 * Functions used to create and manipulate textblock objects. Unlike
8144 * @ref Evas_Object_Text, these handle complex text, doing multiple
8145 * styles and multiline text based on HTML-like tags. Of these extra
8146 * features will be heavier on memory and processing cost.
8148 * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
8150 * This part explains about the textblock object's API and proper usage.
8151 * The main user of the textblock object is the edje entry object in Edje, so
8152 * that's a good place to learn from, but I think this document is more than
8153 * enough, if it's not, please contact me and I'll update it.
8155 * @subsection textblock_intro Introduction
8156 * The textblock objects is, as implied, an object that can show big chunks of
8157 * text. Textblock supports many features including: Text formatting, automatic
8158 * and manual text alignment, embedding items (for example icons) and more.
8159 * Textblock has three important parts, the text paragraphs, the format nodes
8162 * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
8163 * You can also put more than one style directive in one tag:
8164 * "<font_size=50 color=#F00>Big and Red!</font_size>".
8165 * Please notice that we used "</font_size>" although the format also included
8166 * color, this is because the first format determines the matching closing tag's
8167 * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
8168 * just pop any type of format, but it's advised to use the named alternatives
8171 * @subsection textblock_cursors Textblock Object Cursors
8172 * A textblock Cursor is data type that represents
8173 * a position in a textblock. Each cursor contains information about the
8174 * paragraph it points to, the position in that paragraph and the object itself.
8175 * Cursors register to textblock objects upon creation, this means that once
8176 * you created a cursor, it belongs to a specific obj and you can't for example
8177 * copy a cursor "into" a cursor of a different object. Registered cursors
8178 * also have the added benefit of updating automatically upon textblock changes,
8179 * this means that if you have a cursor pointing to a specific character, it'll
8180 * still point to it even after you change the whole object completely (as long
8181 * as the char was not deleted), this is not possible without updating, because
8182 * as mentioned, each cursor holds a character position. There are many
8183 * functions that handle cursors, just check out the evas_textblock_cursor*
8184 * functions. For creation and deletion of cursors check out:
8185 * @see evas_object_textblock_cursor_new()
8186 * @see evas_textblock_cursor_free()
8187 * @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).
8189 * @subsection textblock_paragraphs Textblock Object Paragraphs
8190 * The textblock object is made out of text splitted to paragraphs (delimited
8191 * by the paragraph separation character). Each paragraph has many (or none)
8192 * format nodes associated with it which are responsible for the formatting
8193 * of that paragraph.
8195 * @subsection textblock_format_nodes Textblock Object Format Nodes
8196 * As explained in @ref textblock_paragraphs each one of the format nodes
8197 * is associated with a paragraph.
8198 * There are two types of format nodes, visible and invisible:
8199 * Visible: formats that a cursor can point to, i.e formats that
8200 * occupy space, for example: newlines, tabs, items and etc. Some visible items
8201 * are made of two parts, in this case, only the opening tag is visible.
8202 * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
8203 * Invisible: formats that don't occupy space, for example: bold and underline.
8204 * Being able to access format nodes is very important for some uses. For
8205 * example, edje uses the "<a>" format to create links in the text (and pop
8206 * popups above them when clicked). For the textblock object a is just a
8207 * formatting instruction (how to color the text), but edje utilizes the access
8208 * to the format nodes to make it do more.
8209 * For more information, take a look at all the evas_textblock_node_format_*
8211 * The translation of "<tag>" tags to actual format is done according to the
8212 * tags defined in the style, see @ref evas_textblock_style_set
8214 * @subsection textblock_special_formats Special Formats
8215 * Textblock supports various format directives that can be used in markup. In
8216 * addition to the mentioned format directives, textblock allows creating
8217 * additional format directives using "tags" that can be set in the style see
8218 * @ref evas_textblock_style_set .
8220 * Textblock supports the following formats:
8221 * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
8222 * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
8223 * @li font_style - Overrides the style defined in "font". E.g: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
8224 * @li font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
8225 * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
8226 * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
8227 * @li font_size - The font size in points.
8228 * @li font_source - The source of the font, e.g an eet file.
8229 * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8230 * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8231 * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8232 * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8233 * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8234 * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8235 * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8236 * @li backing_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8237 * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
8238 * @li align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
8239 * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
8240 * @li wrap - "word", "char", "mixed", or "none".
8241 * @li left_margin - Either "reset", or a pixel value indicating the margin.
8242 * @li right_margin - Either "reset", or a pixel value indicating the margin.
8243 * @li underline - "on", "off", "single", or "double".
8244 * @li strikethrough - "on" or "off"
8245 * @li backing - "on" or "off"
8246 * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
8247 * @li tabstops - Pixel value for tab width.
8248 * @li linesize - Force a line size in pixels.
8249 * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8250 * @li linegap - Force a line gap in pixels.
8251 * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
8252 * @li item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
8253 * @li linefill - Either a float value or percentage indicating how much to fill the line.
8254 * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
8255 * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
8257 * @warning We don't guarantee any proper results if you create a Textblock
8259 * without setting the evas engine.
8261 * @todo put here some usage examples
8263 * @ingroup Evas_Object_Specific
8268 typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
8269 typedef struct _Evas_Textblock_Cursor Evas_Textblock_Cursor;
8271 * @typedef Evas_Object_Textblock_Node_Format
8274 typedef struct _Evas_Object_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
8275 typedef struct _Evas_Textblock_Rectangle Evas_Textblock_Rectangle;
8277 struct _Evas_Textblock_Rectangle
8279 Evas_Coord x, y, w, h;
8282 typedef enum _Evas_Textblock_Text_Type
8284 EVAS_TEXTBLOCK_TEXT_RAW,
8285 EVAS_TEXTBLOCK_TEXT_PLAIN,
8286 EVAS_TEXTBLOCK_TEXT_MARKUP
8287 } Evas_Textblock_Text_Type;
8289 typedef enum _Evas_Textblock_Cursor_Type
8291 EVAS_TEXTBLOCK_CURSOR_UNDER,
8292 EVAS_TEXTBLOCK_CURSOR_BEFORE
8293 } Evas_Textblock_Cursor_Type;
8296 * Adds a textblock to the given evas.
8297 * @param e The given evas.
8298 * @return The new textblock object.
8300 EAPI Evas_Object *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8303 * Returns the unescaped version of escape.
8304 * @param escape the string to be escaped
8305 * @return the unescaped version of escape
8307 EAPI const char *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8310 * Returns the escaped version of the string.
8311 * @param string to escape
8312 * @param len_ret the len of the part of the string that was used.
8313 * @return the escaped string.
8315 EAPI const char *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8318 * Return the unescaped version of the string between start and end.
8320 * @param escape_start the start of the string.
8321 * @param escape_end the end of the string.
8322 * @return the unescaped version of the range
8324 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);
8327 * Return the plain version of the markup.
8329 * Works as if you set the markup to a textblock and then retrieve the plain
8330 * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
8331 * the actual char and etc.
8333 * @param obj The textblock object to work with. (if @c NULL, tries the
8335 * @param text The markup text (if @c NULL, return @c NULL).
8336 * @return An allocated plain text version of the markup.
8339 EAPI char *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8342 * Return the markup version of the plain text.
8344 * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
8345 * plain text to be set in a textblock.
8347 * @param obj the textblock object to work with (if @c NULL, it just does the
8348 * default behaviour, i.e with no extra object information).
8349 * @param text The markup text (if @c NULL, return @c NULL).
8350 * @return An allocated plain text version of the markup.
8353 EAPI char *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8356 * Creates a new textblock style.
8357 * @return The new textblock style.
8359 EAPI Evas_Textblock_Style *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
8362 * Destroys a textblock style.
8363 * @param ts The textblock style to free.
8365 EAPI void evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8368 * Sets the style ts to the style passed as text by text.
8369 * Expected a string consisting of many (or none) tag='format' pairs.
8371 * @param ts the style to set.
8372 * @param text the text to parse - NOT NULL.
8373 * @return Returns no value.
8375 EAPI void evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
8378 * Return the text of the style ts.
8379 * @param ts the style to get it's text.
8380 * @return the text of the style or null on error.
8382 EAPI const char *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8385 * Set the objects style to ts.
8386 * @param obj the Evas object to set the style to.
8387 * @param ts the style to set.
8388 * @return Returns no value.
8390 EAPI void evas_object_textblock_style_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8393 * Return the style of an object.
8394 * @param obj the object to get the style from.
8395 * @return the style of the object.
8397 EAPI const Evas_Textblock_Style *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8400 * Push ts to the top of the user style stack.
8402 * FIXME: API is solid but currently only supports 1 style in the stack.
8404 * The user style overrides the corresponding elements of the regular style.
8405 * This is the proper way to do theme overrides in code.
8406 * @param obj the Evas object to set the style to.
8407 * @param ts the style to set.
8408 * @return Returns no value.
8409 * @see evas_object_textblock_style_set
8412 EAPI void evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
8415 * Del the from the top of the user style stack.
8417 * @param obj the object to get the style from.
8418 * @see evas_object_textblock_style_get
8421 EAPI void evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
8424 * Get (don't remove) the style at the top of the user style stack.
8426 * @param obj the object to get the style from.
8427 * @return the style of the object.
8428 * @see evas_object_textblock_style_get
8431 EAPI const Evas_Textblock_Style *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8434 * @brief Set the "replacement character" to use for the given textblock object.
8436 * @param obj The given textblock object.
8437 * @param ch The charset name.
8439 EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
8442 * @brief Get the "replacement character" for given textblock object. Returns
8443 * @c NULL if no replacement character is in use.
8445 * @param obj The given textblock object
8446 * @return Replacement character or @c NULL.
8448 EAPI const char *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8451 * @brief Sets the vertical alignment of text within the textblock object
8454 * Normally alignment is 0.0 (top of object). Values given should be
8455 * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
8458 * @param obj The given textblock object.
8459 * @param align A value between @c 0.0 and @c 1.0.
8462 EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
8465 * @brief Gets the vertical alignment of a textblock
8467 * @param obj The given textblock object.
8468 * @return The alignment set for the object.
8471 EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
8474 * @brief Sets the BiDi delimiters used in the textblock.
8476 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8477 * is useful for example in recipients fields of e-mail clients where bidi
8478 * oddities can occur when mixing RTL and LTR.
8480 * @param obj The given textblock object.
8481 * @param delim A null terminated string of delimiters, e.g ",|".
8484 EAPI void evas_object_textblock_bidi_delimiters_set(Evas_Object *obj, const char *delim);
8487 * @brief Gets the BiDi delimiters used in the textblock.
8489 * BiDi delimiters are use for in-paragraph separation of bidi segments. This
8490 * is useful for example in recipients fields of e-mail clients where bidi
8491 * oddities can occur when mixing RTL and LTR.
8493 * @param obj The given textblock object.
8494 * @return A null terminated string of delimiters, e.g ",|". If empty, returns
8498 EAPI const char *evas_object_textblock_bidi_delimiters_get(const Evas_Object *obj);
8501 * @brief Sets newline mode. When true, newline character will behave
8502 * as a paragraph separator.
8504 * @param obj The given textblock object.
8505 * @param mode @c EINA_TRUE for legacy mode, @c EINA_FALSE otherwise.
8508 EAPI void evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
8511 * @brief Gets newline mode. When true, newline character behaves
8512 * as a paragraph separator.
8514 * @param obj The given textblock object.
8515 * @return @c EINA_TRUE if in legacy mode, @c EINA_FALSE otherwise.
8518 EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8521 * Sets the tetxblock's text to the markup text.
8523 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8525 * @param obj the textblock object.
8526 * @param text the markup text to use.
8527 * @return Return no value.
8529 EAPI void evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
8532 * Prepends markup to the cursor cur.
8534 * @note assumes text does not include the unicode object replacement char (0xFFFC)
8536 * @param cur the cursor to prepend to.
8537 * @param text the markup text to prepend.
8538 * @return Return no value.
8540 EAPI void evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8543 * Return the markup of the object.
8545 * @param obj the Evas object.
8546 * @return the markup text of the object.
8548 EAPI const char *evas_object_textblock_text_markup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8551 * Return the object's main cursor.
8553 * @param obj the object.
8554 * @return The @p obj's main cursor.
8556 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8559 * Create a new cursor, associate it to the obj and init it to point
8560 * to the start of the textblock. Association to the object means the cursor
8561 * will be updated when the object will change.
8563 * @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).
8565 * @param obj the object to associate to.
8566 * @return the new cursor.
8568 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8571 * Free the cursor and unassociate it from the object.
8572 * @note do not use it to free unassociated cursors.
8574 * @param cur the cursor to free.
8575 * @return Returns no value.
8577 EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8580 * Sets the cursor to the start of the first text node.
8582 * @param cur the cursor to update.
8583 * @return Returns no value.
8585 EAPI void evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8588 * sets the cursor to the end of the last text node.
8590 * @param cur the cursor to set.
8591 * @return Returns no value.
8593 EAPI void evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8596 * Advances to the start of the next text node
8598 * @param cur the cursor to update
8599 * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8602 EAPI Eina_Bool evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8605 * Advances to the end of the previous text node
8607 * @param cur the cursor to update
8608 * @return @c EINA_TRUE if it managed to advance a paragraph, @c EINA_FALSE
8611 EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8616 * @param obj The evas, must not be @c NULL.
8617 * @param anchor the anchor name to get
8618 * @return Returns the list format node corresponding to the anchor, may be null if there are none.
8620 EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1, 2);
8623 * Returns the first format node.
8625 * @param obj The evas, must not be @c NULL.
8626 * @return Returns the first format node, may be null if there are none.
8628 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_first_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8631 * Returns the last format node.
8633 * @param obj The evas textblock, must not be NULL.
8634 * @return Returns the first format node, may be null if there are none.
8636 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_last_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
8639 * Returns the next format node (after n)
8641 * @param n the current format node - not null.
8642 * @return Returns the next format node, may be null.
8644 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8647 * Returns the prev format node (after n)
8649 * @param n the current format node - not null.
8650 * @return Returns the prev format node, may be null.
8652 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
8655 * Remove a format node and it's match. i.e, removes a \<tag\> \</tag\> pair.
8656 * Assumes the node is the first part of \<tag\> i.e, this won't work if
8657 * n is a closing tag.
8659 * @param obj the Evas object of the textblock - not null.
8660 * @param n the current format node - not null.
8662 EAPI void evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8665 * Sets the cursor to point to the place where format points to.
8667 * @param cur the cursor to update.
8668 * @param n the format node to update according.
8669 * @deprecated duplicate of evas_textblock_cursor_at_format_set
8671 EAPI void evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
8674 * Return the format node at the position pointed by cur.
8676 * @param cur the position to look at.
8677 * @return the format node if found, @c NULL otherwise.
8678 * @see evas_textblock_cursor_format_is_visible_get()
8680 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8683 * Get the text format representation of the format node.
8685 * @param fnode the format node.
8686 * @return the textual format of the format node.
8688 EAPI const char *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8691 * Set the cursor to point to the position of fmt.
8693 * @param cur the cursor to update
8694 * @param fmt the format to update according to.
8696 EAPI void evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
8699 * Check if the current cursor position is a visible format. This way is more
8700 * efficient than evas_textblock_cursor_format_get() to check for the existence
8701 * of a visible format.
8703 * @param cur the cursor to look at.
8704 * @return @c EINA_TRUE if the cursor points to a visible format, @c EINA_FALSE
8706 * @see evas_textblock_cursor_format_get()
8708 EAPI Eina_Bool evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8711 * Advances to the next format node
8713 * @param cur the cursor to be updated.
8714 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8716 EAPI Eina_Bool evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8719 * Advances to the previous format node.
8721 * @param cur the cursor to update.
8722 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8724 EAPI Eina_Bool evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8727 * Returns true if the cursor points to a format.
8729 * @param cur the cursor to check.
8730 * @return @c EINA_TRUE if a cursor points to a format @c EINA_FALSE
8733 EAPI Eina_Bool evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8736 * Advances 1 char forward.
8738 * @param cur the cursor to advance.
8739 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8741 EAPI Eina_Bool evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8744 * Advances 1 char backward.
8746 * @param cur the cursor to advance.
8747 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8749 EAPI Eina_Bool evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8752 * Moves the cursor to the start of the word under the cursor.
8754 * @param cur the cursor to move.
8755 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8758 EAPI Eina_Bool evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8761 * Moves the cursor to the end of the word under the cursor.
8763 * @param cur the cursor to move.
8764 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
8767 EAPI Eina_Bool evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8770 * Go to the first char in the node the cursor is pointing on.
8772 * @param cur the cursor to update.
8773 * @return Returns no value.
8775 EAPI void evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8778 * Go to the last char in a text node.
8780 * @param cur the cursor to update.
8781 * @return Returns no value.
8783 EAPI void evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8786 * Go to the start of the current line
8788 * @param cur the cursor to update.
8789 * @return Returns no value.
8791 EAPI void evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8794 * Go to the end of the current line.
8796 * @param cur the cursor to update.
8797 * @return Returns no value.
8799 EAPI void evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8802 * Return the current cursor pos.
8804 * @param cur the cursor to take the position from.
8805 * @return the position or -1 on error
8807 EAPI int evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8810 * Set the cursor pos.
8812 * @param cur the cursor to be set.
8813 * @param pos the pos to set.
8815 EAPI void evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int pos) EINA_ARG_NONNULL(1);
8818 * Go to the start of the line passed
8820 * @param cur cursor to update.
8821 * @param line numer to set.
8822 * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
8824 EAPI Eina_Bool evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
8827 * Compare two cursors.
8829 * @param cur1 the first cursor.
8830 * @param cur2 the second cursor.
8831 * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
8833 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);
8836 * Make cur_dest point to the same place as cur. Does not work if they don't
8837 * point to the same object.
8839 * @param cur the source cursor.
8840 * @param cur_dest destination cursor.
8841 * @return Returns no value.
8843 EAPI void evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) EINA_ARG_NONNULL(1, 2);
8846 * Adds text to the current cursor position and set the cursor to *before*
8847 * the start of the text just added.
8849 * @param cur the cursor to where to add text at.
8850 * @param text the text to add.
8851 * @return Returns the len of the text added.
8852 * @see evas_textblock_cursor_text_prepend()
8854 EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8857 * Adds text to the current cursor position and set the cursor to *after*
8858 * the start of the text just added.
8860 * @param cur the cursor to where to add text at.
8861 * @param text the text to add.
8862 * @return Returns the len of the text added.
8863 * @see evas_textblock_cursor_text_append()
8865 EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
8868 * Adds format to the current cursor position. If the format being added is a
8869 * visible format, add it *before* the cursor position, otherwise, add it after.
8870 * This behavior is because visible formats are like characters and invisible
8871 * should be stacked in a way that the last one is added last.
8873 * This function works with native formats, that means that style defined
8874 * tags like <br> won't work here. For those kind of things use markup prepend.
8876 * @param cur the cursor to where to add format at.
8877 * @param format the format to add.
8878 * @return Returns true if a visible format was added, false otherwise.
8879 * @see evas_textblock_cursor_format_prepend()
8883 * Check if the current cursor position points to the terminating null of the
8884 * last paragraph. (shouldn't be allowed to point to the terminating null of
8885 * any previous paragraph anyway.
8887 * @param cur the cursor to look at.
8888 * @return @c EINA_TRUE if the cursor points to the terminating null, @c EINA_FALSE otherwise.
8890 EAPI Eina_Bool evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8893 * Adds format to the current cursor position. If the format being added is a
8894 * visible format, add it *before* the cursor position, otherwise, add it after.
8895 * This behavior is because visible formats are like characters and invisible
8896 * should be stacked in a way that the last one is added last.
8897 * If the format is visible the cursor is advanced after it.
8899 * This function works with native formats, that means that style defined
8900 * tags like <br> won't work here. For those kind of things use markup prepend.
8902 * @param cur the cursor to where to add format at.
8903 * @param format the format to add.
8904 * @return Returns true if a visible format was added, false otherwise.
8905 * @see evas_textblock_cursor_format_prepend()
8907 EAPI Eina_Bool evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
8910 * Delete the character at the location of the cursor. If there's a format
8911 * pointing to this position, delete it as well.
8913 * @param cur the cursor pointing to the current location.
8914 * @return Returns no value.
8916 EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
8919 * Delete the range between cur1 and cur2.
8921 * @param cur1 one side of the range.
8922 * @param cur2 the second side of the range
8923 * @return Returns no value.
8925 EAPI void evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
8928 * Return the text of the paragraph cur points to - returns the text in markup.
8930 * @param cur the cursor pointing to the paragraph.
8931 * @return the text on success, @c NULL otherwise.
8933 EAPI const char *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8936 * Return the length of the paragraph, cheaper the eina_unicode_strlen()
8938 * @param cur the position of the paragraph.
8939 * @return the length of the paragraph on success, -1 otehrwise.
8941 EAPI int evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
8944 * Return the currently visible range.
8946 * @param start the start of the range.
8947 * @param end the end of the range.
8948 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
8951 EAPI Eina_Bool evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
8954 * Return the format nodes in the range between cur1 and cur2.
8956 * @param cur1 one side of the range.
8957 * @param cur2 the other side of the range
8958 * @return the foramt nodes in the range. You have to free it.
8961 EAPI Eina_List *evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
8964 * Return the text in the range between cur1 and cur2
8966 * @param cur1 one side of the range.
8967 * @param cur2 the other side of the range
8968 * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
8969 * @return the text in the range
8970 * @see elm_entry_markup_to_utf8()
8972 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);
8975 * Return the content of the cursor.
8977 * Free the returned string pointer when done (if it is not NULL).
8979 * @param cur the cursor
8980 * @return the text in the range, terminated by a nul byte (may be utf8).
8982 EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
8985 * Returns the geometry of the cursor. Depends on the type of cursor requested.
8986 * This should be used instead of char_geometry_get because there are weird
8987 * special cases with BiDi text.
8988 * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
8989 * get, except for the case of the last char of a line which depends on the
8990 * paragraph direction.
8992 * in '|' cursor mode (i.e a line between two chars) it is very variable.
8993 * For example consider the following visual string:
8994 * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
8995 * a '|' between the c and the C.
8997 * @param cur the cursor.
8998 * @param cx the x of the cursor
8999 * @param cy the y of the cursor
9000 * @param cw the width of the cursor
9001 * @param ch the height of the cursor
9002 * @param dir the direction of the cursor, can be NULL.
9003 * @param ctype the type of the cursor.
9004 * @return line number of the char on success, -1 on error.
9006 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);
9009 * Returns the geometry of the char at cur.
9011 * @param cur the position of the char.
9012 * @param cx the x of the char.
9013 * @param cy the y of the char.
9014 * @param cw the w of the char.
9015 * @param ch the h of the char.
9016 * @return line number of the char on success, -1 on error.
9018 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);
9021 * Returns the geometry of the pen at cur.
9023 * @param cur the position of the char.
9024 * @param cpen_x the pen_x of the char.
9025 * @param cy the y of the char.
9026 * @param cadv the adv of the char.
9027 * @param ch the h of the char.
9028 * @return line number of the char on success, -1 on error.
9030 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);
9033 * Returns the geometry of the line at cur.
9035 * @param cur the position of the line.
9036 * @param cx the x of the line.
9037 * @param cy the y of the line.
9038 * @param cw the width of the line.
9039 * @param ch the height of the line.
9040 * @return line number of the line on success, -1 on error.
9042 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);
9045 * Set the position of the cursor according to the X and Y coordinates.
9047 * @param cur the cursor to set.
9048 * @param x coord to set by.
9049 * @param y coord to set by.
9050 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9052 EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9055 * Set the cursor position according to the y coord.
9057 * @param cur the cur to be set.
9058 * @param y the coord to set by.
9059 * @return the line number found, -1 on error.
9061 EAPI int evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
9064 * Get the geometry of a range.
9066 * @param cur1 one side of the range.
9067 * @param cur2 other side of the range.
9068 * @return a list of Rectangles representing the geometry of the range.
9070 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);
9071 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);
9074 * Checks if the cursor points to the end of the line.
9076 * @param cur the cursor to check.
9077 * @return @c EINA_TRUE if true, @c EINA_FALSE otherwise.
9079 EAPI Eina_Bool evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
9082 * Get the geometry of a line number.
9084 * @param obj the object.
9085 * @param line the line number.
9086 * @param cx x coord of the line.
9087 * @param cy y coord of the line.
9088 * @param cw w coord of the line.
9089 * @param ch h coord of the line.
9090 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
9092 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);
9095 * Clear the textblock object.
9096 * @note Does *NOT* free the Evas object itself.
9098 * @param obj the object to clear.
9101 EAPI void evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9104 * Get the formatted width and height. This calculates the actual size after restricting
9105 * the textblock to the current size of the object.
9106 * The main difference between this and @ref evas_object_textblock_size_native_get
9107 * is that the "native" function does not wrapping into account
9108 * it just calculates the real width of the object if it was placed on an
9109 * infinite canvas, while this function gives the size after wrapping
9110 * according to the size restrictions of the object.
9112 * For example for a textblock containing the text: "You shall not pass!"
9113 * with no margins or padding and assuming a monospace font and a size of
9114 * 7x10 char widths (for simplicity) has a native size of 19x1
9115 * and a formatted size of 5x4.
9118 * @param obj the Evas object.
9119 * @param w the width of the object.
9120 * @param h the height of the object
9121 * @return Returns no value.
9122 * @see evas_object_textblock_size_native_get
9124 EAPI void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9127 * Get the native width and height. This calculates the actual size without taking account
9128 * the current size of the object.
9129 * The main difference between this and @ref evas_object_textblock_size_formatted_get
9130 * is that the "native" function does not take wrapping into account
9131 * it just calculates the real width of the object if it was placed on an
9132 * infinite canvas, while the "formatted" function gives the size after
9133 * wrapping text according to the size restrictions of the object.
9135 * For example for a textblock containing the text: "You shall not pass!"
9136 * with no margins or padding and assuming a monospace font and a size of
9137 * 7x10 char widths (for simplicity) has a native size of 19x1
9138 * and a formatted size of 5x4.
9140 * @param obj the Evas object of the textblock
9141 * @param w the width returned
9142 * @param h the height returned
9143 * @return Returns no value.
9145 EAPI void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
9146 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);
9154 * @defgroup Evas_Object_Textgrid Textgrid Object Functions
9156 * @todo put here some usage examples
9160 * @ingroup Evas_Object_Specific
9166 * @typedef Evas_Textgrid_Palette
9168 * The palette to use for the forgraound and background colors.
9174 EVAS_TEXTGRID_PALETTE_NONE, /**< No palette is used */
9175 EVAS_TEXTGRID_PALETTE_STANDARD, /**< standard palette (around 16 colors) */
9176 EVAS_TEXTGRID_PALETTE_EXTENDED, /**< extended palette (at max 256 colors) */
9177 EVAS_TEXTGRID_PALETTE_LAST /**< ignore it */
9178 } Evas_Textgrid_Palette;
9181 * @typedef Evas_Textgrid_Font_Style
9183 * The style to give to each character of the grid.
9189 EVAS_TEXTGRID_FONT_STYLE_NORMAL = (1 << 0), /**< Normal style */
9190 EVAS_TEXTGRID_FONT_STYLE_BOLD = (1 << 1), /**< Bold style */
9191 EVAS_TEXTGRID_FONT_STYLE_ITALIC = (1 << 2) /**< Oblique style */
9192 } Evas_Textgrid_Font_Style;
9195 * @typedef Evas_Textgrid_Cell
9197 * The values that describes each cell.
9201 typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell;
9204 * @struct _Evas_Textgrid_Cell
9206 * The values that describes each cell.
9210 struct _Evas_Textgrid_Cell
9212 Eina_Unicode codepoint; /**< the UNICODE value of the character */
9213 unsigned char fg; /**< the index of the palette for the foreground color */
9214 unsigned char bg; /**< the index of the palette for the background color */
9215 unsigned short bold : 1; /**< whether the character is bold */
9216 unsigned short italic : 1; /**< whether the character is oblique */
9217 unsigned short underline : 1; /**< whether the character is underlined */
9218 unsigned short strikethrough : 1; /**< whether the character is strikethrough'ed */
9219 unsigned short fg_extended : 1; /**< whether the extended palette is used for the foreground color */
9220 unsigned short bg_extended : 1; /**< whether the extended palette is used for the background color */
9221 unsigned short double_width : 1; /**< if the codepoint is merged with the following cell to the right visually (cells must be in pairs with 2nd cell being a duplicate in all ways except codepoint is 0) */
9225 * @brief Add a textgrid to the given Evas.
9227 * @param e The given evas.
9228 * @return The new textgrid object.
9230 * This function adds a new textgrid object to the Evas @p e and returns the object.
9234 EAPI Evas_Object *evas_object_textgrid_add(Evas *e);
9237 * @brief Set the size of the textgrid object.
9239 * @param obj The textgrid object.
9240 * @param w The number of columns (width in cells) of the grid.
9241 * @param h The number of rows (height in cells) of the grid.
9243 * This function sets the number of lines @p h and the number
9244 * of columns @p w to the textgrid object @p obj. If
9245 * @p w or @p h are less or equal than 0, this
9246 * functiond does nothing.
9250 EAPI void evas_object_textgrid_size_set(Evas_Object *obj, int w, int h);
9253 * @brief Get the size of the textgrid object.
9255 * @param obj The textgrid object.
9256 * @param w The number of columns of the grid.
9257 * @param h The number of rows of the grid.
9259 * This function retrieves the number of lines in the buffer @p
9260 * h and the number of columns in the buffer @p w of
9261 * the textgrid object @p obj. @p w or @p h can be
9262 * @c NULL. On error, their value is 0.
9266 EAPI void evas_object_textgrid_size_get(const Evas_Object *obj, int *w, int *h);
9269 * @brief Set the font (source) file to be used on a given textgrid object.
9271 * @param obj The textgrid object to set font for.
9272 * @param font_source The font file's path.
9274 * This function allows the font file @p font_source to be explicitly
9275 * set for the textgrid object @p obj, overriding system lookup, which
9276 * will first occur in the given file's contents. If @font_source is
9277 * @c NULL or is an empty string, or the same font_source has already
9278 * been set, or on error, this function does nothing.
9280 * @see evas_object_textgrid_font_get()
9281 * @see evas_object_textgrid_font_set()
9282 * @see evas_object_textgrid_font_source_get()
9286 EAPI void evas_object_textgrid_font_source_set(Evas_Object *obj, const char *font_source);
9289 * @brief Get the font file's path which is being used on a given textgrid object.
9291 * @param obj The textgrid object to set font for.
9292 * @return The font file's path.
9294 * This function returns the font source path of the textgrid object
9295 * @p obj. If the font source path has not been set, or on error,
9296 * @c NULL is returned.
9298 * @see evas_object_textgrid_font_get()
9299 * @see evas_object_textgrid_font_set()
9300 * @see evas_object_textgrid_font_source_set()
9304 EAPI const char *evas_object_textgrid_font_source_get(const Evas_Object *obj);
9307 * @brief Set the font family and size on a given textgrid object.
9309 * @param obj The textgrid object to set font for.
9310 * @param font_name The font (family) name.
9311 * @param font_size The font size, in points.
9313 * This function allows the font name @p font_name and size
9314 * @p font_size of the textgrid object @p obj to be set. The @p font_name
9315 * string has to follow fontconfig's convention on naming fonts, as
9316 * it's the underlying library used to query system fonts by Evas (see
9317 * the @c fc-list command's output, on your system, to get an
9318 * idea). It also has to be a monospace font. If @p font_name is
9319 * @c NULL, or if it is an empty string, or if @p font_size is less or
9320 * equal than 0, or on error, this function does nothing.
9322 * @see evas_object_textgrid_font_get()
9323 * @see evas_object_textgrid_font_source_set()
9324 * @see evas_object_textgrid_font_source_get()
9328 EAPI void evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font_Size font_size);
9331 * @brief Retrieve the font family and size in use on a given textgrid object.
9333 * @param obj The textgrid object to query for font information.
9334 * @param font_name A pointer to the location to store the font name in.
9335 * @param font_size A pointer to the location to store the font size in.
9337 * This function allows the font name and size of a textgrid object
9338 * @p obj to be queried and stored respectively in the buffers
9339 * @p font_name and @p font_size. Be aware that the font name string is
9340 * still owned by Evas and should @b not have free() called on it by
9341 * the caller of the function. On error, the font name is the empty
9342 * string and the font size is 0. @p font_name and @p font_source can
9345 * @see evas_object_textgrid_font_set()
9346 * @see evas_object_textgrid_font_source_set()
9347 * @see evas_object_textgrid_font_source_get()
9351 EAPI void evas_object_textgrid_font_get(const Evas_Object *obj, const char **font_name, Evas_Font_Size *font_size);
9354 * @brief Retrieve the size of a cell of the given textgrid object in pixels.
9356 * @param obj The textgrid object to query for font information.
9357 * @param width A pointer to the location to store the width in pixels of a cell.
9358 * @param height A pointer to the location to store the height in
9361 * This functions retrieves the width and height, in pixels, of a cell
9362 * of the textgrid object @p obj and store them respectively in the
9363 * buffers @p width and @p height. Their value depends on the
9364 * monospace font used for the textgrid object, as well as the
9365 * style. @p width and @p height can be @c NULL. On error, they are
9368 * @see evas_object_textgrid_font_set()
9369 * @see evas_object_textgrid_supported_font_styles_set()
9373 EAPI void evas_object_textgrid_cell_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
9376 * @brief The set color to the given palette at the given index of the given textgrid object.
9378 * @param obj The textgrid object to query for font information.
9379 * @param pal The type of the palette to set the color.
9380 * @param idx The index of the paletter to wich the color is stored.
9381 * @param r The red component of the color.
9382 * @param g The green component of the color.
9383 * @param b The blue component of the color.
9384 * @param a The alpha component of the color.
9386 * This function sets the color for the palette of type @p pal at the
9387 * index @p idx of the textgrid object @p obj. The ARGB components are
9388 * given by @p r, @p g, @p b and @p a. This color can be used when
9389 * setting the #Evas_Textgrid_Cell structure. The components must set
9390 * a pre-multiplied color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or
9391 * #EVAS_TEXTGRID_PALETTE_LAST, or if @p idx is not between 0 and 255,
9392 * or on error, this function does nothing. The color components are
9393 * clamped between 0 and 255. If @p idx is greater than the latest set
9394 * color, the colors between this last index and @p idx - 1 are set to
9395 * black (0, 0, 0, 0).
9397 * @see evas_object_textgrid_palette_get()
9401 EAPI void evas_object_textgrid_palette_set(Evas_Object *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a);
9404 * @brief The retrieve color to the given palette at the given index of the given textgrid object.
9406 * @param obj The textgrid object to query for font information.
9407 * @param pal The type of the palette to set the color.
9408 * @param idx The index of the paletter to wich the color is stored.
9409 * @param r A pointer to the red component of the color.
9410 * @param g A pointer to the green component of the color.
9411 * @param b A pointer to the blue component of the color.
9412 * @param a A pointer to the alpha component of the color.
9414 * This function retrieves the color for the palette of type @p pal at the
9415 * index @p idx of the textgrid object @p obj. The ARGB components are
9416 * stored in the buffers @p r, @p g, @p b and @p a. If @p idx is not
9417 * between 0 and the index of the latest set color, or if @p pal is
9418 * #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, the
9419 * values of the components are 0. @p r, @p g, @pb and @p a can be
9422 * @see evas_object_textgrid_palette_set()
9426 EAPI void evas_object_textgrid_palette_get(const Evas_Object *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a);
9428 EAPI void evas_object_textgrid_supported_font_styles_set(Evas_Object *obj, Evas_Textgrid_Font_Style styles);
9429 EAPI Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get(const Evas_Object *obj);
9432 * @brief Set the string at the given row of the given textgrid object.
9434 * @param obj The textgrid object to query for font information.
9435 * @param y The row index of the grid.
9436 * @param The string as a sequence of #Evas_Textgrid_Cell.
9438 * This function returns cells to the textgrid taken by
9439 * evas_object_textgrid_cellrow_get(). The row pointer @p row should be the
9440 * same row pointer returned by evas_object_textgrid_cellrow_get() for the
9443 * @see evas_object_textgrid_cellrow_get()
9444 * @see evas_object_textgrid_size_set()
9445 * @see evas_object_textgrid_update_add()
9449 EAPI void evas_object_textgrid_cellrow_set(Evas_Object *obj, int y, const Evas_Textgrid_Cell *row);
9452 * @brief Get the string at the given row of the given textgrid object.
9454 * @param obj The textgrid object to query for font information.
9455 * @param y The row index of the grid.
9456 * @return A pointer to the first cell of the given row.
9458 * This function returns a pointer to the first cell of the line @p y
9459 * of the textgrid object @p obj. If @p y is not between 0 and the
9460 * number of lines of the grid - 1, or on error, this function return @c NULL.
9462 * @see evas_object_textgrid_cellrow_set()
9463 * @see evas_object_textgrid_size_set()
9464 * @see evas_object_textgrid_update_add()
9468 EAPI Evas_Textgrid_Cell *evas_object_textgrid_cellrow_get(const Evas_Object *obj, int y);
9471 * @brief Indicate for evas that part of a textgrid region (cells) has been updated.
9473 * @param obj The textgrid object.
9474 * @param x The rect region of cells top-left x (column)
9475 * @param y The rect region of cells top-left y (row)
9476 * @param w The rect region size in number of cells (columns)
9477 * @param h The rect region size in number of cells (rows)
9479 * This function declares to evas that a region of cells was updated by
9480 * code and needs refreshing. An application should modify cells like this
9484 * Evas_Textgrid_Cell *cells;
9487 * cells = evas_object_textgrid_cellrow_get(obj, row);
9488 * for (i = 0; i < width; i++) cells[i].codepoint = 'E';
9489 * evas_object_textgrid_cellrow_set(obj, row, cells);
9490 * evas_object_textgrid_update_add(obj, 0, row, width, 1);
9493 * @see evas_object_textgrid_cellrow_set()
9494 * @see evas_object_textgrid_cellrow_get()
9495 * @see evas_object_textgrid_size_set()
9499 EAPI void evas_object_textgrid_update_add(Evas_Object *obj, int x, int y, int w, int h);
9506 * @defgroup Evas_Line_Group Line Object Functions
9508 * Functions used to deal with evas line objects.
9510 * @warning We don't guarantee any proper results if you create a Line object
9511 * without setting the evas engine.
9513 * @ingroup Evas_Object_Specific
9519 * Adds a new evas line object to the given evas.
9520 * @param e The given evas.
9521 * @return The new evas line object.
9523 EAPI Evas_Object *evas_object_line_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9526 * Sets the coordinates of the end points of the given evas line object.
9527 * @param obj The given evas line object.
9528 * @param x1 The X coordinate of the first point.
9529 * @param y1 The Y coordinate of the first point.
9530 * @param x2 The X coordinate of the second point.
9531 * @param y2 The Y coordinate of the second point.
9533 EAPI void evas_object_line_xy_set(Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2);
9536 * Retrieves the coordinates of the end points of the given evas line object.
9537 * @param obj The given line object.
9538 * @param x1 Pointer to an integer in which to store the X coordinate of the
9540 * @param y1 Pointer to an integer in which to store the Y coordinate of the
9542 * @param x2 Pointer to an integer in which to store the X coordinate of the
9544 * @param y2 Pointer to an integer in which to store the Y coordinate of the
9547 EAPI void evas_object_line_xy_get(const Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2);
9553 * @defgroup Evas_Object_Polygon Polygon Object Functions
9555 * Functions that operate on evas polygon objects.
9557 * Hint: as evas does not provide ellipse, smooth paths or circle, one
9558 * can calculate points and convert these to a polygon.
9560 * @warning We don't guarantee any proper results if you create a Polygon
9561 * object without setting the evas engine.
9563 * @ingroup Evas_Object_Specific
9569 * Adds a new evas polygon object to the given evas.
9570 * @param e The given evas.
9571 * @return A new evas polygon object.
9573 EAPI Evas_Object *evas_object_polygon_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
9576 * Adds the given point to the given evas polygon object.
9577 * @param obj The given evas polygon object.
9578 * @param x The X coordinate of the given point.
9579 * @param y The Y coordinate of the given point.
9580 * @ingroup Evas_Polygon_Group
9582 EAPI void evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
9585 * Removes all of the points from the given evas polygon object.
9586 * @param obj The given polygon object.
9588 EAPI void evas_object_polygon_points_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
9594 EAPI void evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame);
9597 EAPI Eina_Bool evas_object_is_frame_object_get(Evas_Object *obj);
9600 * @defgroup Evas_Smart_Group Smart Functions
9602 * Functions that deal with #Evas_Smart structs, creating definition
9603 * (classes) of objects that will have customized behavior for methods
9604 * like evas_object_move(), evas_object_resize(),
9605 * evas_object_clip_set() and others.
9607 * These objects will accept the generic methods defined in @ref
9608 * Evas_Object_Group and the extensions defined in @ref
9609 * Evas_Smart_Object_Group. There are a couple of existent smart
9610 * objects in Evas itself (see @ref Evas_Object_Box, @ref
9611 * Evas_Object_Table and @ref Evas_Smart_Object_Clipped).
9613 * See also some @ref Example_Evas_Smart_Objects "examples" of this
9614 * group of functions.
9618 * @addtogroup Evas_Smart_Group
9623 * @def EVAS_SMART_CLASS_VERSION
9625 * The version you have to put into the version field in the
9626 * #Evas_Smart_Class struct. Used to safeguard from binaries with old
9627 * smart object intefaces running with newer ones.
9629 * @ingroup Evas_Smart_Group
9631 #define EVAS_SMART_CLASS_VERSION 4
9633 * @struct _Evas_Smart_Class
9635 * A smart object's @b base class definition
9637 * @ingroup Evas_Smart_Group
9639 struct _Evas_Smart_Class
9641 const char *name; /**< the name string of the class */
9643 void (*add)(Evas_Object *o); /**< code to be run when adding object to a canvas */
9644 void (*del)(Evas_Object *o); /**< code to be run when removing object from a canvas */
9645 void (*move)(Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas. @a x and @a y will be new coordinates one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9646 void (*resize)(Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas. @a w and @a h will be new dimensions one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
9647 void (*show)(Evas_Object *o); /**< code to be run when showing object on a canvas */
9648 void (*hide)(Evas_Object *o); /**< code to be run when hiding object on a canvas */
9649 void (*color_set)(Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas. @a r, @a g, @a b and @a y will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
9650 void (*clip_set)(Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas. @a clip will be new clipper one applied to the object. use evas_object_clip_get() if you need the old one, during this call. after that, the old (object pointer) value will be lost. */
9651 void (*clip_unset)(Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas. if you need the pointer to a previous set clipper, during this call, use evas_object_clip_get(). after that, the old (object pointer) value will be lost. */
9652 void (*calculate)(Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
9653 void (*member_add)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is added to object */
9654 void (*member_del)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is removed from object */
9656 const Evas_Smart_Class *parent; /**< this class inherits from this parent */
9657 const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
9658 const Evas_Smart_Interface **interfaces; /**< #Evas_Smart_Interface pointers array, @c NULL terminated. These will be the interfaces supported at this level for an object (parents may have others) @since 1.7 */
9663 * @struct _Evas_Smart_Interface
9665 * A smart object's @b base interface definition
9667 * Every Evas interface must have a name field, pointing to a global,
9668 * constant string variable. This string pointer will be the only way
9669 * of retrieving back a given interface from a smart object. Two
9670 * function pointers must be defined, too, which will be called at
9671 * object creation and deletion times.
9673 * See also some @ref Example_Evas_Smart_Interfaces "examples" on
9678 * @ingroup Evas_Smart_Group
9680 struct _Evas_Smart_Interface
9682 const char *name; /**< Name of the given interface */
9683 unsigned private_size; /**< Size, in bytes, of the interface's private dada blob. This will be allocated and freed automatically for you. Get it with evas_object_smart_interface_data_get(). */
9684 Eina_Bool (*add)(Evas_Object *obj); /**< Function to be called at object creation time. This will take place @b before the object's smart @c add() function. */
9685 void (*del)(Evas_Object *obj); /**< Function to be called at object deletion time. This will take place @b after the object's smart @c del() function. */
9689 * @struct _Evas_Smart_Cb_Description
9691 * Describes a callback issued by a smart object
9692 * (evas_object_smart_callback_call()), as defined in its smart object
9693 * class. This is particularly useful to explain to end users and
9694 * their code (i.e., introspection) what the parameter @c event_info
9697 * @ingroup Evas_Smart_Group
9699 struct _Evas_Smart_Cb_Description
9701 const char *name; /**< callback name ("changed", for example) */
9704 * @brief Hint on the type of @c event_info parameter's contents on
9705 * a #Evas_Smart_Cb callback.
9707 * The type string uses the pattern similar to
9708 * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
9709 * but extended to optionally include variable names within
9710 * brackets preceding types. Example:
9712 * @li Structure with two integers:
9715 * @li Structure called 'x' with two integers named 'a' and 'b':
9716 * @c "[x]([a]i[b]i)"
9718 * @li Array of integers:
9721 * @li Array called 'x' of struct with two integers:
9724 * @note This type string is used as a hint and is @b not validated
9725 * or enforced in any way. Implementors should make the best
9726 * use of it to help bindings, documentation and other users
9727 * of introspection features.
9733 * @def EVAS_SMART_CLASS_INIT_NULL
9734 * Initializer to zero a whole Evas_Smart_Class structure.
9736 * @see EVAS_SMART_CLASS_INIT_VERSION
9737 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9738 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9739 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9740 * @ingroup Evas_Smart_Group
9742 #define EVAS_SMART_CLASS_INIT_NULL {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
9745 * @def EVAS_SMART_CLASS_INIT_VERSION
9746 * Initializer to zero a whole Evas_Smart_Class structure and set version.
9748 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9749 * latest EVAS_SMART_CLASS_VERSION.
9751 * @see EVAS_SMART_CLASS_INIT_NULL
9752 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9753 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9754 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9755 * @ingroup Evas_Smart_Group
9757 #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}
9760 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION
9761 * Initializer to zero a whole Evas_Smart_Class structure and set name
9764 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9765 * latest EVAS_SMART_CLASS_VERSION and name to the specified value.
9767 * It will keep a reference to name field as a "const char *", that is,
9768 * name must be available while the structure is used (hint: static or global!)
9769 * and will not be modified.
9771 * @see EVAS_SMART_CLASS_INIT_NULL
9772 * @see EVAS_SMART_CLASS_INIT_VERSION
9773 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9774 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9775 * @ingroup Evas_Smart_Group
9777 #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}
9780 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9781 * Initializer to zero a whole Evas_Smart_Class structure and set name,
9782 * version and parent class.
9784 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9785 * latest EVAS_SMART_CLASS_VERSION, name to the specified value and
9788 * It will keep a reference to name field as a "const char *", that is,
9789 * name must be available while the structure is used (hint: static or global!)
9790 * and will not be modified. Similarly, parent reference will be kept.
9792 * @see EVAS_SMART_CLASS_INIT_NULL
9793 * @see EVAS_SMART_CLASS_INIT_VERSION
9794 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9795 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9796 * @ingroup Evas_Smart_Group
9798 #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}
9801 * @def EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT_CALLBACKS
9802 * Initializer to zero a whole Evas_Smart_Class structure and set name,
9803 * version, parent class and callbacks definition.
9805 * Similar to EVAS_SMART_CLASS_INIT_NULL, but will set version field to
9806 * latest EVAS_SMART_CLASS_VERSION, name to the specified value, parent
9807 * class and callbacks at this level.
9809 * It will keep a reference to name field as a "const char *", that is,
9810 * name must be available while the structure is used (hint: static or global!)
9811 * and will not be modified. Similarly, parent and callbacks reference
9814 * @see EVAS_SMART_CLASS_INIT_NULL
9815 * @see EVAS_SMART_CLASS_INIT_VERSION
9816 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
9817 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION_PARENT
9818 * @ingroup Evas_Smart_Group
9820 #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}
9823 * @def EVAS_SMART_SUBCLASS_NEW
9825 * Convenience macro to subclass a given Evas smart class.
9827 * @param smart_name The name used for the smart class. e.g:
9828 * @c "Evas_Object_Box".
9829 * @param prefix Prefix used for all variables and functions defined
9830 * and referenced by this macro.
9831 * @param api_type Type of the structure used as API for the smart
9832 * class. Either #Evas_Smart_Class or something derived from it.
9833 * @param parent_type Type of the parent class API.
9834 * @param parent_func Function that gets the parent class. e.g:
9835 * evas_object_box_smart_class_get().
9836 * @param cb_desc Array of callback descriptions for this smart class.
9838 * This macro saves some typing when writing a smart class derived
9839 * from another one. In order to work, the user @b must provide some
9840 * functions adhering to the following guidelines:
9841 * - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9842 * function (defined by this macro) will call this one, provided by
9843 * the user, after inheriting everything from the parent, which
9844 * should <b>take care of setting the right member functions for
9845 * the class</b>, both overrides and extensions, if any.
9846 * - If this new class should be subclassable as well, a @b public
9847 * @c _smart_set() function is desirable to fill in the class used as
9848 * parent by the children. It's up to the user to provide this
9849 * interface, which will most likely call @<prefix@>_smart_set() to
9852 * After the macro's usage, the following will be defined for use:
9853 * - @<prefix@>_parent_sc: A pointer to the @b parent smart
9854 * class. When calling parent functions from overloaded ones, use
9855 * this global variable.
9856 * - @<prefix@>_smart_class_new(): this function returns the
9857 * #Evas_Smart needed to create smart objects with this class,
9858 * which should be passed to evas_object_smart_add().
9860 * @warning @p smart_name has to be a pointer to a globally available
9861 * string! The smart class created here will just have a pointer set
9862 * to that, and all object instances will depend on it for smart class
9865 * @ingroup Evas_Smart_Group
9867 #define EVAS_SMART_SUBCLASS_NEW(smart_name, prefix, api_type, parent_type, parent_func, cb_desc) \
9868 static const parent_type * prefix##_parent_sc = NULL; \
9869 static void prefix##_smart_set_user(api_type * api); \
9870 static void prefix##_smart_set(api_type * api) \
9872 Evas_Smart_Class *sc; \
9873 if (!(sc = (Evas_Smart_Class *)api)) \
9875 if (!prefix##_parent_sc) \
9876 prefix##_parent_sc = parent_func(); \
9877 evas_smart_class_inherit(sc, prefix##_parent_sc); \
9878 prefix##_smart_set_user(api); \
9880 static Evas_Smart *prefix##_smart_class_new(void) \
9882 static Evas_Smart *smart = NULL; \
9883 static api_type api; \
9886 Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9887 memset(&api, 0, sizeof(api_type)); \
9888 sc->version = EVAS_SMART_CLASS_VERSION; \
9889 sc->name = smart_name; \
9890 sc->callbacks = cb_desc; \
9891 prefix##_smart_set(&api); \
9892 smart = evas_smart_class_new(sc); \
9898 * @def EVAS_SMART_SUBCLASS_IFACE_NEW
9902 * Convenience macro to subclass a given Evas smart class. This is the
9903 * same as #EVAS_SMART_SUBCLASS_NEW, but now <b>declaring smart
9904 * interfaces</b> besides the smart callbacks.
9906 * @param smart_name The name used for the smart class. e.g:
9907 * @c "Evas_Object_Box".
9908 * @param prefix Prefix used for all variables and functions defined
9909 * and referenced by this macro.
9910 * @param api_type Type of the structure used as API for the smart
9911 * class. Either #Evas_Smart_Class or something
9913 * @param parent_type Type of the parent class API.
9914 * @param parent_func Function that gets the parent class. e.g:
9915 * evas_object_box_smart_class_get().
9916 * @param cb_desc Array of smart callback descriptions for this smart
9918 * @param ifaces Array of Evas smart interafaces for this smart
9921 * This macro saves some typing when writing a smart class derived
9922 * from another one. In order to work, the user @b must provide some
9923 * functions adhering to the following guidelines:
9924 * - @<prefix@>_smart_set_user(): the @b internal @c _smart_set
9925 * function (defined by this macro) will call this one, provided by
9926 * the user, after inheriting everything from the parent, which
9927 * should <b>take care of setting the right member functions for
9928 * the class</b>, both overrides and extensions, if any.
9929 * - If this new class should be subclassable as well, a @b public
9930 * @c _smart_set() function is desirable to fill in the class used as
9931 * parent by the children. It's up to the user to provide this
9932 * interface, which will most likely call @<prefix@>_smart_set() to
9935 * After the macro's usage, the following will be defined for use:
9936 * - @<prefix@>_parent_sc: A pointer to the @b parent smart
9937 * class. When calling parent functions from overloaded ones, use
9938 * this global variable.
9939 * - @<prefix@>_smart_class_new(): this function returns the
9940 * #Evas_Smart needed to create smart objects with this class,
9941 * which should be passed to evas_object_smart_add().
9943 * @warning @p smart_name has to be a pointer to a globally available
9944 * string! The smart class created here will just have a pointer set
9945 * to that, and all object instances will depend on it for smart class
9948 * @ingroup Evas_Smart_Group
9950 #define EVAS_SMART_SUBCLASS_IFACE_NEW(smart_name, \
9957 static const parent_type * prefix##_parent_sc = NULL; \
9958 static void prefix##_smart_set_user(api_type * api); \
9959 static void prefix##_smart_set(api_type * api) \
9961 Evas_Smart_Class *sc; \
9962 if (!(sc = (Evas_Smart_Class *)api)) \
9964 if (!prefix##_parent_sc) \
9965 prefix##_parent_sc = parent_func(); \
9966 evas_smart_class_inherit(sc, prefix##_parent_sc); \
9967 prefix##_smart_set_user(api); \
9969 static Evas_Smart *prefix##_smart_class_new(void) \
9971 static Evas_Smart *smart = NULL; \
9972 static api_type api; \
9975 Evas_Smart_Class *sc = (Evas_Smart_Class *)&api; \
9976 memset(&api, 0, sizeof(api_type)); \
9977 sc->version = EVAS_SMART_CLASS_VERSION; \
9978 sc->name = smart_name; \
9979 sc->callbacks = cb_desc; \
9980 sc->interfaces = ifaces; \
9981 prefix##_smart_set(&api); \
9982 smart = evas_smart_class_new(sc); \
9988 * @def EVAS_SMART_DATA_ALLOC
9990 * Convenience macro to allocate smart data only if needed.
9992 * When writing a subclassable smart object, the @c .add() function
9993 * will need to check if the smart private data was already allocated
9994 * by some child object or not. This macro makes it easier to do it.
9996 * @note This is an idiom used when one calls the parent's @c .add()
9997 * after the specialized code. Naturally, the parent's base smart data
9998 * has to be contemplated as the specialized one's first member, for
10001 * @param o Evas object passed to the @c .add() function
10002 * @param priv_type The type of the data to allocate
10004 * @ingroup Evas_Smart_Group
10006 #define EVAS_SMART_DATA_ALLOC(o, priv_type) \
10007 priv_type * priv; \
10008 priv = evas_object_smart_data_get(o); \
10010 priv = (priv_type *)calloc(1, sizeof(priv_type)); \
10011 if (!priv) return; \
10012 evas_object_smart_data_set(o, priv); \
10016 * Free an #Evas_Smart struct
10018 * @param s the #Evas_Smart struct to free
10020 * @warning If this smart handle was created using
10021 * evas_smart_class_new(), the associated #Evas_Smart_Class will not
10024 * @note If you're using the #EVAS_SMART_SUBCLASS_NEW schema to create your
10025 * smart object, note that an #Evas_Smart handle will be shared amongst all
10026 * instances of the given smart class, through a static variable.
10027 * Evas will internally count references on #Evas_Smart handles and free them
10028 * when they are not referenced anymore. Thus, this function is of no use
10029 * for Evas users, most probably.
10031 EAPI void evas_smart_free(Evas_Smart *s) EINA_ARG_NONNULL(1);
10034 * Creates a new #Evas_Smart from a given #Evas_Smart_Class struct
10036 * @param sc the smart class definition
10037 * @return a new #Evas_Smart pointer
10039 * #Evas_Smart handles are necessary to create new @b instances of
10040 * smart objects belonging to the class described by @p sc. That
10041 * handle will contain, besides the smart class interface definition,
10042 * all its smart callbacks infrastructure set, too.
10044 * @note If you are willing to subclass a given smart class to
10045 * construct yours, consider using the #EVAS_SMART_SUBCLASS_NEW macro,
10046 * which will make use of this function automatically for you.
10048 EAPI Evas_Smart *evas_smart_class_new(const Evas_Smart_Class *sc) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
10051 * Get the #Evas_Smart_Class handle of an #Evas_Smart struct
10053 * @param s a valid #Evas_Smart pointer
10054 * @return the #Evas_Smart_Class in it
10056 EAPI const Evas_Smart_Class *evas_smart_class_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10059 * @brief Get the data pointer set on an #Evas_Smart struct
10061 * @param s a valid #Evas_Smart handle
10063 * This data pointer is set as the data field in the #Evas_Smart_Class
10064 * passed in to evas_smart_class_new().
10066 EAPI void *evas_smart_data_get(const Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10069 * Get the smart callbacks known by this #Evas_Smart handle's smart
10072 * @param s A valid #Evas_Smart handle.
10073 * @param[out] count Returns the number of elements in the returned
10075 * @return The array with callback descriptions known by this smart
10076 * class, with its size returned in @a count parameter. It
10077 * should not be modified in any way. If no callbacks are
10078 * known, @c NULL is returned. The array is sorted by event
10079 * names and elements refer to the original values given to
10080 * evas_smart_class_new()'s Evas_Smart_Class::callbacks
10081 * (pointer to them).
10083 * This is likely different from
10084 * evas_object_smart_callbacks_descriptions_get() as it will contain
10085 * the callbacks of @b all this class hierarchy sorted, while the
10086 * direct smart class member refers only to that specific class and
10087 * should not include parent's.
10089 * If no callbacks are known, this function returns @c NULL.
10091 * The array elements and thus their contents will be @b references to
10092 * original values given to evas_smart_class_new() as
10093 * Evas_Smart_Class::callbacks.
10095 * The array is sorted by Evas_Smart_Cb_Description::name. The last
10096 * array element is a @c NULL pointer and is not accounted for in @a
10097 * count. Loop iterations can check any of these size indicators.
10099 * @note objects may provide per-instance callbacks, use
10100 * evas_object_smart_callbacks_descriptions_get() to get those
10102 * @see evas_object_smart_callbacks_descriptions_get()
10104 EAPI const Evas_Smart_Cb_Description **evas_smart_callbacks_descriptions_get(const Evas_Smart *s, unsigned int *count) EINA_ARG_NONNULL(1, 1);
10107 * Find a callback description for the callback named @a name.
10109 * @param s The #Evas_Smart where to search for class registered smart
10111 * @param name Name of the desired callback, which must @b not be @c
10112 * NULL. The search has a special case for @a name being the
10113 * same pointer as registered with #Evas_Smart_Cb_Description.
10114 * One can use it to avoid excessive use of strcmp().
10115 * @return A reference to the description if found, or @c NULL, otherwise
10117 * @see evas_smart_callbacks_descriptions_get()
10119 EAPI const Evas_Smart_Cb_Description *evas_smart_callback_description_find(const Evas_Smart *s, const char *name) EINA_ARG_NONNULL(1, 2);
10122 * Sets one class to inherit from the other.
10124 * Copy all function pointers, set @c parent to @a parent_sc and copy
10125 * everything after sizeof(Evas_Smart_Class) present in @a parent_sc,
10126 * using @a parent_sc_size as reference.
10128 * This is recommended instead of a single memcpy() since it will take
10129 * care to not modify @a sc name, version, callbacks and possible
10132 * @param sc child class.
10133 * @param parent_sc parent class, will provide attributes.
10134 * @param parent_sc_size size of parent_sc structure, child should be at least
10135 * this size. Everything after @c Evas_Smart_Class size is copied
10136 * using regular memcpy().
10138 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);
10141 * Get the number of users of the smart instance
10143 * @param s The Evas_Smart to get the usage count of
10144 * @return The number of uses of the smart instance
10146 * This function tells you how many more uses of the smart instance are in
10147 * existence. This should be used before freeing/clearing any of the
10148 * Evas_Smart_Class that was used to create the smart instance. The smart
10149 * instance will refer to data in the Evas_Smart_Class used to create it and
10150 * thus you cannot remove the original data until all users of it are gone.
10151 * When the usage count goes to 0, you can evas_smart_free() the smart
10152 * instance @p s and remove from memory any of the Evas_Smart_Class that
10153 * was used to create the smart instance, if you desire. Removing it from
10154 * memory without doing this will cause problems (crashes, undefined
10155 * behavior etc. etc.), so either never remove the original
10156 * Evas_Smart_Class data from memory (have it be a constant structure and
10157 * data), or use this API call and be very careful.
10159 EAPI int evas_smart_usage_get(const Evas_Smart *s);
10162 * @def evas_smart_class_inherit
10163 * Easy to use version of evas_smart_class_inherit_full().
10165 * This version will use sizeof(parent_sc), copying everything.
10167 * @param sc child class, will have methods copied from @a parent_sc
10168 * @param parent_sc parent class, will provide contents to be copied.
10169 * @return 1 on success, 0 on failure.
10170 * @ingroup Evas_Smart_Group
10172 #define evas_smart_class_inherit(sc, parent_sc) evas_smart_class_inherit_full(sc, (Evas_Smart_Class *)parent_sc, sizeof(*parent_sc))
10179 * @defgroup Evas_Smart_Object_Group Smart Object Functions
10181 * Functions dealing with Evas smart objects (instances).
10183 * Smart objects are groupings of primitive Evas objects that behave
10184 * as a cohesive group. For instance, a file manager icon may be a
10185 * smart object composed of an image object, a text label and two
10186 * rectangles that appear behind the image and text when the icon is
10187 * selected. As a smart object, the normal Evas object API could be
10188 * used on the icon object.
10190 * Besides that, generally smart objects implement a <b>specific
10191 * API</b>, so that users interact with its own custom features. The
10192 * API takes form of explicit exported functions one may call and
10193 * <b>smart callbacks</b>.
10195 * @section Evas_Smart_Object_Group_Callbacks Smart events and callbacks
10197 * Smart objects can elect events (smart events, from now on) occurring
10198 * inside of them to be reported back to their users via callback
10199 * functions (smart callbacks). This way, you can extend Evas' own
10200 * object events. They are defined by an <b>event string</b>, which
10201 * identifies them uniquely. There's also a function prototype
10202 * definition for the callback functions: #Evas_Smart_Cb.
10204 * When defining an #Evas_Smart_Class, smart object implementors are
10205 * strongly encouraged to properly set the Evas_Smart_Class::callbacks
10206 * callbacks description array, so that the users of the smart object
10207 * can have introspection on its events API <b>at run time</b>.
10209 * See some @ref Example_Evas_Smart_Objects "examples" of this group
10212 * @see @ref Evas_Smart_Group for class definitions.
10216 * @addtogroup Evas_Smart_Object_Group
10221 * Instantiates a new smart object described by @p s.
10223 * @param e the canvas on which to add the object
10224 * @param s the #Evas_Smart describing the smart object
10225 * @return a new #Evas_Object handle
10227 * This is the function one should use when defining the public
10228 * function @b adding an instance of the new smart object to a given
10229 * canvas. It will take care of setting all of its internals to work
10230 * as they should, if the user set things properly, as seem on the
10231 * #EVAS_SMART_SUBCLASS_NEW, for example.
10233 * @ingroup Evas_Smart_Object_Group
10235 EAPI Evas_Object *evas_object_smart_add(Evas *e, Evas_Smart *s) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC;
10238 * Set an Evas object as a member of a given smart object.
10240 * @param obj The member object
10241 * @param smart_obj The smart object
10243 * Members will automatically be stacked and layered together with the
10244 * smart object. The various stacking functions will operate on
10245 * members relative to the other members instead of the entire canvas,
10246 * since they now live on an exclusive layer (see
10247 * evas_object_stack_above(), for more details).
10249 * Any @p smart_obj object's specific implementation of the @c
10250 * member_add() smart function will take place too, naturally.
10252 * @see evas_object_smart_member_del()
10253 * @see evas_object_smart_members_get()
10255 * @ingroup Evas_Smart_Object_Group
10257 EAPI void evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj) EINA_ARG_NONNULL(1, 2);
10260 * Removes a member object from a given smart object.
10262 * @param obj the member object
10263 * @ingroup Evas_Smart_Object_Group
10265 * This removes a member object from a smart object, if it was added
10266 * to any. The object will still be on the canvas, but no longer
10267 * associated with whichever smart object it was associated with.
10269 * @see evas_object_smart_member_add() for more details
10270 * @see evas_object_smart_members_get()
10272 EAPI void evas_object_smart_member_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
10275 * Retrieves the list of the member objects of a given Evas smart
10278 * @param obj the smart object to get members from
10279 * @return Returns the list of the member objects of @p obj.
10281 * The returned list should be freed with @c eina_list_free() when you
10282 * no longer need it.
10284 * @since 1.7 This function will return @c NULL when a non-smart object is passed.
10286 * @see evas_object_smart_member_add()
10287 * @see evas_object_smart_member_del()
10289 EAPI Eina_List *evas_object_smart_members_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10292 * Gets the parent smart object of a given Evas object, if it has one.
10294 * @param obj the Evas object you want to get the parent smart object
10296 * @return Returns the parent smart object of @a obj or @c NULL, if @a
10297 * obj is not a smart member of any
10299 * @ingroup Evas_Smart_Object_Group
10301 EAPI Evas_Object *evas_object_smart_parent_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10304 * Checks whether a given smart object or any of its smart object
10305 * parents is of a given smart class.
10307 * @param obj An Evas smart object to check the type of
10308 * @param type The @b name (type) of the smart class to check for
10309 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10310 * type, @c EINA_FALSE otherwise
10312 * If @p obj is not a smart object, this call will fail
10313 * immediately. Otherwise, make sure evas_smart_class_inherit() or its
10314 * sibling functions were used correctly when creating the smart
10315 * object's class, so it has a valid @b parent smart class pointer
10318 * The checks use smart classes names and <b>string
10319 * comparison</b>. There is a version of this same check using
10320 * <b>pointer comparison</b>, since a smart class' name is a single
10323 * @see evas_object_smart_type_check_ptr()
10324 * @see #EVAS_SMART_SUBCLASS_NEW
10326 * @ingroup Evas_Smart_Object_Group
10328 EAPI Eina_Bool evas_object_smart_type_check(const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
10331 * Checks whether a given smart object or any of its smart object
10332 * parents is of a given smart class, <b>using pointer comparison</b>.
10334 * @param obj An Evas smart object to check the type of
10335 * @param type The type (name string) to check for. Must be the name
10336 * @return @c EINA_TRUE, if @a obj or any of its parents is of type @a
10337 * type, @c EINA_FALSE otherwise
10339 * @see evas_object_smart_type_check() for more details
10341 * @ingroup Evas_Smart_Object_Group
10343 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);
10346 * Get the #Evas_Smart from which @p obj smart object was created.
10348 * @param obj a smart object
10349 * @return the #Evas_Smart handle or @c NULL, on errors
10351 * @ingroup Evas_Smart_Object_Group
10353 EAPI Evas_Smart *evas_object_smart_smart_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10356 * Retrieve user data stored on a given smart object.
10358 * @param obj The smart object's handle
10359 * @return A pointer to data stored using
10360 * evas_object_smart_data_set(), or @c NULL, if none has been
10363 * @see evas_object_smart_data_set()
10365 * @ingroup Evas_Smart_Object_Group
10367 EAPI void *evas_object_smart_data_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10370 * Store a pointer to user data for a given smart object.
10372 * @param obj The smart object's handle
10373 * @param data A pointer to user data
10375 * This data is stored @b independently of the one set by
10376 * evas_object_data_set(), naturally.
10378 * @see evas_object_smart_data_get()
10380 * @ingroup Evas_Smart_Object_Group
10382 EAPI void evas_object_smart_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1);
10385 * Add (register) a callback function to the smart event specified by
10386 * @p event on the smart object @p obj.
10388 * @param obj a smart object
10389 * @param event the event's name string
10390 * @param func the callback function
10391 * @param data user data to be passed to the callback function
10393 * Smart callbacks look very similar to Evas callbacks, but are
10394 * implemented as smart object's custom ones.
10396 * This function adds a function callback to an smart object when the
10397 * event named @p event occurs in it. The function is @p func.
10399 * In the event of a memory allocation error during addition of the
10400 * callback to the object, evas_alloc_error() should be used to
10401 * determine the nature of the error, if any, and the program should
10402 * sensibly try and recover.
10404 * A smart callback function must have the ::Evas_Smart_Cb prototype
10405 * definition. The first parameter (@p data) in this definition will
10406 * have the same value passed to evas_object_smart_callback_add() as
10407 * the @p data parameter, at runtime. The second parameter @p obj is a
10408 * handle to the object on which the event occurred. The third
10409 * parameter, @p event_info, is a pointer to data which is totally
10410 * dependent on the smart object's implementation and semantic for the
10413 * There is an infrastructure for introspection on smart objects'
10414 * events (see evas_smart_callbacks_descriptions_get()), but no
10415 * internal smart objects on Evas implement them yet.
10417 * @see @ref Evas_Smart_Object_Group_Callbacks for more details.
10419 * @see evas_object_smart_callback_del()
10420 * @ingroup Evas_Smart_Object_Group
10422 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);
10425 * Add (register) a callback function to the smart event specified by
10426 * @p event on the smart object @p obj. Except for the priority field,
10427 * it's exactly the same as @ref evas_object_smart_callback_add
10429 * @param obj a smart object
10430 * @param event the event's name string
10431 * @param priority The priority of the callback, lower values called first.
10432 * @param func the callback function
10433 * @param data user data to be passed to the callback function
10435 * @see evas_object_smart_callback_add
10437 * @ingroup Evas_Smart_Object_Group
10439 EAPI void evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data);
10442 * Delete (unregister) a callback function from the smart event
10443 * specified by @p event on the smart object @p obj.
10445 * @param obj a smart object
10446 * @param event the event's name string
10447 * @param func the callback function
10448 * @return the data pointer
10450 * This function removes <b>the first</b> added smart callback on the
10451 * object @p obj matching the event name @p event and the registered
10452 * function pointer @p func. If the removal is successful it will also
10453 * return the data pointer that was passed to
10454 * evas_object_smart_callback_add() (that will be the same as the
10455 * parameter) when the callback(s) was(were) added to the canvas. If
10456 * not successful @c NULL will be returned.
10458 * @see evas_object_smart_callback_add() for more details.
10460 * @ingroup Evas_Smart_Object_Group
10462 EAPI void *evas_object_smart_callback_del(Evas_Object *obj, const char *event, Evas_Smart_Cb func) EINA_ARG_NONNULL(1, 2, 3);
10465 * Delete (unregister) a callback function from the smart event
10466 * specified by @p event on the smart object @p obj.
10468 * @param obj a smart object
10469 * @param event the event's name string
10470 * @param func the callback function
10471 * @param data the data pointer that was passed to the callback
10472 * @return the data pointer
10474 * This function removes <b>the first</b> added smart callback on the
10475 * object @p obj matching the event name @p event, the registered
10476 * function pointer @p func and the callback data pointer @p data. If
10477 * the removal is successful it will also return the data pointer that
10478 * was passed to evas_object_smart_callback_add() (that will be the same
10479 * as the parameter) when the callback(s) was(were) added to the canvas.
10480 * If not successful @c NULL will be returned. A common use would be to
10481 * remove an exact match of a callback
10483 * @see evas_object_smart_callback_add() for more details.
10485 * @ingroup Evas_Smart_Object_Group
10487 * @note To delete all smart event callbacks which match @p type and @p func,
10488 * use evas_object_smart_callback_del().
10490 EAPI void *evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2, 3);
10493 * Call a given smart callback on the smart object @p obj.
10495 * @param obj the smart object
10496 * @param event the event's name string
10497 * @param event_info pointer to an event specific struct or information to
10498 * pass to the callback functions registered on this smart event
10500 * This should be called @b internally, from the smart object's own
10501 * code, when some specific event has occurred and the implementor
10502 * wants is to pertain to the object's events API (see @ref
10503 * Evas_Smart_Object_Group_Callbacks). The documentation for the smart
10504 * object should include a list of possible events and what type of @p
10505 * event_info to expect for each of them. Also, when defining an
10506 * #Evas_Smart_Class, smart object implementors are strongly
10507 * encouraged to properly set the Evas_Smart_Class::callbacks
10508 * callbacks description array, so that the users of the smart object
10509 * can have introspection on its events API <b>at run time</b>.
10511 * @ingroup Evas_Smart_Object_Group
10513 EAPI void evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info) EINA_ARG_NONNULL(1, 2);
10516 * Set an smart object @b instance's smart callbacks descriptions.
10518 * @param obj A smart object
10519 * @param descriptions @c NULL terminated array with
10520 * #Evas_Smart_Cb_Description descriptions. Array elements won't be
10521 * modified at run time, but references to them and their contents
10522 * will be made, so this array should be kept alive during the whole
10523 * object's lifetime.
10524 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
10526 * These descriptions are hints to be used by introspection and are
10527 * not enforced in any way.
10529 * It will not be checked if instance callbacks descriptions have the
10530 * same name as respective possibly registered in the smart object
10531 * @b class. Both are kept in different arrays and users of
10532 * evas_object_smart_callbacks_descriptions_get() should handle this
10533 * case as they wish.
10535 * @note Becase @p descriptions must be @c NULL terminated, and
10536 * because a @c NULL name makes little sense, too,
10537 * Evas_Smart_Cb_Description::name must @b not be @c NULL.
10539 * @note While instance callbacks descriptions are possible, they are
10540 * @b not recommended. Use @b class callbacks descriptions
10541 * instead as they make you smart object user's life simpler and
10542 * will use less memory, as descriptions and arrays will be
10543 * shared among all instances.
10545 * @ingroup Evas_Smart_Object_Group
10547 EAPI Eina_Bool evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions) EINA_ARG_NONNULL(1);
10550 * Retrieve an smart object's know smart callback descriptions (both
10551 * instance and class ones).
10553 * @param obj The smart object to get callback descriptions from.
10554 * @param class_descriptions Where to store class callbacks
10555 * descriptions array, if any is known. If no descriptions are
10556 * known, @c NULL is returned
10557 * @param class_count Returns how many class callbacks descriptions
10559 * @param instance_descriptions Where to store instance callbacks
10560 * descriptions array, if any is known. If no descriptions are
10561 * known, @c NULL is returned.
10562 * @param instance_count Returns how many instance callbacks
10563 * descriptions are known.
10565 * This call searches for registered callback descriptions for both
10566 * instance and class of the given smart object. These arrays will be
10567 * sorted by Evas_Smart_Cb_Description::name and also @c NULL
10568 * terminated, so both @a class_count and @a instance_count can be
10569 * ignored, if the caller wishes so. The terminator @c NULL is not
10570 * counted in these values.
10572 * @note If just class descriptions are of interest, try
10573 * evas_smart_callbacks_descriptions_get() instead.
10575 * @note Use @c NULL pointers on the descriptions/counters you're not
10576 * interested in: they'll be ignored by the function.
10578 * @see evas_smart_callbacks_descriptions_get()
10580 * @ingroup Evas_Smart_Object_Group
10582 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);
10585 * Find callback description for callback called @a name.
10587 * @param obj the smart object.
10588 * @param name name of desired callback, must @b not be @c NULL. The
10589 * search have a special case for @a name being the same
10590 * pointer as registered with Evas_Smart_Cb_Description, one
10591 * can use it to avoid excessive use of strcmp().
10592 * @param class_description pointer to return class description or
10593 * @c NULL if not found. If parameter is @c NULL, no search will
10594 * be done on class descriptions.
10595 * @param instance_description pointer to return instance description
10596 * or @c NULL if not found. If parameter is @c NULL, no search
10597 * will be done on instance descriptions.
10598 * @return reference to description if found, @c NULL if not found.
10600 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);
10603 * Retrieve an Evas smart object's interface, by name string pointer.
10605 * @param obj An Evas smart object.
10606 * @param name Name string of the desired interface, which must be the
10607 * same pointer used at the interface's declarion, when
10608 * creating the smart object @a obj.
10612 * @return The interface's handle pointer, if found, @c NULL
10615 const void *evas_object_smart_interface_get(const Evas_Object *obj, const char *name);
10618 * Retrieve an Evas smart object interface's <b>private data</b>.
10620 * @param obj An Evas smart object.
10621 * @param iface The given object's interface handle.
10625 * @return The object interface's private data blob pointer, if found,
10626 * @c NULL otherwise.
10628 void *evas_object_smart_interface_data_get(const Evas_Object *obj, const Evas_Smart_Interface *iface);
10631 * Mark smart object as changed, dirty.
10633 * @param obj The given Evas smart object
10635 * This will flag the given object as needing recalculation,
10636 * forcefully. As an effect, on the next rendering cycle it's @b
10637 * calculate() (see #Evas_Smart_Class) smart function will be called.
10639 * @see evas_object_smart_need_recalculate_set().
10640 * @see evas_object_smart_calculate().
10642 * @ingroup Evas_Smart_Object_Group
10644 EAPI void evas_object_smart_changed(Evas_Object *obj) EINA_ARG_NONNULL(1);
10647 * Set or unset the flag signalling that a given smart object needs to
10648 * get recalculated.
10650 * @param obj the smart object
10651 * @param value whether one wants to set (@c EINA_TRUE) or to unset
10652 * (@c EINA_FALSE) the flag.
10654 * If this flag is set, then the @c calculate() smart function of @p
10655 * obj will be called, if one is provided, during rendering phase of
10656 * Evas (see evas_render()), after which this flag will be
10657 * automatically unset.
10659 * If that smart function is not provided for the given object, this
10660 * flag will be left unchanged.
10662 * @note just setting this flag will not make the canvas' whole scene
10663 * dirty, by itself, and evas_render() will have no effect. To
10664 * force that, use evas_object_smart_changed(), that will also
10665 * automatically call this function automatically, with
10666 * @c EINA_TRUE as parameter.
10668 * @see evas_object_smart_need_recalculate_get()
10669 * @see evas_object_smart_calculate()
10670 * @see evas_smart_objects_calculate()
10672 * @ingroup Evas_Smart_Object_Group
10674 EAPI void evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
10677 * Get the value of the flag signalling that a given smart object needs to
10678 * get recalculated.
10680 * @param obj the smart object
10681 * @return if flag is set or not.
10683 * @note this flag will be unset during the rendering phase, when the
10684 * @c calculate() smart function is called, if one is provided.
10685 * If it's not provided, then the flag will be left unchanged
10686 * after the rendering phase.
10688 * @see evas_object_smart_need_recalculate_set(), for more details
10690 * @ingroup Evas_Smart_Object_Group
10692 EAPI Eina_Bool evas_object_smart_need_recalculate_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10695 * Call the @b calculate() smart function immediately on a given smart
10698 * @param obj the smart object's handle
10700 * This will force immediate calculations (see #Evas_Smart_Class)
10701 * needed for renderization of this object and, besides, unset the
10702 * flag on it telling it needs recalculation for the next rendering
10705 * @see evas_object_smart_need_recalculate_set()
10707 * @ingroup Evas_Smart_Object_Group
10709 EAPI void evas_object_smart_calculate(Evas_Object *obj) EINA_ARG_NONNULL(1);
10712 * Call user-provided @c calculate() smart functions and unset the
10713 * flag signalling that the object needs to get recalculated to @b all
10714 * smart objects in the canvas.
10716 * @param e The canvas to calculate all smart objects in
10718 * @see evas_object_smart_need_recalculate_set()
10720 * @ingroup Evas_Smart_Object_Group
10722 EAPI void evas_smart_objects_calculate(Evas *e);
10725 * This gets the internal counter that counts the number of smart calculations
10727 * @param e The canvas to get the calculate counter from
10729 * Whenever evas performs smart object calculations on the whole canvas
10730 * it increments a counter by 1. This is the smart object calculate counter
10731 * that this function returns the value of. It starts at the value of 0 and
10732 * will increase (and eventually wrap around to negative values and so on) by
10733 * 1 every time objects are calculated. You can use this counter to ensure
10734 * you don't re-do calculations withint the same calculation generation/run
10735 * if the calculations maybe cause self-feeding effects.
10737 * @ingroup Evas_Smart_Object_Group
10740 EAPI int evas_smart_objects_calculate_count_get(const Evas *e);
10743 * Moves all children objects of a given smart object relative to a
10746 * @param obj the smart object.
10747 * @param dx horizontal offset (delta).
10748 * @param dy vertical offset (delta).
10750 * This will make each of @p obj object's children to move, from where
10751 * they before, with those delta values (offsets) on both directions.
10753 * @note This is most useful on custom smart @c move() functions.
10755 * @note Clipped smart objects already make use of this function on
10756 * their @c move() smart function definition.
10758 EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) EINA_ARG_NONNULL(1);
10765 * @defgroup Evas_Smart_Object_Clipped Clipped Smart Object
10767 * Clipped smart object is a base to construct other smart objects
10768 * based on the concept of having an internal clipper that is applied
10769 * to all children objects. This clipper will control the visibility,
10770 * clipping and color of sibling objects (remember that the clipping
10771 * is recursive, and clipper color modulates the color of its
10772 * clippees). By default, this base will also move children relatively
10773 * to the parent, and delete them when parent is deleted. In other
10774 * words, it is the base for simple object grouping.
10776 * See some @ref Example_Evas_Smart_Objects "examples" of this group
10779 * @see evas_object_smart_clipped_smart_set()
10781 * @ingroup Evas_Smart_Object_Group
10785 * @addtogroup Evas_Smart_Object_Clipped
10790 * Every subclass should provide this at the beginning of their own
10791 * data set with evas_object_smart_data_set().
10793 typedef struct _Evas_Object_Smart_Clipped_Data Evas_Object_Smart_Clipped_Data;
10794 struct _Evas_Object_Smart_Clipped_Data
10796 Evas_Object *clipper;
10801 * Get the clipper object for the given clipped smart object.
10803 * @param obj the clipped smart object to retrieve associated clipper
10805 * @return the clipper object.
10807 * Use this function if you want to change any of this clipper's
10808 * properties, like colors.
10810 * @see evas_object_smart_clipped_smart_add()
10812 EAPI Evas_Object *evas_object_smart_clipped_clipper_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
10815 * Set a given smart class' callbacks so it implements the <b>clipped smart
10816 * object"</b>'s interface.
10818 * @param sc The smart class handle to operate on
10820 * This call will assign all the required methods of the @p sc
10821 * #Evas_Smart_Class instance to the implementations set for clipped
10822 * smart objects. If one wants to "subclass" it, call this function
10823 * and then override desired values. If one wants to call any original
10824 * method, save it somewhere. Example:
10827 * static Evas_Smart_Class parent_sc = EVAS_SMART_CLASS_INIT_NULL;
10829 * static void my_class_smart_add(Evas_Object *o)
10831 * parent_sc.add(o);
10832 * evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
10836 * Evas_Smart_Class *my_class_new(void)
10838 * static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
10839 * if (!parent_sc.name)
10841 * evas_object_smart_clipped_smart_set(&sc);
10843 * sc.add = my_class_smart_add;
10849 * Default behavior for each of #Evas_Smart_Class functions on a
10850 * clipped smart object are:
10851 * - @c add: creates a hidden clipper with "infinite" size, to clip
10852 * any incoming members;
10853 * - @c del: delete all children objects;
10854 * - @c move: move all objects relative relatively;
10855 * - @c resize: <b>not defined</b>;
10856 * - @c show: if there are children objects, show clipper;
10857 * - @c hide: hides clipper;
10858 * - @c color_set: set the color of clipper;
10859 * - @c clip_set: set clipper of clipper;
10860 * - @c clip_unset: unset the clipper of clipper;
10862 * @note There are other means of assigning parent smart classes to
10863 * child ones, like the #EVAS_SMART_SUBCLASS_NEW macro or the
10864 * evas_smart_class_inherit_full() function.
10866 EAPI void evas_object_smart_clipped_smart_set(Evas_Smart_Class *sc) EINA_ARG_NONNULL(1);
10869 * Get a pointer to the <b>clipped smart object's</b> class, to use
10870 * for proper inheritance
10872 * @see #Evas_Smart_Object_Clipped for more information on this smart
10875 EAPI const Evas_Smart_Class *evas_object_smart_clipped_class_get(void) EINA_CONST;
10882 * @defgroup Evas_Object_Box Box Smart Object
10884 * A box is a convenience smart object that packs children inside it
10885 * in @b sequence, using a layouting function specified by the
10886 * user. There are a couple of pre-made layouting functions <b>built-in
10887 * in Evas</b>, all of them using children size hints to define their
10888 * size and alignment inside their cell space.
10890 * Examples on this smart object's usage:
10891 * - @ref Example_Evas_Box
10892 * - @ref Example_Evas_Size_Hints
10894 * @see @ref Evas_Object_Group_Size_Hints
10896 * @ingroup Evas_Smart_Object_Group
10900 * @addtogroup Evas_Object_Box
10905 * @typedef Evas_Object_Box_Api
10907 * Smart class extension, providing extra box object requirements.
10909 * @ingroup Evas_Object_Box
10911 typedef struct _Evas_Object_Box_Api Evas_Object_Box_Api;
10914 * @typedef Evas_Object_Box_Data
10916 * Smart object instance data, providing box object requirements.
10918 * @ingroup Evas_Object_Box
10920 typedef struct _Evas_Object_Box_Data Evas_Object_Box_Data;
10923 * @typedef Evas_Object_Box_Option
10925 * The base structure for a box option. Box options are a way of
10926 * extending box items properties, which will be taken into account
10927 * for layouting decisions. The box layouting functions provided by
10928 * Evas will only rely on objects' canonical size hints to layout
10929 * them, so the basic box option has @b no (custom) property set.
10931 * Users creating their own layouts, but not depending on extra child
10932 * items' properties, would be fine just using
10933 * evas_object_box_layout_set(). But if one desires a layout depending
10934 * on extra child properties, he/she has to @b subclass the box smart
10935 * object. Thus, by using evas_object_box_smart_class_get() and
10936 * evas_object_box_smart_set(), the @c option_new() and @c
10937 * option_free() smart class functions should be properly
10938 * redefined/extended.
10940 * Object properties are bound to an integer identifier and must have
10941 * a name string. Their values are open to any data. See the API on
10942 * option properties for more details.
10944 * @ingroup Evas_Object_Box
10946 typedef struct _Evas_Object_Box_Option Evas_Object_Box_Option;
10949 * @typedef Evas_Object_Box_Layout
10951 * Function signature for an Evas box object layouting routine. By
10952 * @a o it will be passed the box object in question, by @a priv it will
10953 * be passed the box's internal data and, by @a user_data, it will be
10954 * passed any custom data one could have set to a given box layouting
10955 * function, with evas_object_box_layout_set().
10957 * @ingroup Evas_Object_Box
10959 typedef void (*Evas_Object_Box_Layout)(Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
10962 * @def EVAS_OBJECT_BOX_API_VERSION
10964 * Current version for Evas box object smart class, a value which goes
10965 * to _Evas_Object_Box_Api::version.
10967 * @ingroup Evas_Object_Box
10969 #define EVAS_OBJECT_BOX_API_VERSION 1
10972 * @struct _Evas_Object_Box_Api
10974 * This structure should be used by any smart class inheriting from
10975 * the box's one, to provide custom box behavior which could not be
10976 * achieved only by providing a layout function, with
10977 * evas_object_box_layout_set().
10979 * @extends Evas_Smart_Class
10980 * @ingroup Evas_Object_Box
10982 struct _Evas_Object_Box_Api
10984 Evas_Smart_Class base; /**< Base smart class struct, need for all smart objects */
10985 int version; /**< Version of this smart class definition */
10986 Evas_Object_Box_Option *(*append)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child); /**< Smart function to append child elements in boxes */
10987 Evas_Object_Box_Option *(*prepend)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child); /**< Smart function to prepend child elements in boxes */
10988 Evas_Object_Box_Option *(*insert_before)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child, const Evas_Object * reference); /**< Smart function to insert a child element before another in boxes */
10989 Evas_Object_Box_Option *(*insert_after)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child, const Evas_Object * reference); /**< Smart function to insert a child element after another in boxes */
10990 Evas_Object_Box_Option *(*insert_at)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child, unsigned int pos); /**< Smart function to insert a child element at a given position on boxes */
10991 Evas_Object *(*remove)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child); /**< Smart function to remove a child element from boxes */
10992 Evas_Object *(*remove_at)(Evas_Object * o, Evas_Object_Box_Data * priv, unsigned int pos); /**< Smart function to remove a child element from boxes, by its position */
10993 Eina_Bool (*property_set)(Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to set a custom property on a box child */
10994 Eina_Bool (*property_get)(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args); /**< Smart function to retrieve a custom property from a box child */
10995 const char *(*property_name_get)(const Evas_Object * o, int property); /**< Smart function to get the name of a custom property of box children */
10996 int (*property_id_get)(const Evas_Object *o, const char *name); /**< Smart function to get the numerical ID of a custom property of box children */
10997 Evas_Object_Box_Option *(*option_new)(Evas_Object * o, Evas_Object_Box_Data * priv, Evas_Object * child); /**< Smart function to create a new box option struct */
10998 void (*option_free)(Evas_Object *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Option *opt); /**< Smart function to delete a box option struct */
11002 * @def EVAS_OBJECT_BOX_API_INIT
11004 * Initializer for a whole #Evas_Object_Box_Api structure, with
11005 * @c NULL values on its specific fields.
11007 * @param smart_class_init initializer to use for the "base" field
11008 * (#Evas_Smart_Class).
11010 * @see EVAS_SMART_CLASS_INIT_NULL
11011 * @see EVAS_SMART_CLASS_INIT_VERSION
11012 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
11013 * @see EVAS_OBJECT_BOX_API_INIT_NULL
11014 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11015 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11016 * @ingroup Evas_Object_Box
11018 #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}
11021 * @def EVAS_OBJECT_BOX_API_INIT_NULL
11023 * Initializer to zero out a whole #Evas_Object_Box_Api structure.
11025 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11026 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11027 * @see EVAS_OBJECT_BOX_API_INIT
11028 * @ingroup Evas_Object_Box
11030 #define EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
11033 * @def EVAS_OBJECT_BOX_API_INIT_VERSION
11035 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11036 * set a specific version on it.
11038 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will set
11039 * the version field of #Evas_Smart_Class (base field) to the latest
11040 * #EVAS_SMART_CLASS_VERSION.
11042 * @see EVAS_OBJECT_BOX_API_INIT_NULL
11043 * @see EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11044 * @see EVAS_OBJECT_BOX_API_INIT
11045 * @ingroup Evas_Object_Box
11047 #define EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
11050 * @def EVAS_OBJECT_BOX_API_INIT_NAME_VERSION
11052 * Initializer to zero out a whole #Evas_Object_Box_Api structure and
11053 * set its name and version.
11055 * This is similar to #EVAS_OBJECT_BOX_API_INIT_NULL, but it will also
11056 * set the version field of #Evas_Smart_Class (base field) to the
11057 * latest #EVAS_SMART_CLASS_VERSION and name it to the specific value.
11059 * It will keep a reference to the name field as a <c>"const char *"</c>,
11060 * i.e., the name must be available while the structure is
11061 * used (hint: static or global variable!) and must not be modified.
11063 * @see EVAS_OBJECT_BOX_API_INIT_NULL
11064 * @see EVAS_OBJECT_BOX_API_INIT_VERSION
11065 * @see EVAS_OBJECT_BOX_API_INIT
11066 * @ingroup Evas_Object_Box
11068 #define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
11071 * @struct _Evas_Object_Box_Data
11073 * This structure augments clipped smart object's instance data,
11074 * providing extra members required by generic box implementation. If
11075 * a subclass inherits from #Evas_Object_Box_Api, then it may augment
11076 * #Evas_Object_Box_Data to fit its own needs.
11078 * @extends Evas_Object_Smart_Clipped_Data
11079 * @ingroup Evas_Object_Box
11081 struct _Evas_Object_Box_Data
11083 Evas_Object_Smart_Clipped_Data base;
11084 const Evas_Object_Box_Api *api;
11093 Eina_List *children;
11096 Evas_Object_Box_Layout cb;
11098 void (*free_data)(void *data);
11100 Eina_Bool layouting : 1;
11101 Eina_Bool children_changed : 1;
11104 struct _Evas_Object_Box_Option
11106 Evas_Object *obj; /**< Pointer to the box child object, itself */
11107 Eina_Bool max_reached : 1;
11108 Eina_Bool min_reached : 1;
11109 Evas_Coord alloc_size;
11110 }; /**< #Evas_Object_Box_Option struct fields */
11113 * Set the default box @a api struct (Evas_Object_Box_Api)
11114 * with the default values. May be used to extend that API.
11116 * @param api The box API struct to set back, most probably with
11117 * overridden fields (on class extensions scenarios)
11119 EAPI void evas_object_box_smart_set(Evas_Object_Box_Api *api) EINA_ARG_NONNULL(1);
11122 * Get the Evas box smart class, for inheritance purposes.
11124 * @return the (canonical) Evas box smart class.
11126 * The returned value is @b not to be modified, just use it as your
11129 EAPI const Evas_Object_Box_Api *evas_object_box_smart_class_get(void) EINA_CONST;
11132 * Set a new layouting function to a given box object
11134 * @param o The box object to operate on.
11135 * @param cb The new layout function to set on @p o.
11136 * @param data Data pointer to be passed to @p cb.
11137 * @param free_data Function to free @p data, if need be.
11139 * A box layout function affects how a box object displays child
11140 * elements within its area. The list of pre-defined box layouts
11141 * available in Evas is:
11142 * - evas_object_box_layout_horizontal()
11143 * - evas_object_box_layout_vertical()
11144 * - evas_object_box_layout_homogeneous_horizontal()
11145 * - evas_object_box_layout_homogeneous_vertical()
11146 * - evas_object_box_layout_homogeneous_max_size_horizontal()
11147 * - evas_object_box_layout_homogeneous_max_size_vertical()
11148 * - evas_object_box_layout_flow_horizontal()
11149 * - evas_object_box_layout_flow_vertical()
11150 * - evas_object_box_layout_stack()
11152 * Refer to each of their documentation texts for details on them.
11154 * @note A box layouting function will be triggered by the @c
11155 * 'calculate' smart callback of the box's smart class.
11157 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);
11160 * Add a new box object on the provided canvas.
11162 * @param evas The canvas to create the box object on.
11163 * @return @c NULL on error, a pointer to a new box object on
11166 * After instantiation, if a box object hasn't its layout function
11167 * set, via evas_object_box_layout_set(), it will have it by default
11168 * set to evas_object_box_layout_horizontal(). The remaining
11169 * properties of the box must be set/retrieved via
11170 * <c>evas_object_box_{h,v}_{align,padding}_{get,set)()</c>.
11172 EAPI Evas_Object *evas_object_box_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11175 * Add a new box as a @b child of a given smart object.
11177 * @param parent The parent smart object to put the new box in.
11178 * @return @c NULL on error, a pointer to a new box object on
11181 * This is a helper function that has the same effect of putting a new
11182 * box object into @p parent by use of evas_object_smart_member_add().
11184 * @see evas_object_box_add()
11186 EAPI Evas_Object *evas_object_box_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11189 * Layout function which sets the box @a o to a (basic) horizontal box
11191 * @param o The box object in question
11192 * @param priv The smart data of the @p o
11193 * @param data The data pointer passed on
11194 * evas_object_box_layout_set(), if any
11196 * In this layout, the box object's overall behavior is controlled by
11197 * its padding/alignment properties, which are set by the
11198 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11199 * functions. The size hints of the elements in the box -- set by the
11200 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11201 * -- also control the way this function works.
11203 * \par Box's properties:
11204 * @c align_h controls the horizontal alignment of the child objects
11205 * relative to the containing box. When set to @c 0.0, children are
11206 * aligned to the left. A value of @c 1.0 makes them aligned to the
11207 * right border. Values in between align them proportionally. Note
11208 * that if the size required by the children, which is given by their
11209 * widths and the @c padding_h property of the box, is bigger than the
11210 * their container's width, the children will be displayed out of the
11211 * box's bounds. A negative value of @c align_h makes the box to
11212 * @b justify its children. The padding between them, in this case, is
11213 * corrected so that the leftmost one touches the left border and the
11214 * rightmost one touches the right border (even if they must
11215 * overlap). The @c align_v and @c padding_v properties of the box
11216 * @b don't contribute to its behaviour when this layout is chosen.
11218 * \par Child element's properties:
11219 * @c align_x does @b not influence the box's behavior. @c padding_l
11220 * and @c padding_r sum up to the container's horizontal padding
11221 * between elements. The child's @c padding_t, @c padding_b and
11222 * @c align_y properties apply for padding/alignment relative to the
11223 * overall height of the box. Finally, there is the @c weight_x
11224 * property, which, if set to a non-zero value, tells the container
11225 * that the child width is @b not pre-defined. If the container can't
11226 * accommodate all its children, it sets the widths of the ones
11227 * <b>with weights</b> to sizes as small as they can all fit into
11228 * it. If the size required by the children is less than the
11229 * available, the box increases its childrens' (which have weights)
11230 * widths as to fit the remaining space. The @c weight_x property,
11231 * besides telling the element is resizable, gives a @b weight for the
11232 * resizing process. The parent box will try to distribute (or take
11233 * off) widths accordingly to the @b normalized list of weigths: most
11234 * weighted children remain/get larger in this process than the least
11235 * ones. @c weight_y does not influence the layout.
11237 * If one desires that, besides having weights, child elements must be
11238 * resized bounded to a minimum or maximum size, those size hints must
11239 * be set, by the <c>evas_object_size_hint_{min,max}_set()</c>
11242 EAPI void evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11245 * Layout function which sets the box @a o to a (basic) vertical box
11247 * This function behaves analogously to
11248 * evas_object_box_layout_horizontal(). The description of its
11249 * behaviour can be derived from that function's documentation.
11251 EAPI void evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11254 * Layout function which sets the box @a o to a @b homogeneous
11257 * This function behaves analogously to
11258 * evas_object_box_layout_homogeneous_horizontal(). The description
11259 * of its behaviour can be derived from that function's documentation.
11261 EAPI void evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11264 * Layout function which sets the box @a o to a @b homogeneous
11267 * @param o The box object in question
11268 * @param priv The smart data of the @p o
11269 * @param data The data pointer passed on
11270 * evas_object_box_layout_set(), if any
11272 * In a homogeneous horizontal box, its width is divided @b equally
11273 * between the contained objects. The box's overall behavior is
11274 * controlled by its padding/alignment properties, which are set by
11275 * the <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11276 * functions. The size hints the elements in the box -- set by the
11277 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11278 * -- also control the way this function works.
11280 * \par Box's properties:
11281 * @c align_h has no influence on the box for this layout.
11282 * @c padding_h tells the box to draw empty spaces of that size, in
11283 * pixels, between the (equal) child objects's cells. The @c align_v
11284 * and @c padding_v properties of the box don't contribute to its
11285 * behaviour when this layout is chosen.
11287 * \par Child element's properties:
11288 * @c padding_l and @c padding_r sum up to the required width of the
11289 * child element. The @c align_x property tells the relative position
11290 * of this overall child width in its allocated cell (@c 0.0 to
11291 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11292 * @c align_x makes the box try to resize this child element to the exact
11293 * width of its cell (respecting the minimum and maximum size hints on
11294 * the child's width and accounting for its horizontal padding
11295 * hints). The child's @c padding_t, @c padding_b and @c align_y
11296 * properties apply for padding/alignment relative to the overall
11297 * height of the box. A value of @c -1.0 to @c align_y makes the box
11298 * try to resize this child element to the exact height of its parent
11299 * (respecting the maximum size hint on the child's height).
11301 EAPI void evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11304 * Layout function which sets the box @a o to a <b>maximum size,
11305 * homogeneous</b> horizontal box
11307 * @param o The box object in question
11308 * @param priv The smart data of the @p o
11309 * @param data The data pointer passed on
11310 * evas_object_box_layout_set(), if any
11312 * In a maximum size, homogeneous horizontal box, besides having cells
11313 * of <b>equal size</b> reserved for the child objects, this size will
11314 * be defined by the size of the @b largest child in the box (in
11315 * width). The box's overall behavior is controlled by its properties,
11316 * which are set by the
11317 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11318 * functions. The size hints of the elements in the box -- set by the
11319 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11320 * -- also control the way this function works.
11322 * \par Box's properties:
11323 * @c padding_h tells the box to draw empty spaces of that size, in
11324 * pixels, between the child objects's cells. @c align_h controls the
11325 * horizontal alignment of the child objects, relative to the
11326 * containing box. When set to @c 0.0, children are aligned to the
11327 * left. A value of @c 1.0 lets them aligned to the right
11328 * border. Values in between align them proportionally. A negative
11329 * value of @c align_h makes the box to @b justify its children
11330 * cells. The padding between them, in this case, is corrected so that
11331 * the leftmost one touches the left border and the rightmost one
11332 * touches the right border (even if they must overlap). The
11333 * @c align_v and @c padding_v properties of the box don't contribute to
11334 * its behaviour when this layout is chosen.
11336 * \par Child element's properties:
11337 * @c padding_l and @c padding_r sum up to the required width of the
11338 * child element. The @c align_x property tells the relative position
11339 * of this overall child width in its allocated cell (@c 0.0 to
11340 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to
11341 * @c align_x makes the box try to resize this child element to the exact
11342 * width of its cell (respecting the minimum and maximum size hints on
11343 * the child's width and accounting for its horizontal padding
11344 * hints). The child's @c padding_t, @c padding_b and @c align_y
11345 * properties apply for padding/alignment relative to the overall
11346 * height of the box. A value of @c -1.0 to @c align_y makes the box
11347 * try to resize this child element to the exact height of its parent
11348 * (respecting the max hint on the child's height).
11350 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);
11353 * Layout function which sets the box @a o to a <b>maximum size,
11354 * homogeneous</b> vertical box
11356 * This function behaves analogously to
11357 * evas_object_box_layout_homogeneous_max_size_horizontal(). The
11358 * description of its behaviour can be derived from that function's
11361 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);
11364 * Layout function which sets the box @a o to a @b flow horizontal
11367 * @param o The box object in question
11368 * @param priv The smart data of the @p o
11369 * @param data The data pointer passed on
11370 * evas_object_box_layout_set(), if any
11372 * In a flow horizontal box, the box's child elements are placed in
11373 * @b rows (think of text as an analogy). A row has as much elements as
11374 * can fit into the box's width. The box's overall behavior is
11375 * controlled by its properties, which are set by the
11376 * <c>evas_object_box_{h,v}_{align,padding}_set()</c> family of
11377 * functions. The size hints of the elements in the box -- set by the
11378 * <c>evas_object_size_hint_{align,padding,weight}_set()</c> functions
11379 * -- also control the way this function works.
11381 * \par Box's properties:
11382 * @c padding_h tells the box to draw empty spaces of that size, in
11383 * pixels, between the child objects's cells. @c align_h dictates the
11384 * horizontal alignment of the rows (@c 0.0 to left align them, @c 1.0
11385 * to right align). A value of @c -1.0 to @c align_h lets the rows
11386 * @b justified horizontally. @c align_v controls the vertical alignment
11387 * of the entire set of rows (@c 0.0 to top, @c 1.0 to bottom). A
11388 * value of @c -1.0 to @c align_v makes the box to @b justify the rows
11389 * vertically. The padding between them, in this case, is corrected so
11390 * that the first row touches the top border and the last one touches
11391 * the bottom border (even if they must overlap). @c padding_v has no
11392 * influence on the layout.
11394 * \par Child element's properties:
11395 * @c padding_l and @c padding_r sum up to the required width of the
11396 * child element. The @c align_x property has no influence on the
11397 * layout. The child's @c padding_t and @c padding_b sum up to the
11398 * required height of the child element and is the only means (besides
11399 * row justifying) of setting space between rows. Note, however, that
11400 * @c align_y dictates positioning relative to the <b>largest
11401 * height</b> required by a child object in the actual row.
11403 EAPI void evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11406 * Layout function which sets the box @a o to a @b flow vertical box.
11408 * This function behaves analogously to
11409 * evas_object_box_layout_flow_horizontal(). The description of its
11410 * behaviour can be derived from that function's documentation.
11412 EAPI void evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11415 * Layout function which sets the box @a o to a @b stacking box
11417 * @param o The box object in question
11418 * @param priv The smart data of the @p o
11419 * @param data The data pointer passed on
11420 * evas_object_box_layout_set(), if any
11422 * In a stacking box, all children will be given the same size -- the
11423 * box's own size -- and they will be stacked one above the other, so
11424 * that the first object in @p o's internal list of child elements
11425 * will be the bottommost in the stack.
11427 * \par Box's properties:
11428 * No box properties are used.
11430 * \par Child element's properties:
11431 * @c padding_l and @c padding_r sum up to the required width of the
11432 * child element. The @c align_x property tells the relative position
11433 * of this overall child width in its allocated cell (@c 0.0 to
11434 * extreme left, @c 1.0 to extreme right). A value of @c -1.0 to @c
11435 * align_x makes the box try to resize this child element to the exact
11436 * width of its cell (respecting the min and max hints on the child's
11437 * width and accounting for its horizontal padding properties). The
11438 * same applies to the vertical axis.
11440 EAPI void evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) EINA_ARG_NONNULL(1, 2);
11443 * Set the alignment of the whole bounding box of contents, for a
11444 * given box object.
11446 * @param o The given box object to set alignment from
11447 * @param horizontal The horizontal alignment, in pixels
11448 * @param vertical the vertical alignment, in pixels
11450 * This will influence how a box object is to align its bounding box
11451 * of contents within its own area. The values @b must be in the range
11452 * @c 0.0 - @c 1.0, or undefined behavior is expected. For horizontal
11453 * alignment, @c 0.0 means to the left, with @c 1.0 meaning to the
11454 * right. For vertical alignment, @c 0.0 means to the top, with @c 1.0
11455 * meaning to the bottom.
11457 * @note The default values for both alignments is @c 0.5.
11459 * @see evas_object_box_align_get()
11461 EAPI void evas_object_box_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11464 * Get the alignment of the whole bounding box of contents, for a
11465 * given box object.
11467 * @param o The given box object to get alignment from
11468 * @param horizontal Pointer to a variable where to store the
11469 * horizontal alignment
11470 * @param vertical Pointer to a variable where to store the vertical
11473 * @see evas_object_box_align_set() for more information
11475 EAPI void evas_object_box_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11478 * Set the (space) padding between cells set for a given box object.
11480 * @param o The given box object to set padding from
11481 * @param horizontal The horizontal padding, in pixels
11482 * @param vertical the vertical padding, in pixels
11484 * @note The default values for both padding components is @c 0.
11486 * @see evas_object_box_padding_get()
11488 EAPI void evas_object_box_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11491 * Get the (space) padding between cells set for a given box object.
11493 * @param o The given box object to get padding from
11494 * @param horizontal Pointer to a variable where to store the
11495 * horizontal padding
11496 * @param vertical Pointer to a variable where to store the vertical
11499 * @see evas_object_box_padding_set()
11501 EAPI void evas_object_box_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11504 * Append a new @a child object to the given box object @a o.
11506 * @param o The given box object
11507 * @param child A child Evas object to be made a member of @p o
11508 * @return A box option bound to the recently added box item or @c
11511 * On success, the @c "child,added" smart event will take place.
11513 * @note The actual placing of the item relative to @p o's area will
11514 * depend on the layout set to it. For example, on horizontal layouts
11515 * an item in the end of the box's list of children will appear on its
11518 * @note This call will trigger the box's _Evas_Object_Box_Api::append
11521 EAPI Evas_Object_Box_Option *evas_object_box_append(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11524 * Prepend a new @a child object to the given box object @a o.
11526 * @param o The given box object
11527 * @param child A child Evas object to be made a member of @p o
11528 * @return A box option bound to the recently added box item or @c
11531 * On success, the @c "child,added" smart event will take place.
11533 * @note The actual placing of the item relative to @p o's area will
11534 * depend on the layout set to it. For example, on horizontal layouts
11535 * an item in the beginning of the box's list of children will appear
11538 * @note This call will trigger the box's
11539 * _Evas_Object_Box_Api::prepend smart function.
11541 EAPI Evas_Object_Box_Option *evas_object_box_prepend(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11544 * Insert a new @a child object <b>before another existing one</b>, in
11545 * a given box object @a o.
11547 * @param o The given box object
11548 * @param child A child Evas object to be made a member of @p o
11549 * @param reference The child object to place this new one before
11550 * @return A box option bound to the recently added box item or @c
11553 * On success, the @c "child,added" smart event will take place.
11555 * @note This function will fail if @p reference is not a member of @p
11558 * @note The actual placing of the item relative to @p o's area will
11559 * depend on the layout set to it.
11561 * @note This call will trigger the box's
11562 * _Evas_Object_Box_Api::insert_before smart function.
11564 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);
11567 * Insert a new @a child object <b>after another existing one</b>, in
11568 * a given box object @a o.
11570 * @param o The given box object
11571 * @param child A child Evas object to be made a member of @p o
11572 * @param reference The child object to place this new one after
11573 * @return A box option bound to the recently added box item or @c
11576 * On success, the @c "child,added" smart event will take place.
11578 * @note This function will fail if @p reference is not a member of @p
11581 * @note The actual placing of the item relative to @p o's area will
11582 * depend on the layout set to it.
11584 * @note This call will trigger the box's
11585 * _Evas_Object_Box_Api::insert_after smart function.
11587 EAPI Evas_Object_Box_Option *evas_object_box_insert_after(Evas_Object *o, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1, 2, 3);
11590 * Insert a new @a child object <b>at a given position</b>, in a given
11593 * @param o The given box object
11594 * @param child A child Evas object to be made a member of @p o
11595 * @param pos The numeric position (starting from @c 0) to place the
11596 * new child object at
11597 * @return A box option bound to the recently added box item or @c
11600 * On success, the @c "child,added" smart event will take place.
11602 * @note This function will fail if the given position is invalid,
11603 * given @p o's internal list of elements.
11605 * @note The actual placing of the item relative to @p o's area will
11606 * depend on the layout set to it.
11608 * @note This call will trigger the box's
11609 * _Evas_Object_Box_Api::insert_at smart function.
11611 EAPI Evas_Object_Box_Option *evas_object_box_insert_at(Evas_Object *o, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1, 2);
11614 * Remove a given object from a box object, unparenting it again.
11616 * @param o The box object to remove a child object from
11617 * @param child The handle to the child object to be removed
11618 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11620 * On removal, you'll get an unparented object again, just as it was
11621 * before you inserted it in the box. The
11622 * _Evas_Object_Box_Api::option_free box smart callback will be called
11623 * automatically for you and, also, the @c "child,removed" smart event
11626 * @note This call will trigger the box's _Evas_Object_Box_Api::remove
11629 EAPI Eina_Bool evas_object_box_remove(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
11632 * Remove an object, <b>bound to a given position</b> in a box object,
11633 * unparenting it again.
11635 * @param o The box object to remove a child object from
11636 * @param pos The numeric position (starting from @c 0) of the child
11637 * object to be removed
11638 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11640 * On removal, you'll get an unparented object again, just as it was
11641 * before you inserted it in the box. The @c option_free() box smart
11642 * callback will be called automatically for you and, also, the
11643 * @c "child,removed" smart event will take place.
11645 * @note This function will fail if the given position is invalid,
11646 * given @p o's internal list of elements.
11648 * @note This call will trigger the box's
11649 * _Evas_Object_Box_Api::remove_at smart function.
11651 EAPI Eina_Bool evas_object_box_remove_at(Evas_Object *o, unsigned int pos) EINA_ARG_NONNULL(1);
11654 * Remove @b all child objects from a box object, unparenting them
11657 * @param o The box object to remove a child object from
11658 * @param clear if true, it will delete just removed children.
11659 * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
11661 * This has the same effect of calling evas_object_box_remove() on
11662 * each of @p o's child objects, in sequence. If, and only if, all
11663 * those calls succeed, so does this one.
11665 EAPI Eina_Bool evas_object_box_remove_all(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
11668 * Get an iterator to walk the list of children of a given box object.
11670 * @param o The box to retrieve an items iterator from
11671 * @return An iterator on @p o's child objects, on success, or @c NULL,
11674 * @note Do @b not remove or delete objects while walking the list.
11676 EAPI Eina_Iterator *evas_object_box_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11679 * Get an accessor (a structure providing random items access) to the
11680 * list of children of a given box object.
11682 * @param o The box to retrieve an items iterator from
11683 * @return An accessor on @p o's child objects, on success, or @c NULL,
11686 * @note Do not remove or delete objects while walking the list.
11688 EAPI Eina_Accessor *evas_object_box_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11691 * Get the list of children objects in a given box object.
11693 * @param o The box to retrieve an items list from
11694 * @return A list of @p o's child objects, on success, or @c NULL,
11695 * on errors (or if it has no child objects)
11697 * The returned list should be freed with @c eina_list_free() when you
11698 * no longer need it.
11700 * @note This is a duplicate of the list kept by the box internally.
11701 * It's up to the user to destroy it when it no longer needs it.
11702 * It's possible to remove objects from the box when walking
11703 * this list, but these removals won't be reflected on it.
11705 EAPI Eina_List *evas_object_box_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11708 * Get the name of the property of the child elements of the box @a o
11709 * which have @a id as identifier
11711 * @param o The box to search child options from
11712 * @param property The numerical identifier of the option being searched,
11714 * @return The name of the given property or @c NULL, on errors.
11716 * @note This call won't do anything for a canonical Evas box. Only
11717 * users which have @b subclassed it, setting custom box items options
11718 * (see #Evas_Object_Box_Option) on it, would benefit from this
11719 * function. They'd have to implement it and set it to be the
11720 * _Evas_Object_Box_Api::property_name_get smart class function of the
11721 * box, which is originally set to @c NULL.
11723 EAPI const char *evas_object_box_option_property_name_get(const Evas_Object *o, int property) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11726 * Get the numerical identifier of the property of the child elements
11727 * of the box @a o which have @a name as name string
11729 * @param o The box to search child options from
11730 * @param name The name string of the option being searched, for
11732 * @return The numerical ID of the given property or @c -1, on
11735 * @note This call won't do anything for a canonical Evas box. Only
11736 * users which have @b subclassed it, setting custom box items options
11737 * (see #Evas_Object_Box_Option) on it, would benefit from this
11738 * function. They'd have to implement it and set it to be the
11739 * _Evas_Object_Box_Api::property_id_get smart class function of the
11740 * box, which is originally set to @c NULL.
11742 EAPI int evas_object_box_option_property_id_get(const Evas_Object *o, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
11745 * Set a property value (by its given numerical identifier), on a
11746 * given box child element
11748 * @param o The box parenting the child element
11749 * @param opt The box option structure bound to the child box element
11750 * to set a property on
11751 * @param property The numerical ID of the given property
11752 * @param ... (List of) actual value(s) to be set for this
11753 * property. It (they) @b must be of the same type the user has
11754 * defined for it (them).
11755 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11757 * @note This call won't do anything for a canonical Evas box. Only
11758 * users which have @b subclassed it, setting custom box items options
11759 * (see #Evas_Object_Box_Option) on it, would benefit from this
11760 * function. They'd have to implement it and set it to be the
11761 * _Evas_Object_Box_Api::property_set smart class function of the box,
11762 * which is originally set to @c NULL.
11764 * @note This function will internally create a variable argument
11765 * list, with the values passed after @p property, and call
11766 * evas_object_box_option_property_vset() with this list and the same
11767 * previous arguments.
11769 EAPI Eina_Bool evas_object_box_option_property_set(Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11772 * Set a property value (by its given numerical identifier), on a
11773 * given box child element -- by a variable argument list
11775 * @param o The box parenting the child element
11776 * @param opt The box option structure bound to the child box element
11777 * to set a property on
11778 * @param property The numerical ID of the given property
11779 * @param args The variable argument list implementing the value to
11780 * be set for this property. It @b must be of the same type the user has
11782 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11784 * This is a variable argument list variant of the
11785 * evas_object_box_option_property_set(). See its documentation for
11788 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);
11791 * Get a property's value (by its given numerical identifier), on a
11792 * given box child element
11794 * @param o The box parenting the child element
11795 * @param opt The box option structure bound to the child box element
11796 * to get a property from
11797 * @param property The numerical ID of the given property
11798 * @param ... (List of) pointer(s) where to store the value(s) set for
11799 * this property. It (they) @b must point to variable(s) of the same
11800 * type the user has defined for it (them).
11801 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11803 * @note This call won't do anything for a canonical Evas box. Only
11804 * users which have @b subclassed it, getting custom box items options
11805 * (see #Evas_Object_Box_Option) on it, would benefit from this
11806 * function. They'd have to implement it and get it to be the
11807 * _Evas_Object_Box_Api::property_get smart class function of the
11808 * box, which is originally get to @c NULL.
11810 * @note This function will internally create a variable argument
11811 * list, with the values passed after @p property, and call
11812 * evas_object_box_option_property_vget() with this list and the same
11813 * previous arguments.
11815 EAPI Eina_Bool evas_object_box_option_property_get(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, ...) EINA_ARG_NONNULL(1, 2);
11818 * Get a property's value (by its given numerical identifier), on a
11819 * given box child element -- by a variable argument list
11821 * @param o The box parenting the child element
11822 * @param opt The box option structure bound to the child box element
11823 * to get a property from
11824 * @param property The numerical ID of the given property
11825 * @param args The variable argument list with pointers to where to
11826 * store the values of this property. They @b must point to variables
11827 * of the same type the user has defined for them.
11828 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
11830 * This is a variable argument list variant of the
11831 * evas_object_box_option_property_get(). See its documentation for
11834 EAPI Eina_Bool evas_object_box_option_property_vget(const Evas_Object *o, Evas_Object_Box_Option *opt, int property, va_list args) EINA_ARG_NONNULL(1, 2);
11841 * @defgroup Evas_Object_Table Table Smart Object.
11843 * Convenience smart object that packs children using a tabular
11844 * layout using children size hints to define their size and
11845 * alignment inside their cell space.
11847 * @ref tutorial_table shows how to use this Evas_Object.
11849 * @see @ref Evas_Object_Group_Size_Hints
11851 * @ingroup Evas_Smart_Object_Group
11857 * @brief Create a new table.
11859 * @param evas Canvas in which table will be added.
11861 EAPI Evas_Object *evas_object_table_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11864 * @brief Create a table that is child of a given element @a parent.
11866 * @see evas_object_table_add()
11868 EAPI Evas_Object *evas_object_table_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
11871 * @brief Set how this table should layout children.
11873 * @todo consider aspect hint and respect it.
11875 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
11876 * If table does not use homogeneous mode then columns and rows will
11877 * be calculated based on hints of individual cells. This operation
11878 * mode is more flexible, but more complex and heavy to calculate as
11879 * well. @b Weight properties are handled as a boolean expand. Negative
11880 * alignment will be considered as 0.5. This is the default.
11882 * @todo @c EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
11884 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
11885 * When homogeneous is relative to table the own table size is divided
11886 * equally among children, filling the whole table area. That is, if
11887 * table has @c WIDTH and @c COLUMNS, each cell will get <tt>WIDTH /
11888 * COLUMNS</tt> pixels. If children have minimum size that is larger
11889 * than this amount (including padding), then it will overflow and be
11890 * aligned respecting the alignment hint, possible overlapping sibling
11891 * cells. @b Weight hint is used as a boolean, if greater than zero it
11892 * will make the child expand in that axis, taking as much space as
11893 * possible (bounded to maximum size hint). Negative alignment will be
11894 * considered as 0.5.
11896 * @par EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
11897 * When homogeneous is relative to item it means the greatest minimum
11898 * cell size will be used. That is, if no element is set to expand,
11899 * the table will have its contents to a minimum size, the bounding
11900 * box of all these children will be aligned relatively to the table
11901 * object using evas_object_table_align_get(). If the table area is
11902 * too small to hold this minimum bounding box, then the objects will
11903 * keep their size and the bounding box will overflow the box area,
11904 * still respecting the alignment. @b Weight hint is used as a
11905 * boolean, if greater than zero it will make that cell expand in that
11906 * axis, toggling the <b>expand mode</b>, which makes the table behave
11907 * much like @b EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the
11908 * bounding box will overflow and items will not overlap siblings. If
11909 * no minimum size is provided at all then the table will fallback to
11910 * expand mode as well.
11912 EAPI void evas_object_table_homogeneous_set(Evas_Object *o, Evas_Object_Table_Homogeneous_Mode homogeneous) EINA_ARG_NONNULL(1);
11915 * Get the current layout homogeneous mode.
11917 * @see evas_object_table_homogeneous_set()
11919 EAPI Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
11922 * Set padding between cells.
11924 EAPI void evas_object_table_padding_set(Evas_Object *o, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1);
11927 * Get padding between cells.
11929 EAPI void evas_object_table_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1);
11932 * Set the alignment of the whole bounding box of contents.
11934 EAPI void evas_object_table_align_set(Evas_Object *o, double horizontal, double vertical) EINA_ARG_NONNULL(1);
11937 * Get alignment of the whole bounding box of contents.
11939 EAPI void evas_object_table_align_get(const Evas_Object *o, double *horizontal, double *vertical) EINA_ARG_NONNULL(1);
11942 * Sets the mirrored mode of the table. In mirrored mode the table items go
11943 * from right to left instead of left to right. That is, 1,1 is top right, not
11946 * @param o The table object.
11947 * @param mirrored the mirrored mode to set
11950 EAPI void evas_object_table_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
11953 * Gets the mirrored mode of the table.
11955 * @param o The table object.
11956 * @return @c EINA_TRUE if it's a mirrored table, @c EINA_FALSE otherwise.
11958 * @see evas_object_table_mirrored_set()
11960 EAPI Eina_Bool evas_object_table_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
11963 * Get packing location of a child of table
11965 * @param o The given table object.
11966 * @param child The child object to add.
11967 * @param col pointer to store relative-horizontal position to place child.
11968 * @param row pointer to store relative-vertical position to place child.
11969 * @param colspan pointer to store how many relative-horizontal position to use for this child.
11970 * @param rowspan pointer to store how many relative-vertical position to use for this child.
11972 * @return 1 on success, 0 on failure.
11975 EAPI Eina_Bool evas_object_table_pack_get(const Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan);
11978 * Add a new child to a table object or set its current packing.
11980 * @param o The given table object.
11981 * @param child The child object to add.
11982 * @param col relative-horizontal position to place child.
11983 * @param row relative-vertical position to place child.
11984 * @param colspan how many relative-horizontal position to use for this child.
11985 * @param rowspan how many relative-vertical position to use for this child.
11987 * @return 1 on success, 0 on failure.
11989 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);
11992 * Remove child from table.
11994 * @note removing a child will immediately call a walk over children in order
11995 * to recalculate numbers of columns and rows. If you plan to remove
11996 * all children, use evas_object_table_clear() instead.
11998 * @return 1 on success, 0 on failure.
12000 EAPI Eina_Bool evas_object_table_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
12003 * Faster way to remove all child objects from a table object.
12005 * @param o The given table object.
12006 * @param clear if true, it will delete just removed children.
12008 EAPI void evas_object_table_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12011 * Get the number of columns and rows this table takes.
12013 * @note columns and rows are virtual entities, one can specify a table
12014 * with a single object that takes 4 columns and 5 rows. The only
12015 * difference for a single cell table is that paddings will be
12016 * accounted proportionally.
12018 EAPI void evas_object_table_col_row_size_get(const Evas_Object *o, int *cols, int *rows) EINA_ARG_NONNULL(1);
12021 * Get an iterator to walk the list of children for the table.
12023 * @note Do not remove or delete objects while walking the list.
12025 EAPI Eina_Iterator *evas_object_table_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12028 * Get an accessor to get random access to the list of children for the table.
12030 * @note Do not remove or delete objects while walking the list.
12032 EAPI Eina_Accessor *evas_object_table_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12035 * Get the list of children for the table.
12037 * @note This is a duplicate of the list kept by the table internally.
12038 * It's up to the user to destroy it when it no longer needs it.
12039 * It's possible to remove objects from the table when walking this
12040 * list, but these removals won't be reflected on it.
12042 EAPI Eina_List *evas_object_table_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12045 * Get the child of the table at the given coordinates
12047 * @note This does not take into account col/row spanning
12049 EAPI Evas_Object *evas_object_table_child_get(const Evas_Object *o, unsigned short col, unsigned short row) EINA_ARG_NONNULL(1);
12055 * @defgroup Evas_Object_Grid Grid Smart Object.
12057 * Convenience smart object that packs children under a regular grid
12058 * layout, using their virtual grid location and size to determine
12059 * children's positions inside the grid object's area.
12061 * @ingroup Evas_Smart_Object_Group
12066 * @addtogroup Evas_Object_Grid
12071 * Create a new grid.
12073 * It's set to a virtual size of 1x1 by default and add children with
12074 * evas_object_grid_pack().
12077 EAPI Evas_Object *evas_object_grid_add(Evas *evas) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12080 * Create a grid that is child of a given element @a parent.
12082 * @see evas_object_grid_add()
12085 EAPI Evas_Object *evas_object_grid_add_to(Evas_Object *parent) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12088 * Set the virtual resolution for the grid
12090 * @param o The grid object to modify
12091 * @param w The virtual horizontal size (resolution) in integer units
12092 * @param h The virtual vertical size (resolution) in integer units
12095 EAPI void evas_object_grid_size_set(Evas_Object *o, int w, int h) EINA_ARG_NONNULL(1);
12098 * Get the current virtual resolution
12100 * @param o The grid object to query
12101 * @param w A pointer to an integer to store the virtual width
12102 * @param h A pointer to an integer to store the virtual height
12103 * @see evas_object_grid_size_set()
12106 EAPI void evas_object_grid_size_get(const Evas_Object *o, int *w, int *h) EINA_ARG_NONNULL(1);
12109 * Sets the mirrored mode of the grid. In mirrored mode the grid items go
12110 * from right to left instead of left to right. That is, 0,0 is top right, not
12113 * @param o The grid object.
12114 * @param mirrored the mirrored mode to set
12117 EAPI void evas_object_grid_mirrored_set(Evas_Object *o, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
12120 * Gets the mirrored mode of the grid.
12122 * @param o The grid object.
12123 * @return @c EINA_TRUE if it's a mirrored grid, @c EINA_FALSE otherwise.
12124 * @see evas_object_grid_mirrored_set()
12127 EAPI Eina_Bool evas_object_grid_mirrored_get(const Evas_Object *o) EINA_ARG_NONNULL(1);
12130 * Add a new child to a grid object.
12132 * @param o The given grid object.
12133 * @param child The child object to add.
12134 * @param x The virtual x coordinate of the child
12135 * @param y The virtual y coordinate of the child
12136 * @param w The virtual width of the child
12137 * @param h The virtual height of the child
12138 * @return 1 on success, 0 on failure.
12141 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);
12144 * Remove child from grid.
12146 * @note removing a child will immediately call a walk over children in order
12147 * to recalculate numbers of columns and rows. If you plan to remove
12148 * all children, use evas_object_grid_clear() instead.
12150 * @return 1 on success, 0 on failure.
12153 EAPI Eina_Bool evas_object_grid_unpack(Evas_Object *o, Evas_Object *child) EINA_ARG_NONNULL(1, 2);
12156 * Faster way to remove all child objects from a grid object.
12158 * @param o The given grid object.
12159 * @param clear if true, it will delete just removed children.
12162 EAPI void evas_object_grid_clear(Evas_Object *o, Eina_Bool clear) EINA_ARG_NONNULL(1);
12165 * Get the pack options for a grid child
12167 * Get the pack x, y, width and height in virtual coordinates set by
12168 * evas_object_grid_pack()
12169 * @param o The grid object
12170 * @param child The grid child to query for coordinates
12171 * @param x The pointer to where the x coordinate will be returned
12172 * @param y The pointer to where the y coordinate will be returned
12173 * @param w The pointer to where the width will be returned
12174 * @param h The pointer to where the height will be returned
12175 * @return 1 on success, 0 on failure.
12178 EAPI Eina_Bool evas_object_grid_pack_get(const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h);
12181 * Get an iterator to walk the list of children for the grid.
12183 * @note Do not remove or delete objects while walking the list.
12186 EAPI Eina_Iterator *evas_object_grid_iterator_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12189 * Get an accessor to get random access to the list of children for the grid.
12191 * @note Do not remove or delete objects while walking the list.
12194 EAPI Eina_Accessor *evas_object_grid_accessor_new(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12197 * Get the list of children for the grid.
12199 * @note This is a duplicate of the list kept by the grid internally.
12200 * It's up to the user to destroy it when it no longer needs it.
12201 * It's possible to remove objects from the grid when walking this
12202 * list, but these removals won't be reflected on it.
12205 EAPI Eina_List *evas_object_grid_children_get(const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
12212 * @defgroup Evas_Cserve Shared Image Cache Server
12214 * Evas has an (optional) module which provides client-server
12215 * infrastructure to <b>share bitmaps across multiple processes</b>,
12216 * saving data and processing power.
12218 * Be warned that it @b doesn't work when <b>threaded image
12219 * preloading</b> is enabled for Evas, though.
12221 typedef struct _Evas_Cserve_Stats Evas_Cserve_Stats;
12222 typedef struct _Evas_Cserve_Image_Cache Evas_Cserve_Image_Cache;
12223 typedef struct _Evas_Cserve_Image Evas_Cserve_Image;
12224 typedef struct _Evas_Cserve_Config Evas_Cserve_Config;
12227 * Statistics about the server that shares cached bitmaps.
12228 * @ingroup Evas_Cserve
12230 struct _Evas_Cserve_Stats
12232 int saved_memory; /**< current amount of saved memory, in bytes */
12233 int wasted_memory; /**< current amount of wasted memory, in bytes */
12234 int saved_memory_peak; /**< peak amount of saved memory, in bytes */
12235 int wasted_memory_peak; /**< peak amount of wasted memory, in bytes */
12236 double saved_time_image_header_load; /**< time, in seconds, saved in header loads by sharing cached loads instead */
12237 double saved_time_image_data_load; /**< time, in seconds, saved in data loads by sharing cached loads instead */
12241 * A handle of a cache of images shared by a server.
12242 * @ingroup Evas_Cserve
12244 struct _Evas_Cserve_Image_Cache
12255 * A handle to an image shared by a server.
12256 * @ingroup Evas_Cserve
12258 struct _Evas_Cserve_Image
12260 const char *file, *key;
12262 time_t file_mod_time;
12263 time_t file_checked_time;
12264 time_t cached_time;
12267 int memory_footprint;
12268 double head_load_time;
12269 double data_load_time;
12270 Eina_Bool alpha : 1;
12271 Eina_Bool data_loaded : 1;
12272 Eina_Bool active : 1;
12273 Eina_Bool dead : 1;
12274 Eina_Bool useless : 1;
12278 * Configuration that controls the server that shares cached bitmaps.
12279 * @ingroup Evas_Cserve
12281 struct _Evas_Cserve_Config
12283 int cache_max_usage;
12284 int cache_item_timeout;
12285 int cache_item_timeout_check;
12289 * Retrieves if the system wants to share bitmaps using the server.
12290 * @return @c EINA_TRUE if it wants, @c EINA_FALSE otherwise.
12291 * @ingroup Evas_Cserve
12293 EAPI Eina_Bool evas_cserve_want_get(void) EINA_WARN_UNUSED_RESULT;
12296 * Retrieves if the system is connected to the server used to share
12299 * @return @c EINA_TRUE if it's connected, @c EINA_FALSE otherwise.
12300 * @ingroup Evas_Cserve
12302 EAPI Eina_Bool evas_cserve_connected_get(void) EINA_WARN_UNUSED_RESULT;
12305 * Retrieves statistics from a running bitmap sharing server.
12306 * @param stats pointer to structure to fill with statistics about the
12307 * bitmap cache server.
12309 * @return @c EINA_TRUE if @p stats were filled with data,
12310 * @c EINA_FALSE otherwise (when @p stats is untouched)
12311 * @ingroup Evas_Cserve
12313 EAPI Eina_Bool evas_cserve_stats_get(Evas_Cserve_Stats *stats) EINA_WARN_UNUSED_RESULT;
12316 * Completely discard/clean a given images cache, thus re-setting it.
12318 * @param cache A handle to the given images cache.
12320 EAPI void evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache);
12323 * Retrieves the current configuration of the Evas image caching
12326 * @param config where to store current image caching server's
12329 * @return @c EINA_TRUE if @p config was filled with data,
12330 * @c EINA_FALSE otherwise (when @p config is untouched)
12332 * The fields of @p config will be altered to reflect the current
12333 * configuration's values.
12335 * @see evas_cserve_config_set()
12337 * @ingroup Evas_Cserve
12339 EAPI Eina_Bool evas_cserve_config_get(Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12342 * Changes the configurations of the Evas image caching server.
12344 * @param config A bitmap cache configuration handle with fields set
12345 * to desired configuration values.
12346 * @return @c EINA_TRUE if @p config was successfully applied,
12347 * @c EINA_FALSE otherwise.
12349 * @see evas_cserve_config_get()
12351 * @ingroup Evas_Cserve
12353 EAPI Eina_Bool evas_cserve_config_set(const Evas_Cserve_Config *config) EINA_WARN_UNUSED_RESULT;
12356 * Force the system to disconnect from the bitmap caching server.
12358 * @ingroup Evas_Cserve
12360 EAPI void evas_cserve_disconnect(void);
12363 * @defgroup Evas_Utils General Utilities
12365 * Some functions that are handy but are not specific of canvas or
12370 * Converts the given Evas image load error code into a string
12371 * describing it in english.
12373 * @param error the error code, a value in ::Evas_Load_Error.
12374 * @return Always returns a valid string. If the given @p error is not
12375 * supported, <code>"Unknown error"</code> is returned.
12377 * Mostly evas_object_image_file_set() would be the function setting
12378 * that error value afterwards, but also evas_object_image_load(),
12379 * evas_object_image_save(), evas_object_image_data_get(),
12380 * evas_object_image_data_convert(), evas_object_image_pixels_import()
12381 * and evas_object_image_is_inside(). This function is meant to be
12382 * used in conjunction with evas_object_image_load_error_get(), as in:
12385 * @dontinclude evas-images.c
12387 * @until ecore_main_loop_begin(
12389 * Here, being @c valid_path the path to a valid image and @c
12390 * bogus_path a path to a file which does not exist, the two outputs
12391 * of evas_load_error_str() would be (if no other errors occur):
12392 * <code>"No error on load"</code> and <code>"File (or file path) does
12393 * not exist"</code>, respectively. See the full @ref
12394 * Example_Evas_Images "example".
12396 * @ingroup Evas_Utils
12398 EAPI const char *evas_load_error_str(Evas_Load_Error error);
12400 /* Evas utility routines for color space conversions */
12401 /* hsv color space has h in the range 0.0 to 360.0, and s,v in the range 0.0 to 1.0 */
12402 /* rgb color space has r,g,b in the range 0 to 255 */
12405 * Convert a given color from HSV to RGB format.
12407 * @param h The Hue component of the color.
12408 * @param s The Saturation component of the color.
12409 * @param v The Value component of the color.
12410 * @param r The Red component of the color.
12411 * @param g The Green component of the color.
12412 * @param b The Blue component of the color.
12414 * This function converts a given color in HSV color format to RGB
12417 * @ingroup Evas_Utils
12419 EAPI void evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b);
12422 * Convert a given color from RGB to HSV format.
12424 * @param r The Red component of the color.
12425 * @param g The Green component of the color.
12426 * @param b The Blue component of the color.
12427 * @param h The Hue component of the color.
12428 * @param s The Saturation component of the color.
12429 * @param v The Value component of the color.
12431 * This function converts a given color in RGB color format to HSV
12434 * @ingroup Evas_Utils
12436 EAPI void evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v);
12438 /* argb color space has a,r,g,b in the range 0 to 255 */
12441 * Pre-multiplies a rgb triplet by an alpha factor.
12443 * @param a The alpha factor.
12444 * @param r The Red component of the color.
12445 * @param g The Green component of the color.
12446 * @param b The Blue component of the color.
12448 * This function pre-multiplies a given rgb triplet by an alpha
12449 * factor. Alpha factor is used to define transparency.
12451 * @ingroup Evas_Utils
12453 EAPI void evas_color_argb_premul(int a, int *r, int *g, int *b);
12456 * Undo pre-multiplication of a rgb triplet by an alpha factor.
12458 * @param a The alpha factor.
12459 * @param r The Red component of the color.
12460 * @param g The Green component of the color.
12461 * @param b The Blue component of the color.
12463 * This function undoes pre-multiplication a given rbg triplet by an
12464 * alpha factor. Alpha factor is used to define transparency.
12466 * @see evas_color_argb_premul().
12468 * @ingroup Evas_Utils
12470 EAPI void evas_color_argb_unpremul(int a, int *r, int *g, int *b);
12473 * Pre-multiplies data by an alpha factor.
12475 * @param data The data value.
12476 * @param len The length value.
12478 * This function pre-multiplies a given data by an alpha
12479 * factor. Alpha factor is used to define transparency.
12481 * @ingroup Evas_Utils
12483 EAPI void evas_data_argb_premul(unsigned int *data, unsigned int len);
12486 * Undo pre-multiplication data by an alpha factor.
12488 * @param data The data value.
12489 * @param len The length value.
12491 * This function undoes pre-multiplication of a given data by an alpha
12492 * factor. Alpha factor is used to define transparency.
12494 * @ingroup Evas_Utils
12496 EAPI void evas_data_argb_unpremul(unsigned int *data, unsigned int len);
12498 /* string and font handling */
12501 * Gets the next character in the string
12503 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12504 * this function will place in @p decoded the decoded code point at @p pos
12505 * and return the byte index for the next character in the string.
12507 * The only boundary check done is that @p pos must be >= 0. Other than that,
12508 * no checks are performed, so passing an index value that's not within the
12509 * length of the string will result in undefined behavior.
12511 * @param str The UTF-8 string
12512 * @param pos The byte index where to start
12513 * @param decoded Address where to store the decoded code point. Optional.
12515 * @return The byte index of the next character
12517 * @ingroup Evas_Utils
12519 EAPI int evas_string_char_next_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12522 * Gets the previous character in the string
12524 * Given the UTF-8 string in @p str, and starting byte position in @p pos,
12525 * this function will place in @p decoded the decoded code point at @p pos
12526 * and return the byte index for the previous character in the string.
12528 * The only boundary check done is that @p pos must be >= 1. Other than that,
12529 * no checks are performed, so passing an index value that's not within the
12530 * length of the string will result in undefined behavior.
12532 * @param str The UTF-8 string
12533 * @param pos The byte index where to start
12534 * @param decoded Address where to store the decoded code point. Optional.
12536 * @return The byte index of the previous character
12538 * @ingroup Evas_Utils
12540 EAPI int evas_string_char_prev_get(const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1);
12543 * Get the length in characters of the string.
12544 * @param str The string to get the length of.
12545 * @return The length in characters (not bytes)
12546 * @ingroup Evas_Utils
12548 EAPI int evas_string_char_len_get(const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12551 * @defgroup Evas_Keys Key Input Functions
12553 * Functions which feed key events to the canvas.
12555 * As explained in @ref intro_not_evas, Evas is @b not aware of input
12556 * systems at all. Then, the user, if using it crudely (evas_new()),
12557 * will have to feed it with input events, so that it can react
12558 * somehow. If, however, the user creates a canvas by means of the
12559 * Ecore_Evas wrapper, it will automatically bind the chosen display
12560 * engine's input events to the canvas, for you.
12562 * This group presents the functions dealing with the feeding of key
12563 * events to the canvas. On most of them, one has to reference a given
12564 * key by a name (<code>keyname</code> argument). Those are
12565 * <b>platform dependent</b> symbolic names for the keys. Sometimes
12566 * you'll get the right <code>keyname</code> by simply using an ASCII
12567 * value of the key name, but it won't be like that always.
12569 * Typical platforms are Linux frame buffer (Ecore_FB) and X server
12570 * (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer
12571 * to your display engine's documentation when using evas through an
12572 * Ecore helper wrapper when you need the <code>keyname</code>s.
12575 * @dontinclude evas-events.c
12576 * @skip mods = evas_key_modifier_get(evas);
12579 * All the other @c evas_key functions behave on the same manner. See
12580 * the full @ref Example_Evas_Events "example".
12582 * @ingroup Evas_Canvas
12586 * @addtogroup Evas_Keys
12591 * Returns a handle to the list of modifier keys registered in the
12592 * canvas @p e. This is required to check for which modifiers are set
12593 * at a given time with the evas_key_modifier_is_set() function.
12595 * @param e The pointer to the Evas canvas
12597 * @see evas_key_modifier_add
12598 * @see evas_key_modifier_del
12599 * @see evas_key_modifier_on
12600 * @see evas_key_modifier_off
12601 * @see evas_key_modifier_is_set
12603 * @return An ::Evas_Modifier handle to query Evas' keys subsystem
12604 * with evas_key_modifier_is_set(), or @c NULL on error.
12606 EAPI const Evas_Modifier *evas_key_modifier_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12609 * Returns a handle to the list of lock keys registered in the canvas
12610 * @p e. This is required to check for which locks are set at a given
12611 * time with the evas_key_lock_is_set() function.
12613 * @param e The pointer to the Evas canvas
12615 * @see evas_key_lock_add
12616 * @see evas_key_lock_del
12617 * @see evas_key_lock_on
12618 * @see evas_key_lock_off
12619 * @see evas_key_lock_is_set
12621 * @return An ::Evas_Lock handle to query Evas' keys subsystem with
12622 * evas_key_lock_is_set(), or @c NULL on error.
12624 EAPI const Evas_Lock *evas_key_lock_get(const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
12627 * Checks the state of a given modifier key, at the time of the
12628 * call. If the modifier is set, such as shift being pressed, this
12629 * function returns @c Eina_True.
12631 * @param m The current modifiers set, as returned by
12632 * evas_key_modifier_get().
12633 * @param keyname The name of the modifier key to check status for.
12635 * @return @c Eina_True if the modifier key named @p keyname is on, @c
12636 * Eina_False otherwise.
12638 * @see evas_key_modifier_add
12639 * @see evas_key_modifier_del
12640 * @see evas_key_modifier_get
12641 * @see evas_key_modifier_on
12642 * @see evas_key_modifier_off
12644 EAPI Eina_Bool evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12647 * Checks the state of a given lock key, at the time of the call. If
12648 * the lock is set, such as caps lock, this function returns @c
12651 * @param l The current locks set, as returned by evas_key_lock_get().
12652 * @param keyname The name of the lock key to check status for.
12654 * @return @c Eina_True if the @p keyname lock key is set, @c
12655 * Eina_False otherwise.
12657 * @see evas_key_lock_get
12658 * @see evas_key_lock_add
12659 * @see evas_key_lock_del
12660 * @see evas_key_lock_on
12661 * @see evas_key_lock_off
12663 EAPI Eina_Bool evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12666 * Adds the @p keyname key to the current list of modifier keys.
12668 * @param e The pointer to the Evas canvas
12669 * @param keyname The name of the modifier key to add to the list of
12672 * Modifiers are keys like shift, alt and ctrl, i.e., keys which are
12673 * meant to be pressed together with others, altering the behavior of
12674 * the secondly pressed keys somehow. Evas is so that these keys can
12677 * This call allows custom modifiers to be added to the Evas system at
12678 * run time. It is then possible to set and unset modifier keys
12679 * programmatically for other parts of the program to check and act
12680 * on. Programmers using Evas would check for modifier keys on key
12681 * event callbacks using evas_key_modifier_is_set().
12683 * @see evas_key_modifier_del
12684 * @see evas_key_modifier_get
12685 * @see evas_key_modifier_on
12686 * @see evas_key_modifier_off
12687 * @see evas_key_modifier_is_set
12689 * @note If the programmer instantiates the canvas by means of the
12690 * ecore_evas_new() family of helper functions, Ecore will take
12691 * care of registering on it all standard modifiers: "Shift",
12692 * "Control", "Alt", "Meta", "Hyper", "Super".
12694 EAPI void evas_key_modifier_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12697 * Removes the @p keyname key from the current list of modifier keys
12700 * @param e The pointer to the Evas canvas
12701 * @param keyname The name of the key to remove from the modifiers list.
12703 * @see evas_key_modifier_add
12704 * @see evas_key_modifier_get
12705 * @see evas_key_modifier_on
12706 * @see evas_key_modifier_off
12707 * @see evas_key_modifier_is_set
12709 EAPI void evas_key_modifier_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12712 * Adds the @p keyname key to the current list of lock keys.
12714 * @param e The pointer to the Evas canvas
12715 * @param keyname The name of the key to add to the locks list.
12717 * Locks are keys like caps lock, num lock or scroll lock, i.e., keys
12718 * which are meant to be pressed once -- toggling a binary state which
12719 * is bound to it -- and thus altering the behavior of all
12720 * subsequently pressed keys somehow, depending on its state. Evas is
12721 * so that these keys can be defined by the user.
12723 * This allows custom locks to be added to the evas system at run
12724 * time. It is then possible to set and unset lock keys
12725 * programmatically for other parts of the program to check and act
12726 * on. Programmers using Evas would check for lock keys on key event
12727 * callbacks using evas_key_lock_is_set().
12729 * @see evas_key_lock_get
12730 * @see evas_key_lock_del
12731 * @see evas_key_lock_on
12732 * @see evas_key_lock_off
12733 * @see evas_key_lock_is_set
12735 * @note If the programmer instantiates the canvas by means of the
12736 * ecore_evas_new() family of helper functions, Ecore will take
12737 * care of registering on it all standard lock keys: "Caps_Lock",
12738 * "Num_Lock", "Scroll_Lock".
12740 EAPI void evas_key_lock_add(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12743 * Removes the @p keyname key from the current list of lock keys on
12746 * @param e The pointer to the Evas canvas
12747 * @param keyname The name of the key to remove from the locks list.
12749 * @see evas_key_lock_get
12750 * @see evas_key_lock_add
12751 * @see evas_key_lock_on
12752 * @see evas_key_lock_off
12754 EAPI void evas_key_lock_del(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12757 * Enables or turns on programmatically the modifier key with name @p
12760 * @param e The pointer to the Evas canvas
12761 * @param keyname The name of the modifier to enable.
12763 * The effect will be as if the key was pressed for the whole time
12764 * between this call and a matching evas_key_modifier_off().
12766 * @see evas_key_modifier_add
12767 * @see evas_key_modifier_get
12768 * @see evas_key_modifier_off
12769 * @see evas_key_modifier_is_set
12771 EAPI void evas_key_modifier_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12774 * Disables or turns off programmatically the modifier key with name
12777 * @param e The pointer to the Evas canvas
12778 * @param keyname The name of the modifier to disable.
12780 * @see evas_key_modifier_add
12781 * @see evas_key_modifier_get
12782 * @see evas_key_modifier_on
12783 * @see evas_key_modifier_is_set
12785 EAPI void evas_key_modifier_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12788 * Enables or turns on programmatically the lock key with name @p
12791 * @param e The pointer to the Evas canvas
12792 * @param keyname The name of the lock to enable.
12794 * The effect will be as if the key was put on its active state after
12797 * @see evas_key_lock_get
12798 * @see evas_key_lock_add
12799 * @see evas_key_lock_del
12800 * @see evas_key_lock_off
12802 EAPI void evas_key_lock_on(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12805 * Disables or turns off programmatically the lock key with name @p
12808 * @param e The pointer to the Evas canvas
12809 * @param keyname The name of the lock to disable.
12811 * The effect will be as if the key was put on its inactive state
12814 * @see evas_key_lock_get
12815 * @see evas_key_lock_add
12816 * @see evas_key_lock_del
12817 * @see evas_key_lock_on
12819 EAPI void evas_key_lock_off(Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2);
12822 * Creates a bit mask from the @p keyname @b modifier key. Values
12823 * returned from different calls to it may be ORed together,
12826 * @param e The canvas whom to query the bit mask from.
12827 * @param keyname The name of the modifier key to create the mask for.
12829 * @returns the bit mask or 0 if the @p keyname key wasn't registered as a
12830 * modifier for canvas @p e.
12832 * This function is meant to be using in conjunction with
12833 * evas_object_key_grab()/evas_object_key_ungrab(). Go check their
12834 * documentation for more information.
12836 * @see evas_key_modifier_add
12837 * @see evas_key_modifier_get
12838 * @see evas_key_modifier_on
12839 * @see evas_key_modifier_off
12840 * @see evas_key_modifier_is_set
12841 * @see evas_object_key_grab
12842 * @see evas_object_key_ungrab
12844 EAPI Evas_Modifier_Mask evas_key_modifier_mask_get(const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
12847 * Requests @p keyname key events be directed to @p obj.
12849 * @param obj the object to direct @p keyname events to.
12850 * @param keyname the key to request events for.
12851 * @param modifiers a mask of modifiers that must be present to
12852 * trigger the event.
12853 * @param not_modifiers a mask of modifiers that must @b not be present
12854 * to trigger the event.
12855 * @param exclusive request that the @p obj is the only object
12856 * receiving the @p keyname events.
12857 * @return @c EINA_TRUE, if the call succeeded, @c EINA_FALSE otherwise.
12859 * Key grabs allow one or more objects to receive key events for
12860 * specific key strokes even if other objects have focus. Whenever a
12861 * key is grabbed, only the objects grabbing it will get the events
12862 * for the given keys.
12864 * @p keyname is a platform dependent symbolic name for the key
12865 * pressed (see @ref Evas_Keys for more information).
12867 * @p modifiers and @p not_modifiers are bit masks of all the
12868 * modifiers that must and mustn't, respectively, be pressed along
12869 * with @p keyname key in order to trigger this new key
12870 * grab. Modifiers can be things such as Shift and Ctrl as well as
12871 * user defined types via evas_key_modifier_add(). Retrieve them with
12872 * evas_key_modifier_mask_get() or use @c 0 for empty masks.
12874 * @p exclusive will make the given object the only one permitted to
12875 * grab the given key. If given @c EINA_TRUE, subsequent calls on this
12876 * function with different @p obj arguments will fail, unless the key
12877 * is ungrabbed again.
12879 * Example code follows.
12880 * @dontinclude evas-events.c
12881 * @skip if (d.focus)
12884 * See the full example @ref Example_Evas_Events "here".
12886 * @warning Providing impossible modifier sets creates undefined behavior
12888 * @see evas_object_key_ungrab
12889 * @see evas_object_focus_set
12890 * @see evas_object_focus_get
12891 * @see evas_focus_get
12892 * @see evas_key_modifier_add
12894 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);
12897 * Removes the grab on @p keyname key events by @p obj.
12899 * @param obj the object that has an existing key grab.
12900 * @param keyname the key the grab is set for.
12901 * @param modifiers a mask of modifiers that must be present to
12902 * trigger the event.
12903 * @param not_modifiers a mask of modifiers that must not not be
12904 * present to trigger the event.
12906 * Removes a key grab on @p obj if @p keyname, @p modifiers, and @p
12907 * not_modifiers match.
12909 * Example code follows.
12910 * @dontinclude evas-events.c
12911 * @skip got here by key grabs
12914 * See the full example @ref Example_Evas_Events "here".
12916 * @see evas_object_key_grab
12917 * @see evas_object_focus_set
12918 * @see evas_object_focus_get
12919 * @see evas_focus_get
12921 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);
12928 * @defgroup Evas_Touch_Point_List Touch Point List Functions
12930 * Functions to get information of touched points in the Evas.
12932 * Evas maintains list of touched points on the canvas. Each point has
12933 * its co-ordinates, id and state. You can get the number of touched
12934 * points and information of each point using evas_touch_point_list
12937 * @ingroup Evas_Canvas
12941 * @addtogroup Evas_Touch_Point_List
12946 * Get the number of touched point in the evas.
12948 * @param e The pointer to the Evas canvas.
12949 * @return The number of touched point on the evas.
12951 * New touched point is added to the list whenever touching the evas
12952 * and point is removed whenever removing touched point from the evas.
12956 * extern Evas *evas;
12959 * count = evas_touch_point_list_count(evas);
12960 * printf("The count of touch points: %i\n", count);
12963 * @see evas_touch_point_list_nth_xy_get()
12964 * @see evas_touch_point_list_nth_id_get()
12965 * @see evas_touch_point_list_nth_state_get()
12967 EAPI unsigned int evas_touch_point_list_count(Evas *e) EINA_ARG_NONNULL(1);
12970 * This function returns the nth touch point's co-ordinates.
12972 * @param e The pointer to the Evas canvas.
12973 * @param n The number of the touched point (0 being the first).
12974 * @param x The pointer to a Evas_Coord to be filled in.
12975 * @param y The pointer to a Evas_Coord to be filled in.
12977 * Touch point's co-ordinates is updated whenever moving that point
12982 * extern Evas *evas;
12985 * if (evas_touch_point_list_count(evas))
12987 * evas_touch_point_nth_xy_get(evas, 0, &x, &y);
12988 * printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
12992 * @see evas_touch_point_list_count()
12993 * @see evas_touch_point_list_nth_id_get()
12994 * @see evas_touch_point_list_nth_state_get()
12996 EAPI void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) EINA_ARG_NONNULL(1);
12999 * This function returns the @p id of nth touch point.
13001 * @param e The pointer to the Evas canvas.
13002 * @param n The number of the touched point (0 being the first).
13003 * @return id of nth touch point, if the call succeeded, -1 otherwise.
13005 * The point which comes from Mouse Event has @p id 0 and The point
13006 * which comes from Multi Event has @p id that is same as Multi
13007 * Event's device id.
13011 * extern Evas *evas;
13014 * if (evas_touch_point_list_count(evas))
13016 * id = evas_touch_point_nth_id_get(evas, 0);
13017 * printf("The first touch point's id: %i\n", id);
13021 * @see evas_touch_point_list_count()
13022 * @see evas_touch_point_list_nth_xy_get()
13023 * @see evas_touch_point_list_nth_state_get()
13025 EAPI int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);
13028 * This function returns the @p state of nth touch point.
13030 * @param e The pointer to the Evas canvas.
13031 * @param n The number of the touched point (0 being the first).
13032 * @return @p state of nth touch point, if the call succeeded,
13033 * EVAS_TOUCH_POINT_CANCEL otherwise.
13035 * The point's @p state is EVAS_TOUCH_POINT_DOWN when pressed,
13036 * EVAS_TOUCH_POINT_STILL when the point is not moved after pressed,
13037 * EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and
13038 * EVAS_TOUCH_POINT_UP when released.
13042 * extern Evas *evas;
13043 * Evas_Touch_Point_State state;
13045 * if (evas_touch_point_list_count(evas))
13047 * state = evas_touch_point_nth_state_get(evas, 0);
13048 * printf("The first touch point's state: %i\n", state);
13052 * @see evas_touch_point_list_count()
13053 * @see evas_touch_point_list_nth_xy_get()
13054 * @see evas_touch_point_list_nth_id_get()
13056 EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) EINA_ARG_NONNULL(1);