edje_private.h
Go to the documentation of this file.
1 #ifndef _EDJE_PRIVATE_H
2 #define _EDJE_PRIVATE_H
3 
4 #ifdef HAVE_CONFIG_H
5 # include <config.h>
6 #endif
7 
8 #ifndef _WIN32
9 # define _GNU_SOURCE
10 #endif
11 
12 #ifdef STDC_HEADERS
13 # include <stdlib.h>
14 # include <stddef.h>
15 #else
16 # ifdef HAVE_STDLIB_H
17 # include <stdlib.h>
18 # endif
19 #endif
20 #ifdef HAVE_ALLOCA_H
21 # include <alloca.h>
22 #elif !defined alloca
23 # ifdef __GNUC__
24 # define alloca __builtin_alloca
25 # elif defined _AIX
26 # define alloca __alloca
27 # elif defined _MSC_VER
28 # include <malloc.h>
29 # define alloca _alloca
30 # elif !defined HAVE_ALLOCA
31 # ifdef __cplusplus
32 extern "C"
33 # endif
34 void *alloca (size_t);
35 # endif
36 #endif
37 
38 #include <string.h>
39 #include <limits.h>
40 #include <sys/stat.h>
41 #include <time.h>
42 #include <sys/time.h>
43 #include <errno.h>
44 
45 #ifndef _MSC_VER
46 # include <libgen.h>
47 # include <unistd.h>
48 #endif
49 
50 #include <fcntl.h>
51 
52 #include <lua.h>
53 #include <lualib.h>
54 #include <lauxlib.h>
55 #include <setjmp.h>
56 
57 #ifdef HAVE_LOCALE_H
58 # include <locale.h>
59 #endif
60 
61 #ifdef HAVE_EVIL
62 # include <Evil.h>
63 #endif
64 
65 #include <Eina.h>
66 #include <Eet.h>
67 #include <Evas.h>
68 #include <Ecore.h>
69 #include <Ecore_Evas.h>
70 #include <Ecore_File.h>
71 #ifdef HAVE_ECORE_IMF
72 # include <Ecore_IMF.h>
73 # include <Ecore_IMF_Evas.h>
74 #endif
75 #include <Embryo.h>
76 
77 #include "Edje.h"
78 
79 EAPI extern int _edje_default_log_dom ;
80 
81 #ifdef EDJE_DEFAULT_LOG_COLOR
82 # undef EDJE_DEFAULT_LOG_COLOR
83 #endif
84 #define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
85 #ifdef ERR
86 # undef ERR
87 #endif
88 #define ERR(...) EINA_LOG_DOM_ERR(_edje_default_log_dom, __VA_ARGS__)
89 #ifdef INF
90 # undef INF
91 #endif
92 #define INF(...) EINA_LOG_DOM_INFO(_edje_default_log_dom, __VA_ARGS__)
93 #ifdef WRN
94 # undef WRN
95 #endif
96 #define WRN(...) EINA_LOG_DOM_WARN(_edje_default_log_dom, __VA_ARGS__)
97 #ifdef CRIT
98 # undef CRIT
99 #endif
100 #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__)
101 #ifdef DBG
102 # undef DBG
103 #endif
104 #define DBG(...) EINA_LOG_DOM_DBG(_edje_default_log_dom, __VA_ARGS__)
105 #ifdef __GNUC__
106 # if __GNUC__ >= 4
107 // BROKEN in gcc 4 on amd64
108 //# pragma GCC visibility push(hidden)
109 # endif
110 #endif
111 
112 #ifndef ABS
113 #define ABS(x) ((x) < 0 ? -(x) : (x))
114 #endif
115 
116 #ifndef CLAMP
117 #define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
118 #endif
119 
120 #ifndef MIN
121 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
122 #endif
123 
124 
125 #ifdef BUILD_EDJE_FP
126 
127 #define FLOAT_T Eina_F32p32
128 #define EDJE_T_FLOAT EET_T_F32P32
129 #define MUL(a, b) eina_f32p32_mul(a, b)
130 #define SCALE(a, b) eina_f32p32_scale(a, b)
131 #define DIV(a, b) eina_f32p32_div(a, b)
132 #define DIV2(a) ((a) >> 1)
133 #define ADD(a, b) eina_f32p32_add(a, b)
134 #define SUB(a, b) eina_f32p32_sub(a, b)
135 #define SQRT(a) eina_f32p32_sqrt(a)
136 #define TO_DOUBLE(a) eina_f32p32_double_to(a)
137 #define FROM_DOUBLE(a) eina_f32p32_double_from(a)
138 #define FROM_INT(a) eina_f32p32_int_from(a)
139 #define TO_INT(a) eina_f32p32_int_to(a)
140 #define ZERO 0
141 #define COS(a) eina_f32p32_cos(a)
142 #define SIN(a) eina_f32p32_sin(a)
143 #define PI EINA_F32P32_PI
144 
145 #else
146 
147 #define FLOAT_T double
148 #define EDJE_T_FLOAT EET_T_DOUBLE
149 #define MUL(a, b) ((a) * (b))
150 #define SCALE(a, b) ((a) * (double)(b))
151 #define DIV(a, b) ((a) / (b))
152 #define DIV2(a) ((a) / 2.0)
153 #define ADD(a, b) ((a) + (b))
154 #define SUB(a, b) ((a) - (b))
155 #define SQRT(a) sqrt(a)
156 #define TO_DOUBLE(a) (double)(a)
157 #define FROM_DOUBLE(a) (a)
158 #define FROM_INT(a) (double)(a)
159 #define TO_INT(a) (int)(a)
160 #define ZERO 0.0
161 #define COS(a) cos(a)
162 #define SIN(a) sin(a)
163 #define PI 3.14159265358979323846
164 
165 #endif
166 
167 /* Inheritable Edje Smart API. For now private so only Edje Edit makes
168  * use of this, but who knows what will be possible in the future */
169 #define EDJE_SMART_API_VERSION 1
170 
172 
174 {
175  Evas_Smart_Class base;
176  int version;
177  Eina_Bool (*file_set)(Evas_Object *obj, const char *file, const char *group);
178 };
179 
180 /* Basic macro to init the Edje Smart API */
181 #define EDJE_SMART_API_INIT(smart_class_init) {smart_class_init, EDJE_SMART_API_VERSION, NULL}
182 
183 #define EDJE_SMART_API_INIT_NULL EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
184 #define EDJE_SMART_API_INIT_VERSION EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
185 #define EDJE_SMART_API_INIT_NAME_VERSION(name) EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
186 
187 /* increment this when the EET data descriptors have changed and old
188  * EETs cannot be loaded/used correctly anymore.
189  */
190 #define EDJE_FILE_VERSION 3
191 /* increment this when you add new feature to edje file format without
192  * breaking backward compatibility.
193  */
194 #define EDJE_FILE_MINOR 3
195 
196 /* FIXME:
197  *
198  * More example Edje files
199  *
200  * ? programs can do multiple actions from one signal
201  * ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox)
202  * ? text entry widget (single line only)
203  *
204  * ? recursions, unsafe callbacks outside Edje etc. with freeze, ref/unref and block/unblock and break_programs needs to be redesigned & fixed
205  * ? all unsafe calls that may result in callbacks must be marked and dealt with
206  */
207 
208 typedef enum
209 {
216 
218 {
219  Evas_Object *obj;
220  Evas *e;
221  Evas_Coord px, py, z0, foc;
222  Eina_List *users;
223  Eina_Bool global : 1;
224 };
225 
227 {
229 };
230 
232 {
233  int x, y;
234 };
235 
237 {
238  int w, h;
239  Eina_Bool limit; /* should we limit ourself to the size of the source */
240 };
241 
243 {
244  int x, y, w, h;
245 };
246 
248 {
249  unsigned char r, g, b, a;
250 };
251 
253 {
255  char prefer;
256 };
257 
259 {
260  int w, h;
262 };
263 
265 {
266  const char *str;
267  unsigned int id;
268 };
269 
273 typedef struct _Edje_Size Edje_Size;
275 typedef struct _Edje_Color Edje_Color;
277 typedef struct _Edje_Aspect Edje_Aspect;
278 typedef struct _Edje_String Edje_String;
279 
280 typedef struct _Edje_File Edje_File;
281 typedef struct _Edje_Style Edje_Style;
290 typedef struct _Edje_Limit Edje_Limit;
300 typedef struct _Edje_Part Edje_Part;
320 
321 typedef struct _Edje Edje;
333 typedef struct _Edje_Var Edje_Var;
345 
346 #define EDJE_INF_MAX_W 100000
347 #define EDJE_INF_MAX_H 100000
348 
349 #define EDJE_IMAGE_SOURCE_TYPE_NONE 0
350 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT 1
351 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY 2
352 #define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL 3
353 #define EDJE_IMAGE_SOURCE_TYPE_LAST 4
354 
355 #define EDJE_SOUND_SOURCE_TYPE_NONE 0
356 #define EDJE_SOUND_SOURCE_TYPE_INLINE_RAW 1
357 #define EDJE_SOUND_SOURCE_TYPE_INLINE_COMP 2
358 #define EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY 3
359 #define EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS 4
360 
361 #define EDJE_VAR_NONE 0
362 #define EDJE_VAR_INT 1
363 #define EDJE_VAR_FLOAT 2
364 #define EDJE_VAR_STRING 3
365 #define EDJE_VAR_LIST 4
366 #define EDJE_VAR_HASH 5
367 
368 #define EDJE_VAR_MAGIC_BASE 0x12fe84ba
369 
370 #define EDJE_STATE_PARAM_NONE 0
371 #define EDJE_STATE_PARAM_ALIGNMENT 1
372 #define EDJE_STATE_PARAM_MIN 2
373 #define EDJE_STATE_PARAM_MAX 3
374 #define EDJE_STATE_PARAM_STEP 4
375 #define EDJE_STATE_PARAM_ASPECT 5
376 #define EDJE_STATE_PARAM_ASPECT_PREF 6
377 #define EDJE_STATE_PARAM_COLOR 7
378 #define EDJE_STATE_PARAM_COLOR2 8
379 #define EDJE_STATE_PARAM_COLOR3 9
380 #define EDJE_STATE_PARAM_COLOR_CLASS 10
381 #define EDJE_STATE_PARAM_REL1 11
382 #define EDJE_STATE_PARAM_REL1_TO 12
383 #define EDJE_STATE_PARAM_REL1_OFFSET 13
384 #define EDJE_STATE_PARAM_REL2 14
385 #define EDJE_STATE_PARAM_REL2_TO 15
386 #define EDJE_STATE_PARAM_REL2_OFFSET 16
387 #define EDJE_STATE_PARAM_IMAGE 17
388 #define EDJE_STATE_PARAM_BORDER 18
389 #define EDJE_STATE_PARAM_FILL_SMOOTH 19
390 #define EDJE_STATE_PARAM_FILL_POS 20
391 #define EDJE_STATE_PARAM_FILL_SIZE 21
392 #define EDJE_STATE_PARAM_TEXT 22
393 #define EDJE_STATE_PARAM_TEXT_CLASS 23
394 #define EDJE_STATE_PARAM_TEXT_FONT 24
395 #define EDJE_STATE_PARAM_TEXT_STYLE 25
396 #define EDJE_STATE_PARAM_TEXT_SIZE 26
397 #define EDJE_STATE_PARAM_TEXT_FIT 27
398 #define EDJE_STATE_PARAM_TEXT_MIN 28
399 #define EDJE_STATE_PARAM_TEXT_MAX 29
400 #define EDJE_STATE_PARAM_TEXT_ALIGN 30
401 #define EDJE_STATE_PARAM_VISIBLE 31
402 #define EDJE_STATE_PARAM_MAP_OM 32
403 #define EDJE_STATE_PARAM_MAP_PERSP 33
404 #define EDJE_STATE_PARAM_MAP_LIGNT 34
405 #define EDJE_STATE_PARAM_MAP_ROT_CENTER 35
406 #define EDJE_STATE_PARAM_MAP_ROT_X 36
407 #define EDJE_STATE_PARAM_MAP_ROT_Y 37
408 #define EDJE_STATE_PARAM_MAP_ROT_Z 38
409 #define EDJE_STATE_PARAM_MAP_BACK_CULL 39
410 #define EDJE_STATE_PARAM_MAP_PERSP_ON 40
411 #define EDJE_STATE_PARAM_PERSP_ZPLANE 41
412 #define EDJE_STATE_PARAM_PERSP_FOCAL 42
413 #define EDJE_STATE_PARAM_LAST 43
414 
415 #define EDJE_ENTRY_EDIT_MODE_NONE 0
416 #define EDJE_ENTRY_EDIT_MODE_SELECTABLE 1
417 #define EDJE_ENTRY_EDIT_MODE_EDITABLE 2
418 #define EDJE_ENTRY_EDIT_MODE_PASSWORD 3
419 
420 #define EDJE_ENTRY_SELECTION_MODE_DEFAULT 0
421 #define EDJE_ENTRY_SELECTION_MODE_EXPLICIT 1
422 
423 #define EDJE_ENTRY_CURSOR_MODE_UNDER 0
424 #define EDJE_ENTRY_CURSOR_MODE_BEFORE 1
425 
426 #define EDJE_ORIENTATION_AUTO 0
427 #define EDJE_ORIENTATION_LTR 1
428 #define EDJE_ORIENTATION_RTL 2
429 
430 #define EDJE_PART_PATH_SEPARATOR ':'
431 #define EDJE_PART_PATH_SEPARATOR_STRING ":"
432 #define EDJE_PART_PATH_SEPARATOR_INDEXL '['
433 #define EDJE_PART_PATH_SEPARATOR_INDEXR ']'
434 
435 #define FLAG_NONE 0
436 #define FLAG_X 0x01
437 #define FLAG_Y 0x02
438 #define FLAG_XY (FLAG_X | FLAG_Y)
439 
440 /*----------*/
441 
443 {
444  const char *path;
445  time_t mtime;
446 
450  Eina_List *styles;
451  Eina_List *color_classes;
452 
454  const char *compiler;
455  int version;
456  int minor;
458 
459  Eina_Hash *data;
460  Eina_Hash *fonts;
461 
462  Eina_Hash *collection;
463  Eina_List *collection_cache;
464 
466 
467  Eet_File *ef;
468 
469  unsigned char free_strings : 1;
470  unsigned char dangling : 1;
471  unsigned char warning : 1;
472 };
473 
475 {
476  char *name;
477  Eina_List *tags;
478  Evas_Textblock_Style *style;
479 };
480 
482 {
483  const char *key;
484  const char *value;
485  const char *font;
486  double font_size;
487  const char *text_class;
488 };
489 
490 /*----------*/
491 
492 
494 {
495  const char *entry; /* the name of the font */
496  const char *file; /* the name of the file */
497 };
498 
499 /*----------*/
500 
502 {
503  Edje_External_Directory_Entry *entries; /* a list of Edje_External_Directory_Entry */
504  unsigned int entries_count;
505 };
506 
508 {
509  const char *entry; /* the name of the external */
510 };
511 
512 
513 /*----------*/
514 
515 
516 
517 /*----------*/
518 
520 {
521  Edje_Image_Directory_Entry *entries; /* an array of Edje_Image_Directory_Entry */
522  unsigned int entries_count;
523 
525  unsigned int sets_count; /* an array of Edje_Image_Directory_Set */
526 };
527 
529 {
530  const char *entry; /* the nominal name of the image - if any */
531  int source_type; /* alternate source mode. 0 = none */
532  int source_param; /* extra params on encoding */
533  int id; /* the id no. of the image */
534 };
535 
537 {
538  char *name;
539  Eina_List *entries;
540 
541  int id;
542 };
543 
545 {
546  const char *name;
547  int id;
548 
549  struct {
550  struct {
551  int w;
552  int h;
553  } min, max;
554  } size;
555 };
556 
557 struct _Edje_Sound_Sample /*Sound Sample*/
558 {
559  const char *name; /* the nominal name of the sound */
560  const char *snd_src; /* Sound source Wav file */
561  int compression; /* Compression - RAW, LOSSLESS COMP , LOSSY ) */
562  int mode; /* alternate source mode. 0 = none */
563  double quality;
564  int id; /* the id no. of the sound */
565 };
566 
567 struct _Edje_Sound_Tone /*Sound Sample*/
568 {
569  const char *name; /* the nominal name of the sound - if any */
570  int value; /* alternate source mode. 0 = none */
571  int id; /* the id no. of the sound */
572 };
573 
575 {
576 
577  Edje_Sound_Sample *samples; /* an array of Edje_Sound_Sample entries */
578  unsigned int samples_count;
579 
580  Edje_Sound_Tone *tones; /* an array of Edje_Sound_Tone entries */
581  unsigned int tones_count;
582 };
583 
584 /*----------*/
585 
586 struct _Edje_Program /* a conditional program to be run */
587 {
588  int id; /* id of program */
589  const char *name; /* name of the action */
590 
591  const char *signal; /* if signal emission name matches the glob here... */
592  const char *source; /* if part that emitted this (name) matches this glob */
593  const char *sample_name;
594  const char *tone_name;
595  double duration;
596  double speed;
597 
598  struct {
599  const char *part;
600  const char *state; /* if state is not set, we will try with source */
601  } filter; /* the part filter.part should be in state filter.state for signal to be accepted */
602 
603  struct {
604  double from;
605  double range;
606  } in;
607 
608  int action; /* type - set state, stop action, set drag pos etc. */
609  const char *state; /* what state of alternates to apply, NULL = default */
610  const char *state2; /* what other state to use - for signal emit action */
611  double value; /* value of state to apply (if multiple names match) */
612  double value2; /* other value for drag actions */
613 
614  struct {
615  int mode; /* how to tween - linear, sinusoidal etc. */
616  FLOAT_T time; /* time to graduate between current and new state */
617  FLOAT_T v1; /* other value for drag actions */
618  FLOAT_T v2; /* other value for drag actions */
619  } tween;
620 
621  Eina_List *targets; /* list of target parts to apply the state to */
622 
623  Eina_List *after; /* list of actions to run at the end of this, for looping */
624 
625  struct {
626  const char *name;
627  const char *description;
628  } api;
629 
630  /* used for PARAM_COPY (param names in state and state2 above!) */
631  struct {
632  int src; /* part where parameter is being retrieved */
633  int dst; /* part where parameter is being stored */
634  } param;
635 
636  Eina_Bool exec : 1;
637 };
638 
639 struct _Edje_Program_Target /* the target of an action */
640 {
641  int id; /* just the part id no, or action id no */
642 };
643 
644 struct _Edje_Program_After /* the action to run after another action */
645 {
646  int id;
647 };
648 
649 /*----------*/
651 {
652  const char *name;
653  int value;
654 };
655 
656 /*----------*/
657 #define PART_TYPE_FIELDS(TYPE) \
658  TYPE RECTANGLE; \
659  TYPE TEXT; \
660  TYPE IMAGE; \
661  TYPE PROXY; \
662  TYPE SWALLOW; \
663  TYPE TEXTBLOCK; \
664  TYPE GROUP; \
665  TYPE BOX; \
666  TYPE TABLE; \
667  TYPE EXTERNAL;
668 
670 {
671  const char *entry; /* the nominal name of the part collection */
672  int id; /* the id of this named part collection */
673 
674  struct
675  {
676  PART_TYPE_FIELDS(int)
677  int part;
678  } count;
679 
680  struct
681  {
682  PART_TYPE_FIELDS(Eina_Mempool *)
683  Eina_Mempool *part;
684  } mp;
685 
686  struct
687  {
688  PART_TYPE_FIELDS(Eina_Mempool *)
689  } mp_rtl; /* For Right To Left interface */
690 
692 };
693 
694 /*----------*/
695 
696 /*----------*/
697 
699 {
700  unsigned char type; /* only GROUP supported for now */
701  Edje_Real_Part *parent; /* pointer to the table/box that hold it, set at runtime */
702  const char *name; /* if != NULL, will be set with evas_object_name_set */
703  const char *source; /* group name to use as source for this element */
704  Edje_Size min, prefer, max;
705  struct {
706  int l, r, t, b;
707  } padding;
711  const char *options; /* extra options for custom objects */
712  /* table specific follows */
713  int col, row;
714  unsigned short colspan, rowspan;
715 };
716 
717 /*----------*/
718 
720 {
721  struct { /* list of Edje_Program */
722  Edje_Program **fnmatch; /* complex match with "*?[\" */
723  unsigned int fnmatch_count;
724 
725  Edje_Program **strcmp; /* No special caractere, plain strcmp does the work */
726  unsigned int strcmp_count;
727 
728  Edje_Program **strncmp; /* Finish by * or ?, plain strncmp does the work */
729  unsigned int strncmp_count;
730 
731  Edje_Program **strrncmp; /* Start with * or ?, reverse strncmp will do the job */
732  unsigned int strrncmp_count;
733 
734  Edje_Program **nocmp; /* Empty signal/source that will never match */
735  unsigned int nocmp_count;
736  } programs;
737 
738  struct { /* list of limit that need to be monitored */
740  unsigned int vertical_count;
741 
743  unsigned int horizontal_count;
744  } limits;
745 
746  Edje_Part **parts; /* an array of Edje_Part */
747  unsigned int parts_count;
748 
749  Eina_Hash *data;
750 
751  int id; /* the collection id */
752 
753  Eina_Hash *alias; /* aliasing part */
754  Eina_Hash *aliased; /* invert match of alias */
755 
756  struct {
758  unsigned char orientation;
759  } prop;
760 
762 
763 #ifdef EDJE_PROGRAM_CACHE
764  struct {
765  Eina_Hash *no_matches;
766  Eina_Hash *matches;
767  } prog_cache;
768 #endif
769 
770  Embryo_Program *script; /* all the embryo script code for this group */
771  const char *part;
772 
773  unsigned char script_only;
774 
775  unsigned char lua_script_only;
776 
777  unsigned char broadcast_signal;
778 
779  unsigned char checked : 1;
780 };
781 
783 {
784  int step_x; /* drag jumps n pixels (0 = no limit) */
785  int step_y; /* drag jumps n pixels (0 = no limit) */
786 
787  int count_x; /* drag area divided by n (0 = no limit) */
788  int count_y; /* drag area divided by n (0 = no limit) */
789 
790  int confine_id; /* dragging within this bit, -1 = no */
791 
792  /* davinchi */
793  int event_id; /* If it is used as scrollbar */
794 
795  signed char x; /* can u click & drag this bit in x dir */
796  signed char y; /* can u click & drag this bit in y dir */
797 };
798 
800 {
801  const char *name;
802  const char *description;
803 };
804 
807 {
809  Edje_Part_Description_Common **desc_rtl; /* desc for Right To Left interface */
810  unsigned int desc_count;
811 };
812 
814 {
815  const char *name; /* the name if any of the part */
816  Edje_Part_Description_Common *default_desc; /* the part descriptor for default */
817  Edje_Part_Description_Common *default_desc_rtl; /* default desc for Right To Left interface */
818 
819  Edje_Part_Description_List other; /* other possible descriptors */
820 
821  const char *source, *source2, *source3, *source4, *source5, *source6;
822  int id; /* its id number */
823  int clip_to_id; /* the part id to clip this one to */
825  Edje_Pack_Element **items; /* packed items for box and table */
826  unsigned int items_count;
827  unsigned char type; /* what type (image, rect, text) */
828  unsigned char effect; /* 0 = plain... */
829  unsigned char mouse_events; /* it will affect/respond to mouse events */
830  unsigned char repeat_events; /* it will repeat events to objects below */
831  Evas_Event_Flags ignore_flags;
832  unsigned char scale; /* should certain properties scale with edje scale factor? */
833  unsigned char precise_is_inside;
835  unsigned char pointer_mode;
836  unsigned char entry_mode;
837  unsigned char select_mode;
838  unsigned char cursor_mode;
839  unsigned char multiline;
841 };
842 
844 {
845  int id;
846  Eina_Bool set;
847 };
848 
850 {
851  struct {
852  double value; /* the value of the state (for ranges) */
853  const char *name; /* the named state if any */
854  } state;
855 
856  Edje_Alignment align; /* 0 <-> 1.0 alignment within allocated space */
857 
858  struct {
859  unsigned char w, h; /* width or height is fixed in side (cannot expand with Edje object size) */
860  } fixed;
861 
862  struct { // only during recalc
863  unsigned char have;
864  FLOAT_T w, h;
865  } minmul;
866 
868  Edje_Position step; /* size stepping by n pixels, 0 = none */
870 
871  char *color_class; /* how to modify the color */
874 
875  struct {
878  int offset_x;
879  int offset_y;
880  int id_x; /* -1 = whole part collection, or part ID */
881  int id_y; /* -1 = whole part collection, or part ID */
882  } rel1, rel2;
883 
884  struct {
885  int id_persp;
886  int id_light;
887  struct {
889  FLOAT_T x, y, z;
890  } rot;
891  unsigned char backcull;
892  unsigned char on;
893  unsigned char persp_on;
894  unsigned char smooth;
895  unsigned char alpha;
896  } map;
897 
898  struct {
899  int zplane;
900  int focal;
901  } persp;
902 
903  unsigned char visible; /* is it shown */
904 };
905 
907 {
908  FLOAT_T pos_rel_x; /* fill offset x relative to area */
909  FLOAT_T rel_x; /* relative size compared to area */
910  FLOAT_T pos_rel_y; /* fill offset y relative to area */
911  FLOAT_T rel_y; /* relative size compared to area */
912  int pos_abs_x; /* fill offset x added to fill offset */
913  int abs_x; /* size of fill added to relative fill */
914  int pos_abs_y; /* fill offset y added to fill offset */
915  int abs_y; /* size of fill added to relative fill */
916  int angle; /* angle of fill -- currently only used by grads */
917  int spread; /* spread of fill -- currently only used by grads */
918  char smooth; /* fill with smooth scaling or not */
919  unsigned char type; /* fill coordinate from container (SCALE) or from source image (TILE) */
920 };
921 
923 {
924  int l, r, t, b; /* border scaling on image fill */
925  unsigned char no_fill; /* do we fill the center of the image if bordered? 1 == NO!!!! */
926  unsigned char scale; /* scale image border by same as scale factor */
927  FLOAT_T scale_by; /* when border scale above is enabled, border width OUTPUT is scaled by the object or global scale factor. this value adds another multiplier that the global scale is multiplued by first. if <= 0.0 it is not used, and if 1.0 it i s "ineffective" */
928 };
929 
931 {
933 
934  Edje_Part_Image_Id **tweens; /* list of Edje_Part_Image_Id */
935  unsigned int tweens_count; /* number of tweens */
936 
937  int id; /* the image id to use */
938  int scale_hint; /* evas scale hint */
939  Eina_Bool set; /* if image condition it's content */
940 
942 };
943 
945 {
947 
948  int id; /* the part id to use as a source for this state */
949 };
950 
952 {
953  Edje_String text; /* if "" or NULL, then leave text unchanged */
954  char *text_class; /* how to apply/modify the font */
955  Edje_String style; /* the text style if a textblock */
956  Edje_String font; /* if a specific font is asked for */
957  Edje_String repch; /* replacement char for password mode entry */
958 
959  Edje_Alignment align; /* text alignment within bounds */
961 
962  double elipsis; /* 0.0 - 1.0 defining where the elipsis align */
963  int size; /* 0 = use user set size */
964  int id_source; /* -1 if none */
965  int id_text_source; /* -1 if none */
966 
967  unsigned char fit_x; /* resize font size down to fit in x dir */
968  unsigned char fit_y; /* resize font size down to fit in y dir */
969  unsigned char min_x; /* if text size should be part min size */
970  unsigned char min_y; /* if text size should be part min size */
971  unsigned char max_x; /* if text size should be part max size */
972  unsigned char max_y; /* if text size should be part max size */
974  int size_range_max; /* -1 means, no bound. */
975 };
976 
978 {
979  char *layout, *alt_layout;
981  struct {
982  int x, y;
983  } padding;
984  struct {
985  unsigned char h, v;
986  } min;
987 };
988 
990 {
991  unsigned char homogeneous;
993  struct {
994  int x, y;
995  } padding;
996  struct {
997  unsigned char h, v;
998  } min;
999 };
1000 
1002 {
1005 };
1006 
1008 {
1011 };
1012 
1014 {
1017 };
1018 
1020 {
1023 };
1024 
1026 {
1029 };
1030 
1032 {
1034  Eina_List *external_params; /* parameters for external objects */
1035 };
1036 
1037 /*----------*/
1038 
1040 {
1042 
1043  const char *signal;
1044  const char *source;
1045 
1046  Eina_List *list;
1047 };
1048 
1050 
1051 {
1054 
1055  Eina_Rbtree *exact_match;
1056 
1057  union {
1058  struct {
1060  unsigned int count;
1061  } programs;
1062  struct {
1063  Eina_List *globing;
1064  } callbacks;
1065  } u;
1066 };
1067 
1069 
1070 struct _Edje
1071 {
1072  Evas_Object_Smart_Clipped_Data base;
1073  /* This contains (or should):
1074  Evas_Object *clipper; // a big rect to clip this Edje to
1075  Evas *evas; // the Evas this Edje belongs to
1076  */
1078  const char *path;
1079  const char *group;
1080  const char *parent;
1081 
1082  Evas_Coord x, y, w, h;
1084  double paused_at;
1085  Evas_Object *obj; /* the smart object */
1086  Edje_File *file; /* the file the data comes form */
1087  Edje_Part_Collection *collection; /* the description being used */
1088  Eina_List *actions; /* currently running actions */
1089  Eina_List *callbacks;
1090  Eina_List *pending_actions;
1091  Eina_List *color_classes;
1092  Eina_List *text_classes;
1093  /* variable pool for Edje Embryo scripts */
1095  /* for faster lookups to avoid nth list walks */
1099  Eina_List *subobjs;
1103 
1105  unsigned int table_parts_size;
1106 
1107  struct {
1108  Eina_Hash *text_class;
1109  Eina_Hash *color_class;
1110  } members;
1111 
1113 
1114  struct {
1117  } patterns;
1118 
1120  int block;
1122  int freeze;
1124  Eina_Bool is_rtl : 1;
1125 
1126  struct {
1128  void *data;
1129  } text_change;
1130 
1131  struct {
1133  void *data;
1134  int num;
1135  } message;
1137 
1138  int state;
1139 
1141 
1142  lua_State *L;
1143  Eina_Inlist *lua_objs;
1144  int lua_ref;
1145 
1146  struct {
1148  void *data;
1149  } item_provider;
1150 
1151  unsigned int dirty : 1;
1152  unsigned int recalc : 1;
1153  unsigned int walking_callbacks : 1;
1154  unsigned int delete_callbacks : 1;
1155  unsigned int just_added_callbacks : 1;
1156  unsigned int have_objects : 1;
1157  unsigned int paused : 1;
1158  unsigned int no_anim : 1;
1159  unsigned int calc_only : 1;
1160  unsigned int walking_actions : 1;
1161  unsigned int block_break : 1;
1162  unsigned int delete_me : 1;
1163  unsigned int postponed : 1;
1164  unsigned int freeze_calc : 1;
1165  unsigned int has_entries : 1;
1166  unsigned int entries_inited : 1;
1167 #ifdef EDJE_CALC_CACHE
1168  unsigned int text_part_change : 1;
1169  unsigned int all_part_change : 1;
1170 #endif
1171  unsigned int have_mapped_part : 1;
1172  unsigned int recalc_call : 1;
1173  unsigned int update_hints : 1;
1174  unsigned int recalc_hints : 1;
1175 };
1176 
1178 {
1179  int x, y, w, h; // 16
1183  union {
1184  struct {
1185  struct {
1186  int x, y, w, h; // 16
1187  int angle; // 4
1188  int spread; // 4
1189  } fill; // 24
1190 
1191  union {
1192  struct {
1193  int l, r, t, b; // 16
1194  } image; // 16
1195  } spec; // 16
1196  } common; // 40
1197  struct {
1198  Edje_Alignment align; /* text alignment within bounds */ // 16
1199  double elipsis; // 8
1200  int size; // 4
1201  Edje_Color color2, color3; // 8
1202  } text; // 36
1203  } type; // 40
1204  struct {
1205  struct {
1206  int x, y, z;
1207  } center; // 12
1208  struct {
1209  FLOAT_T x, y, z;
1210  } rotation; // 24
1211  struct {
1212  int x, y, z;
1213  int r, g, b;
1214  int ar, ag, ab;
1215  } light; // 36
1216  struct {
1217  int x, y, z;
1218  int focal;
1219  } persp;
1220  } map;
1221  unsigned char persp_on : 1;
1222  unsigned char lighted : 1;
1223  unsigned char mapped : 1;
1224  unsigned char visible : 1;
1225  unsigned char smooth : 1; // 1
1226 }; // 96
1227 
1229 {
1232 
1233  int id; // 4
1234 };
1235 
1237 {
1244 #ifdef EDJE_CALC_CACHE
1245  int state; // 4
1246  Edje_Calc_Params p; // 96
1247 #endif
1248  void *external_params; // 4
1250 }; // 32
1251 // WITH EDJE_CALC_CACHE 132
1252 
1254 {
1255  FLOAT_T x, y; // 16
1256  Edje_Position_Scale val, size, step, page; // 64
1257  struct {
1258  unsigned int count; // 4
1259  int x, y; // 8
1260  } down;
1261  struct {
1262  int x, y; // 8
1263  } tmp;
1264  unsigned char need_reset : 1; // 4
1266 }; // 104
1267 
1269 {
1270  Edje *edje; // 4
1272  Evas_Object *object; // 4
1273  int x, y, w, h; // 16
1275 
1276  Eina_List *items; // 4 //FIXME: only if table/box
1277  Edje_Part_Box_Animation *anim; // 4 //FIXME: Used only if box
1278  void *entry_data; // 4 // FIXME: move to entry section
1279 
1280  Evas_Object *swallowed_object; // 4 // FIXME: move with swallow_params data
1281  struct {
1282  Edje_Size min, max; // 16
1284  } swallow_params; // 28 // FIXME: only if type SWALLOW
1285 
1288 
1289  struct {
1292  const char *text; // 4
1293  Edje_Position offset; // 8 text only
1294  const char *font; // 4 text only
1295  const char *style; // 4 text only
1296  int size; // 4 text only
1297  struct {
1298  double in_w, in_h; // 16 text only
1299  int in_size; // 4 text only
1300  const char *in_str; // 4 text only
1301  const char *out_str; // 4 text only
1302  int out_size; // 4 text only
1303  FLOAT_T align_x, align_y; // 16 text only
1304  double elipsis; // 8 text only
1305  int fit_x, fit_y; // 8 text only
1306  } cache; // 64
1307  } text; // 86 // FIXME make text a potiner to struct and alloc at end
1308  // if part type is TEXT move common members textblock +
1309  // text to front and have smaller struct for textblock
1310 
1314  // WITH EDJE_CALC_CACHE: 140
1317 
1318 #ifdef EDJE_CALC_CACHE
1319  int state; // 4
1320 #endif
1321 
1323 
1325 
1326  int clicked_button; // 4
1327 
1328  unsigned char calculated; // 1
1329  unsigned char calculating; // 1
1330 
1331  unsigned char still_in : 1; // 1
1332 #ifdef EDJE_CALC_CACHE
1333  unsigned char invalidate : 1; // 0
1334 #endif
1335 }; // 264
1336 // WITH EDJE_CALC_CACHE: 404
1337 
1339 {
1342  double start_time;
1343  char delete_me : 1;
1344 };
1345 
1347 {
1348  const char *signal;
1349  const char *source;
1351  void *data;
1352  unsigned char just_added : 1;
1353  unsigned char delete_me : 1;
1354  unsigned char propagate : 1;
1355 };
1356 
1358 {
1359  const char *part;
1361  void *data;
1362 };
1363 
1365 {
1366  const char *part;
1368  void *data;
1369 };
1370 
1372 {
1375  Ecore_Timer *timer;
1376 };
1377 
1379 {
1380  struct {
1381  unsigned char x, y;
1382  } offset;
1383  struct {
1384  unsigned char l, r, t, b;
1385  } pad;
1386  int num;
1387  struct {
1388  unsigned char color; /* 0 = color, 1, 2 = color2, color3 */
1389  signed char x, y; /* offset */
1390  unsigned char alpha;
1391  } members[32];
1392 };
1393 
1395 {
1396  const char *name;
1397  unsigned char r, g, b, a;
1398  unsigned char r2, g2, b2, a2;
1399  unsigned char r3, g3, b3, a3;
1400 };
1401 
1403 {
1404  const char *name;
1405  const char *font;
1406  Evas_Font_Size size;
1407 };
1408 
1410 {
1411  int v;
1412 };
1413 
1415 {
1416  double v;
1417 };
1418 
1420 {
1421  char *v;
1422 };
1423 
1425 {
1426  Eina_List *v;
1427 };
1428 
1430 {
1431  Eina_Hash *v;
1432 };
1433 
1435 {
1437  int id;
1438  Embryo_Function func;
1439  int val;
1440  Ecore_Timer *timer;
1441 };
1442 
1444 {
1446  int id;
1447  Embryo_Function func;
1448  int val;
1449  double start, len;
1451 };
1452 
1454 {
1456  Eina_List *timers;
1457  Eina_List *animators;
1458  int size;
1461 };
1462 
1464 {
1465  union {
1471  } data;
1472  unsigned char type;
1473 };
1474 
1475 typedef enum _Edje_Queue
1476 {
1479 } Edje_Queue;
1480 
1483 
1486 {
1487  int ref;
1488  void *data;
1489  void (*free_func)(void *);
1490 };
1491 
1493 {
1494  const char *sig;
1495  const char *src;
1497 };
1498 
1500 {
1504  int id;
1505  unsigned char *msg;
1506  Eina_Bool propagated : 1;
1507 };
1508 
1509 typedef enum _Edje_Fill
1510 {
1513 } Edje_Fill;
1514 
1515 typedef enum _Edje_Match_Error
1516 {
1520 
1522 
1523 typedef struct _Edje_States Edje_States;
1525 {
1526  const char **patterns;
1527 
1529 
1530  int ref;
1531  Eina_Bool delete_me : 1;
1532 
1534  size_t max_length;
1535  size_t finals[];
1536 };
1537 
1538 Edje_Patterns *edje_match_collection_dir_init(const Eina_List *lst);
1540  unsigned int count);
1542  unsigned int count);
1543 Edje_Patterns *edje_match_callback_signal_init(const Eina_List *lst);
1544 Edje_Patterns *edje_match_callback_source_init(const Eina_List *lst);
1545 
1546 Eina_Bool edje_match_collection_dir_exec(const Edje_Patterns *ppat,
1547  const char *string);
1548 Eina_Bool edje_match_programs_exec(const Edje_Patterns *ppat_signal,
1549  const Edje_Patterns *ppat_source,
1550  const char *signal,
1551  const char *source,
1552  Edje_Program **programs,
1553  Eina_Bool (*func)(Edje_Program *pr, void *data),
1554  void *data,
1555  Eina_Bool prop);
1556 int edje_match_callback_exec(Edje_Patterns *ppat_signal,
1557  Edje_Patterns *ppat_source,
1558  const char *signal,
1559  const char *source,
1560  Eina_List *callbacks,
1561  Edje *ed,
1562  Eina_Bool prop);
1563 
1565 
1566 Eina_List *edje_match_program_hash_build(Edje_Program * const * programs,
1567  unsigned int count,
1568  Eina_Rbtree **tree);
1569 Eina_List *edje_match_callback_hash_build(const Eina_List *callbacks,
1570  Eina_Rbtree **tree);
1571 const Eina_List *edje_match_signal_source_hash_get(const char *signal,
1572  const char *source,
1573  const Eina_Rbtree *tree);
1575 
1576 // FIXME remove below 2 eapi decls when edje_convert goes
1577 EAPI void _edje_edd_init(void);
1578 EAPI void _edje_edd_shutdown(void);
1579 
1580 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
1581 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
1582 
1583 extern int _edje_anim_count;
1584 extern Ecore_Animator *_edje_timer;
1585 extern Eina_List *_edje_animators;
1586 extern Eina_List *_edje_edjes;
1587 
1588 extern char *_edje_fontset_append;
1589 extern FLOAT_T _edje_scale;
1590 extern int _edje_freeze_val;
1591 extern int _edje_freeze_calc_count;
1592 extern Eina_List *_edje_freeze_calc_list;
1593 
1594 extern Eina_Bool _edje_password_show_last;
1596 
1597 extern Eina_Mempool *_edje_real_part_mp;
1598 extern Eina_Mempool *_edje_real_part_state_mp;
1599 
1600 extern Eina_Mempool *_emp_RECTANGLE;
1601 extern Eina_Mempool *_emp_TEXT;
1602 extern Eina_Mempool *_emp_IMAGE;
1603 extern Eina_Mempool *_emp_PROXY;
1604 extern Eina_Mempool *_emp_SWALLOW;
1605 extern Eina_Mempool *_emp_TEXTBLOCK;
1606 extern Eina_Mempool *_emp_GROUP;
1607 extern Eina_Mempool *_emp_BOX;
1608 extern Eina_Mempool *_emp_TABLE;
1609 extern Eina_Mempool *_emp_EXTERNAL;
1610 extern Eina_Mempool *_emp_part;
1611 
1612 void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2);
1614  Edje_Real_Part *rp,
1615  const char *name, double val);
1616 void _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, double v1, const char *d2, double v2);
1617 void _edje_recalc(Edje *ed);
1618 void _edje_recalc_do(Edje *ed);
1619 void _edje_part_recalc_1(Edje *ed, Edje_Real_Part *ep);
1622 
1623 Eina_Bool _edje_timer_cb(void *data);
1624 Eina_Bool _edje_pending_timer_cb(void *data);
1625 void _edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
1626 void _edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
1627 void _edje_callbacks_del(Evas_Object *obj, Edje *ed);
1628 void _edje_callbacks_focus_del(Evas_Object *obj, Edje *ed);
1629 
1630 void _edje_edd_init(void);
1631 void _edje_edd_shutdown(void);
1632 
1633 int _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, const char *parent, Eina_List *group_path);
1634 
1635 void _edje_file_add(Edje *ed);
1636 void _edje_file_del(Edje *ed);
1637 void _edje_file_free(Edje_File *edf);
1638 void _edje_file_cache_shutdown(void);
1644  Eina_Bool free_strings);
1648  Eina_Bool free_strings);
1649 
1652 
1653 void _edje_del(Edje *ed);
1654 void _edje_ref(Edje *ed);
1655 void _edje_unref(Edje *ed);
1656 void _edje_clean_objects(Edje *ed);
1657 void _edje_ref(Edje *ed);
1658 void _edje_unref(Edje *ed);
1659 
1660 Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
1662 void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
1665 void _edje_emit(Edje *ed, const char *sig, const char *src);
1666 void _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *));
1667 void _edje_emit_handle(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop);
1670 
1671 void _edje_text_init(void);
1673 void _edje_text_part_on_del(Edje *ed, Edje_Part *ep);
1674 void _edje_text_recalc_apply(Edje *ed,
1675  Edje_Real_Part *ep,
1676  Edje_Calc_Params *params,
1677  Edje_Part_Description_Text *chosen_desc);
1678 Evas_Font_Size _edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc);
1679 const char * _edje_text_class_font_get(Edje *ed,
1680  Edje_Part_Description_Text *chosen_desc,
1681  int *size, char **free_later);
1682 
1683 
1684 Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part);
1685 Edje_Real_Part *_edje_real_part_recursive_get(const Edje *ed, const char *part);
1686 Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class);
1687 void _edje_color_class_member_direct_del(const char *color_class, void *lookup);
1688 void _edje_color_class_member_add(Edje *ed, const char *color_class);
1689 void _edje_color_class_member_del(Edje *ed, const char *color_class);
1690 void _edje_color_class_on_del(Edje *ed, Edje_Part *ep);
1692 void _edje_color_class_hash_free(void);
1693 
1694 Edje_Text_Class *_edje_text_class_find(Edje *ed, const char *text_class);
1695 void _edje_text_class_member_add(Edje *ed, const char *text_class);
1696 void _edje_text_class_member_del(Edje *ed, const char *text_class);
1697 void _edje_text_class_member_direct_del(const char *text_class, void *lookup);
1699 void _edje_text_class_hash_free(void);
1700 
1701 Edje *_edje_fetch(const Evas_Object *obj) EINA_PURE;
1702 int _edje_freeze(Edje *ed);
1703 int _edje_thaw(Edje *ed);
1704 int _edje_block(Edje *ed);
1705 int _edje_unblock(Edje *ed);
1706 int _edje_block_break(Edje *ed);
1707 void _edje_block_violate(Edje *ed);
1708 void _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
1709 void _edje_object_part_swallow_changed_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
1710 void _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow, Eina_Bool hints_update);
1712 void _edje_box_init(void);
1713 void _edje_box_shutdown(void);
1714 Eina_Bool _edje_box_layout_find(const char *name, Evas_Object_Box_Layout *cb, void **data, void (**free_data)(void *data));
1715 void _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Box *chosen_desc);
1716 Eina_Bool _edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj);
1717 void _edje_box_layout_remove_child(Edje_Real_Part *rp, Evas_Object *child_obj);
1719 void _edje_box_layout_free_data(void *data);
1720 
1721 Eina_Bool _edje_real_part_box_append(Edje_Real_Part *rp, Evas_Object *child_obj);
1722 Eina_Bool _edje_real_part_box_prepend(Edje_Real_Part *rp, Evas_Object *child_obj);
1723 Eina_Bool _edje_real_part_box_insert_before(Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
1724 Eina_Bool _edje_real_part_box_insert_at(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos);
1725 Evas_Object *_edje_real_part_box_remove(Edje_Real_Part *rp, Evas_Object *child_obj);
1726 Evas_Object *_edje_real_part_box_remove_at(Edje_Real_Part *rp, unsigned int pos);
1727 Eina_Bool _edje_real_part_box_remove_all(Edje_Real_Part *rp, Eina_Bool clear);
1728 Eina_Bool _edje_real_part_table_pack(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
1729 Eina_Bool _edje_real_part_table_unpack(Edje_Real_Part *rp, Evas_Object *child_obj);
1730 void _edje_real_part_table_clear(Edje_Real_Part *rp, Eina_Bool clear);
1731 Evas_Object *_edje_children_get(Edje_Real_Part *rp, const char *partid);
1732 
1733 Eina_Bool _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text);
1734 char *_edje_text_escape(const char *text);
1735 char *_edje_text_unescape(const char *text);
1736 
1739 void _edje_embryo_script_reset (Edje *ed);
1740 void _edje_embryo_test_run (Edje *ed, const char *fname, const char *sig, const char *src);
1741 Edje_Var *_edje_var_new (void);
1742 void _edje_var_free (Edje_Var *var);
1743 void _edje_var_init (Edje *ed);
1744 void _edje_var_shutdown (Edje *ed);
1745 int _edje_var_string_id_get (Edje *ed, const char *string);
1746 int _edje_var_var_int_get (Edje *ed, Edje_Var *var);
1747 void _edje_var_var_int_set (Edje *ed, Edje_Var *var, int v);
1748 double _edje_var_var_float_get (Edje *ed, Edje_Var *var);
1749 void _edje_var_var_float_set (Edje *ed, Edje_Var *var, double v);
1750 const char *_edje_var_var_str_get (Edje *ed, Edje_Var *var);
1751 void _edje_var_var_str_set (Edje *ed, Edje_Var *var, const char *str);
1752 int _edje_var_int_get (Edje *ed, int id);
1753 void _edje_var_int_set (Edje *ed, int id, int v);
1754 double _edje_var_float_get (Edje *ed, int id);
1755 void _edje_var_float_set (Edje *ed, int id, double v);
1756 const char *_edje_var_str_get (Edje *ed, int id);
1757 void _edje_var_str_set (Edje *ed, int id, const char *str);
1758 
1759 void _edje_var_list_var_append(Edje *ed, int id, Edje_Var *var);
1760 void _edje_var_list_var_prepend(Edje *ed, int id, Edje_Var *var);
1761 void _edje_var_list_var_append_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
1762 void _edje_var_list_var_prepend_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
1763 Edje_Var *_edje_var_list_nth(Edje *ed, int id, int n);
1764 
1765 int _edje_var_list_count_get(Edje *ed, int id);
1766 void _edje_var_list_remove_nth(Edje *ed, int id, int n);
1767 
1768 int _edje_var_list_nth_int_get(Edje *ed, int id, int n);
1769 void _edje_var_list_nth_int_set(Edje *ed, int id, int n, int v);
1770 void _edje_var_list_int_append(Edje *ed, int id, int v);
1771 void _edje_var_list_int_prepend(Edje *ed, int id, int v);
1772 void _edje_var_list_int_insert(Edje *ed, int id, int n, int v);
1773 
1774 double _edje_var_list_nth_float_get(Edje *ed, int id, int n);
1775 void _edje_var_list_nth_float_set(Edje *ed, int id, int n, double v);
1776 void _edje_var_list_float_append(Edje *ed, int id, double v);
1777 void _edje_var_list_float_prepend(Edje *ed, int id, double v);
1778 void _edje_var_list_float_insert(Edje *ed, int id, int n, double v);
1779 
1780 const char *_edje_var_list_nth_str_get(Edje *ed, int id, int n);
1781 void _edje_var_list_nth_str_set(Edje *ed, int id, int n, const char *v);
1782 void _edje_var_list_str_append(Edje *ed, int id, const char *v);
1783 void _edje_var_list_str_prepend(Edje *ed, int id, const char *v);
1784 void _edje_var_list_str_insert(Edje *ed, int id, int n, const char *v);
1785 
1786 int _edje_var_timer_add (Edje *ed, double in, const char *fname, int val);
1787 void _edje_var_timer_del (Edje *ed, int id);
1788 
1789 int _edje_var_anim_add (Edje *ed, double len, const char *fname, int val);
1790 void _edje_var_anim_del (Edje *ed, int id);
1791 
1792 void _edje_message_init (void);
1793 void _edje_message_shutdown (void);
1794 void _edje_message_cb_set (Edje *ed, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data);
1796 void _edje_message_free (Edje_Message *em);
1797 void _edje_message_propornot_send (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, void *emsg, Eina_Bool prop);
1798 void _edje_message_send (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, void *emsg);
1801 void _edje_message_queue_process (void);
1802 void _edje_message_queue_clear (void);
1803 void _edje_message_del (Edje *ed);
1804 
1810 Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret);
1815 
1817 
1818 #define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return -1;
1819 #define GETSTR(str, par) { \
1820  Embryo_Cell *___cptr; \
1821  int ___l; \
1822  str = NULL; \
1823  if ((___cptr = embryo_data_address_get(ep, (par)))) { \
1824  ___l = embryo_data_string_length_get(ep, ___cptr); \
1825  if (((str) = alloca(___l + 1))) \
1826  embryo_data_string_get(ep, ___cptr, (str)); } }
1827 #define GETSTREVAS(str, par) { \
1828  if ((str)) { \
1829  if ((par) && (!strcmp((par), (str)))) return 0; \
1830  if ((par)) eina_stringshare_del((par)); \
1831  (par) = (char *)eina_stringshare_add((str)); } \
1832  else (par) = NULL; }
1833 #define GETFLOAT(val, par) { \
1834  float *___cptr; \
1835  if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
1836  val = *___cptr; } }
1837 
1838 #define GETFLOAT_T(val, par) \
1839  { \
1840  float *___cptr; \
1841  if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \
1842  { \
1843  val = FROM_DOUBLE(*___cptr); \
1844  } \
1845  }
1846 
1847 #define GETINT(val, par) { \
1848  int *___cptr; \
1849  if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
1850  val = *___cptr; } }
1851 #define SETSTR(str, par) { \
1852  Embryo_Cell *___cptr; \
1853  if ((___cptr = embryo_data_address_get(ep, (par)))) { \
1854  embryo_data_string_set(ep, str, ___cptr); } }
1855 #define SETSTRALLOCATE(s) \
1856  { \
1857  if (s) { \
1858  if ((int) strlen((s)) < params[4]) { \
1859  SETSTR((s), params[3]); } \
1860  else { \
1861  char *ss; \
1862  ss = alloca(strlen((s)) + 1); \
1863  strcpy(ss, (s)); \
1864  ss[params[4] - 2] = 0; \
1865  SETSTR(ss, params[3]); } } \
1866  else \
1867  SETSTR("", params[3]); \
1868  }
1869 #define SETFLOAT(val, par) { \
1870  float *___cptr; \
1871  if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
1872  *___cptr = (float)val; } }
1873 #define SETFLOAT_T(val, par) \
1874  { \
1875  float *___cptr; \
1876  if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \
1877  { \
1878  *___cptr = (float) TO_DOUBLE(val); \
1879  } \
1880  }
1881 #define SETINT(val, par) { \
1882  int *___cptr; \
1883  if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
1884  *___cptr = (int)val; } }
1885 
1886 Eina_Bool _edje_script_only(Edje *ed);
1887 void _edje_script_only_init(Edje *ed);
1889 void _edje_script_only_show(Edje *ed);
1890 void _edje_script_only_hide(Edje *ed);
1891 void _edje_script_only_move(Edje *ed);
1892 void _edje_script_only_resize(Edje *ed);
1894 
1895 extern jmp_buf _edje_lua_panic_jmp;
1896 #define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp)
1897 
1898 lua_State *_edje_lua_state_get();
1899 lua_State *_edje_lua_new_thread(Edje *ed, lua_State *L);
1900 void _edje_lua_free_thread(Edje *ed, lua_State *L);
1901 void _edje_lua_new_reg(lua_State *L, int index, void *ptr);
1902 void _edje_lua_get_reg(lua_State *L, void *ptr);
1903 void _edje_lua_free_reg(lua_State *L, void *ptr);
1904 void _edje_lua_script_fn_new(Edje *ed);
1905 void _edje_lua_group_fn_new(Edje *ed);
1906 void _edje_lua_init();
1907 void _edje_lua_shutdown();
1908 
1909 void __edje_lua_error(const char *file, const char *fnc, int line, lua_State *L, int err_code);
1910 #define _edje_lua_error(L, err_code) \
1911  __edje_lua_error(__FILE__, __FUNCTION__, __LINE__, L, err_code)
1912 
1913 Eina_Bool _edje_lua_script_only(Edje *ed);
1921 
1922 void _edje_entry_init(Edje *ed);
1923 void _edje_entry_shutdown(Edje *ed);
1927 const char *_edje_entry_selection_get(Edje_Real_Part *rp);
1928 const char *_edje_entry_text_get(Edje_Real_Part *rp);
1929 void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
1930 void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
1931 void _edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text);
1939 const Eina_List *_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor);
1940 const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp);
1941 Eina_Bool _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
1942 const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp);
1943 void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
1944 void _edje_entry_user_insert(Edje_Real_Part *rp, const char *text);
1945 void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow);
1946 Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp);
1957 Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y);
1961 void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos);
1968 void _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction);
1970 void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled);
1976 void _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len);
1977 void _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len);
1982 
1983 void _edje_external_init();
1985 Evas_Object *_edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name);
1986 void _edje_external_signal_emit(Evas_Object *obj, const char *emission, const char *source);
1987 Eina_Bool _edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param) EINA_ARG_NONNULL(2);
1988 Eina_Bool _edje_external_param_get(const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param) EINA_ARG_NONNULL(2);
1989 Evas_Object *_edje_external_content_get(const Evas_Object *obj, const char *content) EINA_ARG_NONNULL(1, 2);
1990 void _edje_external_params_free(Eina_List *params, Eina_Bool free_strings);
1992  Edje_Calc_Params *params,
1993  Edje_Part_Description_Common *chosen_desc);
1994 void *_edje_external_params_parse(Evas_Object *obj, const Eina_List *params);
1995 void _edje_external_parsed_params_free(Evas_Object *obj, void *params);
1996 
1997 Eina_Module *_edje_module_handle_load(const char *module);
1998 void _edje_module_init();
1999 void _edje_module_shutdown();
2000 
2001 static inline Eina_Bool
2002 edje_program_is_strncmp(const char *str)
2003 {
2004  size_t length;
2005 
2006  length = strlen(str);
2007 
2008  if (strpbrk(str, "*?[\\") != str + length)
2009  return EINA_FALSE;
2010  if (str[length] == '['
2011  || str[length] == '\\')
2012  return EINA_FALSE;
2013  return EINA_TRUE;
2014 }
2015 
2016 static inline Eina_Bool
2017 edje_program_is_strrncmp(const char *str)
2018 {
2019  if (*str != '*' && *str != '?')
2020  return EINA_FALSE;
2021  if (strpbrk(str + 1, "*?[\\"))
2022  return EINA_FALSE;
2023  return EINA_TRUE;
2024 }
2025 void edje_object_propagate_callback_add(Evas_Object *obj, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source), void *data);
2026 
2027 
2028 /* used by edje_cc - private still */
2031 
2032 void _edje_lua2_error_full(const char *file, const char *fnc, int line, lua_State *L, int err_code);
2033 #define _edje_lua2_error(L, err_code) _edje_lua2_error_full(__FILE__, __FUNCTION__, __LINE__, L, err_code)
2034 void _edje_lua2_script_init(Edje *ed);
2036 void _edje_lua2_script_load(Edje_Part_Collection *edc, void *data, int size);
2038 
2045 void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
2046 
2047 const char *edje_string_get(const Edje_String *es);
2048 const char *edje_string_id_get(const Edje_String *es);
2049 
2050 void _edje_object_orientation_inform(Evas_Object *obj);
2051 
2052 void _edje_lib_ref(void);
2053 void _edje_lib_unref(void);
2054 
2055 void _edje_subobj_register(Edje *ed, Evas_Object *ob);
2056 
2057 void _edje_multisense_init(void);
2058 void _edje_multisense_shutdown(void);
2059 Eina_Bool _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, const double speed);
2060 Eina_Bool _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const double duration);
2061 
2062 void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state);
2063 
2064 #ifdef HAVE_LIBREMIX
2065 #include <remix/remix.h>
2066 #endif
2067 #include <Eina.h>
2068 
2070 
2072 {
2073 #ifdef HAVE_LIBREMIX
2074  RemixEnv *remixenv;
2075 #endif
2076 };
2077 
2079 #ifdef HAVE_LIBREMIX
2080 typedef RemixBase* (*MULTISENSE_SOUND_PLAYER_GET_FUNC) (Edje_Multisense_Env *);
2081 #endif
2082 
2083 #endif