aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/edje/src/lib/Edje.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/edje/src/lib/Edje.h')
-rw-r--r--libraries/edje/src/lib/Edje.h3926
1 files changed, 3926 insertions, 0 deletions
diff --git a/libraries/edje/src/lib/Edje.h b/libraries/edje/src/lib/Edje.h
new file mode 100644
index 0000000..c8094b4
--- /dev/null
+++ b/libraries/edje/src/lib/Edje.h
@@ -0,0 +1,3926 @@
1/**
2@brief Edje Graphical Design Library
3
4These routines are used for Edje.
5
6@mainpage Edje Library Documentation
7@version 1.1
8@date 2003-2011
9
10Please see the @ref authors page for contact details.
11
12
13
14
15
16
17
18@section intro What is Edje?
19
20Edje is a complex graphical design & layout library.
21
22It doesn't pretend to do containing and regular layout like a widget
23set, but it is the base for such components. Based on the requirements
24of Enlightenment 0.17, Edje should serve all the purposes of creating
25visual elements (borders of windows, buttons, scrollbars, etc.) and
26allow the designer the ability to animate, layout and control the look
27and feel of any program using Edje as its basic GUI constructor. This
28library allows for multiple collections of Layouts in one file,
29sharing the same image and font database and thus allowing a whole
30theme to be conveniently packaged into 1 file and shipped around.
31
32Edje separates the layout and behavior logic. Edje files ship with an
33image and font database, used by all the parts in all the collections
34to source graphical data. It has a directory of logical part names
35pointing to the part collection entry ID in the file (thus allowing
36for multiple logical names to point to the same part collection,
37allowing for the sharing of data between display elements). Each part
38collection consists of a list of visual parts, as well as a list of
39programs. A program is a conditionally run program that if a
40particular event occurs (a button is pressed, a mouse enters or leaves
41a part) will trigger an action that may affect other parts. In this
42way a part collection can be "programmed" via its file as to hilight
43buttons when the mouse passes over them or show hidden parts when a
44button is clicked somewhere etc. The actions performed in changing
45from one state to another are also allowed to transition over a period
46of time, allowing animation. Programs and animations can be run in
47"parallel".
48
49This separation and simplistic event driven style of programming can produce
50almost any look and feel one could want for basic visual elements. Anything
51more complex is likely the domain of an application or widget set that may
52use Edje as a convenient way of being able to configure parts of the display.
53
54For details of Edje's history, see the \ref history section.
55
56
57@section requirements What does Edje require?
58
59Edje requires fairly little on your system. to use the Edje runtime library
60you need:
61
62 - Evas (library)
63 - Ecore (library)
64 - Eet (library)
65 - Embryo (library)
66 - Eina (library)
67 - Lua 5.1 (library)
68
69Evas needs to be build with the JPEG, PNG and EET image loaders enabled at a
70minimum. You will also need the buffer engine (which requires the
71software_generic engine) as well.
72
73Ecore needs the ECORE, ECORE_EVAS and ECORE_X modules built at a minimum.
74It's suggested to build all the Ecore modules. You will beed the Buffer
75engine support built into Ecore_Evas for edje?_cc to function.
76
77
78@section compiling How to compile and test Edje
79
80Now you need to compile and install Edje.
81
82@verbatim
83 ./configure
84 make
85 sudo make install
86@endverbatim
87
88You now have it installed and ready to go, but you need input
89data. There are lots of examples in SVN, the best one is
90Enlightenment's own theme file.
91
92You may use different tools to edit and view the generated ".edj"
93files, for instance:
94
95 - edje_player (provided by Edje)
96 - editje (http://trac.enlightenment.org/e/wiki/Editje)
97 - edje_viewer (http://trac.enlightenment.org/e/wiki/Edje_Viewer)
98
99
100@section details So how does this all work?
101
102Edje internally holds a geometry state machine and state graph of what is
103visible, not, where, at what size, with what colors etc. This is described
104to Edje from an Edje .edj file containing this information. These files can
105be produced by using edje_cc to take a text file (a .edc file) and "compile"
106an output .edj file that contains this information, images and any other
107data needed.
108
109The application using Edje will then create an object in its Evas
110canvas and set the bundle file to use, specifying the @b group name to
111use. Edje will load such information and create all the required
112children objects with the specified properties as defined in each @b
113part of the given group. See the following annotated example:
114
115@code
116
117#include <Eina.h>
118#include <Evas.h>
119#include <Ecore.h>
120#include <Ecore_Evas.h>
121#include <Edje.h>
122
123#define WIDTH 320
124#define HEIGHT 240
125
126static Evas_Object *create_my_group(Evas *canvas, const char *text)
127{
128 Evas_Object *edje;
129
130 edje = edje_object_add(canvas);
131 if (!edje)
132 {
133 EINA_LOG_CRIT("could not create edje object!");
134 return NULL;
135 }
136
137 if (!edje_object_file_set(edje, "edje_example.edj", "my_group"))
138 {
139 int err = edje_object_load_error_get(edje);
140 const char *errmsg = edje_load_error_str(err);
141 EINA_LOG_ERR("could not load 'my_group' from edje_example.edj: %s",
142 errmsg);
143
144 evas_object_del(edje);
145 return NULL;
146 }
147
148 if (text)
149 {
150 if (!edje_object_part_text_set(edje, "text", text))
151 {
152 EINA_LOG_WARN("could not set the text. "
153 "Maybe part 'text' does not exist?");
154 }
155 }
156
157 evas_object_move(edje, 0, 0);
158 evas_object_resize(edje, WIDTH, HEIGHT);
159 evas_object_show(edje);
160 return edje;
161}
162
163int main(int argc, char *argv[])
164{
165 Ecore_Evas *window;
166 Evas *canvas;
167 Evas_Object *edje;
168 const char *text;
169
170 eina_init();
171 evas_init();
172 ecore_init();
173 ecore_evas_init();
174 edje_init();
175
176 window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
177 if (!window)
178 {
179 EINA_LOG_CRIT("could not create window.");
180 return -1;
181 }
182 canvas = ecore_evas_get(window);
183
184 text = (argc > 1) ? argv[1] : NULL;
185
186 edje = create_my_group(canvas, text);
187 if (!edje)
188 return -2;
189
190 ecore_evas_show(window);
191 ecore_main_loop_begin();
192
193 evas_object_del(edje);
194 ecore_evas_free(window);
195
196 return 0;
197}
198@endcode
199
200It requires the following source Edje file:
201@code
202// compile: edje_cc edje_example.edc
203collections {
204 group {
205 name: "my_group"; // must be the same as in edje_example.c
206
207 parts {
208 part {
209 name: "background";
210 type: RECT; // plain boring rectangle
211 mouse_events: 0; // we don't need any mouse event on the background
212
213 // just one state "default"
214 description {
215 state: "default" 0.0; // must always exist
216 color: 255 255 255 255; // white
217
218 // define part coordinates:
219
220 rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0]
221 relative: 0.0 0.0;
222 offset: 0 0;
223 }
224 rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1)
225 relative: 1.0 1.0;
226 offset: -1 -1;
227 }
228 }
229 }
230
231 part {
232 name: "text";
233 type: TEXT;
234 mouse_events: 1; // we want to change the color on mouse-over
235
236 // 2 states, one "default" and another "over" to be used
237 // on mouse over effect
238
239 description {
240 state: "default" 0.0;
241 color: 255 0 0 255; // red
242
243 // define part coordinates:
244
245 rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10)
246 relative: 0.1 0.2;
247 offset: 5 10;
248 }
249 rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11)
250 relative: 0.9 0.8;
251 offset: -6 -11;
252 }
253
254 // define text specific state details
255 text {
256 font: "Sans"; // using fontconfig name!
257 size: 10;
258 text: "hello world";
259 }
260 }
261
262 description {
263 state: "over" 0.0;
264 inherit: "default" 0.0; // copy everything from "default" at this point
265
266 color: 0 255 0 255; // override color, now it is green
267 }
268 }
269
270 // do programs to change color on text mouse in/out (over)
271 programs {
272 program {
273 // what triggers this program:
274 signal: "mouse,in";
275 source: "text";
276
277 // what this program does:
278 action: STATE_SET "over" 0.0;
279 target: "text";
280
281 // do the state-set in a nice interpolation animation
282 // using linear time in 0.1 second
283 transition: LINEAR 0.1;
284 }
285
286 program {
287 // what triggers this program:
288 signal: "mouse,out";
289 source: "text";
290
291 // what this program does:
292 action: STATE_SET "default" 0.0;
293 target: "text";
294
295 // do the state-set in a nice interpolation animation
296 // using linear time in 0.1 second
297 transition: LINEAR 0.1;
298 }
299 }
300 }
301 }
302}
303@endcode
304
305
306One should save these files as edje_example.c and edje_example.edc then:
307@verbatim
308gcc -o edje_example edje_example.c `pkg-config --cflags --libs eina evas ecore ecore-evas edje`
309edje_cc edje_example.edc
310
311./edje_example "some text"
312@endverbatim
313
314Although simple, this example illustrates that animations and state
315changes can be done from the Edje file itself without any requirement
316in the C application.
317
318Before digging into changing or creating your own Edje source (edc)
319files, read the @ref edcref.
320
321
322
323@section history Edje History
324
325It's a sequel to "Ebits" which has serviced the needs of Enlightenment
326development for early version 0.17. The original design parameters under
327which Ebits came about were a lot more restricted than the resulting
328use of them, thus Edje was born.
329
330Edje is a more complex layout engine compared to Ebits. It doesn't
331pretend to do containing and regular layout like a widget set. It
332still inherits the more simplistic layout ideas behind Ebits, but it
333now does them a lot more cleanly, allowing for easy expansion, and the
334ability to cover much more ground than Ebits ever could. For the
335purposes of Enlightenment 0.17, Edje was conceived to serve all the
336purposes of creating visual elements (borders of windows, buttons,
337scrollbars, etc.) and allow the designer the ability to animate,
338layout and control the look and feel of any program using Edje as its
339basic GUI constructor.
340
341Unlike Ebits, Edje separates the layout and behavior logic.
342
343
344
345@section Edje_Examples Examples on Edje's usage
346
347What follows is a list with various commented examples, covering a great
348part of Edje's API:
349
350- @ref Example_Edje_Basics
351- @ref tutorial_edje_swallow
352- @ref tutorial_edje_table
353- @ref tutorial_edje_box
354- @ref tutorial_edje_box2
355- @ref tutorial_edje_color_class
356- @ref tutorial_edje_animations
357- @ref Example_Edje_Signals_Messages
358
359
360*/
361
362/**
363@page authors Authors
364@author Carsten Haitzler <raster@@rasterman.com>
365@author Tilman Sauerbeck (tilman at code-monkey de)
366@author ZigsMcKenzie <zigsmckenzie@@gmail.com>
367@author Cedric BAIL <cedric.bail@@free.fr>
368@author Brian Mattern <rephorm@@rephorm.com>
369@author Mathieu Taillefumier <mathieu.taillefumier@@free.fr>
370@author Tristan <blunderer@@gmail.com>
371@author Gustavo Lima Chaves <glima@@profusion.mobi>
372@author Bruno Dilly <bdilly@@profusion.mobi>
373@author Fabiano Fidêncio <fidencio@@profusion.mobi>
374@author Jihoon Kim <jihoon48.kim@@samsung.com>
375@author Tiago Falcão <tiago@@profusion.mobi>
376@author Davide Andreoli <dave@@gurumeditation.it>
377@author Sebastian Dransfeld <sd@@tango.flipp.net>
378@author Tom Hacohen <tom@@stosb.com>
379@author Aharon Hillel <a.hillel@@partner.samsung.com>
380
381Please contact <enlightenment-devel@lists.sourceforge.net> to get in
382contact with the developers and maintainers.
383*/
384
385
386/**
387
388@example embryo_custom_state.edc
389This example show how to create a custom state from embryo. Clicking on the
3903 labels will rotate the object in the given direction.
391
392@example embryo_pong.edc
393Super-simple Pong implementation in pure embryo.
394
395@example embryo_run_program.edc
396This example show how to run an edje program from embryo code.
397
398@example embryo_set_state.edc
399This example show how to change the state of a part from embryo code.
400
401@example embryo_set_text.edc
402This example show how to set the text in TEXT part from embryo code.
403
404@example embryo_timer.edc
405This example show the usage of timers in embryo.
406
407@example external_elm_anchorblock.edc
408This example use an elementary anchorblock and a button to animate the text.
409
410@example external_elm_button.edc
411This example create some elementary buttons and do some actions on user click.
412
413@example external_elm_check.edc
414This example show EXTERNAL checkbox in action.
415
416@example external_elm_panes.edc
417This example show EXTERNAL elementary panes in action.
418
419@example external_emotion_elm.edc
420Super-concise video player example using Edje/Emotion/Elementary.
421
422@example lua_script.edc
423This example show the usage of lua scripting to create and animate some
424objects in the canvas.
425
426@example toggle_using_filter.edc
427This example show how to toggle the state of a part using the 'filter'
428param in edje programs
429
430*/
431
432#ifndef _EDJE_H
433#define _EDJE_H
434
435#ifndef _MSC_VER
436# include <stdint.h>
437#endif
438#include <math.h>
439#include <float.h>
440#include <limits.h>
441
442#include <Evas.h>
443
444#ifdef EAPI
445# undef EAPI
446#endif
447
448#ifdef _WIN32
449# ifdef EFL_EDJE_BUILD
450# ifdef DLL_EXPORT
451# define EAPI __declspec(dllexport)
452# else
453# define EAPI
454# endif /* ! DLL_EXPORT */
455# else
456# define EAPI __declspec(dllimport)
457# endif /* ! EFL_EDJE_BUILD */
458#else
459# ifdef __GNUC__
460# if __GNUC__ >= 4
461# define EAPI __attribute__ ((visibility("default")))
462# else
463# define EAPI
464# endif
465# else
466# define EAPI
467# endif
468#endif
469
470#ifdef __cplusplus
471extern "C" {
472#endif
473
474#define EDJE_VERSION_MAJOR 1
475#define EDJE_VERSION_MINOR 0
476
477 typedef struct _Edje_Version
478 {
479 int major;
480 int minor;
481 int micro;
482 int revision;
483 } Edje_Version;
484
485 EAPI extern Edje_Version *edje_version;
486
487/**
488 * @file Edje.h
489 * @brief Edje Graphical Design Library
490 *
491 * These routines are used for Edje.
492 */
493
494/**
495 * Identifiers of Edje message types, which can be sent back and forth
496 * code and a given Edje object's theme file/group.
497 *
498 * @see edje_object_message_send()
499 * @see edje_object_message_handler_set()
500 */
501typedef enum _Edje_Message_Type
502{
503 EDJE_MESSAGE_NONE = 0,
504
505 EDJE_MESSAGE_SIGNAL = 1, /* DONT USE THIS */
506
507 EDJE_MESSAGE_STRING = 2, /**< A message with a string as value. Use #Edje_Message_String structs as message body, for this type. */
508 EDJE_MESSAGE_INT = 3, /**< A message with an integer number as value. Use #Edje_Message_Int structs as message body, for this type. */
509 EDJE_MESSAGE_FLOAT = 4, /**< A message with a floating pointer number as value. Use #Edje_Message_Float structs as message body, for this type. */
510
511 EDJE_MESSAGE_STRING_SET = 5, /**< A message with a list of strings as value. Use #Edje_Message_String_Set structs as message body, for this type. */
512 EDJE_MESSAGE_INT_SET = 6, /**< A message with a list of integer numbers as value. Use #Edje_Message_Int_Set structs as message body, for this type. */
513 EDJE_MESSAGE_FLOAT_SET = 7, /**< A message with a list of floating point numbers as value. Use #Edje_Message_Float_Set structs as message body, for this type. */
514
515 EDJE_MESSAGE_STRING_INT = 8, /**< A message with a struct containing a string and an integer number as value. Use #Edje_Message_String_Int structs as message body, for this type. */
516 EDJE_MESSAGE_STRING_FLOAT = 9, /**< A message with a struct containing a string and a floating point number as value. Use #Edje_Message_String_Float structs as message body, for this type. */
517
518 EDJE_MESSAGE_STRING_INT_SET = 10, /**< A message with a struct containing a string and list of integer numbers as value. Use #Edje_Message_String_Int_Set structs as message body, for this type. */
519 EDJE_MESSAGE_STRING_FLOAT_SET = 11 /**< A message with a struct containing a string and list of floating point numbers as value. Use #Edje_Message_String_Float_Set structs as message body, for this type. */
520} Edje_Message_Type;
521
522typedef enum _Edje_Aspect_Control
523{
524 EDJE_ASPECT_CONTROL_NONE = 0,
525 EDJE_ASPECT_CONTROL_NEITHER = 1,
526 EDJE_ASPECT_CONTROL_HORIZONTAL = 2,
527 EDJE_ASPECT_CONTROL_VERTICAL = 3,
528 EDJE_ASPECT_CONTROL_BOTH = 4
529} Edje_Aspect_Control;
530
531typedef enum _Edje_Object_Table_Homogeneous_Mode
532{
533 EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE = 0,
534 EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1,
535 EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
536} Edje_Object_Table_Homogeneous_Mode;
537
538typedef enum _Edje_Part_Type
539{
540 EDJE_PART_TYPE_NONE = 0,
541 EDJE_PART_TYPE_RECTANGLE = 1,
542 EDJE_PART_TYPE_TEXT = 2,
543 EDJE_PART_TYPE_IMAGE = 3,
544 EDJE_PART_TYPE_SWALLOW = 4,
545 EDJE_PART_TYPE_TEXTBLOCK = 5,
546 EDJE_PART_TYPE_GRADIENT = 6,
547 EDJE_PART_TYPE_GROUP = 7,
548 EDJE_PART_TYPE_BOX = 8,
549 EDJE_PART_TYPE_TABLE = 9,
550 EDJE_PART_TYPE_EXTERNAL = 10,
551 EDJE_PART_TYPE_PROXY = 11,
552 EDJE_PART_TYPE_LAST = 12
553} Edje_Part_Type;
554
555typedef enum _Edje_Text_Effect
556{
557#define EDJE_TEXT_EFFECT_MASK_BASIC 0xf
558#define EDJE_TEXT_EFFECT_BASIC_SET(x, s) \
559 do { x = ((x) & ~EDJE_TEXT_EFFECT_MASK_BASIC) | (s); } while (0)
560 EDJE_TEXT_EFFECT_NONE = 0,
561 EDJE_TEXT_EFFECT_PLAIN = 1,
562 EDJE_TEXT_EFFECT_OUTLINE = 2,
563 EDJE_TEXT_EFFECT_SOFT_OUTLINE = 3,
564 EDJE_TEXT_EFFECT_SHADOW = 4,
565 EDJE_TEXT_EFFECT_SOFT_SHADOW = 5,
566 EDJE_TEXT_EFFECT_OUTLINE_SHADOW = 6,
567 EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW = 7,
568 EDJE_TEXT_EFFECT_FAR_SHADOW = 8,
569 EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW = 9,
570 EDJE_TEXT_EFFECT_GLOW = 10,
571
572 EDJE_TEXT_EFFECT_LAST = 11,
573
574#define EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION (0x7 << 4)
575#define EDJE_TEXT_EFFECT_SHADOW_DIRECTION_SET(x, s) \
576 do { x = ((x) & ~EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) | (s); } while (0)
577 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4),
578 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM = (0x1 << 4),
579 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4),
580 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT = (0x3 << 4),
581 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4),
582 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP = (0x5 << 4),
583 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4),
584 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT = (0x7 << 4)
585} Edje_Text_Effect;
586
587typedef enum _Edje_Action_Type
588{
589 EDJE_ACTION_TYPE_NONE = 0,
590 EDJE_ACTION_TYPE_STATE_SET = 1,
591 EDJE_ACTION_TYPE_ACTION_STOP = 2,
592 EDJE_ACTION_TYPE_SIGNAL_EMIT = 3,
593 EDJE_ACTION_TYPE_DRAG_VAL_SET = 4,
594 EDJE_ACTION_TYPE_DRAG_VAL_STEP = 5,
595 EDJE_ACTION_TYPE_DRAG_VAL_PAGE = 6,
596 EDJE_ACTION_TYPE_SCRIPT = 7,
597 EDJE_ACTION_TYPE_FOCUS_SET = 8,
598 EDJE_ACTION_TYPE_RESERVED00 = 9,
599 EDJE_ACTION_TYPE_FOCUS_OBJECT = 10,
600 EDJE_ACTION_TYPE_PARAM_COPY = 11,
601 EDJE_ACTION_TYPE_PARAM_SET = 12,
602 EDJE_ACTION_TYPE_SOUND_SAMPLE = 13, /**< @since 1.1 */
603 EDJE_ACTION_TYPE_SOUND_TONE = 14, /**< @since 1.1 */
604 EDJE_ACTION_TYPE_LAST = 15
605} Edje_Action_Type;
606
607typedef enum _Edje_Tween_Mode
608{
609 EDJE_TWEEN_MODE_NONE = 0,
610 EDJE_TWEEN_MODE_LINEAR = 1,
611 EDJE_TWEEN_MODE_SINUSOIDAL = 2,
612 EDJE_TWEEN_MODE_ACCELERATE = 3,
613 EDJE_TWEEN_MODE_DECELERATE = 4,
614 EDJE_TWEEN_MODE_ACCELERATE_FACTOR = 5,
615 EDJE_TWEEN_MODE_DECELERATE_FACTOR = 6,
616 EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR = 7,
617 EDJE_TWEEN_MODE_DIVISOR_INTERP = 8,
618 EDJE_TWEEN_MODE_BOUNCE = 9,
619 EDJE_TWEEN_MODE_SPRING = 10,
620 EDJE_TWEEN_MODE_LAST = 11,
621 EDJE_TWEEN_MODE_MASK = 0xff,
622 EDJE_TWEEN_MODE_OPT_FROM_CURRENT = (1 << 31)
623} Edje_Tween_Mode;
624
625typedef enum _Edje_Cursor
626{
627 EDJE_CURSOR_MAIN,
628 EDJE_CURSOR_SELECTION_BEGIN,
629 EDJE_CURSOR_SELECTION_END,
630 EDJE_CURSOR_PREEDIT_START,
631 EDJE_CURSOR_PREEDIT_END,
632 EDJE_CURSOR_USER,
633 EDJE_CURSOR_USER_EXTRA,
634 // more later
635} Edje_Cursor;
636
637struct _Edje_Entry_Change_Info
638{
639 union {
640 struct {
641 const char *content;
642 size_t pos;
643 size_t plain_length; /* Number of cursor positions represented
644 in content. */
645 } insert;
646 struct {
647 const char *content;
648 size_t start, end;
649 } del;
650 } change;
651 Eina_Bool insert : 1; /**< True if the "change" union's "insert" is valid */
652 Eina_Bool merge : 1; /**< True if can be merged with the previous one. Used for example with insertion when something is already selected. */
653};
654
655/**
656 * @since 1.1.0
657 */
658typedef struct _Edje_Entry_Change_Info Edje_Entry_Change_Info;
659
660typedef struct _Edje_Message_String Edje_Message_String;
661typedef struct _Edje_Message_Int Edje_Message_Int;
662typedef struct _Edje_Message_Float Edje_Message_Float;
663typedef struct _Edje_Message_String_Set Edje_Message_String_Set;
664typedef struct _Edje_Message_Int_Set Edje_Message_Int_Set;
665typedef struct _Edje_Message_Float_Set Edje_Message_Float_Set;
666typedef struct _Edje_Message_String_Int Edje_Message_String_Int;
667typedef struct _Edje_Message_String_Float Edje_Message_String_Float;
668typedef struct _Edje_Message_String_Int_Set Edje_Message_String_Int_Set;
669typedef struct _Edje_Message_String_Float_Set Edje_Message_String_Float_Set;
670
671struct _Edje_Message_String
672{
673 char *str; /**< The message's string pointer */
674}; /**< Structure passed as value on #EDJE_MESSAGE_STRING messages. The string in it is automatically freed be Edje if passed to you by Edje */
675
676struct _Edje_Message_Int
677{
678 int val; /**< The message's value */
679}; /**< Structure passed as value on #EDJE_MESSAGE_INT messages */
680
681struct _Edje_Message_Float
682{
683 double val; /**< The message's value */
684}; /**< Structure passed as value on #EDJE_MESSAGE_FLOAT messages */
685
686struct _Edje_Message_String_Set
687{
688 int count; /**< The size of the message's array (may be greater than 1) */
689 char *str[1]; /**< The message's @b array of string pointers */
690}; /**< Structure passed as value on #EDJE_MESSAGE_STRING_SET messages. The array in it is automatically freed be Edje if passed to you by Edje */
691
692struct _Edje_Message_Int_Set
693{
694 int count; /**< The size of the message's array (may be greater than 1) */
695 int val[1]; /**< The message's @b array of integers */
696}; /**< Structure passed as value on #EDJE_MESSAGE_INT_SET messages. The array in it is automatically freed be Edje if passed to you by Edje */
697
698struct _Edje_Message_Float_Set
699{
700 int count; /**< The size of the message's array (may be greater than 1) */
701 double val[1]; /**< The message's @b array of floats */
702}; /**< Structure passed as value on #EDJE_MESSAGE_FLOAT_SET messages. The array in it is automatically freed be Edje if passed to you by Edje */
703
704struct _Edje_Message_String_Int
705{
706 char *str; /**< The message's string value */
707 int val; /**< The message's integer value */
708}; /**< Structure passed as value on #EDJE_MESSAGE_STRING_INT messages. The string in it is automatically freed be Edje if passed to you by Edje */
709
710struct _Edje_Message_String_Float
711{
712 char *str; /**< The message's string value */
713 double val; /**< The message's float value */
714}; /**< Structure passed as value on #EDJE_MESSAGE_STRING_FLOAT messages. The string in it is automatically freed be Edje if passed to you by Edje */
715
716struct _Edje_Message_String_Int_Set
717{
718 char *str; /**< The message's string value */
719 int count; /**< The size of the message's array (may be greater than 1) */
720 int val[1]; /**< The message's @b array of integers */
721}; /**< Structure passed as value on #EDJE_MESSAGE_STRING_INT_SET messages. The array and string in it are automatically freed be Edje if passed to you by Edje */
722
723struct _Edje_Message_String_Float_Set
724{
725 char *str; /**< The message's string value */
726 int count; /**< The size of the message's array (may be greater than 1) */
727 double val[1]; /**< The message's @b array of floats */
728}; /**< Structure passed as value on #EDJE_MESSAGE_STRING_FLOAT_SET messages. The array and string in it are automatically freed be Edje if passed to you by Edje */
729
730typedef enum _Edje_Drag_Dir
731{
732 EDJE_DRAG_DIR_NONE = 0,
733 EDJE_DRAG_DIR_X = 1,
734 EDJE_DRAG_DIR_Y = 2,
735 EDJE_DRAG_DIR_XY = 3
736} Edje_Drag_Dir;
737
738typedef enum _Edje_Load_Error
739{
740 EDJE_LOAD_ERROR_NONE = 0, /**< No error happened, the loading was successful */
741 EDJE_LOAD_ERROR_GENERIC = 1, /**< A generic error happened during the loading */
742 EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< The file pointed to did not exist */
743 EDJE_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission to read the given file was denied */
744 EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Resource allocation failed during the loading */
745 EDJE_LOAD_ERROR_CORRUPT_FILE = 5, /**< The file pointed to was corrupt */
746 EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6, /**< The file pointed to had an unknown format */
747 EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7, /**< The file pointed to is incompatible, i.e., it doesn't match the library's current version's format */
748 EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8, /**< The group/collection set to load from was @b not found in the file */
749 EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9 /**< The group/collection set to load from had <b>recursive references</b> on its components */
750} Edje_Load_Error; /**< Edje file loading error codes one can get - see edje_load_error_str() too. */
751
752typedef enum _Edje_Text_Filter_Type
753{
754 EDJE_TEXT_FILTER_TEXT = 0,
755 EDJE_TEXT_FILTER_FORMAT = 1,
756 EDJE_TEXT_FILTER_MARKUP = 2
757} Edje_Text_Filter_Type;
758
759typedef enum _Edje_Text_Autocapital_Type
760{
761 EDJE_TEXT_AUTOCAPITAL_TYPE_NONE,
762 EDJE_TEXT_AUTOCAPITAL_TYPE_WORD,
763 EDJE_TEXT_AUTOCAPITAL_TYPE_SENTENCE,
764 EDJE_TEXT_AUTOCAPITAL_TYPE_ALLCHARACTER
765} Edje_Text_Autocapital_Type;
766
767/**
768 * The possible types the parameters of an EXTERNAL part can be.
769 */
770typedef enum _Edje_External_Param_Type
771{
772 EDJE_EXTERNAL_PARAM_TYPE_INT, /**< Parameter value is an integer. */
773 EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, /**< Parameter value is a double. */
774 EDJE_EXTERNAL_PARAM_TYPE_STRING, /**< Paramater value is a string. */
775 EDJE_EXTERNAL_PARAM_TYPE_BOOL, /**< Parameter value is boolean. */
776 EDJE_EXTERNAL_PARAM_TYPE_CHOICE, /**< Parameter value is one of a set of
777 predefined string choices. */
778 EDJE_EXTERNAL_PARAM_TYPE_MAX /**< Sentinel. Don't use. */
779} Edje_External_Param_Type;
780
781/**
782 * Flags that determine how a parameter may be accessed in different
783 * circumstances.
784 */
785typedef enum _Edje_External_Param_Flags
786{
787 EDJE_EXTERNAL_PARAM_FLAGS_NONE = 0, /**< Propery is incapable of operations, this is used to catch bogus flags. */
788 EDJE_EXTERNAL_PARAM_FLAGS_GET = (1 << 0), /**< Property can be read/get. */
789 EDJE_EXTERNAL_PARAM_FLAGS_SET = (1 << 1), /**< Property can be written/set. This only enables edje_object_part_external_param_set() and Embryo scripts. To enable the parameter being set from state description whenever it changes state, use #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */
790 EDJE_EXTERNAL_PARAM_FLAGS_STATE = (1 << 2), /**< Property can be set from state dsecription. */
791 EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR = (1 << 3), /**< This property is only set once when the object is constructed using its value from "default" 0.0 state description. Setting this overrides #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */
792 EDJE_EXTERNAL_PARAM_FLAGS_REGULAR = (EDJE_EXTERNAL_PARAM_FLAGS_GET |
793 EDJE_EXTERNAL_PARAM_FLAGS_SET |
794 EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */
795} Edje_External_Param_Flags;
796
797typedef enum
798{
799 EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
800 EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
801 EDJE_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
802 EDJE_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
803 EDJE_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
804 EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
805 EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
806 EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
807 EDJE_INPUT_PANEL_LAYOUT_INVALID
808} Edje_Input_Panel_Layout;
809
810/**
811 * @brief Converts type identifier to string nicer representation.
812 *
813 * This may be used to debug or other informational purposes.
814 *
815 * @param type the identifier to convert.
816 * @return the string with the string representation, or @c "(unknown)".
817 */
818EAPI const char *edje_external_param_type_str(Edje_External_Param_Type type) EINA_PURE;
819
820/**
821 * Struct that holds parameters for parts of type EXTERNAL.
822 */
823struct _Edje_External_Param
824{
825 const char *name; /**< The name of the parameter. */
826 Edje_External_Param_Type type; /**< The type of the parameter. This defines
827 which of the next three variables holds
828 the value for it. */
829 // XXX these could be in a union, but eet doesn't support them (or does it?)
830 int i; /**< Used by both integer and boolean */
831 double d; /**< Used by double */
832 const char *s; /**< Used by both string and choice */
833};
834/**
835 * Struct that holds parameters for parts of type EXTERNAL.
836 */
837typedef struct _Edje_External_Param Edje_External_Param;
838
839/**
840 * Helper macro to indicate an EXTERNAL's integer parameter is undefined.
841 */
842#define EDJE_EXTERNAL_INT_UNSET INT_MAX
843/**
844 * Helper macro to indicate an EXTERNAL's double parameter is undefined.
845 */
846#define EDJE_EXTERNAL_DOUBLE_UNSET DBL_MAX
847
848/**
849 * Struct holding information about an EXTERNAL part's parameters.
850 *
851 * When creating types to use with EXTERNAL parts, an array of this type is
852 * used to describe the different parameters the object uses.
853 *
854 * This struct holds the name, type and flags that define how and when the
855 * parameter is used, as well as information specific to each type, like the
856 * maximum or minimum value, that can be used by editors to restrict the
857 * range of values to set for each parameter.
858 */
859typedef struct _Edje_External_Param_Info Edje_External_Param_Info;
860/**
861 * Struct holding information about an EXTERNAL part's parameters.
862 *
863 * When creating types to use with EXTERNAL parts, an array of this type is
864 * used to describe the different parameters the object uses.
865 *
866 * This struct holds the name, type and flags that define how and when the
867 * parameter is used, as well as information specific to each type, like the
868 * maximum or minimum value, that can be used by editors to restrict the
869 * range of values to set for each parameter.
870 */
871struct _Edje_External_Param_Info
872{
873 const char *name; /**< Name of the parameter. */
874 Edje_External_Param_Type type; /**< Type of the parameter. */
875 Edje_External_Param_Flags flags; /**< Flags indicating how this parameter is
876 used. */
877 union {
878 struct {
879 int def, /**< Default value for the paramter. */
880 min, /**< Minimum value it can have. */
881 max, /**< Maximum value it can have. */
882 step; /**< Values will be a multiple of this. */
883 } i; /**< Info about integer type parametrs. Use #EDJE_EXTERNAL_INT_UNSET
884 on any of them to indicate they are not defined.*/
885 struct {
886 double def, /**< Default value for the paramter. */
887 min, /**< Minimum value it can have. */
888 max, /**< Maximum value it can have. */
889 step; /**< Values will be a multiple of this. */
890 } d; /**< Info about double type parametrs. Use
891#EDJE_EXTERNAL_DOUBLE_UNSET on any of them to indicate they are not defined.*/
892 struct {
893 const char *def; /**< Default value. */
894 const char *accept_fmt; /**< Not implemented. */
895 const char *deny_fmt; /**< Not implemented */
896 } s; /**< Info about string type parameters. NULL indicates undefined. */
897 struct {
898 int def; /**< Default value. */
899 const char *false_str; /**< String shown by editors to indicate the false state. */
900 const char *true_str; /**< String shown by editors to indicate the true state. */
901 } b; /**< Info about boolean type parameters.*/
902 struct {
903 const char *def; /**< Default value. */
904 const char **choices; /* Array of strings, each represents a
905 valid value for this parameter. The
906 last element of the array must be
907 NULL. */
908 char *(*def_get)(void *data, const Edje_External_Param_Info *info); /** return malloc() memory with the default choice, should be used if def is NULL. First parameter is Edje_External_Type::data */
909 char **(*query)(void *data, const Edje_External_Param_Info *info); /** NULL terminated array of strings, memory is dynamically allocated and should be freed with free() for array and each element. First parameter is Edje_External_Type::data */
910 } c; /**< Info about choice type parameters. */
911 } info;
912};
913
914#define EDJE_EXTERNAL_PARAM_INFO_INT_FULL_FLAGS(name, def, min, max, step, flags) \
915 {name, EDJE_EXTERNAL_PARAM_TYPE_INT, flags, {.i = {def, min, max, step}}}
916#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FULL_FLAGS(name, def, min, max, step, flags) \
917 {name, EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, flags, {.d = {def, min, max, step}}}
918#define EDJE_EXTERNAL_PARAM_INFO_STRING_FULL_FLAGS(name, def, accept, deny, flags) \
919 {name, EDJE_EXTERNAL_PARAM_TYPE_STRING, flags, {.s = {def, accept, deny}}}
920#define EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL_FLAGS(name, def, false_str, true_str, flags) \
921 {name, EDJE_EXTERNAL_PARAM_TYPE_BOOL, flags, {.b = {def, false_str, true_str}}}
922#define EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL_FLAGS(name, def, choices, flags) \
923 {name, EDJE_EXTERNAL_PARAM_TYPE_CHOICE, flags, {.c = {def, choices, NULL, NULL}}}
924#define EDJE_EXTERNAL_PARAM_INFO_CHOICE_DYNAMIC_FULL_FLAGS(name, def_get, query, flags) \
925 {name, EDJE_EXTERNAL_PARAM_TYPE_CHOICE, flags, {.c = {NULL, NULL, def_get, query}}}
926
927#define EDJE_EXTERNAL_PARAM_INFO_INT_FULL(name, def, min, max, step) \
928 EDJE_EXTERNAL_PARAM_INFO_INT_FULL_FLAGS(name, def, min, max, step, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
929#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FULL(name, def, min, max, step) \
930 EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FULL_FLAGS(name, def, min, max, step, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
931#define EDJE_EXTERNAL_PARAM_INFO_STRING_FULL(name, def, accept, deny) \
932 EDJE_EXTERNAL_PARAM_INFO_STRING_FULL_FLAGS(name, def, accept, deny, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
933#define EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL(name, def, false_str, true_str) \
934 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL_FLAGS(name, def, false_str, true_str, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
935#define EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL(name, def, choices) \
936 EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL_FLAGS(name, def, choices, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
937#define EDJE_EXTERNAL_PARAM_INFO_CHOICE_DYNAMIC_FULL(name, def_get, query) \
938 EDJE_EXTERNAL_PARAM_INFO_CHOICE_DYNAMIC_FULL_FLAGS(name, def_get, query, EDJE_EXTERNAL_PARAM_FLAGS_REGULAR)
939
940#define EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT(name, def) \
941 EDJE_EXTERNAL_PARAM_INFO_INT_FULL(name, def, EDJE_EXTERNAL_INT_UNSET, EDJE_EXTERNAL_INT_UNSET, EDJE_EXTERNAL_INT_UNSET)
942#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE_DEFAULT(name, def) \
943 EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FULL(name, def, EDJE_EXTERNAL_DOUBLE_UNSET, EDJE_EXTERNAL_DOUBLE_UNSET, EDJE_EXTERNAL_DOUBLE_UNSET)
944#define EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT(name, def) \
945 EDJE_EXTERNAL_PARAM_INFO_STRING_FULL(name, def, NULL, NULL)
946#define EDJE_EXTERNAL_PARAM_INFO_BOOL_DEFAULT(name, def) \
947 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL(name, def, "false", "true")
948
949#define EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT_FLAGS(name, def, flags) \
950 EDJE_EXTERNAL_PARAM_INFO_INT_FULL_FLAGS(name, def, EDJE_EXTERNAL_INT_UNSET, EDJE_EXTERNAL_INT_UNSET, EDJE_EXTERNAL_INT_UNSET, flags)
951#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE_DEFAULT_FLAGS(name, def, flags) \
952 EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FULL_FLAGS(name, def, EDJE_EXTERNAL_DOUBLE_UNSET, EDJE_EXTERNAL_DOUBLE_UNSET, EDJE_EXTERNAL_DOUBLE_UNSET, flags)
953#define EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT_FLAGS(name, def, flags) \
954 EDJE_EXTERNAL_PARAM_INFO_STRING_FULL_FLAGS(name, def, NULL, NULL, flags)
955#define EDJE_EXTERNAL_PARAM_INFO_BOOL_DEFAULT_FLAGS(name, def, flags) \
956 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL_FLAGS(name, def, "false", "true", flags)
957
958#define EDJE_EXTERNAL_PARAM_INFO_INT(name) \
959 EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT(name, 0)
960#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE(name) \
961 EDJE_EXTERNAL_PARAM_INFO_DOUBLE_DEFAULT(name, 0.0)
962#define EDJE_EXTERNAL_PARAM_INFO_STRING(name) \
963 EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT(name, NULL)
964#define EDJE_EXTERNAL_PARAM_INFO_BOOL(name) \
965 EDJE_EXTERNAL_PARAM_INFO_BOOL_DEFAULT(name, 0)
966
967#define EDJE_EXTERNAL_PARAM_INFO_INT_FLAGS(name, flags) \
968 EDJE_EXTERNAL_PARAM_INFO_INT_DEFAULT_FLAGS(name, 0, flags)
969#define EDJE_EXTERNAL_PARAM_INFO_DOUBLE_FLAGS(name, flags) \
970 EDJE_EXTERNAL_PARAM_INFO_DOUBLE_DEFAULT_FLAGS(name, 0.0, flags)
971#define EDJE_EXTERNAL_PARAM_INFO_STRING_FLAGS(name, flags) \
972 EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT_FLAGS(name, NULL, flags)
973#define EDJE_EXTERNAL_PARAM_INFO_BOOL_FLAGS(name, flags) \
974 EDJE_EXTERNAL_PARAM_INFO_BOOL_DEFAULT_FLAGS(name, 0, flags)
975
976#define EDJE_EXTERNAL_PARAM_INFO_SENTINEL {NULL, 0, 0, {.s = {NULL, NULL, NULL}}}
977
978/**
979 * @struct _Edje_External_Type
980 *
981 * @brief Information about an external type to be used.
982 *
983 * This structure provides information on how to display and modify a
984 * third party Evas_Object in Edje.
985 *
986 * Some function pointers are not really used by Edje, but provide
987 * means for Edje users to better interact with such objects. For
988 * instance, an editor may use label_get() and icon_get() to list all
989 * registered external types.
990 *
991 * @note The function pointers provided in this structure must check
992 * for errors and invalid or out-of-range values as for
993 * performance reasons Edje will not enforce hints provided as
994 * #Edje_External_Param_Info in the member parameters_info.
995 */
996struct _Edje_External_Type
997{
998#define EDJE_EXTERNAL_TYPE_ABI_VERSION (3)
999 unsigned int abi_version; /**< always use:
1000 * - #EDJE_EXTERNAL_TYPE_ABI_VERSION to declare.
1001 * - edje_external_type_abi_version_get() to check.
1002 */
1003 const char *module; /**< Name of the module that holds these definitions,
1004 as used in the externals {} block of a theme
1005 definition. */
1006 const char *module_name; /**< Canonical name of the module, for displaying
1007 in edition programs, for example. */
1008 Evas_Object *(*add) (void *data, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name); /**< Creates the object to be used by Edje as the part. @p part_name is the name of the part that holds the object and can be used to forward callbacks from the object as signals from Edje. @p params is the list of #Edje_External_Param, not parsed, from the default state of the part. Parameters of type #EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR should be set on
1009 the object here. */
1010 void (*state_set) (void *data, Evas_Object *obj, const void *from_params, const void *to_params, float pos); /**< Called upon state changes, including the initial "default" 0.0 state. Parameters are the value returned by params_parse(). The @p pos parameter is a value between 0.0 and 1.0 indicating the position in time within the state transition. */
1011 void (*signal_emit) (void *data, Evas_Object *obj, const char *emission, const char *source); /**< Feed a signal emitted with emission originally set as part_name:signal to this object (without the "part_name:" prefix) */
1012 Eina_Bool (*param_set) (void *data, Evas_Object *obj, const Edje_External_Param *param); /**< Dynamically change a parameter of this external, called by scripts and user code. Returns @c EINA_TRUE on success */
1013 Eina_Bool (*param_get) (void *data, const Evas_Object *obj, Edje_External_Param *param); /**< Dynamically fetch a parameter of this external, called by scripts and user code. Returns @c EINA_TRUE on success. (Must check parameter name and type!) */
1014 Evas_Object *(*content_get) (void *data, const Evas_Object *obj, const char *content); /**< Dynamically fetch a sub object of this external, called by scripts and user code. Returns @c Evas_Object * on success. (Must check parameter name and type!) */
1015 void *(*params_parse) (void *data, Evas_Object *obj, const Eina_List *params); /**< Parses the list of parameters, converting into a friendly representation. Used with state_set() */
1016 void (*params_free) (void *params); /**< Free parameters parsed with params_parse() */
1017
1018 /* The following callbacks aren't used by Edje itself, but by UI design
1019 tools instead */
1020 const char *(*label_get) (void *data); /**< Get a label to use to identify this EXTERNAL. (For editors) */
1021 const char *(*description_get) (void *data); /**< Get a user friendly description of this EXTERNAL. (For editors) */
1022 Evas_Object *(*icon_add) (void *data, Evas *e); /**< Get an icon to use to identify this EXTERNAL. (For editors) */
1023 Evas_Object *(*preview_add) (void *data, Evas *e); /**< Get a preview of the EXTERNAL object in use. (For editors) */
1024 const char *(*translate) (void *data, const char *orig); /**< called to translate parameters_info name properties for use in user interfaces that support internationalization (i18n) (For editors) */
1025
1026 Edje_External_Param_Info *parameters_info; /**< An array of #Edje_External_Param_Info describing the different parameters this EXTERNAL may have. The last element in the array must be #EDJE_EXTERNAL_PARAM_INFO_SENTINEL. */
1027 void *data; /**< Private user data that will be passed to all of the class functions. */
1028};
1029typedef struct _Edje_External_Type Edje_External_Type;
1030
1031/**
1032 * Convenience struct used to mass-register types of EXTERNAL objects.
1033 *
1034 * Used with edje_external_type_array_register().
1035 */
1036struct _Edje_External_Type_Info
1037{
1038 const char *name; /**< The name of the type to register. */
1039 const Edje_External_Type *info; /**< The type definition. */
1040};
1041typedef struct _Edje_External_Type_Info Edje_External_Type_Info;
1042
1043typedef void (*Edje_Signal_Cb) (void *data, Evas_Object *obj, const char *emission, const char *source); /**< Edje signal callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the signal comes from. @c emission will identify the exact signal's emission string and @c source the exact signal's source one. */
1044typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part);
1045typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg); /**< Edje message handler callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the message comes from. @c type will identify the type of the given message and @c msg will be a pointer the message's contents, de facto, which depend on @c type. */
1046typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text);
1047typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item);
1048
1049/**
1050 * @brief Initialize the Edje library.
1051 *
1052 * @return The new init count. The initial value is zero.
1053 *
1054 * This function initializes the Ejde library, making the proper calls
1055 * to internal initialization functions. It will also initialize its
1056 * @b dependencies, making calls to @c eina_init(), @c ecore_init(),
1057 * @c embryo_init() and @c eet_init(). So, there is no need to call
1058 * those functions again, in your code. To shutdown Edje there is the
1059 * function edje_shutdown().
1060 *
1061 * @see edje_shutdown()
1062 * @see eina_init()
1063 * @see ecore_init()
1064 * @see embryo_init()
1065 * @see eet_init()
1066 *
1067 */
1068EAPI int edje_init (void);
1069
1070/**
1071 * @brief Shutdown the Edje library.
1072 *
1073 * @return The number of times the library has been initialised
1074 * without being shutdown.
1075 *
1076 * This function shuts down the Edje library. It will also call the
1077 * shutdown functions of its @b dependencies, which are @c
1078 * eina_shutdown(), @c ecore_shutdown(), @c embryo_shutdown() and @c
1079 * eet_shutdown(), so there is no need to call these functions again,
1080 * in your code.
1081 *
1082 * @see edje_init()
1083 * @see eina_shutdown()
1084 * @see ecore_shutdown()
1085 * @see embryo_shutdown()
1086 * @see eet_shutdown()
1087 *
1088 */
1089EAPI int edje_shutdown (void);
1090
1091/**
1092 * @brief Set edje trasitions' frame time.
1093 *
1094 * @param t The frame time, in seconds. Default value is 1/30.
1095 *
1096 * This function sets the edje built-in animations' frame time (thus,
1097 * affecting their resolution) by calling
1098 * ecore_animator_frametime_set(). This frame time can be retrieved
1099 * with edje_frametime_get().
1100 *
1101 * @see edje_frametime_get()
1102 *
1103 */
1104EAPI void edje_frametime_set (double t);
1105
1106/**
1107 * @brief Get edje trasitions' frame time.
1108 *
1109 * @return The frame time, in seconds.
1110 *
1111 * This function returns the edje frame time set by
1112 * edje_frametime_set() or the default value 1/30.
1113 *
1114 * @see edje_frametime_set()
1115 *
1116 */
1117EAPI double edje_frametime_get (void);
1118
1119/**
1120 * @brief Freeze Edje objects.
1121 *
1122 * This function freezes all Edje animations in the current process.
1123 *
1124 * @note: for freeze a specific object @see edje_object_freeze().
1125 *
1126 * @see edje_thaw()
1127 *
1128 */
1129EAPI void edje_freeze (void);
1130
1131/**
1132 * @brief Thaw Edje objects.
1133 *
1134 * This function thaws all Edje animations in the current process.
1135 *
1136 * @note for thaw a specific object @see edje_object_thaw().
1137 *
1138 * @see edje_freeze()
1139 *
1140 */
1141EAPI void edje_thaw (void);
1142
1143/**
1144 * @brief Set the edje append fontset.
1145 *
1146 * @param fonts The fontset to append.
1147 *
1148 * This function sets the edje append fontset.
1149 *
1150 */
1151EAPI void edje_fontset_append_set (const char *fonts);
1152
1153/**
1154 * @brief Get the edje append fontset.
1155 *
1156 * @return The edje append fontset.
1157 *
1158 * This function returns the edje append fontset set by
1159 * edje_fontset_append_set() function.
1160 *
1161 * @see edje_fontset_append_set().
1162 *
1163 */
1164EAPI const char *edje_fontset_append_get (void);
1165
1166/**
1167 * @brief Set Edje's global scaling factor.
1168 *
1169 * @param scale The global scaling factor (the default value is @c 1.0)
1170 *
1171 * Edje allows one to build scalable interfaces. Scaling factors,
1172 * which are set to neutral (@c 1.0) values by default (no scaling,
1173 * actual sizes), are of two types: @b global and @b individual.
1174 * Edje's global scaling factor will affect all its objects which
1175 * hadn't their individual scaling factors altered from the default
1176 * value (which is zero). If they had it set differently, by
1177 * edje_object_scale_set(), that factor will @b override the global
1178 * one.
1179 *
1180 * Scaling affects the values of mininum/maximum @b part sizes, which
1181 * are @b multiplied by it. Font sizes are scaled, too.
1182 *
1183 * @warning Only parts which, at EDC level, had the @c "scale"
1184 * property set to @c 1, will be affected by this function. Check the
1185 * complete @ref edcref "syntax reference" for EDC files.
1186 *
1187 * @see edje_scale_get().
1188 */
1189EAPI void edje_scale_set (double scale);
1190
1191/**
1192 * @brief Retrieve Edje's global scaling factor.
1193 *
1194 * @return The global scaling factor
1195 *
1196 * This function returns Edje's global scaling factor.
1197 *
1198 * @see edje_scale_set() for more details
1199 *
1200 */
1201EAPI double edje_scale_get (void);
1202
1203/**
1204 * @brief Show last character in password mode.
1205 *
1206 * @param password_show_last If TRUE enable last character show in password mode.
1207 *
1208 * This function enables last input to be visible when in password mode for few seconds
1209 * or until the next input is entered.
1210 *
1211 * The time out value is obtained by edje_password_show_last_timeout_set function.
1212 *
1213 * @see edje_password_show_last_timeout_set().
1214 */
1215EAPI void edje_password_show_last_set(Eina_Bool password_show_last);
1216
1217/**
1218 * @brief Set's the timeout value in last show password mode.
1219 *
1220 * @param password_show_last_timeout The timeout value.
1221 *
1222 * This functions sets the time out value for which the last input entered in password
1223 * mode will be visible.
1224 *
1225 * This value can be used only when last show mode is set in password mode.
1226 *
1227 * @see edje_password_show_last_set().
1228 *
1229 */
1230EAPI void edje_password_show_last_timeout_set(double password_show_last_timeout);
1231
1232/**
1233 * @brief Set the scaling factor for a given Edje object.
1234 *
1235 * @param obj A handle to an Edje object
1236 * @param scale The scaling factor (the default value is @c 0.0,
1237 * meaning indivinual scaling @b not set)
1238 *
1239 * This function sets an @b individual scaling factor on the @a obj
1240 * Edje object. This property (or Edje's global scaling factor, when
1241 * applicable), will affect this object's part sizes. If @p scale is
1242 * not zero, than the individual scaling will @b override any global
1243 * scaling set, for the object @p obj's parts. Put it back to zero to
1244 * get the effects of the global scaling again.
1245 *
1246 * @warning Only parts which, at EDC level, had the @c "scale"
1247 * property set to @c 1, will be affected by this function. Check the
1248 * complete @ref edcref "syntax reference" for EDC files.
1249 *
1250 * @see edje_object_scale_get()
1251 * @see edje_scale_get() for more details
1252 */
1253EAPI Eina_Bool edje_object_scale_set (Evas_Object *obj, double scale);
1254
1255/**
1256 * @brief Get a given Edje object's scaling factor.
1257 *
1258 * @param obj A handle to an Edje object
1259 *
1260 * This function returns the @c individual scaling factor set on the
1261 * @a obj Edje object.
1262 *
1263 * @see edje_object_scale_set() for more details
1264 *
1265 */
1266EAPI double edje_object_scale_get (const Evas_Object *obj);
1267
1268/**
1269 * @brief Set the RTL orientation for this object.
1270 *
1271 * @param obj A handle to an Edje object.
1272 * @rtl new value of flag EINA_TRUE/EINA_FALSE
1273 * @since 1.1.0
1274 */
1275EAPI void edje_object_mirrored_set (Evas_Object *obj, Eina_Bool rtl);
1276
1277/**
1278 * @brief Get the RTL orientation for this object.
1279 *
1280 * You can RTL orientation explicitly with edje_object_mirrored_set.
1281 *
1282 * @param obj A handle to an Edje object.
1283 * @return @c EINA_TRUE if the flag is set or @c EINA_FALSE if not.
1284 * @since 1.1.0
1285 */
1286EAPI Eina_Bool edje_object_mirrored_get (const Evas_Object *obj);
1287
1288/**
1289 * Get a list of groups in an edje file
1290 * @param file The path to the edje file
1291 *
1292 * @return The Eina_List of group names (char *)
1293 *
1294 * Note: the list must be freed using edje_file_collection_list_free()
1295 * when you are done with it.
1296 */
1297EAPI Eina_List *edje_file_collection_list (const char *file);
1298
1299/**
1300 * Free file collection list
1301 * @param lst The Eina_List of groups
1302 *
1303 * Frees the list returned by edje_file_collection_list().
1304 */
1305EAPI void edje_file_collection_list_free (Eina_List *lst);
1306
1307/**
1308 * Determine whether a group matching glob exists in an edje file.
1309 * @param file The file path
1310 * @param glob A glob to match on
1311 *
1312 * @return 1 if a match is found, 0 otherwise
1313 */
1314EAPI Eina_Bool edje_file_group_exists (const char *file, const char *glob);
1315
1316/**
1317 * Get data from the file level data block of an edje file
1318 * @param file The path to the .edj file
1319 * @param key The data key
1320 * @return The string value of the data. Must be freed by the user when no
1321 * longer needed.
1322 *
1323 * If an edje file is built from the following edc:
1324 *
1325 * data {
1326 * item: "key1" "value1";
1327 * item: "key2" "value2";
1328 * }
1329 * collections { ... }
1330 *
1331 * Then, edje_file_data_get("key1") will return "value1"
1332 */
1333EAPI char *edje_file_data_get (const char *file, const char *key);
1334
1335/**
1336 * @brief Set the file cache size.
1337 *
1338 * @param count The file cache size in edje file units. Default is 16.
1339 *
1340 * This function sets the file cache size. Edje keeps this cache in
1341 * order to prevent duplicates of edje file entries in memory. The
1342 * file cache size can be retrieved with edje_file_cache_get().
1343 *
1344 * @see edje_file_cache_get()
1345 * @see edje_file_cache_flush()
1346 *
1347 */
1348EAPI void edje_file_cache_set (int count);
1349
1350/**
1351 * @brief Return the file cache size.
1352 *
1353 * @return The file cache size in edje file units. Default is 16.
1354 *
1355 * This function returns the file cache size set by
1356 * edje_file_cache_set().
1357 *
1358 * @see edje_file_cache_set()
1359 * @see edje_file_cache_flush()
1360 *
1361 */
1362EAPI int edje_file_cache_get (void);
1363
1364/**
1365 * @brief Clean the file cache.
1366 *
1367 * This function cleans the file cache entries, but keeps this cache's
1368 * size to the last value set.
1369 *
1370 * @see edje_file_cache_set()
1371 * @see edje_file_cache_get()
1372 *
1373 */
1374EAPI void edje_file_cache_flush (void);
1375
1376/**
1377 * @brief Set the collection cache size.
1378 *
1379 * @param count The collection cache size, in edje object units. Default is 16.
1380 *
1381 * This function sets the collection cache size. Edje keeps this cache
1382 * in order to prevent duplicates of edje {collection,group,part}
1383 * entries in memory. The collection cache size can be retrieved with
1384 * edje_collection_cache_get().
1385 *
1386 * @see edje_collection_cache_get()
1387 * @see edje_collection_cache_flush()
1388 *
1389 */
1390EAPI void edje_collection_cache_set (int count);
1391
1392/**
1393 * @brief Return the collection cache size.
1394 *
1395 * @return The collection cache size, in edje object units. Default is 16.
1396 *
1397 * This function returns the collection cache size set by
1398 * edje_collection_cache_set().
1399 *
1400 * @see edje_collection_cache_set()
1401 * @see edje_collection_cache_flush()
1402 *
1403 */
1404EAPI int edje_collection_cache_get (void);
1405
1406/**
1407 * @brief Clean the collection cache.
1408 *
1409 * This function cleans the collection cache, but keeps this cache's
1410 * size to the last value set.
1411 *
1412 * @see edje_collection_cache_set()
1413 * @see edje_collection_cache_get()
1414 *
1415 */
1416EAPI void edje_collection_cache_flush (void);
1417
1418/**
1419 * @brief Set Edje color class.
1420 *
1421 * @param color_class
1422 * @param r Object Red value
1423 * @param g Object Green value
1424 * @param b Object Blue value
1425 * @param a Object Alpha value
1426 * @param r2 Outline Red value
1427 * @param g2 Outline Green value
1428 * @param b2 Outline Blue value
1429 * @param a2 Outline Alpha value
1430 * @param r3 Shadow Red value
1431 * @param g3 Shadow Green value
1432 * @param b3 Shadow Blue value
1433 * @param a3 Shadow Alpha value
1434 *
1435 * This function sets the color values for a process level color
1436 * class. This will cause all edje parts in the current process that
1437 * have the specified color class to have their colors multiplied by
1438 * these values. (Object level color classes set by
1439 * edje_object_color_class_set() will override the values set by this
1440 * function).
1441 *
1442 * The first color is the object, the second is the text outline, and
1443 * the third is the text shadow. (Note that the second two only apply
1444 * to text parts).
1445 *
1446 * Setting color emits a signal "color_class,set" with source being
1447 * the given color class in all objects.
1448 *
1449 * @see edje_color_class_set().
1450 *
1451 * @note unlike Evas, Edje colors are @b not pre-multiplied. That is,
1452 * half-transparent white is 255 255 255 128.
1453 */
1454EAPI Eina_Bool edje_color_class_set (const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
1455
1456/**
1457 * @brief Get Edje color class.
1458 *
1459 * @param color_class
1460 * @param r Object Red value
1461 * @param g Object Green value
1462 * @param b Object Blue value
1463 * @param a Object Alpha value
1464 * @param r2 Outline Red value
1465 * @param g2 Outline Green value
1466 * @param b2 Outline Blue value
1467 * @param a2 Outline Alpha value
1468 * @param r3 Shadow Red value
1469 * @param g3 Shadow Green value
1470 * @param b3 Shadow Blue value
1471 * @param a3 Shadow Alpha value
1472 *
1473 * @return EINA_TRUE if found or EINA_FALSE if not found and all
1474 * values are zeroed.
1475 *
1476 * This function gets the color values for a process level color
1477 * class. This value is the globally set and not per-object, that is,
1478 * the value that would be used by objects if they did not override with
1479 * edje_object_color_class_set().
1480 *
1481 * The first color is the object, the second is the text outline, and
1482 * the third is the text shadow. (Note that the second two only apply
1483 * to text parts).
1484 *
1485 * @see edje_color_class_set().
1486 *
1487 * @note unlike Evas, Edje colors are @b not pre-multiplied. That is,
1488 * half-transparent white is 255 255 255 128.
1489 */
1490EAPI Eina_Bool edje_color_class_get (const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
1491
1492/**
1493 * @brief Delete edje color class.
1494 *
1495 * @param color_class
1496 *
1497 * This function deletes any values at the process level for the
1498 * specified color class.
1499 * @note Deleting the color class will revert it to the
1500 * values defined in the theme file.
1501 *
1502 * Deleting the color class will emit the signal "color_class,del"
1503 * to all the Edje objects in the running program.
1504 */
1505EAPI void edje_color_class_del (const char *color_class);
1506
1507/**
1508 * @brief Lists color classes.
1509 *
1510 * @return A list of color class names (strings). These strings and
1511 * the list must be free()'d by the caller.
1512 *
1513 * This function lists all color classes known about by the current
1514 * process.
1515 *
1516 */
1517EAPI Eina_List *edje_color_class_list (void);
1518
1519/**
1520 * @brief Set the Edje text class.
1521 *
1522 * @param text_class The text class name
1523 * @param font The font name
1524 * @param size The font size
1525 *
1526 * @return @c EINA_TRUE, on success or @c EINA_FALSE, on error
1527 *
1528 * This function updates all Edje members at the process level which
1529 * belong to this text class with the new font attributes.
1530 *
1531 * @see edje_text_class_get().
1532 *
1533 */
1534EAPI Eina_Bool edje_text_class_set (const char *text_class, const char *font, Evas_Font_Size size);
1535
1536/**
1537 * @brief Delete the text class.
1538 *
1539 * @param text_class The text class name string
1540 *
1541 * This function deletes any values at the process level for the
1542 * specified text class.
1543 *
1544 */
1545EAPI void edje_text_class_del (const char *text_class);
1546
1547/**
1548 * @brief List text classes.
1549 *
1550 * @return A list of text class names (strings). These strings are
1551 * stringshares and the list must be free()'d by the caller.
1552 *
1553 * This function lists all text classes known about by the current
1554 * process.
1555 *
1556 */
1557EAPI Eina_List *edje_text_class_list (void);
1558
1559/**
1560 * @brief Set the object minimum size.
1561 *
1562 * @param obj A valid Evas_Object handle
1563 * @param minw The minimum width
1564 * @param minh The minimum height
1565 *
1566 * This sets the minimum size restriction for the object.
1567 */
1568EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
1569
1570/**
1571 * @brief Set the object maximum size.
1572 *
1573 * @param obj A valid Evas_Object handle
1574 * @param maxw The maximum width
1575 * @param maxh The maximum height
1576 *
1577 * This sets the maximum size restriction for the object.
1578 */
1579EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh);
1580
1581/**
1582 * @brief Set the object aspect size.
1583 *
1584 * @param obj A valid Evas_Object handle
1585 * @param aspect The aspect control axes
1586 * @param aw The aspect radio width
1587 * @param ah The aspect ratio height
1588 *
1589 * This sets the desired aspect ratio to keep an object that will be
1590 * swallowed by Edje. The width and height define a preferred size
1591 * ASPECT and the object may be scaled to be larger or smaller, but
1592 * retaining the relative scale of both aspect width and height.
1593 */
1594EAPI void edje_extern_object_aspect_set (Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah);
1595
1596/**
1597 * @brief Registers a custom layout to be used in edje boxes.
1598 *
1599 * @param name The name of the layout
1600 * @param func The function defining the layout
1601 * @param layout_data_get This function gets the custom data pointer
1602 * for func
1603 * @param layout_data_free Passed to func to free its private data
1604 * when needed
1605 * @param free_data Frees data
1606 * @param data Private pointer passed to layout_data_get
1607 *
1608 * This function registers custom layouts that can be referred from
1609 * themes by the registered name. The Evas_Object_Box_Layout
1610 * functions receive two pointers for internal use, one being private
1611 * data, and the other the function to free that data when it's not
1612 * longer needed. From Edje, this private data will be retrieved by
1613 * calling layout_data_get, and layout_data_free will be the free
1614 * function passed to func. layout_data_get will be called with data
1615 * as its parameter, and this one will be freed by free_data whenever
1616 * the layout is unregistered from Edje.
1617 */
1618EAPI void edje_box_layout_register (const char *name, Evas_Object_Box_Layout func, void *(*layout_data_get)(void *), void (*layout_data_free)(void *), void (*free_data)(void *), void *data);
1619
1620/**
1621 * @brief Instantiate a new Edje object
1622 *
1623 * @param evas A valid Evas handle, the canvas to place the new object
1624 * in
1625 * @return A handle to the new object created or @c NULL, on errors.
1626 *
1627 * This function creates a new Edje smart object, returning its @c
1628 * Evas_Object handle. An Edje object is useless without a (source)
1629 * file set to it, so you'd most probably call edje_object_file_set()
1630 * afterwards, like in:
1631 * @code
1632 * Evas_Object *edje;
1633 *
1634 * edje = edje_object_add(canvas);
1635 * if (!edje)
1636 * {
1637 * fprintf(stderr, "could not create edje object!\n");
1638 * return NULL;
1639 * }
1640 *
1641 * if (!edje_object_file_set(edje, "theme.edj", "group_name"))
1642 * {
1643 * int err = edje_object_load_error_get(edje);
1644 * const char *errmsg = edje_load_error_str(err);
1645 * fprintf(stderr, "could not load 'group_name' from theme.edj: %s",
1646 * errmsg);
1647 *
1648 * evas_object_del(edje);
1649 * return NULL;
1650 * }
1651 *
1652 * @endcode
1653 *
1654 * @note before creating the first Edje object in your code, remember
1655 * to initialize the library, with edje_init(), or unexpected behavior
1656 * might occur.
1657 */
1658EAPI Evas_Object *edje_object_add (Evas *evas);
1659
1660/**
1661 * @brief Retrive an <b>EDC data field's value</b> from a given Edje
1662 * object's group.
1663 *
1664 * @param obj A handle to an Edje object
1665 * @param key The data field's key string
1666 * @return The data's value string. Must not be freed.
1667 *
1668 * This function fetches an EDC data field's value, which is declared
1669 * on the objects building EDC file, <b>under its group</b>. EDC data
1670 * blocks are most commonly used to pass arbitrary parameters from an
1671 * application's theme to its code.
1672 *
1673 * They look like the following:
1674 *
1675 * @code
1676 * collections {
1677 * group {
1678 * name: "a_group";
1679 * data {
1680 * item: "key1" "value1";
1681 * item: "key2" "value2";
1682 * }
1683 * }
1684 * }
1685 * @endcode
1686 *
1687 * EDC data fields always hold @b strings as values, hence the return
1688 * type of this function. Check the complete @ref edcref "syntax reference"
1689 * for EDC files.
1690 *
1691 * @warning Do not confuse this call with edje_file_data_get(), which
1692 * queries for a @b global EDC data field on an EDC declaration file.
1693 *
1694 * @see edje_object_file_set()
1695 */
1696EAPI const char *edje_object_data_get (const Evas_Object *obj, const char *key);
1697
1698/**
1699 * @brief Sets the @b EDJ file (and group within it) to load an Edje
1700 * object's contents from
1701 *
1702 * @param obj A handle to an Edje object
1703 * @param file The path to the EDJ file to load @p from
1704 * @param group The name of the group, in @p file, which implements an
1705 * Edje object
1706 * @return @c EINA_TRUE, on success or @c EINA_FALSE, on errors (check
1707 * edje_object_load_error_get() after this call to get errors causes)
1708 *
1709 * Edje expects EDJ files, which are theming objects' descriptions and
1710 * resources packed together in an EET file, to read Edje object
1711 * definitions from. They usually are created with the @c .edj
1712 * extension. EDJ files, in turn, are assembled from @b textual object
1713 * description files, where one describes Edje objects declaratively
1714 * -- the EDC files (see @ref edcref "the syntax" for those files).
1715 *
1716 * Those description files were designed so that many Edje object
1717 * definitions -- also called @b groups (or collections) -- could be
1718 * packed together <b>in the same EDJ file</b>, so that a whole
1719 * application's theme could be packed in one file only. This is the
1720 * reason for the @p group argument.
1721 *
1722 * Use this function after you instantiate a new Edje object, so that
1723 * you can "give him life", telling where to get its contents from.
1724 *
1725 * @see edje_object_add()
1726 * @see edje_object_file_get()
1727 */
1728EAPI Eina_Bool edje_object_file_set (Evas_Object *obj, const char *file, const char *group);
1729
1730/**
1731 * @brief Get the file and group name that a given Edje object is bound to
1732 *
1733 * @param obj A handle to an Edje object
1734 * @param file A pointer to a variable whero to store the <b>file's
1735 * path</b>
1736 * @param group A pointer to a variable where to store the <b>group
1737 * name</b> in
1738 *
1739 * This gets the EDJ file's path, with the respective group set for
1740 * the given Edje object. If @a obj is either not an Edje file, or has
1741 * not had its file/group set previously, by edje_object_file_set(),
1742 * then both @p file and @p group will be set to @c NULL, indicating
1743 * an error.
1744 *
1745 * @see edje_object_file_set()
1746 *
1747 * @note Use @c NULL pointers on the file/group components you're not
1748 * interested in: they'll be ignored by the function.
1749 */
1750EAPI void edje_object_file_get (const Evas_Object *obj, const char **file, const char **group);
1751
1752/**
1753 * @brief Gets the (last) file loading error for a given Edje object
1754 *
1755 * @param obj A handlet to an Edje object
1756 *
1757 * @return The Edje loading error, one of:
1758 * - #EDJE_LOAD_ERROR_NONE
1759 * - #EDJE_LOAD_ERROR_GENERIC
1760 * - #EDJE_LOAD_ERROR_DOES_NOT_EXIST
1761 * - #EDJE_LOAD_ERROR_PERMISSION_DENIED
1762 * - #EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED
1763 * - #EDJE_LOAD_ERROR_CORRUPT_FILE
1764 * - #EDJE_LOAD_ERROR_UNKNOWN_FORMAT
1765 * - #EDJE_LOAD_ERROR_INCOMPATIBLE_FILE
1766 * - #EDJE_LOAD_ERROR_UNKNOWN_COLLECTION
1767 * - #EDJE_LOAD_ERROR_RECURSIVE_REFERENCE
1768 *
1769 * This function is meant to be used after an Edje EDJ <b>file
1770 * loading</b>, what takes place with the edje_object_file_set()
1771 * function. If that function does not return @c EINA_TRUE, one should
1772 * check for the reason of failure with this one.
1773 *
1774 * @see edje_load_error_str()
1775 */
1776EAPI Edje_Load_Error edje_object_load_error_get (const Evas_Object *obj);
1777
1778/**
1779 * Converts the given Edje file load error code into a string
1780 * describing it in English.
1781 *
1782 * @param error the error code, a value in ::Edje_Load_Error.
1783 * @return Always returns a valid string. If the given @p error is not
1784 * supported, <code>"Unknown error"</code> is returned.
1785 *
1786 * edje_object_file_set() is a function which sets an error value,
1787 * afterwards, which can be fetched with
1788 * edje_object_load_error_get(). The function in question is meant
1789 * to be used in conjunction with the latter, for pretty-printing any
1790 * possible error cause.
1791 */
1792EAPI const char *edje_load_error_str (Edje_Load_Error error);
1793
1794/**
1795 * @brief Preload the images on the Edje Object in the background.
1796 *
1797 * @param obj A handle to an Edje object
1798 * @param cancel @c EINA_FALSE will add it the preloading work queue,
1799 * @c EINA_TRUE will remove it (if it was issued before).
1800 * @return @c EINA_FASLE if obj was not a valid Edje object
1801 * otherwise @c EINA_TRUE
1802 *
1803 * This function requests the preload of all data images (on the given
1804 * object) in the background. The work is queued before being processed
1805 * (because there might be other pending requests of this type).
1806 * It emits a signal "preload,done" when finished.
1807 *
1808 * @note Use @c EINA_TRUE on scenarios where you don't need
1809 * the image data preloaded anymore.
1810 */
1811EAPI Eina_Bool edje_object_preload (Evas_Object *obj, Eina_Bool cancel);
1812
1813/**
1814 * @brief Add a callback for an arriving Edje signal, emitted by
1815 * a given Ejde object.
1816 *
1817 * @param obj A handle to an Edje object
1818 * @param emission The signal's "emission" string
1819 * @param source The signal's "source" string
1820 * @param func The callback function to be executed when the signal is
1821 * emitted.
1822 * @param data A pointer to data to pass in to @p func.
1823 *
1824 * Edje signals are one of the communication interfaces between
1825 * @b code and a given Edje object's @b theme. With signals, one can
1826 * communicate two string values at a time, which are:
1827 * - "emission" value: the name of the signal, in general
1828 * - "source" value: a name for the signal's context, in general
1829 *
1830 * Though there are those common uses for the two strings, one is free
1831 * to use them however they like.
1832 *
1833 * This function adds a callback function to a signal emitted by @a obj, to
1834 * be issued every time an EDC program like the following
1835 * @code
1836 * program {
1837 * name: "emit_example";
1838 * action: SIGNAL_EMIT "a_signal" "a_source";
1839 * }
1840 * @endcode
1841 * is run, if @p emission and @p source are given those same values,
1842 * here.
1843 *
1844 * Signal callback registration is powerful, in the way that @b blobs
1845 * may be used to match <b>multiple signals at once</b>. All the @c
1846 * "*?[\" set of @c fnmatch() operators can be used, both for @p
1847 * emission and @p source.
1848 *
1849 * Edje has @b internal signals it will emit, automatically, on
1850 * various actions taking place on group parts. For example, the mouse
1851 * cursor being moved, pressed, released, etc., over a given part's
1852 * area, all generate individual signals.
1853 *
1854 * By using something like
1855 * @code
1856 * edje_object_signal_callback_add(obj, "mouse,down,*", "button.*",
1857 * signal_cb, NULL);
1858 * @endcode
1859 * being @c "button.*" the pattern for the names of parts implementing
1860 * buttons on an interface, you'd be registering for notifications on
1861 * events of mouse buttons being pressed down on either of those parts
1862 * (those events all have the @c "mouse,down," common prefix on their
1863 * names, with a suffix giving the button number). The actual emisson
1864 * and source strings of an event will be passed in as the @a emission
1865 * and @a source parameters of the callback function (e.g. @c
1866 * "mouse,down,2" and @c "button.close"), for each of those events.
1867 *
1868 * @note See @ref edcref "the syntax" for EDC files
1869 * @see edje_object_signal_emit() on how to emits Edje signals from
1870 * code to a an object
1871 * @see edje_object_signal_callback_del_full()
1872 */
1873EAPI void edje_object_signal_callback_add (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
1874
1875/**
1876 * @brief Remove a signal-triggered callback from an object.
1877 *
1878 * @param obj A valid Evas_Object handle.
1879 * @param emission The emission string.
1880 * @param source The source string.
1881 * @param func The callback function.
1882 * @return The data pointer
1883 *
1884 * This function removes a callback, previously attached to the
1885 * emittion of a signal, from the object @a obj. The parameters @a
1886 * emission, @a source and @a func must match exactly those passed to
1887 * a previous call to edje_object_signal_callback_add(). The data
1888 * pointer that was passed to this call will be returned.
1889 *
1890 * @see edje_object_signal_callback_add().
1891 * @see edje_object_signal_callback_del_full().
1892 *
1893 */
1894EAPI void *edje_object_signal_callback_del (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
1895
1896/**
1897 * @brief Unregister/delete a callback set for an arriving Edje
1898 * signal, emitted by a given Ejde object.
1899 *
1900 * @param obj A handle to an Edje object
1901 * @param emission The signal's "emission" string
1902 * @param source The signal's "source" string
1903 * @param func The callback function passed on the callback's
1904 * registration
1905 * @param data The pointer given to be passed as data to @p func
1906 * @return @p data, on success or @c NULL, on errors (or if @p data
1907 * had this value)
1908 *
1909 * This function removes a callback, previously attached to the
1910 * emittion of a signal, from the object @a obj. The parameters
1911 * @a emission, @a source, @a func and @a data must match exactly those
1912 * passed to a previous call to edje_object_signal_callback_add(). The
1913 * data pointer that was passed to this call will be returned.
1914 *
1915 * @see edje_object_signal_callback_add().
1916 * @see edje_object_signal_callback_del().
1917 *
1918 */
1919EAPI void *edje_object_signal_callback_del_full(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
1920
1921/**
1922 * @brief Send/emit an Edje signal to a given Edje object
1923 *
1924 * @param obj A handle to an Edje object
1925 * @param emission The signal's "emission" string
1926 * @param source The signal's "source" string
1927 *
1928 * This function sends a signal to the object @a obj. An Edje program,
1929 * at @p obj's EDC specification level, can respond to a signal by
1930 * having declared matching @c 'signal' and @c 'source' fields on its
1931 * block (see @ref edcref "the syntax" for EDC files).
1932 *
1933 * As an example,
1934 * @code
1935 * edje_object_signal_emit(obj, "a_signal", "");
1936 * @endcode
1937 * would trigger a program which had an EDC declaration block like
1938 * @code
1939 * program {
1940 * name: "a_program";
1941 * signal: "a_signal";
1942 * source: "";
1943 * action: ...
1944 * }
1945 * @endcode
1946 *
1947 * @see edje_object_signal_callback_add() for more on Edje signals.
1948 */
1949EAPI void edje_object_signal_emit (Evas_Object *obj, const char *emission, const char *source);
1950
1951/**
1952 * @brief Get extra data passed to callbacks.
1953 *
1954 * @return the extra data for that callback.
1955 *
1956 * Some callbacks pass extra information. This function gives access to that
1957 * extra information. It's somehow like event_info in smart callbacks.
1958 *
1959 * @see edje_object_signal_callback_add() for more on Edje signals.
1960 * @since 1.1.0
1961 */
1962EAPI void * edje_object_signal_callback_extra_data_get(void);
1963
1964/**
1965 * @brief Set the Edje object to playing or paused states.
1966 *
1967 * @param obj A handle to an Edje object.
1968 * @param play Object state (@c EINA_TRUE to playing,
1969 * @c EINA_FALSE to paused).
1970 *
1971 * This function sets the Edje object @a obj to playing or paused
1972 * states, depending on the parameter @a play. This has no effect if
1973 * the object was already at that state.
1974 *
1975 * @see edje_object_play_get().
1976 *
1977 */
1978EAPI void edje_object_play_set (Evas_Object *obj, Eina_Bool play);
1979
1980/**
1981 * @brief Get the Edje object's state.
1982 *
1983 * @param obj A handle to an Edje object.
1984 * @return @c EINA_FALSE if the object is not connected, its @c delete_me flag
1985 * is set, or it is at paused state; @c EINA_TRUE if the object is at playing
1986 * state.
1987 *
1988 * This function tells if an Edje object is playing or not. This state
1989 * is set by edje_object_play_set().
1990 *
1991 * @see edje_object_play_set().
1992 *
1993 */
1994EAPI Eina_Bool edje_object_play_get (const Evas_Object *obj);
1995
1996/**
1997 * @brief Set the object's animation state.
1998 *
1999 * @param obj A handle to an Edje object.
2000 * @param on The animation state. @c EINA_TRUE to starts or
2001 * @c EINA_FALSE to stops.
2002 *
2003 * This function starts or stops an Edje object's animation. The
2004 * information if it's stopped can be retrieved by
2005 * edje_object_animation_get().
2006 *
2007 * @see edje_object_animation_get()
2008 *
2009 */
2010EAPI void edje_object_animation_set (Evas_Object *obj, Eina_Bool on);
2011
2012/**
2013 * @brief Get the Edje object's animation state.
2014 *
2015 * @param obj A handle to an Edje object.
2016 * @return @c EINA_FALSE on error or if object is not animated;
2017 * @c EINA_TRUE if animated.
2018 *
2019 * This function returns if the animation is stopped or not. The
2020 * animation state is set by edje_object_animation_set().
2021 *
2022 * @see edje_object_animation_set().
2023 *
2024 */
2025EAPI Eina_Bool edje_object_animation_get (const Evas_Object *obj);
2026
2027/**
2028 * @brief Freezes the Edje object.
2029 *
2030 * @param obj A handle to an Edje object.
2031 * @return The frozen state or 0 on Error
2032 *
2033 * This function puts all changes on hold. Successive freezes will
2034 * nest, requiring an equal number of thaws.
2035 *
2036 * @see edje_object_thaw()
2037 */
2038EAPI int edje_object_freeze (Evas_Object *obj);
2039
2040/**
2041 * @brief Thaws the Edje object.
2042 *
2043 * @param obj A handle to an Edje object.
2044 * @return The frozen state or 0 if the object is not frozen or on error.
2045 *
2046 * This function thaws the given Edje object.
2047 *
2048 * @note: If sucessives freezes were done, an equal number of
2049 * thaws will be required.
2050 *
2051 * @see edje_object_freeze()
2052 */
2053EAPI int edje_object_thaw (Evas_Object *obj);
2054
2055/**
2056 * @brief Sets the object color class.
2057 *
2058 * @param obj A valid Evas_Object handle
2059 * @param color_class
2060 * @param r Object Red value
2061 * @param g Object Green value
2062 * @param b Object Blue value
2063 * @param a Object Alpha value
2064 * @param r2 Outline Red value
2065 * @param g2 Outline Green value
2066 * @param b2 Outline Blue value
2067 * @param a2 Outline Alpha value
2068 * @param r3 Shadow Red value
2069 * @param g3 Shadow Green value
2070 * @param b3 Shadow Blue value
2071 * @param a3 Shadow Alpha value
2072 *
2073 * This function sets the color values for an object level color
2074 * class. This will cause all edje parts in the specified object that
2075 * have the specified color class to have their colors multiplied by
2076 * these values.
2077 *
2078 * The first color is the object, the second is the text outline, and
2079 * the third is the text shadow. (Note that the second two only apply
2080 * to text parts).
2081 *
2082 * Setting color emits a signal "color_class,set" with source being
2083 * the given color.
2084 *
2085 * @note unlike Evas, Edje colors are @b not pre-multiplied. That is,
2086 * half-transparent white is 255 255 255 128.
2087 */
2088EAPI Eina_Bool edje_object_color_class_set (Evas_Object *obj, const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
2089
2090/**
2091 * @brief Gets the object color class.
2092 *
2093 * @param o A valid Evas_Object handle
2094 * @param color_class
2095 * @param r Object Red value
2096 * @param g Object Green value
2097 * @param b Object Blue value
2098 * @param a Object Alpha value
2099 * @param r2 Outline Red value
2100 * @param g2 Outline Green value
2101 * @param b2 Outline Blue value
2102 * @param a2 Outline Alpha value
2103 * @param r3 Shadow Red value
2104 * @param g3 Shadow Green value
2105 * @param b3 Shadow Blue value
2106 * @param a3 Shadow Alpha value
2107 *
2108 * @return EINA_TRUE if found or EINA_FALSE if not found and all
2109 * values are zeroed.
2110 *
2111 * This function gets the color values for an object level color
2112 * class. If no explicit object color is set, then global values will
2113 * be used.
2114 *
2115 * The first color is the object, the second is the text outline, and
2116 * the third is the text shadow. (Note that the second two only apply
2117 * to text parts).
2118 *
2119 * @note unlike Evas, Edje colors are @b not pre-multiplied. That is,
2120 * half-transparent white is 255 255 255 128.
2121 */
2122EAPI Eina_Bool edje_object_color_class_get (const Evas_Object *o, const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
2123
2124/**
2125 * @brief Delete the object color class.
2126 *
2127 * @param obj The edje object's reference.
2128 * @param color_class The color class to be deleted.
2129 *
2130 * This function deletes any values at the object level for the
2131 * specified object and color class.
2132 * @note Deleting the color class will revert it to the values
2133 * defined by edje_color_class_set() or the color class
2134 * defined in the theme file.
2135 *
2136 * Deleting the color class will emit the signal "color_class,del"
2137 * for the given Edje object.
2138 */
2139 EAPI void edje_object_color_class_del (Evas_Object *obj, const char *color_class);
2140
2141/**
2142 * @brief Sets Edje text class.
2143 *
2144 * @param obj A valid Evas_Object handle
2145 * @param text_class The text class name
2146 * @param font Font name
2147 * @param size Font Size
2148 *
2149 * @return @c EINA_TRUE, on success or @c EINA_FALSE, on error
2150 *
2151 * This function sets the text class for the Edje.
2152 *
2153 */
2154EAPI Eina_Bool edje_object_text_class_set (Evas_Object *obj, const char *text_class, const char *font, Evas_Font_Size size);
2155
2156/**
2157 * @brief Get the minimum size specified -- as an EDC property -- for a
2158 * given Edje object
2159 *
2160 * @param obj A handle to an Edje object
2161 * @param minw Pointer to a variable where to store the minimum width
2162 * @param minh Pointer to a variable where to store the minimum height
2163 *
2164 * This function retrieves the @p obj object's minimum size values,
2165 * <b>as declared in its EDC group definition</b>. Minimum size of
2166 * groups have the following syntax
2167 * @code
2168 * collections {
2169 * group {
2170 * name: "a_group";
2171 * min: 100 100;
2172 * }
2173 * }
2174 * @endcode
2175 *
2176 * where one declares a minimum size of 100 pixels both for width and
2177 * height. Those are (hint) values which should be respected when the
2178 * given object/group is to be controlled by a given container object
2179 * (e.g. an Edje object being "swallowed" into a given @c SWALLOW
2180 * typed part, as in edje_object_part_swallow()). Check the complete
2181 * @ref edcref "syntax reference" for EDC files.
2182 *
2183 * @note If the @c min EDC property was not declared for @p obj, this
2184 * call will return the value 0, for each axis.
2185 *
2186 * @note On failure, this function will make all non-@c NULL size
2187 * pointers' pointed variables be set to zero.
2188 *
2189 * @see edje_object_size_max_get()
2190 */
2191EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
2192
2193/**
2194 * @brief Get the maximum size specified -- as an EDC property -- for a
2195 * given Edje object
2196 *
2197 * @param obj A handle to an Edje object
2198 * @param maxw Pointer to a variable where to store the maximum width
2199 * @param maxh Pointer to a variable where to store the maximum height
2200 *
2201 * This function retrieves the @p obj object's maximum size values,
2202 * <b>as declared in its EDC group definition</b>. Maximum size of
2203 * groups have the following syntax
2204 * @code
2205 * collections {
2206 * group {
2207 * name: "a_group";
2208 * max: 100 100;
2209 * }
2210 * }
2211 * @endcode
2212 *
2213 * where one declares a maximum size of 100 pixels both for width and
2214 * height. Those are (hint) values which should be respected when the
2215 * given object/group is to be controlled by a given container object
2216 * (e.g. an Edje object being "swallowed" into a given @c SWALLOW
2217 * typed part, as in edje_object_part_swallow()). Check the complete
2218 * @ref edcref "syntax reference" for EDC files.
2219 *
2220 * @note If the @c max EDC property was not declared for @p obj, this
2221 * call will return the maximum size a given Edje object may have, for
2222 * each axis.
2223 *
2224 * @note On failure, this function will make all non-@c NULL size
2225 * pointers' pointed variables be set to zero.
2226 *
2227 * @see edje_object_size_min_get()
2228 */
2229EAPI void edje_object_size_max_get (const Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
2230
2231/**
2232 * @brief Force a Size/Geometry calculation.
2233 *
2234 * @param obj A valid Evas_Object handle
2235 *
2236 * Forces the object @p obj to recalculation layout regardless of
2237 * freeze/thaw.
2238 */
2239EAPI void edje_object_calc_force (Evas_Object *obj);
2240
2241/**
2242 * @brief Calculate the minimum required size for a given Edje object.
2243 *
2244 * @param obj A handle to an Edje object
2245 * @param minw Pointer to a variable where to store the minimum
2246 * required width
2247 * @param minh Pointer to a variable where to store the minimum
2248 * required height
2249 *
2250 * This call works exactly as edje_object_size_min_restricted_calc(),
2251 * with the last two arguments set to 0. Please refer to its
2252 * documentation, then.
2253 */
2254EAPI void edje_object_size_min_calc (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
2255
2256/**
2257 * Calculate the geometry of the region, relative to a given Edje
2258 * object's area, <b>occupied by all parts in the object</b>
2259 *
2260 * @param obj A handle to an Edje object
2261 * @param part The Edje part's name
2262 * @param x A pointer to a variable where to store the parts region's
2263 * x coordinate
2264 * @param y A pointer to a variable where to store the parts region's
2265 * y coordinate
2266 * @param w A pointer to a variable where to store the parts region's
2267 * width
2268 * @param h A pointer to a variable where to store the parts region's
2269 * height
2270 *
2271 * This function gets the geometry of the rectangle equal to the area
2272 * required to group all parts in @p obj's group/collection. The @p x
2273 * and @p y coordinates are relative to the top left corner of the
2274 * whole @p obj object's area. Parts placed out of the group's
2275 * boundaries will also be taken in account, so that @p x and @p y
2276 * <b>may be negative</b>.
2277 *
2278 * @note Use @c NULL pointers on the geometry components you're not
2279 * interested in: they'll be ignored by the function.
2280 *
2281 * @note On failure, this function will make all non-@c NULL geometry
2282 * pointers' pointed variables be set to zero.
2283 */
2284EAPI Eina_Bool edje_object_parts_extends_calc (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
2285
2286/**
2287 * @brief Calculate the minimum required size for a given Edje object.
2288 *
2289 * @param obj A handle to an Edje object
2290 * @param minw Pointer to a variable where to store the minimum
2291 * required width
2292 * @param minh Pointer to a variable where to store the minimum
2293 * required height
2294 * @param restrictedw Do not allow object's calculated (minimum) width
2295 * to be less than this value
2296 * @param restrictedh Do not allow object's calculated (minimum)
2297 * height to be less than this value
2298 *
2299 * This call will trigger an internal recalculation of all parts of
2300 * the @p obj object, in order to return its minimum required
2301 * dimensions for width and height. The user might choose to @b impose
2302 * those minimum sizes, making the resulting calculation to get to values
2303 * equal or bigger than @p restrictedw and @p restrictedh, for width and
2304 * height, respectively.
2305 *
2306 * @note At the end of this call, @p obj @b won't be automatically
2307 * resized to new dimensions, but just return the calculated
2308 * sizes. The caller is the one up to change its geometry or not.
2309 *
2310 * @warning Be advised that invisible parts in @p obj @b will be taken
2311 * into account in this calculation.
2312 */
2313EAPI void edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh);
2314
2315/**
2316 * @brief Check if an Edje part exists in a given Edje object's group
2317 * definition..
2318 *
2319 * @param obj A handle to an Edje object
2320 * @param part The part's name to check for existence in @p obj's
2321 * group
2322 * @return @c EINA_TRUE, if the Edje part exists in @p obj's group or
2323 * @c EINA_FALSE, otherwise (and on errors)
2324 *
2325 * This function returns if a given part exists in the Edje group
2326 * bound to object @p obj (with edje_object_file_set()).
2327 *
2328 * This call is useful, for example, when one could expect or not a
2329 * given GUI element, depending on the @b theme applied to @p obj.
2330 */
2331EAPI Eina_Bool edje_object_part_exists (const Evas_Object *obj, const char *part);
2332
2333/**
2334 * @brief Get a handle to the Evas object implementing a given Edje
2335 * part, in an Edje object.
2336 *
2337 * @param obj A handle to an Edje object
2338 * @param part The Edje part's name
2339 * @return A pointer to the Evas object implementing the given part,
2340 * or @c NULL on failure (e.g. the given part doesn't exist)
2341 *
2342 * This function gets a pointer the Evas object corresponding to a
2343 * given part in the @p obj object's group.
2344 *
2345 * You should @b never modify the state of the returned object (with
2346 * @c evas_object_move() or @c evas_object_hide() for example),
2347 * because it's meant to be managed be Edje, solely. You are safe to
2348 * query information about its current state (with @c
2349 * evas_object_visible_get() or @c evas_object_color_get() for
2350 * example), though.
2351 */
2352EAPI const Evas_Object *edje_object_part_object_get (const Evas_Object *obj, const char *part);
2353
2354/**
2355 * @brief Retrieve the geometry of a given Edje part, in a given Edje
2356 * object's group definition, <b>relative to the object's area</b>
2357 *
2358 * @param obj A handle to an Edje object
2359 * @param part The Edje part's name
2360 * @param x A pointer to a variable where to store the part's x
2361 * coordinate
2362 * @param y A pointer to a variable where to store the part's y
2363 * coordinate
2364 * @param w A pointer to a variable where to store the part's width
2365 * @param h A pointer to a variable where to store the part's height
2366 *
2367 * This function gets the geometry of an Edje part within its
2368 * group. The @p x and @p y coordinates are relative to the top left
2369 * corner of the whole @p obj object's area.
2370 *
2371 * @note Use @c NULL pointers on the geometry components you're not
2372 * interested in: they'll be ignored by the function.
2373 *
2374 * @note On failure, this function will make all non-@c NULL geometry
2375 * pointers' pointed variables be set to zero.
2376 */
2377EAPI Eina_Bool edje_object_part_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
2378
2379
2380/**
2381 * @brief Set the function that provides item objects for named items in an edje entry text
2382 *
2383 * @param obj A valid Evas Object handle
2384 * @param func The function to call (or NULL to disable) to get item objects
2385 * @param data The data pointer to pass to the @p func callback
2386 *
2387 * Item objects may be deleted any time by Edje, and will be deleted when the
2388 * Edje object is deleted (or file is set to a new file).
2389 */
2390EAPI void edje_object_item_provider_set (Evas_Object *obj, Edje_Item_Provider_Cb func, void *data);
2391
2392
2393/**
2394 * @brief Set the object text callback.
2395 *
2396 * @param obj A valid Evas_Object handle
2397 * @param func The callback function to handle the text change
2398 * @param data The data associated to the callback function.
2399 *
2400 * This function sets the callback to be called when the text changes.
2401 */
2402EAPI void edje_object_text_change_cb_set (Evas_Object *obj, Edje_Text_Change_Cb func, void *data);
2403
2404/**
2405 * @brief Sets the text for an object part
2406 *
2407 * @param obj A valid Evas Object handle
2408 * @param part The part name
2409 * @param text The text string
2410 */
2411EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const char *part, const char *text);
2412
2413/**
2414 * @brief Return the text of the object part.
2415 *
2416 * @param obj A valid Evas_Object handle
2417 * @param part The part name
2418 *
2419 * @return The text string
2420 *
2421 * This function returns the text associated to the object part.
2422 *
2423 * @see edje_object_part_text_set().
2424 */
2425EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
2426
2427/**
2428 * @brief Sets the raw (non escaped) text for an object part.
2429 *
2430 * @param obj A valid Evas Object handle
2431 * @param part The part name
2432 * @param text_to_escape The text string
2433 *
2434 * This funciton will not do escape for you if it is a TEXTBLOCK part, that is,
2435 * if text contain tags, these tags will not be interpreted/parsed by TEXTBLOCK.
2436 *
2437 * @see edje_object_part_text_unescaped_get().
2438 */
2439EAPI Eina_Bool edje_object_part_text_unescaped_set (Evas_Object *obj, const char *part, const char *text_to_escape);
2440
2441/**
2442 * @brief Returns the text of the object part, without escaping.
2443 *
2444 * @param obj A valid Evas_Object handle
2445 * @param part The part name
2446 * @return The @b allocated text string without escaping, or NULL on
2447 * problems.
2448 *
2449 * This function is the counterpart of
2450 * edje_object_part_text_unescaped_set(). Please notice that the
2451 * result is newly allocated memory and should be released with free()
2452 * when done.
2453 *
2454 * @see edje_object_part_text_unescaped_set().
2455 */
2456EAPI char *edje_object_part_text_unescaped_get (const Evas_Object *obj, const char *part);
2457
2458/**
2459 * @brief Return the selection text of the object part.
2460 *
2461 * @param obj A valid Evas_Object handle
2462 * @param part The part name
2463 * @return The text string
2464 *
2465 * This function returns selection text of the object part.
2466 *
2467 * @see edje_object_part_text_select_all()
2468 * @see edje_object_part_text_select_none()
2469 */
2470EAPI const char *edje_object_part_text_selection_get (const Evas_Object *obj, const char *part);
2471
2472/**
2473 * @brief Set the selection to be none.
2474 *
2475 * @param obj A valid Evas_Object handle
2476 * @param part The part name
2477 *
2478 * This function sets the selection text to be none.
2479 */
2480EAPI void edje_object_part_text_select_none (const Evas_Object *obj, const char *part);
2481
2482/**
2483 * @brief Set the selection to be everything.
2484 *
2485 * @param obj A valid Evas_Object handle
2486 * @param part The part name
2487 *
2488 * This function selects all text of the object of the part.
2489 */
2490EAPI void edje_object_part_text_select_all (const Evas_Object *obj, const char *part);
2491
2492/**
2493 * @brief Insert text for an object part.
2494 *
2495 * @param obj A valid Evas Object handle
2496 * @param part The part name
2497 * @param text The text string
2498 *
2499 * This function inserts the text for an object part just before the
2500 * cursor position.
2501 *
2502 */
2503EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text);
2504
2505/**
2506 * @brief Insert text for an object part.
2507 *
2508 * @param obj A valid Evas Object handle
2509 * @param part The part name
2510 * @param text The text string
2511 *
2512 * This function inserts the text for an object part at the end; It does not
2513 * move the cursor.
2514 *
2515 * @since 1.1
2516 */
2517EAPI void edje_object_part_text_append(Evas_Object *obj, const char *part, const char *text);
2518
2519/**
2520 * @brief Return a list of char anchor names.
2521 *
2522 * @param obj A valid Evas_Object handle
2523 * @param part The part name
2524 *
2525 * @return The list of anchors (const char *), do not modify!
2526 *
2527 * This function returns a list of char anchor names.
2528 *
2529 */
2530EAPI const Eina_List *edje_object_part_text_anchor_list_get (const Evas_Object *obj, const char *part);
2531
2532/**
2533 * @brief Return a list of Evas_Textblock_Rectangle anchor rectangles.
2534 *
2535 * @param obj A valid Evas_Object handle
2536 * @param part The part name
2537 * @param anchor The anchor name
2538 *
2539 * @return The list of anchor rects (const Evas_Textblock_Rectangle
2540 * *), do not modify! Geometry is relative to entry part.
2541 *
2542 * This function return a list of Evas_Textblock_Rectangle anchor
2543 * rectangles.
2544 *
2545 */
2546EAPI const Eina_List *edje_object_part_text_anchor_geometry_get (const Evas_Object *obj, const char *part, const char *anchor);
2547
2548/**
2549 * @brief Return a list of char item names.
2550 *
2551 * @param obj A valid Evas_Object handle
2552 * @param part The part name
2553 *
2554 * @return The list of items (const char *), do not modify!
2555 *
2556 * This function returns a list of char item names.
2557 *
2558 */
2559EAPI const Eina_List *edje_object_part_text_item_list_get (const Evas_Object *obj, const char *part);
2560
2561/**
2562 * @brief Return item geometry.
2563 *
2564 * @param obj A valid Evas_Object handle
2565 * @param part The part name
2566 * @param item The item name
2567 * @param cx Item x return (relative to entry part)
2568 * @param cy Item y return (relative to entry part)
2569 * @param cw Item width return
2570 * @param ch Item height return
2571 *
2572 * @return 1 if item exists, 0 if not
2573 *
2574 * This function return a list of Evas_Textblock_Rectangle item
2575 * rectangles.
2576 *
2577 */
2578EAPI Eina_Bool edje_object_part_text_item_geometry_get (const Evas_Object *obj, const char *part, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
2579
2580/**
2581 * @brief Returns the cursor geometry of the part relative to the edje
2582 * object.
2583 *
2584 * @param obj A valid Evas_Object handle
2585 * @param part The part name
2586 * @param x Cursor X position
2587 * @param y Cursor Y position
2588 * @param w Cursor width
2589 * @param h Cursor height
2590 *
2591 */
2592EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
2593
2594/**
2595 * @brief Enables selection if the entry is an EXPLICIT selection mode
2596 * type.
2597 *
2598 * @param obj A valid Evas_Object handle
2599 * @param part The part name
2600 * @param allow EINA_TRUE to enable, EINA_FALSE otherwise
2601 *
2602 * The default is to @b not allow selection. This function only affects user
2603 * selection, functions such as edje_object_part_text_select_all() and
2604 * edje_object_part_text_select_none() are not affected.
2605 */
2606EAPI void edje_object_part_text_select_allow_set (const Evas_Object *obj, const char *part, Eina_Bool allow);
2607
2608/**
2609 * @brief Aborts any selection action on a part.
2610 *
2611 * @param obj A valid Evas_Object handle
2612 * @param part The part name
2613 */
2614EAPI void edje_object_part_text_select_abort (const Evas_Object *obj, const char *part);
2615
2616/**
2617 * @brief Starts selecting at current cursor position
2618 *
2619 * @param obj A valid Evas_Object handle
2620 * @param part The part name
2621 */
2622EAPI void edje_object_part_text_select_begin (const Evas_Object *obj, const char *part);
2623
2624/**
2625 * @brief Extends the current selection to the current cursor position
2626 *
2627 * @param obj A valid Evas_Object handle
2628 * @param part The part name
2629 */
2630EAPI void edje_object_part_text_select_extend (const Evas_Object *obj, const char *part);
2631
2632
2633/**
2634 * @brief Advances the cursor to the next cursor position.
2635 * @see evas_textblock_cursor_char_next
2636 *
2637 * @param obj A valid Evas_Object handle
2638 * @param part The part name
2639 * @param cur The edje cursor to advance
2640 */
2641EAPI Eina_Bool edje_object_part_text_cursor_next (Evas_Object *obj, const char *part, Edje_Cursor cur);
2642
2643/**
2644 * @brief Moves the cursor to the previous char
2645 * @see evas_textblock_cursor_char_prev
2646 *
2647 * @param obj A valid Evas_Object handle
2648 * @param part The part name
2649 * @param cur the edje cursor to work on
2650 */
2651EAPI Eina_Bool edje_object_part_text_cursor_prev (Evas_Object *obj, const char *part, Edje_Cursor cur);
2652
2653/**
2654 * @brief Move the cursor to the char above the current cursor position.
2655 *
2656 * @param obj A valid Evas_Object handle
2657 * @param part The part name
2658 * @param cur the edje cursor to work on
2659 */
2660EAPI Eina_Bool edje_object_part_text_cursor_up (Evas_Object *obj, const char *part, Edje_Cursor cur);
2661
2662/**
2663 * @brief Moves the cursor to the char below the current cursor position.
2664 *
2665 * @param obj A valid Evas_Object handle
2666 * @param part The part name
2667 * @param cur the edje cursor to work on
2668 */
2669EAPI Eina_Bool edje_object_part_text_cursor_down (Evas_Object *obj, const char *part, Edje_Cursor cur);
2670
2671/**
2672 * @brief Moves the cursor to the beginning of the text part
2673 * @see evas_textblock_cursor_paragraph_first
2674 *
2675 * @param obj A valid Evas_Object handle
2676 * @param part The part name
2677 * @param cur the edje cursor to work on
2678 */
2679EAPI void edje_object_part_text_cursor_begin_set (Evas_Object *obj, const char *part, Edje_Cursor cur);
2680
2681/**
2682 * @brief Moves the cursor to the end of the text part.
2683 * @see evas_textblock_cursor_paragraph_last
2684 *
2685 * @param obj A valid Evas_Object handle
2686 * @param part The part name
2687 * @param cur the edje cursor to work on
2688 */
2689EAPI void edje_object_part_text_cursor_end_set (Evas_Object *obj, const char *part, Edje_Cursor cur);
2690
2691/**
2692 * @brief Copy the cursor to another cursor.
2693 *
2694 * @param obj A valid Evas_Object handle
2695 * @param part The part name
2696 * @param sry the cursor to copy from
2697 * @param dst the cursor to copy to
2698 */
2699EAPI void edje_object_part_text_cursor_copy (Evas_Object *obj, const char *part, Edje_Cursor src, Edje_Cursor dst);
2700
2701/**
2702 * @brief Move the cursor to the beginning of the line.
2703 * @see evas_textblock_cursor_line_char_first
2704 *
2705 * @param obj A valid Evas_Object handle
2706 * @param part The part name
2707 * @param cur the edje cursor to work on
2708 */
2709EAPI void edje_object_part_text_cursor_line_begin_set (Evas_Object *obj, const char *part, Edje_Cursor cur);
2710
2711/**
2712 * @brief Move the cursor to the end of the line.
2713 * @see evas_textblock_cursor_line_char_last
2714 *
2715 * @param obj A valid Evas_Object handle
2716 * @param part The part name
2717 * @param cur the edje cursor to work on
2718 */
2719EAPI void edje_object_part_text_cursor_line_end_set (Evas_Object *obj, const char *part, Edje_Cursor cur);
2720
2721/**
2722 * Position the given cursor to a X,Y position.
2723 *
2724 * This is frequently used with the user cursor.
2725 *
2726 * @param obj An Edje object.
2727 * @param part The part containing the object.
2728 * @param cur The cursor to adjust.
2729 * @param x X Coordinate.
2730 * @param y Y Coordinate.
2731 * @return True on success, false on error.
2732 */
2733EAPI Eina_Bool edje_object_part_text_cursor_coord_set (Evas_Object *obj, const char *part, Edje_Cursor cur, Evas_Coord x, Evas_Coord y);
2734
2735/**
2736 * @brief Returns whether the cursor points to a format.
2737 * @see evas_textblock_cursor_is_format
2738 *
2739 * @param obj A valid Evas_Object handle
2740 * @param part The part name
2741 * @param cur The cursor to adjust.
2742 * @return EINA_TRUE if it's true, EINA_FALSE otherwise.
2743 */
2744EAPI Eina_Bool edje_object_part_text_cursor_is_format_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
2745
2746/**
2747 * @brief Return true if the cursor points to a visible format
2748 * For example \t, \n, item and etc.
2749 * @see evas_textblock_cursor_format_is_visible_get
2750 *
2751 * @param obj A valid Evas_Object handle
2752 * @param part The part name
2753 * @param cur The cursor to adjust.
2754 */
2755EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur);
2756
2757/**
2758 * @brief Returns the content (char) at the cursor position.
2759 * @see evas_textblock_cursor_content_get
2760 *
2761 * @param obj A valid Evas_Object handle
2762 * @param part The part name
2763 * @param cur The cursor to use
2764 */
2765EAPI const char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
2766
2767/**
2768 * @brief Sets the cursor position to the given value
2769 *
2770 * @param obj A valid Evas_Object handle
2771 * @param part The part name
2772 * @param cur The cursor to move
2773 * @param pos the position of the cursor
2774 * @since 1.1.0
2775 */
2776EAPI void edje_object_part_text_cursor_pos_set (Evas_Object *obj, const char *part, Edje_Cursor cur, int pos);
2777
2778/**
2779 * @brief Retrieves the current position of the cursor
2780 *
2781 * @param obj A valid Evas_Object handle
2782 * @param part The part name
2783 * @param cur The cursor to get the position
2784 * @return The cursor position
2785 * @since 1.1.0
2786 */
2787EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
2788
2789/**
2790 * @brief Set the layout of the input panel.
2791 *
2792 * The layout of the input panel or virtual keyboard can make it easier or
2793 * harder to enter content. This allows you to hint what kind of input you
2794 * are expecting to enter and thus have the input panel automatically
2795 * come up with the right mode.
2796 *
2797 * @param obj A valid Evas_Object handle
2798 * @param part The part name
2799 * @param layout layout type
2800 * @since 1.1
2801 */
2802EAPI void edje_object_part_text_input_panel_layout_set (const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout);
2803
2804/**
2805 * @brief Get the layout of the input panel.
2806 *
2807 * @param obj A valid Evas_Object handle
2808 * @param part The part name
2809 *
2810 * @return Layout type of the input panel
2811 *
2812 * @see edje_object_part_text_input_panel_layout_set
2813 * @since 1.1
2814 */
2815EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const Evas_Object *obj, const char *part);
2816
2817/**
2818 * @brief Set the autocapitalization type on the immodule.
2819 *
2820 * @param obj A valid Evas_Object handle
2821 * @param part The part name
2822 * @param autocapital_type The type of autocapitalization
2823 * @since 1.1.0
2824 */
2825EAPI void edje_object_part_text_autocapital_type_set (const Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type);
2826
2827/**
2828 * @brief Retrieves the autocapitalization type
2829 *
2830 * @param obj A valid Evas_Object handle
2831 * @param part The part name
2832 * @return The autocapitalization type
2833 * @since 1.1.0
2834 */
2835EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part);
2836
2837/**
2838 * @brief Sets the attribute to show the input panel automatically.
2839 *
2840 * @param obj A valid Evas_Object handle
2841 * @param part The part name
2842 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
2843 * @since 1.1.0
2844 */
2845EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_Object *obj, const char *part, Eina_Bool enabled);
2846
2847/**
2848 * @brief Retrieve the attribute to show the input panel automatically.
2849 * @see edje_object_part_text_input_panel_enabled_set
2850 *
2851 * @param obj A valid Evas_Object handle
2852 * @param part The part name
2853 * @return EINA_TRUE if it supports or EINA_FALSE otherwise
2854 * @since 1.1.0
2855 */
2856EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part);
2857
2858/**
2859 * Add a filter function for newly inserted text.
2860 *
2861 * Whenever text is inserted (not the same as set) into the given @p part,
2862 * the list of filter functions will be called to decide if and how the new
2863 * text will be accepted.
2864 * There are three types of filters, EDJE_TEXT_FILTER_TEXT,
2865 * EDJE_TEXT_FILTER_FORMAT and EDJE_TEXT_FILTER_MARKUP.
2866 * The text parameter in the @p func filter can be modified by the user and
2867 * it's up to him to free the one passed if he's to change the pointer. If
2868 * doing so, the newly set text should be malloc'ed, as once all the filters
2869 * are called Edje will free it.
2870 * If the text is to be rejected, freeing it and setting the pointer to NULL
2871 * will make Edje break out of the filter cycle and reject the inserted
2872 * text.
2873 *
2874 * @see edje_object_text_insert_filter_callback_del
2875 * @see edje_object_text_insert_filter_callback_del_full
2876 *
2877 * @param obj A valid Evas_Object handle
2878 * @param part The part name
2879 * @param func The callback function that will act as filter
2880 * @param data User provided data to pass to the filter function
2881 */
2882EAPI void edje_object_text_insert_filter_callback_add (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data);
2883
2884/**
2885 * Delete a function from the filter list.
2886 *
2887 * Delete the given @p func filter from the list in @p part. Returns
2888 * the user data pointer given when added.
2889 *
2890 * @see edje_object_text_insert_filter_callback_add
2891 * @see edje_object_text_insert_filter_callback_del_full
2892 *
2893 * @param obj A valid Evas_Object handle
2894 * @param part The part name
2895 * @param func The function callback to remove
2896 *
2897 * @return The user data pointer if succesful, or NULL otherwise
2898 */
2899EAPI void *edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func);
2900
2901/**
2902 * Delete a function and matching user data from the filter list.
2903 *
2904 * Delete the given @p func filter and @p data user data from the list
2905 * in @p part.
2906 * Returns the user data pointer given when added.
2907 *
2908 * @see edje_object_text_insert_filter_callback_add
2909 * @see edje_object_text_insert_filter_callback_del
2910 *
2911 * @param obj A valid Evas_Object handle
2912 * @param part The part name
2913 * @param func The function callback to remove
2914 * @param data The data passed to the callback function
2915 *
2916 * @return The same data pointer if succesful, or NULL otherwise
2917 */
2918EAPI void *edje_object_text_insert_filter_callback_del_full (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data);
2919
2920/**
2921 * @brief Swallows an object into the edje.
2922 *
2923 * @param obj A valid Evas_Object handle
2924 * @param part The part name
2925 * @param obj_swallow The object to swallow
2926 *
2927 * Swallows the object into the edje part so that all geometry changes
2928 * for the part affect the swallowed object. (e.g. resize, move, show,
2929 * raise/lower, etc.).
2930 *
2931 * If an object has already been swallowed into this part, then it
2932 * will first be unswallowed before the new object is swallowed.
2933 */
2934EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow);
2935
2936/**
2937 * @brief Unswallow an object.
2938 *
2939 * @param obj A valid Evas_Object handle
2940 * @param obj_swallow The swallowed object
2941 *
2942 * Causes the edje to regurgitate a previously swallowed object. :)
2943 *
2944 * @note @p obj_swallow will @b not be deleted.
2945 */
2946EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow);
2947
2948/**
2949 * @brief Get the object currently swallowed by a part.
2950 *
2951 * @param obj A valid Evas_Object handle
2952 * @param part The part name
2953 * @return The swallowed object, or NULL if there is none.
2954 */
2955EAPI Evas_Object *edje_object_part_swallow_get (const Evas_Object *obj, const char *part);
2956
2957/**
2958 * @brief Returns the state of the Edje part.
2959 *
2960 * @param obj A valid Evas_Object handle
2961 * @param part The part name
2962 * @param val_ret
2963 *
2964 * @return The part state:\n
2965 * "default" for the default state\n
2966 * "" for other states
2967 */
2968EAPI const char *edje_object_part_state_get (const Evas_Object *obj, const char *part, double *val_ret);
2969
2970/**
2971 * @brief Determine dragable directions.
2972 *
2973 * @param obj A valid Evas_Object handle
2974 * @param part The part name
2975 *
2976 * The dragable directions are defined in the EDC file, inside the @c dragable
2977 * section, by the attributes @c x and @c y. See the @ref edcref for more
2978 * information.
2979 *
2980 * @return #EDJE_DRAG_DIR_NONE: Not dragable\n
2981 * #EDJE_DRAG_DIR_X: Dragable in X direction\n
2982 * #EDJE_DRAG_DIR_Y: Dragable in Y direction\n
2983 * #EDJE_DRAG_DIR_XY: Dragable in X & Y directions
2984 */
2985EAPI Edje_Drag_Dir edje_object_part_drag_dir_get (const Evas_Object *obj, const char *part);
2986
2987/**
2988 * @brief Set the dragable object location.
2989 *
2990 * @param obj A valid Evas_Object handle
2991 * @param part The part name
2992 * @param dx The x value
2993 * @param dy The y value
2994 *
2995 * Places the dragable object at the given location.
2996 *
2997 * Values for @p dx and @p dy are real numbers that range from 0 to 1,
2998 * representing the relative position to the dragable area on that axis.
2999 *
3000 * This value means, for the vertical axis, that 0.0 will be at the top if the
3001 * first parameter of @c y in the dragable part theme is 1, and at bottom if it
3002 * is -1.
3003 *
3004 * For the horizontal axis, 0.0 means left if the first parameter of @c x in the
3005 * dragable part theme is 1, and right if it is -1.
3006 *
3007 * @see edje_object_part_drag_value_get()
3008 */
3009EAPI Eina_Bool edje_object_part_drag_value_set (Evas_Object *obj, const char *part, double dx, double dy);
3010
3011/**
3012 * @brief Get the dragable object location.
3013 *
3014 * @param obj A valid Evas_Object handle
3015 * @param part The part name
3016 * @param dx The X value pointer
3017 * @param dy The Y value pointer
3018 *
3019 * Values for @p dx and @p dy are real numbers that range from 0 to 1,
3020 * representing the relative position to the dragable area on that axis.
3021 *
3022 * @see edje_object_part_drag_value_set()
3023 *
3024 * Gets the drag location values.
3025 */
3026EAPI Eina_Bool edje_object_part_drag_value_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
3027
3028/**
3029 * @brief Set the dragable object size.
3030 *
3031 * @param obj A valid Evas_Object handle
3032 * @param part The part name
3033 * @param dw The drag width
3034 * @param dh The drag height
3035 *
3036 * Values for @p dw and @p dh are real numbers that range from 0 to 1,
3037 * representing the relative size of the dragable area on that axis.
3038 *
3039 * Sets the size of the dragable object.
3040 *
3041 * @see edje_object_part_drag_size_get()
3042 */
3043EAPI Eina_Bool edje_object_part_drag_size_set (Evas_Object *obj, const char *part, double dw, double dh);
3044
3045/**
3046 * @brief Get the dragable object size.
3047 *
3048 * @param obj A valid Evas_Object handle
3049 * @param part The part name
3050 * @param dw The drag width pointer
3051 * @param dh The drag height pointer
3052 *
3053 * Gets the dragable object size.
3054 *
3055 * @see edje_object_part_drag_size_set()
3056 */
3057EAPI Eina_Bool edje_object_part_drag_size_get (const Evas_Object *obj, const char *part, double *dw, double *dh);
3058
3059/**
3060 * @brief Sets the drag step increment.
3061 *
3062 * @param obj A valid Evas_Object handle
3063 * @param part The part name
3064 * @param dx The x step amount
3065 * @param dy The y step amount
3066 *
3067 * Sets the x,y step increments for a dragable object.
3068 *
3069 * Values for @p dx and @p dy are real numbers that range from 0 to 1,
3070 * representing the relative size of the dragable area on that axis by which the
3071 * part will be moved.
3072 *
3073 * @see edje_object_part_drag_step_get()
3074 */
3075EAPI Eina_Bool edje_object_part_drag_step_set (Evas_Object *obj, const char *part, double dx, double dy);
3076
3077/**
3078 * @brief Gets the drag step increment values.
3079 *
3080 * @param obj A valid Evas_Object handle
3081 * @param part The part
3082 * @param dx The x step increment pointer
3083 * @param dy The y step increment pointer
3084 *
3085 * Gets the x and y step increments for the dragable object.
3086 *
3087 *
3088 * @see edje_object_part_drag_step_set()
3089 */
3090EAPI Eina_Bool edje_object_part_drag_step_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
3091
3092/**
3093 * @brief Sets the page step increments.
3094 *
3095 * @param obj A valid Evas_Object handle
3096 * @param part The part name
3097 * @param dx The x page step increment
3098 * @param dy The y page step increment
3099 *
3100 * Sets the x,y page step increment values.
3101 *
3102 * Values for @p dx and @p dy are real numbers that range from 0 to 1,
3103 * representing the relative size of the dragable area on that axis by which the
3104 * part will be moved.
3105 *
3106 * @see edje_object_part_drag_page_get()
3107 */
3108EAPI Eina_Bool edje_object_part_drag_page_set (Evas_Object *obj, const char *part, double dx, double dy);
3109
3110/**
3111 * @brief Gets the page step increments.
3112 *
3113 * @param obj A valid Evas_Object handle
3114 * @param part The part name
3115 * @param dx The dx page increment pointer
3116 * @param dy The dy page increment pointer
3117 *
3118 * Gets the x,y page step increments for the dragable object.
3119 *
3120 * @see edje_object_part_drag_page_set()
3121 */
3122EAPI Eina_Bool edje_object_part_drag_page_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
3123
3124/**
3125 * @brief Steps the dragable x,y steps.
3126 *
3127 * @param obj A valid Evas_Object handle
3128 * @param part The part name
3129 * @param dx The x step
3130 * @param dy The y step
3131 *
3132 * Steps x,y where the step increment is the amount set by
3133 * edje_object_part_drag_step_set.
3134 *
3135 * Values for @p dx and @p dy are real numbers that range from 0 to 1.
3136 *
3137 * @see edje_object_part_drag_page()
3138 */
3139EAPI Eina_Bool edje_object_part_drag_step (Evas_Object *obj, const char *part, double dx, double dy);
3140
3141/**
3142 * @brief Pages x,y steps.
3143 *
3144 * @param obj A valid Evas_Object handle
3145 * @param part The part name
3146 * @param dx The x step
3147 * @param dy The y step
3148 *
3149 * Pages x,y where the increment is defined by
3150 * edje_object_part_drag_page_set.
3151 *
3152 * Values for @p dx and @p dy are real numbers that range from 0 to 1.
3153 *
3154 * @warning Paging is bugged!
3155 *
3156 * @see edje_object_part_drag_step()
3157 */
3158EAPI Eina_Bool edje_object_part_drag_page (Evas_Object *obj, const char *part, double dx, double dy);
3159
3160
3161/**
3162 * @brief Get the object created by this external part.
3163 *
3164 * Parts of type external creates the part object using information
3165 * provided by external plugins. It's somehow like "swallow"
3166 * (edje_object_part_swallow()), but it's all set automatically.
3167 *
3168 * This function returns the part created by such external plugins and
3169 * being currently managed by this Edje.
3170 *
3171 * @note Almost all swallow rules apply: you should not move, resize,
3172 * hide, show, set the color or clipper of such part. It's a bit
3173 * more restrictive as one must @b never delete this object!
3174 *
3175 * @param obj A valid Evas_Object handle
3176 * @param part The part name
3177 * @return The externally created object, or NULL if there is none or
3178 * part is not an external.
3179 */
3180EAPI Evas_Object *edje_object_part_external_object_get (const Evas_Object *obj, const char *part);
3181
3182/**
3183 * @brief Set the parameter for the external part.
3184 *
3185 * Parts of type external may carry extra properties that have
3186 * meanings defined by the external plugin. For instance, it may be a
3187 * string that defines a button label and setting this property will
3188 * change that label on the fly.
3189 *
3190 * @note external parts have parameters set when they change
3191 * states. Those parameters will never be changed by this
3192 * function. The interpretation of how state_set parameters and
3193 * param_set will interact is up to the external plugin.
3194 *
3195 * @note this function will not check if parameter value is valid
3196 * using #Edje_External_Param_Info minimum, maximum, valid
3197 * choices and others. However these should be checked by the
3198 * underlying implementation provided by the external
3199 * plugin. This is done for performance reasons.
3200 *
3201 * @param obj A valid Evas_Object handle
3202 * @param part The part name
3203 * @param param the parameter details, including its name, type and
3204 * actual value. This pointer should be valid, and the
3205 * parameter must exist in
3206 * #Edje_External_Type::parameters_info, with the exact type,
3207 * otherwise the operation will fail and @c EINA_FALSE will be
3208 * returned.
3209 *
3210 * @return @c EINA_TRUE if everything went fine, @c EINA_FALSE on errors.
3211 */
3212EAPI Eina_Bool edje_object_part_external_param_set (Evas_Object *obj, const char *part, const Edje_External_Param *param);
3213
3214/**
3215 * @brief Get the parameter for the external part.
3216 *
3217 * Parts of type external may carry extra properties that have
3218 * meanings defined by the external plugin. For instance, it may be a
3219 * string that defines a button label. This property can be modifed by
3220 * state parameters, by explicit calls to
3221 * edje_object_part_external_param_set() or getting the actual object
3222 * with edje_object_part_external_object_get() and calling native
3223 * functions.
3224 *
3225 * This function asks the external plugin what is the current value,
3226 * independent on how it was set.
3227 *
3228 * @param obj A valid Evas_Object handle
3229 * @param part The part name
3230
3231 * @param param the parameter details. It is used as both input and
3232 * output variable. This pointer should be valid, and the
3233 * parameter must exist in
3234 * #Edje_External_Type::parameters_info, with the exact type,
3235 * otherwise the operation will fail and @c EINA_FALSE will be
3236 * returned.
3237 *
3238 * @return @c EINA_TRUE if everything went fine and @p param members
3239 * are filled with information, @c EINA_FALSE on errors and @p
3240 * param member values are not set or valid.
3241 */
3242EAPI Eina_Bool edje_object_part_external_param_get (const Evas_Object *obj, const char *part, Edje_External_Param *param);
3243
3244/**
3245 * @brief Get an object contained in an part of type EXTERNAL
3246 *
3247 * The @p content string must not be NULL. Its actual value depends on the
3248 * code providing the EXTERNAL.
3249 *
3250 * @param obj The Edje object
3251 * @param part The name of the part holding the EXTERNAL
3252 * @param content A string identifying which content from the EXTERNAL to get
3253 */
3254EAPI Evas_Object *edje_object_part_external_content_get (const Evas_Object *obj, const char *part, const char *content);
3255
3256/**
3257 * Facility to query the type of the given parameter of the given part.
3258 *
3259 * @param obj A valid Evas_Object handle
3260 * @param part The part name
3261 * @param param the parameter name to use.
3262 *
3263 * @return @c EDJE_EXTERNAL_PARAM_TYPE_MAX on errors, or another value
3264 * from #Edje_External_Param_Type on success.
3265 */
3266EAPI Edje_External_Param_Type edje_object_part_external_param_type_get (const Evas_Object *obj, const char *part, const char *param);
3267
3268
3269/**
3270 * @brief Appends an object to the box.
3271 *
3272 * @param obj A valid Evas_Object handle
3273 * @param part The part name
3274 * @param child The object to append
3275 *
3276 * @return @c EINA_TRUE: Successfully added.\n
3277 * @c EINA_FALSE: An error occurred.
3278 *
3279 * Appends child to the box indicated by part.
3280 *
3281 * @see edje_object_part_box_prepend()
3282 * @see edje_object_part_box_insert_before()
3283 * @see edje_object_part_box_insert_at()
3284 */
3285EAPI Eina_Bool edje_object_part_box_append (Evas_Object *obj, const char *part, Evas_Object *child);
3286
3287/**
3288 * @brief Prepends an object to the box.
3289 *
3290 * @param obj A valid Evas_Object handle
3291 * @param part The part name
3292 * @param child The object to prepend
3293 *
3294 * @return @c EINA_TRUE: Successfully added.\n
3295 * @c EINA_FALSE: An error occurred.
3296 *
3297 * Prepends child to the box indicated by part.
3298 *
3299 * @see edje_object_part_box_append()
3300 * @see edje_object_part_box_insert_before()
3301 * @see edje_object_part_box_insert_at()
3302 */
3303EAPI Eina_Bool edje_object_part_box_prepend (Evas_Object *obj, const char *part, Evas_Object *child);
3304
3305/**
3306 * @brief Adds an object to the box.
3307 *
3308 * @param obj A valid Evas_Object handle
3309 * @param part The part name
3310 * @param child The object to insert
3311 * @param reference The object to be used as reference
3312 *
3313 * @return @c EINA_TRUE: Successfully added.\n
3314 * @c EINA_FALSE: An error occurred.
3315 *
3316 * Inserts child in the box given by part, in the position marked by
3317 * reference.
3318 *
3319 * @see edje_object_part_box_append()
3320 * @see edje_object_part_box_prepend()
3321 * @see edje_object_part_box_insert_at()
3322 */
3323EAPI Eina_Bool edje_object_part_box_insert_before (Evas_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference);
3324
3325/**
3326 * @brief Inserts an object to the box.
3327 *
3328 * @param obj A valid Evas_Object handle
3329 * @param part The part name
3330 * @param child The object to insert
3331 * @param pos The position where to insert child
3332 *
3333 * @return @c EINA_TRUE: Successfully added.\n
3334 * @c EINA_FALSE: An error occurred.
3335 *
3336 * Adds child to the box indicated by part, in the position given by
3337 * pos.
3338 *
3339 * @see edje_object_part_box_append()
3340 * @see edje_object_part_box_prepend()
3341 * @see edje_object_part_box_insert_before()
3342 */
3343EAPI Eina_Bool edje_object_part_box_insert_at (Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos);
3344
3345/**
3346 * @brief Removes an object from the box.
3347 *
3348 * @param obj A valid Evas_Object handle
3349 * @param part The part name
3350 * @param child The object to remove
3351 *
3352 * @return Pointer to the object removed, or @c NULL.
3353 *
3354 * Removes child from the box indicated by part.
3355 *
3356 * @see edje_object_part_box_remove_at()
3357 * @see edje_object_part_box_remove_all()
3358 */
3359EAPI Evas_Object *edje_object_part_box_remove (Evas_Object *obj, const char *part, Evas_Object *child);
3360
3361/**
3362 * @brief Removes an object from the box.
3363 *
3364 * @param obj A valid Evas_Object handle
3365 * @param part The part name
3366 * @param pos The position index of the object (starts counting from 0)
3367 *
3368 * @return Pointer to the object removed, or @c NULL.
3369 *
3370 * Removes from the box indicated by part, the object in the position
3371 * pos.
3372 *
3373 * @see edje_object_part_box_remove()
3374 * @see edje_object_part_box_remove_all()
3375 */
3376EAPI Evas_Object *edje_object_part_box_remove_at (Evas_Object *obj, const char *part, unsigned int pos);
3377
3378/**
3379 * @brief Removes all elements from the box.
3380 *
3381 * @param obj A valid Evas_Object handle
3382 * @param part The part name
3383 * @param clear Delete objects on removal
3384 *
3385 * @return 1: Successfully cleared.\n
3386 * 0: An error occurred.
3387 *
3388 * Removes all the external objects from the box indicated by part.
3389 * Elements created from the theme will not be removed.
3390 *
3391 * @see edje_object_part_box_remove()
3392 * @see edje_object_part_box_remove_at()
3393 */
3394EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Eina_Bool clear);
3395
3396/**
3397 * @brief Retrieve a child from a table
3398 *
3399 * @param obj A valid Evas_Object handle
3400 * @param part The part name
3401 * @param col The column of the child to get
3402 * @param row The row of the child to get
3403 * @return The child Evas_Object
3404 */
3405EAPI Evas_Object *edje_object_part_table_child_get (Evas_Object *obj, const char *part, unsigned int col, unsigned int row);
3406
3407/**
3408 * @brief Packs an object into the table.
3409 *
3410 * @param obj A valid Evas_Object handle
3411 * @param part The part name
3412 * @param child_obj The object to pack in
3413 * @param col The column to place it in
3414 * @param row The row to place it in
3415 * @param colspan Columns the child will take
3416 * @param rowspan Rows the child will take
3417 *
3418 * @return @c EINA_TRUE object was added, @c EINA_FALSE on failure
3419 *
3420 * Packs an object into the table indicated by part.
3421 */
3422EAPI Eina_Bool edje_object_part_table_pack (Evas_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
3423
3424/**
3425 * @brief Removes an object from the table.
3426 *
3427 * @param obj A valid Evas_Object handle
3428 * @param part The part name
3429 * @param child_obj The object to pack in
3430 *
3431 * @return @c EINA_TRUE object removed, @c EINA_FALSE on failure
3432 *
3433 * Removes an object from the table indicated by part.
3434 */
3435EAPI Eina_Bool edje_object_part_table_unpack (Evas_Object *obj, const char *part, Evas_Object *child_obj);
3436
3437/**
3438 * @brief Gets the number of columns and rows the table has.
3439 *
3440 * @param obj A valid Evas_Object handle
3441 * @param part The part name
3442 * @param cols Pointer where to store number of columns (can be NULL)
3443 * @param rows Pointer where to store number of rows (can be NULL)
3444 *
3445 * @return @c EINA_TRUE get some data, @c EINA_FALSE on failure
3446 *
3447 * Retrieves the size of the table in number of columns and rows.
3448 */
3449EAPI Eina_Bool edje_object_part_table_col_row_size_get (const Evas_Object *obj, const char *part, int *cols, int *rows);
3450
3451/**
3452 * @brief Removes all object from the table.
3453 *
3454 * @param obj A valid Evas_Object handle
3455 * @param part The part name
3456 * @param clear If set, will delete subobjs on remove
3457 *
3458 * @return @c EINA_TRUE clear the table, @c EINA_FALSE on failure
3459 *
3460 * Removes all object from the table indicated by part, except the
3461 * internal ones set from the theme.
3462 */
3463EAPI Eina_Bool edje_object_part_table_clear (Evas_Object *obj, const char *part, Eina_Bool clear);
3464
3465/**
3466 * @brief Send an (Edje) message to a given Edje object
3467 *
3468 * @param obj A handle to an Edje object
3469 * @param type The type of message to send to @p obj
3470 * @param id A identification number for the message to be sent
3471 * @param msg The message's body, a struct depending on @p type
3472 *
3473 * This function sends an Edje message to @p obj and to all of its
3474 * child objects, if it has any (swallowed objects are one kind of
3475 * child object). @p type and @p msg @b must be matched accordingly,
3476 * as documented in #Edje_Message_Type.
3477 *
3478 * The @p id argument as a form of code and theme defining a common
3479 * interface on message communication. One should define the same IDs
3480 * on both code and EDC declaration (see @ref edcref "the syntax" for
3481 * EDC files), to individualize messages (binding them to a given
3482 * context).
3483 *
3484 * The function to handle messages arriving @b from @b obj is set with
3485 * edje_object_message_handler_set().
3486 */
3487EAPI void edje_object_message_send (Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
3488
3489/**
3490 * @brief Set an Edje message handler function for a given Edje object.
3491 *
3492 * @param obj A handle to an Edje object
3493 * @param func The function to handle messages @b coming from @p obj
3494 * @param data Auxiliary data to be passed to @p func
3495 *
3496 * Edje messages are one of the communication interfaces between
3497 * @b code and a given Edje object's @b theme. With messages, one can
3498 * communicate values beyond strings (which are the subject of Edje
3499 * signals -- see edje_object_signal_emit()), like float and integer
3500 * numbers. Moreover, messages can be identified by integer
3501 * numbers. See #Edje_Message_Type for the full list of message types.
3502 *
3503 * For scriptable programs on an Edje object's defining EDC file which
3504 * send messages with the @c send_message() primitive, one can attach
3505 * <b>handler functions</b>, to be called in the code which creates
3506 * that object (see @ref edcref "the syntax" for EDC files).
3507 *
3508 * This function associates a message handler function and the
3509 * attached data pointer to the object @p obj.
3510 *
3511 * @see edje_object_message_send()
3512 */
3513EAPI void edje_object_message_handler_set (Evas_Object *obj, Edje_Message_Handler_Cb func, void *data);
3514
3515/**
3516 * @brief Process an object's message queue.
3517 *
3518 * @param obj A handle to an Edje object.
3519 *
3520 * This function goes through the object message queue processing the
3521 * pending messages for @b this specific Edje object. Normally they'd
3522 * be processed only at idle time.
3523 *
3524 */
3525EAPI void edje_object_message_signal_process (Evas_Object *obj);
3526
3527
3528/**
3529 * @brief Process all queued up edje messages.
3530 *
3531 * This function triggers the processing of messages addressed to any
3532 * (alive) edje objects.
3533 *
3534 */
3535EAPI void edje_message_signal_process (void);
3536
3537/**
3538 * Register a type to be used by EXTERNAL parts.
3539 *
3540 * Edje supports parts of type EXTERNAL, which will call user defined functions
3541 * to create and manipulate the object that's allocated in that part. This is
3542 * done by expecifying in the @c source property of the part the name of the
3543 * external to use, which must be one registered with this function.
3544 *
3545 * @param type_name name to register and be known by edje's "source:"
3546 * parameter of "type: EXTERNAL" parts.
3547 * @param type_info meta-information describing how to interact with it.
3548 *
3549 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (like
3550 * type already registered).
3551 *
3552 * @see edje_external_type_array_register()
3553 */
3554EAPI Eina_Bool edje_external_type_register (const char *type_name, const Edje_External_Type *type_info);
3555
3556/**
3557 * Unregister a previously registered EXTERNAL type.
3558 *
3559 * @param type_name name to unregister. It should have been registered with
3560 * edje_external_type_register() before.
3561 *
3562 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (like
3563 * type_name did not exist).
3564 *
3565 * @see edje_external_type_array_unregister()
3566 */
3567EAPI Eina_Bool edje_external_type_unregister (const char *type_name);
3568
3569/**
3570 * Register a batch of types and their information.
3571 *
3572 * When several types will be registered it is recommended to use this
3573 * function instead of several calls to edje_external_type_register(), as it
3574 * is faster.
3575 *
3576 * @note The contents of the array will be referenced directly for as long as
3577 * the type remains registered, so both the @c name and @c info in the
3578 * @p array must be kept alive during all this period (usually, the entire
3579 * program lifetime). The most common case would be to keep the array as a
3580 * @c static @c const type anyway.
3581 *
3582 * @param array @c NULL terminated array with type name and
3583 * information. Note that type name or information are
3584 * referenced directly, so they must be kept alive after
3585 * this function returns!
3586 *
3587 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (like
3588 * type already registered).
3589 *
3590 * @see edje_external_type_register()
3591 */
3592EAPI void edje_external_type_array_register (const Edje_External_Type_Info *array);
3593
3594/**
3595 * Unregister a batch of given external type previously registered.
3596 *
3597 * @param array @c NULL terminated array, should be the same as the
3598 * one used to register with edje_external_type_array_register()
3599 *
3600 * @see edje_external_type_unregister()
3601 */
3602EAPI void edje_external_type_array_unregister (const Edje_External_Type_Info *array);
3603
3604/**
3605 * Return the current ABI version for Edje_External_Type structure.
3606 *
3607 * Always check this number before accessing Edje_External_Type in
3608 * your own software. If the number is not the same, your software may
3609 * access invalid memory and crash, or just get garbage values.
3610 *
3611 * @warning @b NEVER, EVER define your own Edje_External_Type using the
3612 * return of this function as it will change as Edje library
3613 * (libedje.so) changes, but your type definition will
3614 * not. Instead, use #EDJE_EXTERNAL_TYPE_ABI_VERSION.
3615 *
3616 * Summary:
3617 * - use edje_external_type_abi_version_get() to check.
3618 * - use #EDJE_EXTERNAL_TYPE_ABI_VERSION to define/declare.
3619 *
3620 * @return The external ABI version the Edje library was compiled with. That
3621 * is, the value #EDJE_EXTERNAL_TYPE_ABI_VERSION had at that moment.
3622 */
3623EAPI unsigned int edje_external_type_abi_version_get (void) EINA_CONST;
3624
3625/**
3626 * Returns an interator of all the registered EXTERNAL types.
3627 *
3628 * Each item in the iterator is an @c Eina_Hash_Tuple which has the type
3629 * of the external in the @c key and #Edje_External_Type as @c data.
3630 *
3631 * @code
3632 * const Eina_Hash_Tuple *tuple;
3633 * Eina_Iterator *itr;
3634 * const Eina_List *l, *modules;
3635 * const char *s;
3636 *
3637 * modules = edje_available_modules_get();
3638 * EINA_LIST_FOREACH(modules, l, s)
3639 * {
3640 * if (!edje_module_load(s))
3641 * printf("Error loading edje module: %s\n", s);
3642 * }
3643 *
3644 * itr = edje_external_iterator_get();
3645 * EINA_ITERATOR_FOREACH(itr, tuple)
3646 * {
3647 * const char *name = tuple->key;
3648 * const Edje_External_Type *type = tuple->data;
3649 *
3650 * if ((!type) ||
3651 * (type->abi_version != edje_external_type_abi_version_get()))
3652 * {
3653 * printf("Error: invalid type %p (abi: %d, expected: %d)\n",
3654 * type, type ? type->abi_version : 0,
3655 * edje_external_type_abi_version_get());
3656 * continue;
3657 * }
3658 *
3659 * printf("%s: %s (%s) label='%s' desc='%s'\n",
3660 * name, type->module, type->module_name,
3661 * type->label_get ? type->label_get(type->data) : "",
3662 * type->description_get ? type->description_get(type->data) : "");
3663 * }
3664 *
3665 * @endcode
3666 */
3667EAPI Eina_Iterator *edje_external_iterator_get (void);
3668
3669/**
3670 * Conevenience function to find a specific parameter in a list of them.
3671 *
3672 * @param params The list of parameters for the external
3673 * @param key The parameter to look for
3674 *
3675 * @return The matching #Edje_External_Param or NULL if it's not found.
3676 */
3677 EAPI Edje_External_Param *edje_external_param_find (const Eina_List *params, const char *key);
3678/**
3679 * Get the value of the given parameter of integer type.
3680 *
3681 * Look for the @p key parameter in the @p params list and return its value in
3682 * @p ret. If the parameter is found and is of type
3683 * #EDJE_EXTERNAL_PARAM_TYPE_INT, its value will be stored in the int pointed
3684 * by @p ret, returning EINA_TRUE. In any other case, the function returns
3685 * EINA_FALSE.
3686 *
3687 * @param params List of parameters where to look
3688 * @param key Name of the parameter to fetch
3689 * @param ret Int pointer where to store the value, must not be NULL.
3690 *
3691 * @return EINA_TRUE if the parameter was found and is of integer type,
3692 * EINA_FALSE otherwise.
3693 */
3694 EAPI Eina_Bool edje_external_param_int_get (const Eina_List *params, const char *key, int *ret);
3695/**
3696 * Get the value of the given parameter of double type.
3697 *
3698 * Look for the @p key parameter in the @p params list and return its value in
3699 * @p ret. If the parameter is found and is of type
3700 * #EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, its value will be stored in the double
3701 * pointed by @p ret, returning EINA_TRUE. In any other case, the function
3702 * returns EINA_FALSE.
3703 *
3704 * @param params List of parameters where to look
3705 * @param key Name of the parameter to fetch
3706 * @param ret Double pointer where to store the value, must not be NULL.
3707 *
3708 * @return EINA_TRUE if the parameter was found and is of double type,
3709 * EINA_FALSE otherwise.
3710 */
3711 EAPI Eina_Bool edje_external_param_double_get (const Eina_List *params, const char *key, double *ret);
3712/**
3713 * Get the value of the given parameter of string type.
3714 *
3715 * Look for the @p key parameter in the @p params list and return its value in
3716 * @p ret. If the parameter is found and is of type
3717 * #EDJE_EXTERNAL_PARAM_TYPE_STRING, its value will be stored in the pointer
3718 * pointed by @p ret, returning EINA_TRUE. In any other case, the function
3719 * returns EINA_FALSE.
3720 *
3721 * The string stored in @p ret must not be freed or modified.
3722 *
3723 * @param params List of parameters where to look
3724 * @param key Name of the parameter to fetch
3725 * @param ret String pointer where to store the value, must not be NULL.
3726 *
3727 * @return EINA_TRUE if the parameter was found and is of string type,
3728 * EINA_FALSE otherwise.
3729 */
3730 EAPI Eina_Bool edje_external_param_string_get (const Eina_List *params, const char *key, const char **ret);
3731/**
3732 * Get the value of the given parameter of boolean type.
3733 *
3734 * Look for the @p key parameter in the @p params list and return its value in
3735 * @p ret. If the parameter is found and is of type
3736 * #EDJE_EXTERNAL_PARAM_TYPE_BOOL, its value will be stored in the Eina_Bool
3737 * pointed by @p ret, returning EINA_TRUE. In any other case, the function
3738 * returns EINA_FALSE.
3739 *
3740 * @param params List of parameters where to look
3741 * @param key Name of the parameter to fetch
3742 * @param ret Eina_Bool pointer where to store the value, must not be NULL.
3743 *
3744 * @return EINA_TRUE if the parameter was found and is of boolean type,
3745 * EINA_FALSE otherwise.
3746 */
3747 EAPI Eina_Bool edje_external_param_bool_get (const Eina_List *params, const char *key, Eina_Bool *ret);
3748/**
3749 * Get the value of the given parameter of choice type.
3750 *
3751 * Look for the @p key parameter in the @p params list and return its value in
3752 * @p ret. If the parameter is found and is of type
3753 * #EDJE_EXTERNAL_PARAM_TYPE_CHOICE, its value will be stored in the string
3754 * pointed by @p ret, returning EINA_TRUE. In any other case, the function
3755 * returns EINA_FALSE.
3756 *
3757 * The string stored in @p ret must not be freed or modified.
3758 *
3759 * @param params List of parameters where to look
3760 * @param key Name of the parameter to fetch
3761 * @param ret String pointer where to store the value, must not be NULL.
3762 *
3763 * @return EINA_TRUE if the parameter was found and is of integer type,
3764 * EINA_FALSE otherwise.
3765 */
3766 EAPI Eina_Bool edje_external_param_choice_get (const Eina_List *params, const char *key, const char **ret);
3767
3768/**
3769 * Get the array of parameters information about a type given its name.
3770 *
3771 * @note the type names and other strings are static, that means they are
3772 * @b NOT translated. One must use
3773 * Edje_External_Type::translate() to translate those.
3774 *
3775 * @return the NULL terminated array, or @c NULL if type is unknown or
3776 * it does not have any parameter information.
3777 *
3778 * @see edje_external_type_get()
3779 */
3780EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char *type_name);
3781
3782/**
3783 * Get the #Edje_External_Type that defines an EXTERNAL type registered with
3784 * the name @p type_name.
3785 */
3786 EAPI const Edje_External_Type *edje_external_type_get (const char *type_name);
3787
3788 EAPI Eina_Bool edje_module_load (const char *module);
3789 EAPI const Eina_List *edje_available_modules_get (void);
3790
3791 /* perspective info for maps inside edje objects */
3792 typedef struct _Edje_Perspective Edje_Perspective;
3793
3794 /**
3795 * Creates a new perspective in the given canvas.
3796 *
3797 * @param e The given canvas (Evas).
3798 * @return An @ref Edje_Perspective object for this canvas, or @c NULL on errors.
3799 *
3800 * This function creates a perspective object that can be set on an Edje
3801 * object, or globally to all Edje objects on this canvas.
3802 *
3803 * @see edje_perspective_set()
3804 * @see edje_perspective_free()
3805 */
3806 EAPI Edje_Perspective *edje_perspective_new (Evas *e);
3807 /**
3808 * Delete the given perspective object.
3809 *
3810 * @param ps A valid perspective object, or @c NULL.
3811 *
3812 * This function will delete the perspective object. If the perspective
3813 * effect was being applied to any Edje object or part, this effect won't be
3814 * applied anymore.
3815 *
3816 * @see edje_perspective_new()
3817 */
3818 EAPI void edje_perspective_free (Edje_Perspective *ps);
3819 /**
3820 * Setup the transform for this perspective object.
3821 *
3822 * This sets the parameters of the perspective transformation. X, Y and Z
3823 * values are used. The px and py points specify the "infinite distance" point
3824 * in the 3D conversion (where all lines converge to like when artists draw
3825 * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1
3826 * mapping between spatial coorinates and screen coordinates. Any points
3827 * on this z value will not have their X and Y values modified in the transform.
3828 * Those further away (Z value higher) will shrink into the distance, and
3829 * those less than this value will expand and become bigger. The @p foc value
3830 * determines the "focal length" of the camera. This is in reality the distance
3831 * between the camera lens plane itself (at or closer than this rendering
3832 * results are undefined) and the "z0" z value. This allows for some "depth"
3833 * control and @p foc must be greater than 0.
3834 *
3835 * @param m map to change.
3836 * @param px The pespective distance X coordinate
3837 * @param py The pespective distance Y coordinate
3838 * @param z0 The "0" z plane value
3839 * @param foc The focal distance
3840 */
3841 EAPI void edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
3842 /**
3843 * Make this perspective object be global for its canvas.
3844 *
3845 * @param ps The given perspective object
3846 * @param global @c EINA_TRUE if the perspective should be global, @c
3847 * EINA_FALSE otherwise.
3848 *
3849 * The canvas which this perspective object is being set as global is the one
3850 * given as argument upon the object creation (the @p evas parameter on the
3851 * function @c edje_perspective_new(evas) ).
3852 *
3853 * There can be only one global perspective object set per canvas, and if
3854 * a perspective object is set to global when there was already another
3855 * global perspective set, the old one will be set as non-global.
3856 *
3857 * A global perspective just affects a part if its Edje object doesn't have a
3858 * perspective object set to it, and if the part doesn't point to another
3859 * part to be used as perspective.
3860 *
3861 * @see edje_object_perspective_set()
3862 * @see edje_perspective_global_get()
3863 * @see edje_perspective_new()
3864 */
3865 EAPI void edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global);
3866 /**
3867 * Get whether the given perspective object is global or not.
3868 *
3869 * @param ps The given perspective object.
3870 * @return @c EINA_TRUE if this perspective object is global, @c EINA_FALSE
3871 * otherwise.
3872 *
3873 * @see edje_perspective_global_set()
3874 */
3875 EAPI Eina_Bool edje_perspective_global_get (const Edje_Perspective *ps);
3876 /**
3877 * Get the global perspective object set for this canvas.
3878 *
3879 * @param e The given canvas (Evas).
3880 * @return The perspective object set as global for this canvas. Or @c NULL
3881 * if there is no global perspective set and on errors.
3882 *
3883 * This function will return the perspective object that was set as global
3884 * with edje_perspective_global_set().
3885 *
3886 * @see edje_perspective_global_set()
3887 * @see edje_perspective_global_get()
3888 */
3889 EAPI const Edje_Perspective *edje_evas_global_perspective_get(const Evas *e);
3890 /**
3891 * Set the given perspective object on this Edje object.
3892 *
3893 * @param obj The Edje object on the perspective will be set.
3894 * @param ps The perspective object that will be used.
3895 *
3896 * Make the given perspective object be the default perspective for this Edje
3897 * object.
3898 *
3899 * There can be only one perspective object per Edje object, and if a
3900 * previous one was set, it will be removed and the new perspective object
3901 * will be used.
3902 *
3903 * An Edje perspective will only affect a part if it doesn't point to another
3904 * part to be used as perspective.
3905 *
3906 * @see edje_object_perspective_new()
3907 * @see edje_object_perspective_get()
3908 * @see edje_perspective_set()
3909 */
3910 EAPI void edje_object_perspective_set (Evas_Object *obj, Edje_Perspective *ps);
3911 /**
3912 * Get the current perspective used on this Edje object.
3913 *
3914 * @param obj the given Edje object.
3915 * @return The perspective object being used on this Edje object. Or @c NULL
3916 * if there was none, and on errors.
3917 *
3918 * @see edje_object_perspective_set()
3919 */
3920 EAPI const Edje_Perspective *edje_object_perspective_get (const Evas_Object *obj);
3921
3922#ifdef __cplusplus
3923}
3924#endif
3925
3926#endif