Edje: Bumped EDJE_FILE_MINOR for the previous size_range changes.
[framework/uifw/edje.git] / src / lib / edje_private.h
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 HAVE_ALLOCA_H
13 # include <alloca.h>
14 #elif defined __GNUC__
15 # define alloca __builtin_alloca
16 #elif defined _AIX
17 # define alloca __alloca
18 #elif defined _MSC_VER
19 # include <malloc.h>
20 # define alloca _alloca
21 #else
22 # include <stddef.h>
23 void *alloca (size_t);
24 #endif
25
26 #include <string.h>
27 #include <limits.h>
28 #include <sys/stat.h>
29 #include <time.h>
30 #include <sys/time.h>
31 #include <errno.h>
32
33 #ifndef _MSC_VER
34 # include <libgen.h>
35 # include <unistd.h>
36 #endif
37
38 #include <lua.h>
39 #include <lualib.h>
40 #include <lauxlib.h>
41 #include <setjmp.h>
42
43 #ifdef HAVE_LOCALE_H
44 # include <locale.h>
45 #endif
46
47 #ifdef HAVE_EVIL
48 # include <Evil.h>
49 #endif
50
51 #include <Eina.h>
52 #include <Eet.h>
53 #include <Evas.h>
54 #include <Ecore.h>
55 #include <Ecore_File.h>
56 #ifdef HAVE_ECORE_IMF
57 # include <Ecore_IMF.h>
58 # include <Ecore_IMF_Evas.h>
59 #endif
60 #include <Embryo.h>
61
62 #include "Edje.h"
63
64 EAPI extern int _edje_default_log_dom ; 
65
66 #ifdef EDJE_DEFAULT_LOG_COLOR
67 # undef EDJE_DEFAULT_LOG_COLOR
68 #endif
69 #define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
70 #ifdef ERR
71 # undef ERR
72 #endif
73 #define ERR(...) EINA_LOG_DOM_ERR(_edje_default_log_dom, __VA_ARGS__)
74 #ifdef INF
75 # undef INF
76 #endif
77 #define INF(...) EINA_LOG_DOM_INFO(_edje_default_log_dom, __VA_ARGS__)
78 #ifdef WRN
79 # undef WRN
80 #endif
81 #define WRN(...) EINA_LOG_DOM_WARN(_edje_default_log_dom, __VA_ARGS__)
82 #ifdef CRIT
83 # undef CRIT
84 #endif
85 #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__)
86 #ifdef __GNUC__
87 # if __GNUC__ >= 4
88 // BROKEN in gcc 4 on amd64
89 //#  pragma GCC visibility push(hidden)
90 # endif
91 #endif
92
93 #ifndef ABS
94 #define ABS(x) ((x) < 0 ? -(x) : (x))
95 #endif
96
97 #ifndef CLAMP
98 #define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
99 #endif
100
101 #ifndef MIN
102 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
103 #endif
104
105
106 #ifdef BUILD_EDJE_FP
107
108 #define FLOAT_T Eina_F32p32
109 #define EDJE_T_FLOAT EET_T_F32P32
110 #define MUL(a, b) eina_f32p32_mul(a, b)
111 #define SCALE(a, b) eina_f32p32_scale(a, b)
112 #define DIV(a, b) eina_f32p32_div(a, b)
113 #define DIV2(a) ((a) >> 1)
114 #define ADD(a, b) eina_f32p32_add(a, b)
115 #define SUB(a, b) eina_f32p32_sub(a, b)
116 #define SQRT(a) eina_f32p32_sqrt(a)
117 #define TO_DOUBLE(a) eina_f32p32_double_to(a)
118 #define FROM_DOUBLE(a) eina_f32p32_double_from(a)
119 #define FROM_INT(a) eina_f32p32_int_from(a)
120 #define TO_INT(a) eina_f32p32_int_to(a)
121 #define ZERO 0
122 #define COS(a) eina_f32p32_cos(a)
123 #define SIN(a) eina_f32p32_sin(a)
124 #define PI EINA_F32P32_PI
125
126 #else
127
128 #define FLOAT_T double
129 #define EDJE_T_FLOAT EET_T_DOUBLE
130 #define MUL(a, b) ((a) * (b))
131 #define SCALE(a, b) ((a) * (double)(b))
132 #define DIV(a, b) ((a) / (b))
133 #define DIV2(a) ((a) / 2.0)
134 #define ADD(a, b) ((a) + (b))
135 #define SUB(a, b) ((a) - (b))
136 #define SQRT(a) sqrt(a)
137 #define TO_DOUBLE(a) (double)(a)
138 #define FROM_DOUBLE(a) (a)
139 #define FROM_INT(a) (double)(a)
140 #define TO_INT(a) (int)(a)
141 #define ZERO 0.0
142 #define COS(a) cos(a)
143 #define SIN(a) sin(a)
144 #define PI 3.14159265358979323846
145
146 #endif
147
148 /* Inheritable Edje Smart API. For now private so only Edje Edit makes
149  * use of this, but who knows what will be possible in the future */
150 #define EDJE_SMART_API_VERSION 1
151
152 typedef struct _Edje_Smart_Api Edje_Smart_Api;
153
154 struct _Edje_Smart_Api
155 {
156    Evas_Smart_Class base;
157    int version;
158    Eina_Bool (*file_set)(Evas_Object *obj, const char *file, const char *group);
159 };
160
161 /* Basic macro to init the Edje Smart API */
162 #define EDJE_SMART_API_INIT(smart_class_init) {smart_class_init, EDJE_SMART_API_VERSION, NULL}
163
164 #define EDJE_SMART_API_INIT_NULL EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
165 #define EDJE_SMART_API_INIT_VERSION EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
166 #define EDJE_SMART_API_INIT_NAME_VERSION(name) EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
167
168 /* increment this when the EET data descriptors have changed and old
169  * EETs cannot be loaded/used correctly anymore.
170  */
171 #define EDJE_FILE_VERSION 3
172 /* increment this when you add new feature to edje file format without
173  * breaking backward compatibility.
174  */
175 #define EDJE_FILE_MINOR 2
176
177 /* FIXME:
178  *
179  * More example Edje files
180  *
181  * ? programs can do multiple actions from one signal
182  * ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox)
183  * ? text entry widget (single line only)
184  *
185  * ? recursions, unsafe callbacks outside Edje etc. with freeze, ref/unref and block/unblock and break_programs needs to be redesigned & fixed
186  * ? all unsafe calls that may result in callbacks must be marked and dealt with
187  */
188
189 typedef enum
190 {
191    EDJE_ASPECT_PREFER_NONE,
192    EDJE_ASPECT_PREFER_VERTICAL,
193    EDJE_ASPECT_PREFER_HORIZONTAL,
194    EDJE_ASPECT_PREFER_BOTH
195 } Edje_Internal_Aspect;
196
197 struct _Edje_Perspective
198 {
199    Evas_Object *obj;
200    Evas        *e;
201    Evas_Coord   px, py, z0, foc;
202    Eina_List   *users;
203    Eina_Bool    global : 1;
204 };
205
206 struct _Edje_Position_Scale
207 {
208    FLOAT_T x, y;
209 };
210
211 struct _Edje_Position
212 {
213    int x, y;
214 };
215
216 struct _Edje_Size
217 {
218    int w, h;
219 };
220
221 struct _Edje_Rectangle
222 {
223    int x, y, w, h;
224 };
225
226 struct _Edje_Color
227 {
228    unsigned char  r, g, b, a;
229 };
230
231 struct _Edje_Aspect_Prefer
232 {
233    FLOAT_T min, max;
234    Edje_Internal_Aspect prefer;
235 };
236
237 struct _Edje_Aspect
238 {
239    int w, h;
240    Edje_Aspect_Control mode;
241 };
242
243 struct _Edje_String
244 {
245    const char *str;
246    unsigned int id;
247 };
248
249 typedef struct _Edje_Position_Scale                  Edje_Alignment;
250 typedef struct _Edje_Position_Scale                  Edje_Position_Scale;
251 typedef struct _Edje_Position                        Edje_Position;
252 typedef struct _Edje_Size                            Edje_Size;
253 typedef struct _Edje_Rectangle                       Edje_Rectangle;
254 typedef struct _Edje_Color                           Edje_Color;
255 typedef struct _Edje_Aspect_Prefer                   Edje_Aspect_Prefer;
256 typedef struct _Edje_Aspect                          Edje_Aspect;
257 typedef struct _Edje_String                          Edje_String;
258
259 typedef struct _Edje_File                            Edje_File;
260 typedef struct _Edje_Style                           Edje_Style;
261 typedef struct _Edje_Style_Tag                       Edje_Style_Tag;
262 typedef struct _Edje_External_Directory              Edje_External_Directory;
263 typedef struct _Edje_External_Directory_Entry        Edje_External_Directory_Entry;
264 typedef struct _Edje_Font_Directory_Entry            Edje_Font_Directory_Entry;
265 typedef struct _Edje_Image_Directory                 Edje_Image_Directory;
266 typedef struct _Edje_Image_Directory_Entry           Edje_Image_Directory_Entry;
267 typedef struct _Edje_Image_Directory_Set             Edje_Image_Directory_Set;
268 typedef struct _Edje_Image_Directory_Set_Entry       Edje_Image_Directory_Set_Entry;
269 typedef struct _Edje_Program                         Edje_Program;
270 typedef struct _Edje_Program_Target                  Edje_Program_Target;
271 typedef struct _Edje_Program_After                   Edje_Program_After;
272 typedef struct _Edje_Part_Collection_Directory_Entry Edje_Part_Collection_Directory_Entry;
273 typedef struct _Edje_Pack_Element                    Edje_Pack_Element;
274 typedef struct _Edje_Part_Collection                 Edje_Part_Collection;
275 typedef struct _Edje_Part                            Edje_Part;
276 typedef struct _Edje_Part_Api                        Edje_Part_Api;
277 typedef struct _Edje_Part_Dragable                   Edje_Part_Dragable;
278 typedef struct _Edje_Part_Image_Id                   Edje_Part_Image_Id;
279 typedef struct _Edje_Part_Description_Image          Edje_Part_Description_Image;
280 typedef struct _Edje_Part_Description_Text           Edje_Part_Description_Text;
281 typedef struct _Edje_Part_Description_Box            Edje_Part_Description_Box;
282 typedef struct _Edje_Part_Description_Table          Edje_Part_Description_Table;
283 typedef struct _Edje_Part_Description_External       Edje_Part_Description_External;
284 typedef struct _Edje_Part_Description_Common         Edje_Part_Description_Common;
285 typedef struct _Edje_Part_Description_Spec_Fill      Edje_Part_Description_Spec_Fill;
286 typedef struct _Edje_Part_Description_Spec_Border    Edje_Part_Description_Spec_Border;
287 typedef struct _Edje_Part_Description_Spec_Image     Edje_Part_Description_Spec_Image;
288 typedef struct _Edje_Part_Description_Spec_Text      Edje_Part_Description_Spec_Text;
289 typedef struct _Edje_Part_Description_Spec_Box       Edje_Part_Description_Spec_Box;
290 typedef struct _Edje_Part_Description_Spec_Table     Edje_Part_Description_Spec_Table;
291 typedef struct _Edje_Patterns                        Edje_Patterns;
292 typedef struct _Edje_Part_Box_Animation              Edje_Part_Box_Animation;
293
294 typedef struct _Edje Edje;
295 typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
296 typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
297 typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
298 typedef struct _Edje_Real_Part Edje_Real_Part;
299 typedef struct _Edje_Running_Program Edje_Running_Program;
300 typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
301 typedef struct _Edje_Calc_Params Edje_Calc_Params;
302 typedef struct _Edje_Pending_Program Edje_Pending_Program;
303 typedef struct _Edje_Text_Style Edje_Text_Style;
304 typedef struct _Edje_Color_Class Edje_Color_Class;
305 typedef struct _Edje_Text_Class Edje_Text_Class;
306 typedef struct _Edje_Var Edje_Var;
307 typedef struct _Edje_Var_Int Edje_Var_Int;
308 typedef struct _Edje_Var_Float Edje_Var_Float;
309 typedef struct _Edje_Var_String Edje_Var_String;
310 typedef struct _Edje_Var_List Edje_Var_List;
311 typedef struct _Edje_Var_Hash Edje_Var_Hash;
312 typedef struct _Edje_Var_Animator Edje_Var_Animator;
313 typedef struct _Edje_Var_Timer Edje_Var_Timer;
314 typedef struct _Edje_Var_Pool Edje_Var_Pool;
315 typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char;
316 typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback;
317
318 #define EDJE_INF_MAX_W 100000
319 #define EDJE_INF_MAX_H 100000
320
321 #define EDJE_IMAGE_SOURCE_TYPE_NONE           0
322 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT 1
323 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY   2
324 #define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL       3
325 #define EDJE_IMAGE_SOURCE_TYPE_LAST           4
326
327 #define EDJE_VAR_NONE   0
328 #define EDJE_VAR_INT    1
329 #define EDJE_VAR_FLOAT  2
330 #define EDJE_VAR_STRING 3
331 #define EDJE_VAR_LIST   4
332 #define EDJE_VAR_HASH   5
333
334 #define EDJE_VAR_MAGIC_BASE 0x12fe84ba
335
336 #define EDJE_STATE_PARAM_NONE            0
337 #define EDJE_STATE_PARAM_ALIGNMENT       1
338 #define EDJE_STATE_PARAM_MIN             2
339 #define EDJE_STATE_PARAM_MAX             3
340 #define EDJE_STATE_PARAM_STEP            4
341 #define EDJE_STATE_PARAM_ASPECT          5
342 #define EDJE_STATE_PARAM_ASPECT_PREF     6
343 #define EDJE_STATE_PARAM_COLOR           7
344 #define EDJE_STATE_PARAM_COLOR2          8
345 #define EDJE_STATE_PARAM_COLOR3          9
346 #define EDJE_STATE_PARAM_COLOR_CLASS    10
347 #define EDJE_STATE_PARAM_REL1           11
348 #define EDJE_STATE_PARAM_REL1_TO        12
349 #define EDJE_STATE_PARAM_REL1_OFFSET    13
350 #define EDJE_STATE_PARAM_REL2           14
351 #define EDJE_STATE_PARAM_REL2_TO        15
352 #define EDJE_STATE_PARAM_REL2_OFFSET    16
353 #define EDJE_STATE_PARAM_IMAGE          17
354 #define EDJE_STATE_PARAM_BORDER         18
355 #define EDJE_STATE_PARAM_FILL_SMOOTH    19
356 #define EDJE_STATE_PARAM_FILL_POS       20
357 #define EDJE_STATE_PARAM_FILL_SIZE      21
358 #define EDJE_STATE_PARAM_TEXT           22
359 #define EDJE_STATE_PARAM_TEXT_CLASS     23
360 #define EDJE_STATE_PARAM_TEXT_FONT      24
361 #define EDJE_STATE_PARAM_TEXT_STYLE     25
362 #define EDJE_STATE_PARAM_TEXT_SIZE      26
363 #define EDJE_STATE_PARAM_TEXT_FIT       27
364 #define EDJE_STATE_PARAM_TEXT_MIN       28
365 #define EDJE_STATE_PARAM_TEXT_MAX       29
366 #define EDJE_STATE_PARAM_TEXT_ALIGN     30
367 #define EDJE_STATE_PARAM_VISIBLE        31
368 #define EDJE_STATE_PARAM_MAP_OM         32
369 #define EDJE_STATE_PARAM_MAP_PERSP      33
370 #define EDJE_STATE_PARAM_MAP_LIGNT      34
371 #define EDJE_STATE_PARAM_MAP_ROT_CENTER 35
372 #define EDJE_STATE_PARAM_MAP_ROT_X      36
373 #define EDJE_STATE_PARAM_MAP_ROT_Y      37
374 #define EDJE_STATE_PARAM_MAP_ROT_Z      38
375 #define EDJE_STATE_PARAM_MAP_BACK_CULL  39
376 #define EDJE_STATE_PARAM_MAP_PERSP_ON   40
377 #define EDJE_STATE_PARAM_PERSP_ZPLANE   41
378 #define EDJE_STATE_PARAM_PERSP_FOCAL    42
379 #define EDJE_STATE_PARAM_LAST           43
380
381 #define EDJE_ENTRY_EDIT_MODE_NONE 0
382 #define EDJE_ENTRY_EDIT_MODE_SELECTABLE 1
383 #define EDJE_ENTRY_EDIT_MODE_EDITABLE 2
384 #define EDJE_ENTRY_EDIT_MODE_PASSWORD 3
385
386 #define EDJE_ENTRY_SELECTION_MODE_DEFAULT 0
387 #define EDJE_ENTRY_SELECTION_MODE_EXPLICIT 1
388
389 #define EDJE_ENTRY_CURSOR_MODE_UNDER 0
390 #define EDJE_ENTRY_CURSOR_MODE_BEFORE 1
391
392 #define EDJE_ORIENTATION_AUTO  0
393 #define EDJE_ORIENTATION_LTR   1
394 #define EDJE_ORIENTATION_RTL   2
395
396 #define EDJE_PART_PATH_SEPARATOR ':'
397 #define EDJE_PART_PATH_SEPARATOR_STRING ":"
398 #define EDJE_PART_PATH_SEPARATOR_INDEXL '['
399 #define EDJE_PART_PATH_SEPARATOR_INDEXR ']'
400 /*----------*/
401
402 struct _Edje_File
403 {
404    const char                     *path;
405    time_t                          mtime;
406
407    Edje_External_Directory        *external_dir;
408    Edje_Image_Directory           *image_dir;
409    Eina_List                      *styles;
410    Eina_List                      *color_classes;
411
412    int                             references;
413    const char                     *compiler;
414    int                             version;
415    int                             minor;
416    int                             feature_ver;
417
418    Eina_Hash                      *data;
419    Eina_Hash                      *fonts;
420
421    Eina_Hash                      *collection;
422    Eina_List                      *collection_cache;
423
424    Edje_Patterns                  *collection_patterns;
425
426    Eet_File                       *ef;
427
428    unsigned char                   free_strings : 1;
429    unsigned char                   dangling : 1;
430    unsigned char                   warning : 1;
431 };
432
433 struct _Edje_Style
434 {
435    char                           *name;
436    Eina_List                      *tags;
437    Evas_Textblock_Style           *style;
438 };
439
440 struct _Edje_Style_Tag
441 {
442    const char                     *key;
443    const char                     *value;
444    const char                     *font;
445    double                          font_size;
446    const char                     *text_class;
447 };
448
449 /*----------*/
450
451
452 struct _Edje_Font_Directory_Entry
453 {
454    const char *entry; /* the name of the font */
455    const char *file; /* the name of the file */
456 };
457
458 /*----------*/
459
460 struct _Edje_External_Directory
461 {
462    Edje_External_Directory_Entry *entries; /* a list of Edje_External_Directory_Entry */
463    unsigned int entries_count;
464 };
465
466 struct _Edje_External_Directory_Entry
467 {
468    const char *entry; /* the name of the external */
469 };
470
471
472 /*----------*/
473
474
475
476 /*----------*/
477
478 struct _Edje_Image_Directory
479 {
480    Edje_Image_Directory_Entry *entries; /* an array of Edje_Image_Directory_Entry */
481    unsigned int entries_count;
482
483    Edje_Image_Directory_Set *sets;
484    unsigned int sets_count; /* an array of Edje_Image_Directory_Set */
485 };
486
487 struct _Edje_Image_Directory_Entry
488 {
489    const char *entry; /* the nominal name of the image - if any */
490    int   source_type; /* alternate source mode. 0 = none */
491    int   source_param; /* extra params on encoding */
492    int   id; /* the id no. of the image */
493 };
494
495 struct _Edje_Image_Directory_Set
496 {
497    char *name;
498    Eina_List *entries;
499
500    int id;
501 };
502
503 struct _Edje_Image_Directory_Set_Entry
504 {
505    const char *name;
506    int id;
507
508    struct {
509      struct {
510        int w;
511        int h;
512      } min, max;
513    } size;
514 };
515
516 /*----------*/
517
518 struct _Edje_Program /* a conditional program to be run */
519 {
520    int         id; /* id of program */
521    const char *name; /* name of the action */
522
523    const char *signal; /* if signal emission name matches the glob here... */
524    const char *source; /* if part that emitted this (name) matches this glob */
525
526    struct {
527       const char *part;
528       const char *state; /* if state is not set, we will try with source */
529    } filter; /* the part filter.part should be in state filter.state for signal to be accepted */
530
531    struct {
532       double   from;
533       double   range;
534    } in;
535
536    int         action; /* type - set state, stop action, set drag pos etc. */
537    const char *state; /* what state of alternates to apply, NULL = default */
538    const char *state2; /* what other state to use - for signal emit action */
539    double      value; /* value of state to apply (if multiple names match) */
540    double      value2; /* other value for drag actions */
541
542    struct {
543       int      mode; /* how to tween - linear, sinusoidal etc. */
544       FLOAT_T  time; /* time to graduate between current and new state */
545    } tween;
546
547    Eina_List  *targets; /* list of target parts to apply the state to */
548
549    Eina_List  *after; /* list of actions to run at the end of this, for looping */
550
551    struct {
552       const char *name;
553       const char *description;
554    } api;
555
556    /* used for PARAM_COPY (param names in state and state2 above!) */
557    struct {
558       int src; /* part where parameter is being retrieved */
559       int dst; /* part where parameter is being stored */
560    } param;
561 };
562
563 struct _Edje_Program_Target /* the target of an action */
564 {
565    int id; /* just the part id no, or action id no */
566 };
567
568 struct _Edje_Program_After /* the action to run after another action */
569 {
570    int id;
571 };
572
573 /*----------*/
574 #define PART_TYPE_FIELDS(TYPE)    \
575       TYPE      RECTANGLE;        \
576       TYPE      TEXT;             \
577       TYPE      IMAGE;            \
578       TYPE      SWALLOW;          \
579       TYPE      TEXTBLOCK;        \
580       TYPE      GROUP;            \
581       TYPE      BOX;              \
582       TYPE      TABLE;            \
583       TYPE      EXTERNAL;
584
585 struct _Edje_Part_Collection_Directory_Entry
586 {
587    const char *entry; /* the nominal name of the part collection */
588    int         id; /* the id of this named part collection */
589
590    struct
591    {
592       PART_TYPE_FIELDS(int)
593       int      part;
594    } count;
595
596    struct
597    {
598       PART_TYPE_FIELDS(Eina_Mempool *)
599       Eina_Mempool *part;
600    } mp;
601
602    struct
603    {
604       PART_TYPE_FIELDS(Eina_Mempool *)
605    } mp_rtl; /* For Right To Left interface */
606
607    Edje_Part_Collection *ref;
608 };
609
610 /*----------*/
611
612 /*----------*/
613
614 struct _Edje_Pack_Element
615 {
616    unsigned char    type; /* only GROUP supported for now */
617    Edje_Real_Part  *parent; /* pointer to the table/box that hold it, set at runtime */
618    const char      *name; /* if != NULL, will be set with evas_object_name_set */
619    const char      *source; /* group name to use as source for this element */
620    Edje_Size        min, prefer, max;
621    struct {
622            int l, r, t, b;
623    } padding;
624    Edje_Alignment   align;
625    Edje_Alignment   weight;
626    Edje_Aspect      aspect;
627    const char      *options; /* extra options for custom objects */
628    /* table specific follows */
629    int              col, row;
630    unsigned short   colspan, rowspan;
631 };
632
633 /*----------*/
634
635 struct _Edje_Part_Collection
636 {
637    struct { /* list of Edje_Program */
638       Edje_Program **fnmatch; /* complex match with "*?[\" */
639       unsigned int fnmatch_count;
640
641       Edje_Program **strcmp; /* No special caractere, plain strcmp does the work */
642       unsigned int strcmp_count;
643
644       Edje_Program **strncmp; /* Finish by * or ?, plain strncmp does the work */
645       unsigned int strncmp_count;
646
647       Edje_Program **strrncmp; /* Start with * or ?, reverse strncmp will do the job */
648       unsigned int strrncmp_count;
649
650       Edje_Program **nocmp; /* Empty signal/source that will never match */
651       unsigned int nocmp_count;
652    } programs;
653
654    Edje_Part **parts; /* an array of Edje_Part */
655    unsigned int parts_count;
656
657    Eina_Hash *data;
658
659    int        id; /* the collection id */
660
661    Eina_Hash *alias; /* aliasing part */
662    Eina_Hash *aliased; /* invert match of alias */
663
664    struct {
665       Edje_Size min, max;
666       unsigned char orientation;
667    } prop;
668
669    int        references;
670
671 #ifdef EDJE_PROGRAM_CACHE
672    struct {
673       Eina_Hash                   *no_matches;
674       Eina_Hash                   *matches;
675    } prog_cache;
676 #endif
677
678    Embryo_Program   *script; /* all the embryo script code for this group */
679    const char       *part;
680
681    unsigned char    script_only;
682
683    unsigned char    lua_script_only;
684
685    unsigned char    checked : 1;
686 };
687
688 struct _Edje_Part_Dragable
689 {
690    int                 step_x; /* drag jumps n pixels (0 = no limit) */
691    int                 step_y; /* drag jumps n pixels (0 = no limit) */
692
693    int                 count_x; /* drag area divided by n (0 = no limit) */
694    int                 count_y; /* drag area divided by n (0 = no limit) */
695
696    int                 confine_id; /* dragging within this bit, -1 = no */
697
698    /* davinchi */
699    int            event_id; /* If it is used as scrollbar */
700
701    signed char         x; /* can u click & drag this bit in x dir */
702    signed char         y; /* can u click & drag this bit in y dir */
703 };
704
705 struct _Edje_Part_Api
706 {
707    const char         *name;
708    const char         *description;
709 };
710
711 typedef struct _Edje_Part_Description_List Edje_Part_Description_List;
712 struct _Edje_Part_Description_List
713 {
714    Edje_Part_Description_Common **desc;
715    Edje_Part_Description_Common **desc_rtl; /* desc for Right To Left interface */
716    unsigned int desc_count;
717 };
718
719 struct _Edje_Part
720 {
721    const char                   *name; /* the name if any of the part */
722    Edje_Part_Description_Common *default_desc; /* the part descriptor for default */
723    Edje_Part_Description_Common *default_desc_rtl; /* default desc for Right To Left interface */
724
725    Edje_Part_Description_List    other; /* other possible descriptors */
726
727    const char           *source, *source2, *source3, *source4, *source5, *source6;
728    int                    id; /* its id number */
729    int                    clip_to_id; /* the part id to clip this one to */
730    Edje_Part_Dragable     dragable;
731    Edje_Pack_Element    **items; /* packed items for box and table */
732    unsigned int           items_count;
733    unsigned char          type; /* what type (image, rect, text) */
734    unsigned char          effect; /* 0 = plain... */
735    unsigned char          mouse_events; /* it will affect/respond to mouse events */
736    unsigned char          repeat_events; /* it will repeat events to objects below */
737    Evas_Event_Flags       ignore_flags;
738    unsigned char          scale; /* should certain properties scale with edje scale factor? */
739    unsigned char          precise_is_inside;
740    unsigned char          use_alternate_font_metrics;
741    unsigned char          pointer_mode;
742    unsigned char          entry_mode;
743    unsigned char          select_mode;
744    unsigned char          cursor_mode;
745    unsigned char          multiline;
746    Edje_Part_Api          api;
747 };
748
749 struct _Edje_Part_Image_Id
750 {
751    int id;
752    Eina_Bool set;
753 };
754
755 struct _Edje_Part_Description_Common
756 {
757    struct {
758       double         value; /* the value of the state (for ranges) */
759       const char    *name; /* the named state if any */
760    } state;
761
762    Edje_Alignment align; /* 0 <-> 1.0 alignment within allocated space */
763
764    struct {
765       unsigned char  w, h; /* width or height is fixed in side (cannot expand with Edje object size) */
766    } fixed;
767
768    Edje_Size min, max;
769    Edje_Position step; /* size stepping by n pixels, 0 = none */
770    Edje_Aspect_Prefer aspect;
771
772    char      *color_class; /* how to modify the color */
773    Edje_Color color;
774    Edje_Color color2;
775
776    struct {
777       FLOAT_T        relative_x;
778       FLOAT_T        relative_y;
779       int            offset_x;
780       int            offset_y;
781       int            id_x; /* -1 = whole part collection, or part ID */
782       int            id_y; /* -1 = whole part collection, or part ID */
783    } rel1, rel2;
784
785    struct {
786       int id_persp;
787       int id_light;
788       struct {
789          int id_center;
790          FLOAT_T x, y, z;
791       } rot;
792       unsigned char backcull;
793       unsigned char on;
794       unsigned char persp_on;
795       unsigned char smooth;
796       unsigned char alpha;
797    } map;
798
799    struct {
800       int zplane;
801       int focal;
802    } persp;
803
804    unsigned char     visible; /* is it shown */
805 };
806
807 struct _Edje_Part_Description_Spec_Fill
808 {
809    FLOAT_T        pos_rel_x; /* fill offset x relative to area */
810    FLOAT_T        rel_x; /* relative size compared to area */
811    FLOAT_T        pos_rel_y; /* fill offset y relative to area */
812    FLOAT_T        rel_y; /* relative size compared to area */
813    int            pos_abs_x; /* fill offset x added to fill offset */
814    int            abs_x; /* size of fill added to relative fill */
815    int            pos_abs_y; /* fill offset y added to fill offset */
816    int            abs_y; /* size of fill added to relative fill */
817    int            angle; /* angle of fill -- currently only used by grads */
818    int            spread; /* spread of fill -- currently only used by grads */
819    char           smooth; /* fill with smooth scaling or not */
820    unsigned char  type; /* fill coordinate from container (SCALE) or from source image (TILE) */
821 };
822
823 struct _Edje_Part_Description_Spec_Border
824 {
825    int            l, r, t, b; /* border scaling on image fill */
826    unsigned char  no_fill; /* do we fill the center of the image if bordered? 1 == NO!!!! */
827    unsigned char  scale; /* scale image border by same as scale factor */
828 };
829
830 struct _Edje_Part_Description_Spec_Image
831 {
832    Edje_Part_Image_Id **tweens; /* list of Edje_Part_Image_Id */
833    unsigned int         tweens_count; /* number of tweens */
834
835    int            id; /* the image id to use */
836    int            scale_hint; /* evas scale hint */
837    Eina_Bool      set; /* if image condition it's content */
838
839    Edje_Part_Description_Spec_Border border;
840    Edje_Part_Description_Spec_Fill   fill;
841 };
842
843 struct _Edje_Part_Description_Spec_Text
844 {
845    Edje_String    text; /* if "" or NULL, then leave text unchanged */
846    char          *text_class; /* how to apply/modify the font */
847    Edje_String    style; /* the text style if a textblock */
848    Edje_String    font; /* if a specific font is asked for */
849    Edje_String    repch; /* replacement char for password mode entry */
850
851    Edje_Alignment align; /* text alignment within bounds */
852    Edje_Color     color3;
853
854    double         elipsis; /* 0.0 - 1.0 defining where the elipsis align */
855    int            size; /* 0 = use user set size */
856    int            id_source; /* -1 if none */
857    int            id_text_source; /* -1 if none */
858
859    unsigned char  fit_x; /* resize font size down to fit in x dir */
860    unsigned char  fit_y; /* resize font size down to fit in y dir */
861    unsigned char  min_x; /* if text size should be part min size */
862    unsigned char  min_y; /* if text size should be part min size */
863    unsigned char  max_x; /* if text size should be part max size */
864    unsigned char  max_y; /* if text size should be part max size */
865    int            size_range_min;
866    int            size_range_max; /* -1 means, no bound. */
867 };
868
869 struct _Edje_Part_Description_Spec_Box
870 {
871    char          *layout, *alt_layout;
872    Edje_Alignment align;
873    struct {
874       int x, y;
875    } padding;
876    struct {
877       Eina_Bool h, v;
878    } min;
879 };
880
881 struct _Edje_Part_Description_Spec_Table
882 {
883    unsigned char  homogeneous;
884    Edje_Alignment align;
885    struct {
886       int x, y;
887    } padding;
888 };
889
890 struct _Edje_Part_Description_Image
891 {
892    Edje_Part_Description_Common common;
893    Edje_Part_Description_Spec_Image image;
894 };
895
896 struct _Edje_Part_Description_Text
897 {
898    Edje_Part_Description_Common common;
899    Edje_Part_Description_Spec_Text text;
900 };
901
902 struct _Edje_Part_Description_Box
903 {
904    Edje_Part_Description_Common common;
905    Edje_Part_Description_Spec_Box box;
906 };
907
908 struct _Edje_Part_Description_Table
909 {
910    Edje_Part_Description_Common common;
911    Edje_Part_Description_Spec_Table table;
912 };
913
914 struct _Edje_Part_Description_External
915 {
916    Edje_Part_Description_Common common;
917    Eina_List *external_params; /* parameters for external objects */
918 };
919
920 /*----------*/
921
922 struct _Edje_Signal_Source_Char
923 {
924    EINA_RBTREE;
925
926    const char *signal;
927    const char *source;
928
929    Eina_List *list;
930 };
931
932 struct _Edje_Signals_Sources_Patterns
933
934 {
935    Edje_Patterns *signals_patterns;
936    Edje_Patterns *sources_patterns;
937
938    Eina_Rbtree   *exact_match;
939
940    union {
941       struct {
942          Edje_Program **globing;
943          unsigned int  count;
944       } programs;
945       struct {
946          Eina_List     *globing;
947       } callbacks;
948    } u;
949 };
950
951 typedef struct _Edje_Signals_Sources_Patterns Edje_Signals_Sources_Patterns;
952
953 struct _Edje
954 {
955    const Edje_Smart_Api *api;
956    const char           *path;
957    const char           *group;
958    const char           *parent;
959
960    Evas_Coord            x, y, w, h;
961    Edje_Size             min;
962    double                paused_at;
963    Evas                 *evas; /* the Evas this Edje belongs to */
964    Evas_Object          *obj; /* the smart object */
965    Evas_Object          *clipper; /* a big rect to clip this Edje to */
966    Edje_File            *file; /* the file the data comes form */
967    Edje_Part_Collection *collection; /* the description being used */
968    Eina_List            *actions; /* currently running actions */
969    Eina_List            *callbacks;
970    Eina_List            *pending_actions;
971    Eina_List            *color_classes;
972    Eina_List            *text_classes;
973    /* variable pool for Edje Embryo scripts */
974    Edje_Var_Pool        *var_pool;
975    /* for faster lookups to avoid nth list walks */
976    Edje_Real_Part      **table_parts;
977    Edje_Program        **table_programs;
978    Edje_Real_Part       *focused_part;
979    Eina_List            *subobjs;
980    Eina_List            *text_insert_filter_callbacks;
981    void                 *script_only_data;
982    int                   table_programs_size;
983    unsigned int          table_parts_size;
984
985    Edje_Perspective     *persp;
986
987    struct {
988       Edje_Signals_Sources_Patterns callbacks;
989       Edje_Signals_Sources_Patterns programs;
990    } patterns;
991
992    int                   references;
993    int                   block;
994    int                   load_error;
995    int                   freeze;
996    FLOAT_T               scale;
997    Eina_Bool             is_rtl : 1;
998
999    struct {
1000       Edje_Text_Change_Cb  func;
1001       void                *data;
1002    } text_change;
1003
1004    struct {
1005       Edje_Message_Handler_Cb  func;
1006       void                    *data;
1007       int                      num;
1008    } message;
1009    int                      processing_messages;
1010
1011    int                   state;
1012
1013    int                   preload_count;
1014
1015    unsigned int          dirty : 1;
1016    unsigned int          recalc : 1;
1017    unsigned int          walking_callbacks : 1;
1018    unsigned int          delete_callbacks : 1;
1019    unsigned int          just_added_callbacks : 1;
1020    unsigned int          have_objects : 1;
1021    unsigned int          paused : 1;
1022    unsigned int          no_anim : 1;
1023    unsigned int          calc_only : 1;
1024    unsigned int          walking_actions : 1;
1025    unsigned int          block_break : 1;
1026    unsigned int          delete_me : 1;
1027    unsigned int          postponed : 1;
1028    unsigned int          freeze_calc : 1;
1029    unsigned int          has_entries : 1;
1030    unsigned int          entries_inited : 1;
1031 #ifdef EDJE_CALC_CACHE
1032    unsigned int          text_part_change : 1;
1033    unsigned int          all_part_change : 1;
1034 #endif
1035    unsigned int          have_mapped_part : 1;
1036
1037    lua_State            *L;
1038    Eina_Inlist          *lua_objs;
1039    int                   lua_ref;
1040    
1041    struct {
1042       Edje_Item_Provider_Cb  func;
1043       void                  *data;
1044    } item_provider;
1045 };
1046
1047 struct _Edje_Calc_Params
1048 {
1049    int              x, y, w, h; // 16
1050    Edje_Rectangle   req; // 16
1051    Edje_Rectangle   req_drag; // 16
1052    Edje_Color       color; // 4
1053    union {
1054       struct {
1055          struct {
1056             int           x, y, w, h; // 16
1057             int           angle; // 4
1058             int           spread; // 4
1059          } fill; // 24
1060
1061          union {
1062             struct {
1063                int           l, r, t, b; // 16
1064             } image; // 16
1065          } spec; // 16
1066       } common; // 40
1067       struct {
1068          Edje_Alignment align; /* text alignment within bounds */ // 16
1069          double         elipsis; // 8
1070          int            size; // 4
1071          Edje_Color     color2, color3; // 8
1072       } text; // 36
1073    } type; // 40
1074    unsigned char    visible : 1;
1075    unsigned char    smooth : 1; // 1
1076 }; // 96
1077
1078 struct _Edje_Real_Part_Set
1079 {
1080   Edje_Image_Directory_Set_Entry *entry; // 4
1081   Edje_Image_Directory_Set       *set; // 4
1082
1083   int                             id; // 4
1084 };
1085
1086 struct _Edje_Real_Part_State
1087 {
1088    Edje_Part_Description_Common *description; // 4
1089    Edje_Part_Description_Common *description_rtl; // 4
1090    Edje_Real_Part        *rel1_to_x; // 4
1091    Edje_Real_Part        *rel1_to_y; // 4
1092    Edje_Real_Part        *rel2_to_x; // 4
1093    Edje_Real_Part        *rel2_to_y; // 4
1094 #ifdef EDJE_CALC_CACHE
1095    int                    state; // 4
1096    Edje_Calc_Params       p; // 96
1097 #endif
1098    void                  *external_params; // 4
1099    Edje_Real_Part_Set    *set; // 4
1100 }; // 32
1101 // WITH EDJE_CALC_CACHE 132
1102
1103 struct _Edje_Real_Part_Drag
1104 {
1105    FLOAT_T               x, y; // 16
1106    Edje_Position_Scale   val, size, step, page; // 64
1107    struct {
1108       unsigned int       count; // 4
1109       int                x, y; // 8
1110    } down;
1111    struct {
1112       int                x, y; // 8
1113    } tmp;
1114    unsigned char         need_reset : 1; // 4
1115    Edje_Real_Part       *confine_to; // 4
1116 }; // 104
1117
1118 struct _Edje_Real_Part
1119 {
1120    Edje                     *edje; // 4
1121    Edje_Part                *part; // 4
1122    Evas_Object              *object; // 4
1123    int                       x, y, w, h; // 16
1124    Edje_Rectangle            req; // 16
1125
1126    Eina_List                *items; // 4 //FIXME: only if table/box
1127    Edje_Part_Box_Animation  *anim; // 4 //FIXME: Used only if box
1128    void                     *entry_data; // 4 // FIXME: move to entry section
1129
1130    Evas_Object              *swallowed_object; // 4 // FIXME: move with swallow_params data
1131    struct {
1132       Edje_Size min, max; // 16
1133       Edje_Aspect aspect; // 12
1134    } swallow_params; // 28 // FIXME: only if type SWALLOW
1135
1136    Edje_Real_Part_Drag      *drag; // 4
1137    Edje_Real_Part           *events_to; // 4
1138
1139    struct {
1140       Edje_Real_Part        *source; // 4
1141       Edje_Real_Part        *text_source; // 4
1142       const char            *text; // 4
1143       Edje_Position          offset; // 8 text only
1144       const char            *font; // 4 text only
1145       const char            *style; // 4 text only
1146       int                    size; // 4 text only
1147       struct {
1148          double              in_w, in_h; // 16 text only
1149          int                 in_size; // 4 text only
1150          const char         *in_str; // 4 text only
1151          const char         *out_str; // 4 text only
1152          int                 out_size; // 4 text only
1153          FLOAT_T             align_x, align_y; // 16 text only
1154          double              elipsis; // 8 text only
1155          int                 fit_x, fit_y; // 8 text only
1156       } cache; // 64
1157    } text; // 86 // FIXME make text a potiner to struct and alloc at end
1158                  // if part type is TEXT move common members textblock +
1159                  // text to front and have smaller struct for textblock
1160
1161    FLOAT_T                   description_pos; // 8
1162    Edje_Part_Description_Common *chosen_description; // 4
1163    Edje_Real_Part_State      param1; // 20
1164    // WITH EDJE_CALC_CACHE: 140
1165    Edje_Real_Part_State     *param2, *custom; // 8
1166
1167 #ifdef EDJE_CALC_CACHE
1168    int                       state; // 4
1169 #endif
1170
1171    Edje_Real_Part           *clip_to; // 4
1172
1173    Edje_Running_Program     *program; // 4
1174
1175    int                       clicked_button; // 4
1176
1177    unsigned char             calculated; // 1
1178    unsigned char             calculating; // 1
1179
1180    unsigned char             still_in   : 1; // 1
1181 #ifdef EDJE_CALC_CACHE
1182    unsigned char             invalidate : 1; // 0
1183 #endif
1184 }; //  260
1185 // WITH EDJE_CALC_CACHE: 400
1186
1187 struct _Edje_Running_Program
1188 {
1189    Edje           *edje;
1190    Edje_Program   *program;
1191    double          start_time;
1192    char            delete_me : 1;
1193 };
1194
1195 struct _Edje_Signal_Callback
1196 {
1197    const char     *signal;
1198    const char     *source;
1199    Edje_Signal_Cb  func;
1200    void           *data;
1201    unsigned char   just_added : 1;
1202    unsigned char   delete_me : 1;
1203 };
1204
1205 struct _Edje_Text_Insert_Filter_Callback
1206 {
1207    const char  *part;
1208    Edje_Text_Filter_Cb func;
1209    void        *data;
1210 };
1211
1212 struct _Edje_Pending_Program
1213 {
1214    Edje         *edje;
1215    Edje_Program *program;
1216    Ecore_Timer  *timer;
1217 };
1218
1219 struct _Edje_Text_Style
1220 {
1221    struct {
1222       unsigned char x, y;
1223    } offset;
1224    struct {
1225       unsigned char l, r, t, b;
1226    } pad;
1227    int num;
1228    struct {
1229       unsigned char color; /* 0 = color, 1, 2 = color2, color3 */
1230       signed   char x, y; /* offset */
1231       unsigned char alpha;
1232    } members[32];
1233 };
1234
1235 struct _Edje_Color_Class
1236 {
1237    const char    *name;
1238    unsigned char  r, g, b, a;
1239    unsigned char  r2, g2, b2, a2;
1240    unsigned char  r3, g3, b3, a3;
1241 };
1242
1243 struct _Edje_Text_Class
1244 {
1245    const char     *name;
1246    const char     *font;
1247    Evas_Font_Size  size;
1248 };
1249
1250 struct _Edje_Var_Int
1251 {
1252    int      v;
1253 };
1254
1255 struct _Edje_Var_Float
1256 {
1257    double   v;
1258 };
1259
1260 struct _Edje_Var_String
1261 {
1262    char    *v;
1263 };
1264
1265 struct _Edje_Var_List
1266 {
1267    Eina_List *v;
1268 };
1269
1270 struct _Edje_Var_Hash
1271 {
1272    Eina_Hash *v;
1273 };
1274
1275 struct _Edje_Var_Timer
1276 {
1277    Edje           *edje;
1278    int             id;
1279    Embryo_Function func;
1280    int             val;
1281    Ecore_Timer    *timer;
1282 };
1283
1284 struct _Edje_Var_Animator
1285 {
1286    Edje           *edje;
1287    int             id;
1288    Embryo_Function func;
1289    int             val;
1290    double          start, len;
1291    char            delete_me;
1292 };
1293
1294 struct _Edje_Var_Pool
1295 {
1296    int          id_count;
1297    Eina_List   *timers;
1298    Eina_List   *animators;
1299    int          size;
1300    Edje_Var    *vars;
1301    int          walking_list;
1302 };
1303
1304 struct _Edje_Var
1305 {
1306    union {
1307       Edje_Var_Int    i;
1308       Edje_Var_Float  f;
1309       Edje_Var_String s;
1310       Edje_Var_List   l;
1311       Edje_Var_Hash   h;
1312    } data;
1313    unsigned char type;
1314 };
1315
1316 typedef enum _Edje_Queue
1317 {
1318    EDJE_QUEUE_APP,
1319      EDJE_QUEUE_SCRIPT
1320 } Edje_Queue;
1321
1322 typedef struct _Edje_Message_Signal Edje_Message_Signal;
1323 typedef struct _Edje_Message        Edje_Message;
1324
1325 struct _Edje_Message_Signal
1326 {
1327    const char *sig;
1328    const char *src;
1329 };
1330
1331 struct _Edje_Message
1332 {
1333    Edje              *edje;
1334    Edje_Queue         queue;
1335    Edje_Message_Type  type;
1336    int                id;
1337    unsigned char     *msg;
1338 };
1339
1340 typedef enum _Edje_Fill
1341 {
1342    EDJE_FILL_TYPE_SCALE = 0,
1343      EDJE_FILL_TYPE_TILE
1344 } Edje_Fill;
1345
1346 typedef enum _Edje_Match_Error
1347 {
1348    EDJE_MATCH_OK,
1349      EDJE_MATCH_ALLOC_ERROR,
1350      EDJE_MATCH_SYNTAX_ERROR
1351
1352 } Edje_Match_Error;
1353
1354 typedef struct _Edje_States     Edje_States;
1355 struct _Edje_Patterns
1356 {
1357    const char    **patterns;
1358
1359    Edje_States    *states;
1360
1361    int             ref;
1362    Eina_Bool       delete_me : 1;
1363    
1364    size_t          patterns_size;
1365    size_t          max_length;
1366    size_t          finals[];
1367 };
1368
1369 Edje_Patterns   *edje_match_collection_dir_init(const Eina_List *lst);
1370 Edje_Patterns   *edje_match_programs_signal_init(Edje_Program * const *array,
1371                                                  unsigned int count);
1372 Edje_Patterns   *edje_match_programs_source_init(Edje_Program * const *array,
1373                                                  unsigned int count);
1374 Edje_Patterns   *edje_match_callback_signal_init(const Eina_List *lst);
1375 Edje_Patterns   *edje_match_callback_source_init(const Eina_List *lst);
1376
1377 Eina_Bool        edje_match_collection_dir_exec(const Edje_Patterns      *ppat,
1378                                                 const char               *string);
1379 Eina_Bool        edje_match_programs_exec(const Edje_Patterns    *ppat_signal,
1380                                           const Edje_Patterns    *ppat_source,
1381                                           const char             *signal,
1382                                           const char             *source,
1383                                           Edje_Program          **programs,
1384                                           Eina_Bool (*func)(Edje_Program *pr, void *data),
1385                                           void                   *data);
1386 int              edje_match_callback_exec(Edje_Patterns          *ppat_signal,
1387                                           Edje_Patterns          *ppat_source,
1388                                           const char             *signal,
1389                                           const char             *source,
1390                                           Eina_List              *callbacks,
1391                                           Edje                   *ed);
1392
1393 void             edje_match_patterns_free(Edje_Patterns *ppat);
1394
1395 Eina_List *edje_match_program_hash_build(Edje_Program * const * programs,
1396                                          unsigned int count,
1397                                          Eina_Rbtree **tree);
1398 Eina_List *edje_match_callback_hash_build(const Eina_List *callbacks,
1399                                           Eina_Rbtree **tree);
1400 const Eina_List *edje_match_signal_source_hash_get(const char *signal,
1401                                                    const char *source,
1402                                                    const Eina_Rbtree *tree);
1403 void edje_match_signal_source_free(Edje_Signal_Source_Char *key, void *data);
1404
1405 // FIXME remove below 2 eapi decls when edje_convert goes
1406 EAPI void _edje_edd_init(void);
1407 EAPI void _edje_edd_shutdown(void);
1408
1409 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
1410 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
1411
1412 extern int              _edje_anim_count;
1413 extern Ecore_Animator  *_edje_timer;
1414 extern Eina_List       *_edje_animators;
1415 extern Eina_List       *_edje_edjes;
1416
1417 extern char            *_edje_fontset_append;
1418 extern FLOAT_T          _edje_scale;
1419 extern int              _edje_freeze_val;
1420 extern int              _edje_freeze_calc_count;
1421 extern Eina_List       *_edje_freeze_calc_list;
1422
1423 extern Eina_Mempool *_edje_real_part_mp;
1424 extern Eina_Mempool *_edje_real_part_state_mp;
1425
1426 extern Eina_Mempool *_emp_RECTANGLE;
1427 extern Eina_Mempool *_emp_TEXT;
1428 extern Eina_Mempool *_emp_IMAGE;
1429 extern Eina_Mempool *_emp_SWALLOW;
1430 extern Eina_Mempool *_emp_TEXTBLOCK;
1431 extern Eina_Mempool *_emp_GROUP;
1432 extern Eina_Mempool *_emp_BOX;
1433 extern Eina_Mempool *_emp_TABLE;
1434 extern Eina_Mempool *_emp_EXTERNAL;
1435 extern Eina_Mempool *_emp_part;
1436
1437 void  _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos);
1438 Edje_Part_Description_Common *_edje_part_description_find(Edje *ed,
1439                                                           Edje_Real_Part *rp,
1440                                                           const char *name, double val);
1441 void  _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char  *d1, double v1, const char *d2, double v2);
1442 void  _edje_recalc(Edje *ed);
1443 void  _edje_recalc_do(Edje *ed);
1444 void  _edje_part_recalc_1(Edje *ed, Edje_Real_Part *ep);
1445 int   _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y);
1446 void  _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y);
1447
1448 Eina_Bool _edje_timer_cb(void *data);
1449 Eina_Bool _edje_pending_timer_cb(void *data);
1450 void  _edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
1451 void  _edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
1452 void  _edje_callbacks_del(Evas_Object *obj, Edje *ed);
1453 void  _edje_callbacks_focus_del(Evas_Object *obj, Edje *ed);
1454
1455 void  _edje_edd_init(void);
1456 void  _edje_edd_shutdown(void);
1457
1458 int _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, Eina_List *group_path);
1459
1460 void  _edje_file_add(Edje *ed);
1461 void  _edje_file_del(Edje *ed);
1462 void  _edje_file_free(Edje_File *edf);
1463 void  _edje_file_cache_shutdown(void);
1464 void  _edje_collection_free(Edje_File *edf,
1465                             Edje_Part_Collection *ec,
1466                             Edje_Part_Collection_Directory_Entry *ce);
1467 void  _edje_collection_free_part_description_clean(int type,
1468                                                    Edje_Part_Description_Common *desc,
1469                                                    Eina_Bool free_strings);
1470 void _edje_collection_free_part_description_free(int type,
1471                                                  Edje_Part_Description_Common *desc,
1472                                                  Edje_Part_Collection_Directory_Entry *ce,
1473                                                  Eina_Bool free_strings);
1474
1475 void  _edje_object_smart_set(Edje_Smart_Api *sc);
1476 const Edje_Smart_Api * _edje_object_smart_class_get(void);
1477
1478 void  _edje_del(Edje *ed);
1479 void  _edje_ref(Edje *ed);
1480 void  _edje_unref(Edje *ed);
1481 void  _edje_clean_objects(Edje *ed);
1482 void  _edje_ref(Edje *ed);
1483 void  _edje_unref(Edje *ed);
1484
1485 Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
1486 void  _edje_program_end(Edje *ed, Edje_Running_Program *runp);
1487 void  _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
1488 void _edje_programs_patterns_clean(Edje *ed);
1489 void _edje_programs_patterns_init(Edje *ed);
1490 void  _edje_emit(Edje *ed, const char *sig, const char *src);
1491 void  _edje_emit_handle(Edje *ed, const char *sig, const char *src);
1492 void  _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp);
1493 void  _edje_callbacks_patterns_clean(Edje *ed);
1494
1495 void           _edje_text_init(void);
1496 void           _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep);
1497 void           _edje_text_part_on_del(Edje *ed, Edje_Part *ep);
1498 void           _edje_text_recalc_apply(Edje *ed,
1499                                        Edje_Real_Part *ep,
1500                                        Edje_Calc_Params *params,
1501                                        Edje_Part_Description_Text *chosen_desc);
1502 Evas_Font_Size _edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc);
1503 const char *   _edje_text_class_font_get(Edje *ed,
1504                                          Edje_Part_Description_Text *chosen_desc,
1505                                          int *size, char **free_later);
1506
1507
1508 Edje_Real_Part   *_edje_real_part_get(const Edje *ed, const char *part);
1509 Edje_Real_Part   *_edje_real_part_recursive_get(const Edje *ed, const char *part);
1510 Edje             *_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp);
1511 Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class);
1512 void              _edje_color_class_member_add(Edje *ed, const char *color_class);
1513 void              _edje_color_class_member_del(Edje *ed, const char *color_class);
1514 void              _edje_color_class_on_del(Edje *ed, Edje_Part *ep);
1515 void              _edje_color_class_members_free(void);
1516 void              _edje_color_class_hash_free(void);
1517
1518 Edje_Text_Class  *_edje_text_class_find(Edje *ed, const char *text_class);
1519 void              _edje_text_class_member_add(Edje *ed, const char *text_class);
1520 void              _edje_text_class_member_del(Edje *ed, const char *text_class);
1521 void              _edje_text_class_members_free(void);
1522 void              _edje_text_class_hash_free(void);
1523
1524 Edje             *_edje_fetch(const Evas_Object *obj);
1525 int               _edje_freeze(Edje *ed);
1526 int               _edje_thaw(Edje *ed);
1527 int               _edje_block(Edje *ed);
1528 int               _edje_unblock(Edje *ed);
1529 int               _edje_block_break(Edje *ed);
1530 void              _edje_block_violate(Edje *ed);
1531 void              _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
1532 void              _edje_object_part_swallow_changed_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
1533 void              _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow);
1534 void              _edje_real_part_swallow_clear(Edje_Real_Part *rp);
1535 void              _edje_box_init(void);
1536 void              _edje_box_shutdown(void);
1537 Eina_Bool         _edje_box_layout_find(const char *name, Evas_Object_Box_Layout *cb, void **data, void (**free_data)(void *data));
1538 void              _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Box *chosen_desc);
1539 Eina_Bool         _edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj);
1540 void              _edje_box_layout_remove_child(Edje_Real_Part *rp, Evas_Object *child_obj);
1541 Edje_Part_Box_Animation * _edje_box_layout_anim_new(Evas_Object *box);
1542 void              _edje_box_layout_free_data(void *data);
1543
1544 Eina_Bool         _edje_real_part_box_append(Edje_Real_Part *rp, Evas_Object *child_obj);
1545 Eina_Bool         _edje_real_part_box_prepend(Edje_Real_Part *rp, Evas_Object *child_obj);
1546 Eina_Bool         _edje_real_part_box_insert_before(Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
1547 Eina_Bool         _edje_real_part_box_insert_at(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos);
1548 Evas_Object      *_edje_real_part_box_remove(Edje_Real_Part *rp, Evas_Object *child_obj);
1549 Evas_Object      *_edje_real_part_box_remove_at(Edje_Real_Part *rp, unsigned int pos);
1550 Eina_Bool         _edje_real_part_box_remove_all(Edje_Real_Part *rp, Eina_Bool clear);
1551 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);
1552 Eina_Bool         _edje_real_part_table_unpack(Edje_Real_Part *rp, Evas_Object *child_obj);
1553 void              _edje_real_part_table_clear(Edje_Real_Part *rp, Eina_Bool clear);
1554 Evas_Object      *_edje_children_get(Edje_Real_Part *rp, const char *partid);
1555
1556 Eina_Bool         _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text);
1557 char             *_edje_text_escape(const char *text);
1558 char             *_edje_text_unescape(const char *text);
1559
1560 void          _edje_embryo_script_init      (Edje_Part_Collection *edc);
1561 void          _edje_embryo_script_shutdown  (Edje_Part_Collection *edc);
1562 void          _edje_embryo_script_reset     (Edje *ed);
1563 void          _edje_embryo_test_run         (Edje *ed, const char *fname, const char *sig, const char *src);
1564 Edje_Var     *_edje_var_new                 (void);
1565 void          _edje_var_free                (Edje_Var *var);
1566 void          _edje_var_init                (Edje *ed);
1567 void          _edje_var_shutdown            (Edje *ed);
1568 int           _edje_var_string_id_get       (Edje *ed, const char *string);
1569 int           _edje_var_var_int_get         (Edje *ed, Edje_Var *var);
1570 void          _edje_var_var_int_set         (Edje *ed, Edje_Var *var, int v);
1571 double        _edje_var_var_float_get       (Edje *ed, Edje_Var *var);
1572 void          _edje_var_var_float_set       (Edje *ed, Edje_Var *var, double v);
1573 const char   *_edje_var_var_str_get         (Edje *ed, Edje_Var *var);
1574 void          _edje_var_var_str_set         (Edje *ed, Edje_Var *var, const char *str);
1575 int           _edje_var_int_get             (Edje *ed, int id);
1576 void          _edje_var_int_set             (Edje *ed, int id, int v);
1577 double        _edje_var_float_get           (Edje *ed, int id);
1578 void          _edje_var_float_set           (Edje *ed, int id, double v);
1579 const char   *_edje_var_str_get             (Edje *ed, int id);
1580 void          _edje_var_str_set             (Edje *ed, int id, const char *str);
1581
1582 void          _edje_var_list_var_append(Edje *ed, int id, Edje_Var *var);
1583 void          _edje_var_list_var_prepend(Edje *ed, int id, Edje_Var *var);
1584 void          _edje_var_list_var_append_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
1585 void          _edje_var_list_var_prepend_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
1586 Edje_Var     *_edje_var_list_nth(Edje *ed, int id, int n);
1587
1588 int           _edje_var_list_count_get(Edje *ed, int id);
1589 void          _edje_var_list_remove_nth(Edje *ed, int id, int n);
1590
1591 int           _edje_var_list_nth_int_get(Edje *ed, int id, int n);
1592 void          _edje_var_list_nth_int_set(Edje *ed, int id, int n, int v);
1593 void          _edje_var_list_int_append(Edje *ed, int id, int v);
1594 void          _edje_var_list_int_prepend(Edje *ed, int id, int v);
1595 void          _edje_var_list_int_insert(Edje *ed, int id, int n, int v);
1596
1597 double        _edje_var_list_nth_float_get(Edje *ed, int id, int n);
1598 void          _edje_var_list_nth_float_set(Edje *ed, int id, int n, double v);
1599 void          _edje_var_list_float_append(Edje *ed, int id, double v);
1600 void          _edje_var_list_float_prepend(Edje *ed, int id, double v);
1601 void          _edje_var_list_float_insert(Edje *ed, int id, int n, double v);
1602
1603 const char   *_edje_var_list_nth_str_get(Edje *ed, int id, int n);
1604 void          _edje_var_list_nth_str_set(Edje *ed, int id, int n, const char *v);
1605 void          _edje_var_list_str_append(Edje *ed, int id, const char *v);
1606 void          _edje_var_list_str_prepend(Edje *ed, int id, const char *v);
1607 void          _edje_var_list_str_insert(Edje *ed, int id, int n, const char *v);
1608
1609 int           _edje_var_timer_add           (Edje *ed, double in, const char *fname, int val);
1610 void          _edje_var_timer_del           (Edje *ed, int id);
1611
1612 int           _edje_var_anim_add            (Edje *ed, double len, const char *fname, int val);
1613 void          _edje_var_anim_del            (Edje *ed, int id);
1614
1615 void          _edje_message_init            (void);
1616 void          _edje_message_shutdown        (void);
1617 void          _edje_message_cb_set          (Edje *ed, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data);
1618 Edje_Message *_edje_message_new             (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id);
1619 void          _edje_message_free            (Edje_Message *em);
1620 void          _edje_message_send            (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, void *emsg);
1621 void          _edje_message_parameters_push (Edje_Message *em);
1622 void          _edje_message_process         (Edje_Message *em);
1623 void          _edje_message_queue_process   (void);
1624 void          _edje_message_queue_clear     (void);
1625 void          _edje_message_del             (Edje *ed);
1626
1627 void _edje_textblock_styles_add(Edje *ed);
1628 void _edje_textblock_styles_del(Edje *ed);
1629 void _edje_textblock_style_all_update(Edje *ed);
1630 void _edje_textblock_style_parse_and_fix(Edje_File *edf);
1631 void _edje_textblock_style_cleanup(Edje_File *edf);
1632 Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret);
1633 void _edje_cache_coll_clean(Edje_File *edf);
1634 void _edje_cache_coll_flush(Edje_File *edf);
1635 void _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc);
1636 void _edje_cache_file_unref(Edje_File *edf);
1637
1638 void _edje_embryo_globals_init(Edje *ed);
1639
1640 #define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return -1;
1641 #define GETSTR(str, par) { \
1642    Embryo_Cell *___cptr; \
1643    int ___l; \
1644    str = NULL; \
1645    if ((___cptr = embryo_data_address_get(ep, (par)))) { \
1646       ___l = embryo_data_string_length_get(ep, ___cptr); \
1647       if (((str) = alloca(___l + 1))) \
1648         embryo_data_string_get(ep, ___cptr, (str)); } }
1649 #define GETSTREVAS(str, par) { \
1650    if ((str)) { \
1651       if ((par) && (!strcmp((par), (str)))) return 0; \
1652       if ((par)) eina_stringshare_del((par)); \
1653       (par) = (char *)eina_stringshare_add((str)); } \
1654    else (par) = NULL; }
1655 #define GETFLOAT(val, par) { \
1656    float *___cptr; \
1657    if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
1658       val = *___cptr; } }
1659
1660 #define GETFLOAT_T(val, par)                                            \
1661   {                                                                     \
1662      float *___cptr;                                                    \
1663      if ((___cptr = (float *)embryo_data_address_get(ep, (par))))       \
1664        {                                                                \
1665           val = FROM_DOUBLE(*___cptr);                                  \
1666        }                                                                \
1667   }
1668
1669 #define GETINT(val, par) {                      \
1670    int *___cptr; \
1671    if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
1672       val = *___cptr; } }
1673 #define SETSTR(str, par) { \
1674    Embryo_Cell *___cptr; \
1675    if ((___cptr = embryo_data_address_get(ep, (par)))) { \
1676       embryo_data_string_set(ep, str, ___cptr); } }
1677 #define SETSTRALLOCATE(s)                       \
1678   {                                             \
1679      if (s) {                                   \
1680         if ((int) strlen((s)) < params[4]) {    \
1681            SETSTR((s), params[3]); }            \
1682         else {                                  \
1683            char *ss;                            \
1684            ss = alloca(strlen((s)) + 1);        \
1685            strcpy(ss, (s));                     \
1686            ss[params[4] - 2] = 0;               \
1687            SETSTR(ss, params[3]); } }           \
1688      else                                       \
1689        SETSTR("", params[3]);                   \
1690   }
1691 #define SETFLOAT(val, par) { \
1692    float *___cptr; \
1693    if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
1694       *___cptr = (float)val; } }
1695 #define SETFLOAT_T(val, par)                                            \
1696   {                                                                     \
1697      float *___cptr;                                                    \
1698      if ((___cptr = (float *)embryo_data_address_get(ep, (par))))       \
1699        {                                                                \
1700           *___cptr = (float) TO_DOUBLE(val);                            \
1701        }                                                                \
1702   }
1703 #define SETINT(val, par) { \
1704    int *___cptr; \
1705    if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
1706       *___cptr = (int)val; } }
1707
1708 Eina_Bool _edje_script_only(Edje *ed);
1709 void _edje_script_only_init(Edje *ed);
1710 void _edje_script_only_shutdown(Edje *ed);
1711 void _edje_script_only_show(Edje *ed);
1712 void _edje_script_only_hide(Edje *ed);
1713 void _edje_script_only_move(Edje *ed);
1714 void _edje_script_only_resize(Edje *ed);
1715 void _edje_script_only_message(Edje *ed, Edje_Message *em);
1716
1717 extern jmp_buf _edje_lua_panic_jmp;
1718 #define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp)
1719
1720 lua_State *_edje_lua_state_get();
1721 lua_State *_edje_lua_new_thread(Edje *ed, lua_State *L);
1722 void _edje_lua_free_thread(Edje *ed, lua_State *L);
1723 void _edje_lua_new_reg(lua_State *L, int index, void *ptr);
1724 void _edje_lua_get_reg(lua_State *L, void *ptr);
1725 void _edje_lua_free_reg(lua_State *L, void *ptr);
1726 void _edje_lua_script_fn_new(Edje *ed);
1727 void _edje_lua_group_fn_new(Edje *ed);
1728 void _edje_lua_init();
1729 void _edje_lua_shutdown();
1730
1731 void __edje_lua_error(const char *file, const char *fnc, int line, lua_State *L, int err_code);
1732 #define _edje_lua_error(L, err_code)                                    \
1733   __edje_lua_error(__FILE__, __FUNCTION__, __LINE__, L, err_code)
1734
1735 Eina_Bool  _edje_lua_script_only(Edje *ed);
1736 void _edje_lua_script_only_init(Edje *ed);
1737 void _edje_lua_script_only_shutdown(Edje *ed);
1738 void _edje_lua_script_only_show(Edje *ed);
1739 void _edje_lua_script_only_hide(Edje *ed);
1740 void _edje_lua_script_only_move(Edje *ed);
1741 void _edje_lua_script_only_resize(Edje *ed);
1742 void _edje_lua_script_only_message(Edje *ed, Edje_Message *em);
1743
1744 void _edje_entry_init(Edje *ed);
1745 void _edje_entry_shutdown(Edje *ed);
1746 void _edje_entry_real_part_init(Edje_Real_Part *rp);
1747 void _edje_entry_real_part_shutdown(Edje_Real_Part *rp);
1748 void _edje_entry_real_part_configure(Edje_Real_Part *rp);
1749 const char *_edje_entry_selection_get(Edje_Real_Part *rp);
1750 const char *_edje_entry_text_get(Edje_Real_Part *rp);
1751 void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
1752 void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
1753 void _edje_entry_set_cursor_start(Edje_Real_Part *rp);
1754 void _edje_entry_set_cursor_end(Edje_Real_Part *rp);
1755 void _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst);
1756 void _edje_entry_select_none(Edje_Real_Part *rp);
1757 void _edje_entry_select_all(Edje_Real_Part *rp);
1758 void _edje_entry_select_begin(Edje_Real_Part *rp);
1759 void _edje_entry_select_extend(Edje_Real_Part *rp);
1760 const Eina_List *_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor);
1761 const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp);
1762 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);
1763 const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp);
1764 void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
1765 void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow);
1766 Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp);
1767 void _edje_entry_select_abort(Edje_Real_Part *rp);
1768
1769 Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur);
1770 Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur);
1771 Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur);
1772 Eina_Bool _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur);
1773 void _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur);
1774 void _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur);
1775 void _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur);
1776 void _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur);
1777 Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y);
1778 Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur);
1779 Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur);
1780 const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur);
1781 void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos);
1782 int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur);
1783     
1784 void _edje_external_init();
1785 void _edje_external_shutdown();
1786 Evas_Object *_edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name);
1787 void _edje_external_signal_emit(Evas_Object *obj, const char *emission, const char *source);
1788 Eina_Bool _edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param) EINA_ARG_NONNULL(1, 2);
1789 Eina_Bool _edje_external_param_get(const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param) EINA_ARG_NONNULL(1, 2);
1790 Evas_Object *_edje_external_content_get(const Evas_Object *obj, const char *content) EINA_ARG_NONNULL(1, 2);
1791 void _edje_external_params_free(Eina_List *params, Eina_Bool free_strings);
1792 void _edje_external_recalc_apply(Edje *ed, Edje_Real_Part *ep,
1793                                  Edje_Calc_Params *params,
1794                                  Edje_Part_Description_Common *chosen_desc);
1795 void *_edje_external_params_parse(Evas_Object *obj, const Eina_List *params);
1796 void _edje_external_parsed_params_free(Evas_Object *obj, void *params);
1797
1798 EAPI void _edje_module_init();
1799 EAPI void _edje_module_shutdown();
1800
1801 static inline Eina_Bool
1802 edje_program_is_strncmp(const char *str)
1803 {
1804    size_t length;
1805
1806    length = strlen(str);
1807
1808    if (strpbrk(str, "*?[\\") != str + length)
1809      return EINA_FALSE;
1810    if (str[length] == '['
1811        || str[length] == '\\')
1812      return EINA_FALSE;
1813    return EINA_TRUE;
1814 }
1815
1816 static inline Eina_Bool
1817 edje_program_is_strrncmp(const char *str)
1818 {
1819    if (*str != '*' && *str != '?')
1820      return EINA_FALSE;
1821    if (strpbrk(str + 1, "*?[\\"))
1822      return EINA_FALSE;
1823    return EINA_TRUE;
1824 }
1825
1826 EAPI void _edje_program_insert(Edje_Part_Collection *ed, Edje_Program *p);
1827 EAPI void _edje_program_remove(Edje_Part_Collection *ed, Edje_Program *p);
1828
1829 void _edje_lua2_error_full(const char *file, const char *fnc, int line, lua_State *L, int err_code);
1830 #define _edje_lua2_error(L, err_code) _edje_lua2_error_full(__FILE__, __FUNCTION__, __LINE__, L, err_code)
1831 void _edje_lua2_script_init(Edje *ed);
1832 void _edje_lua2_script_shutdown(Edje *ed);
1833 void _edje_lua2_script_load(Edje_Part_Collection *edc, void *data, int size);
1834 void _edje_lua2_script_unload(Edje_Part_Collection *edc);
1835
1836 void _edje_lua2_script_func_shutdown(Edje *ed);
1837 void _edje_lua2_script_func_show(Edje *ed);
1838 void _edje_lua2_script_func_hide(Edje *ed);
1839 void _edje_lua2_script_func_move(Edje *ed);
1840 void _edje_lua2_script_func_resize(Edje *ed);
1841 void _edje_lua2_script_func_message(Edje *ed, Edje_Message *em);
1842 void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
1843
1844 const char *edje_string_get(const Edje_String *es);
1845 const char *edje_string_id_get(const Edje_String *es);
1846
1847 void _edje_object_orientation_inform(Evas_Object *obj);
1848
1849 #endif