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