00001 #ifndef _EDJE_PRIVATE_H
00002 #define _EDJE_PRIVATE_H
00003
00004 #ifdef HAVE_CONFIG_H
00005 # include <config.h>
00006 #endif
00007
00008 #ifndef _WIN32
00009 # define _GNU_SOURCE
00010 #endif
00011
00012 #ifdef HAVE_ALLOCA_H
00013 # include <alloca.h>
00014 #elif defined __GNUC__
00015 # define alloca __builtin_alloca
00016 #elif defined _AIX
00017 # define alloca __alloca
00018 #elif defined _MSC_VER
00019 # include <malloc.h>
00020 # define alloca _alloca
00021 #else
00022 # include <stddef.h>
00023 void *alloca (size_t);
00024 #endif
00025
00026 #include <string.h>
00027 #include <limits.h>
00028 #include <sys/stat.h>
00029 #include <time.h>
00030 #include <sys/time.h>
00031 #include <errno.h>
00032
00033 #ifndef _MSC_VER
00034 # include <libgen.h>
00035 # include <unistd.h>
00036 #endif
00037
00038 #include <lua.h>
00039 #include <lualib.h>
00040 #include <lauxlib.h>
00041 #include <setjmp.h>
00042
00043 #ifdef HAVE_LOCALE_H
00044 # include <locale.h>
00045 #endif
00046
00047 #ifdef HAVE_EVIL
00048 # include <Evil.h>
00049 #endif
00050
00051 #include <Eina.h>
00052 #include <Eet.h>
00053 #include <Evas.h>
00054 #include <Ecore.h>
00055 #include <Ecore_File.h>
00056 #ifdef HAVE_ECORE_IMF
00057 # include <Ecore_IMF.h>
00058 # include <Ecore_IMF_Evas.h>
00059 #endif
00060 #include <Embryo.h>
00061
00062 #include "Edje.h"
00063
00064 EAPI extern int _edje_default_log_dom ;
00065
00066 #ifdef EDJE_DEFAULT_LOG_COLOR
00067 # undef EDJE_DEFAULT_LOG_COLOR
00068 #endif
00069 #define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
00070 #ifdef ERR
00071 # undef ERR
00072 #endif
00073 #define ERR(...) EINA_LOG_DOM_ERR(_edje_default_log_dom, __VA_ARGS__)
00074 #ifdef INF
00075 # undef INF
00076 #endif
00077 #define INF(...) EINA_LOG_DOM_INFO(_edje_default_log_dom, __VA_ARGS__)
00078 #ifdef WRN
00079 # undef WRN
00080 #endif
00081 #define WRN(...) EINA_LOG_DOM_WARN(_edje_default_log_dom, __VA_ARGS__)
00082 #ifdef CRIT
00083 # undef CRIT
00084 #endif
00085 #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__)
00086 #ifdef __GNUC__
00087 # if __GNUC__ >= 4
00088
00089
00090 # endif
00091 #endif
00092
00093 #ifndef ABS
00094 #define ABS(x) ((x) < 0 ? -(x) : (x))
00095 #endif
00096
00097 #ifndef CLAMP
00098 #define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
00099 #endif
00100
00101 #ifndef MIN
00102 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
00103 #endif
00104
00105
00106 #ifdef BUILD_EDJE_FP
00107
00108 #define FLOAT_T Eina_F32p32
00109 #define EDJE_T_FLOAT EET_T_F32P32
00110 #define MUL(a, b) eina_f32p32_mul(a, b)
00111 #define SCALE(a, b) eina_f32p32_scale(a, b)
00112 #define DIV(a, b) eina_f32p32_div(a, b)
00113 #define DIV2(a) ((a) >> 1)
00114 #define ADD(a, b) eina_f32p32_add(a, b)
00115 #define SUB(a, b) eina_f32p32_sub(a, b)
00116 #define SQRT(a) eina_f32p32_sqrt(a)
00117 #define TO_DOUBLE(a) eina_f32p32_double_to(a)
00118 #define FROM_DOUBLE(a) eina_f32p32_double_from(a)
00119 #define FROM_INT(a) eina_f32p32_int_from(a)
00120 #define TO_INT(a) eina_f32p32_int_to(a)
00121 #define ZERO 0
00122 #define COS(a) eina_f32p32_cos(a)
00123 #define SIN(a) eina_f32p32_sin(a)
00124 #define PI EINA_F32P32_PI
00125
00126 #else
00127
00128 #define FLOAT_T double
00129 #define EDJE_T_FLOAT EET_T_DOUBLE
00130 #define MUL(a, b) ((a) * (b))
00131 #define SCALE(a, b) ((a) * (double)(b))
00132 #define DIV(a, b) ((a) / (b))
00133 #define DIV2(a) ((a) / 2.0)
00134 #define ADD(a, b) ((a) + (b))
00135 #define SUB(a, b) ((a) - (b))
00136 #define SQRT(a) sqrt(a)
00137 #define TO_DOUBLE(a) (double)(a)
00138 #define FROM_DOUBLE(a) (a)
00139 #define FROM_INT(a) (double)(a)
00140 #define TO_INT(a) (int)(a)
00141 #define ZERO 0.0
00142 #define COS(a) cos(a)
00143 #define SIN(a) sin(a)
00144 #define PI 3.14159265358979323846
00145
00146 #endif
00147
00148
00149
00150 #define EDJE_SMART_API_VERSION 1
00151
00152 typedef struct _Edje_Smart_Api Edje_Smart_Api;
00153
00154 struct _Edje_Smart_Api
00155 {
00156 Evas_Smart_Class base;
00157 int version;
00158 Eina_Bool (*file_set)(Evas_Object *obj, const char *file, const char *group);
00159 };
00160
00161
00162 #define EDJE_SMART_API_INIT(smart_class_init) {smart_class_init, EDJE_SMART_API_VERSION, NULL}
00163
00164 #define EDJE_SMART_API_INIT_NULL EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NULL)
00165 #define EDJE_SMART_API_INIT_VERSION EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_VERSION)
00166 #define EDJE_SMART_API_INIT_NAME_VERSION(name) EDJE_SMART_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
00167
00168
00169
00170
00171 #define EDJE_FILE_VERSION 3
00172
00173
00174
00175 #define EDJE_FILE_MINOR 1
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 typedef enum
00190 {
00191 EDJE_ASPECT_PREFER_NONE,
00192 EDJE_ASPECT_PREFER_VERTICAL,
00193 EDJE_ASPECT_PREFER_HORIZONTAL,
00194 EDJE_ASPECT_PREFER_BOTH
00195 } Edje_Internal_Aspect;
00196
00197 struct _Edje_Perspective
00198 {
00199 Evas_Object *obj;
00200 Evas *e;
00201 Evas_Coord px, py, z0, foc;
00202 Eina_List *users;
00203 Eina_Bool global : 1;
00204 };
00205
00206 struct _Edje_Position_Scale
00207 {
00208 FLOAT_T x, y;
00209 };
00210
00211 struct _Edje_Position
00212 {
00213 int x, y;
00214 };
00215
00216 struct _Edje_Size
00217 {
00218 int w, h;
00219 };
00220
00221 struct _Edje_Rectangle
00222 {
00223 int x, y, w, h;
00224 };
00225
00226 struct _Edje_Color
00227 {
00228 unsigned char r, g, b, a;
00229 };
00230
00231 struct _Edje_Aspect_Prefer
00232 {
00233 FLOAT_T min, max;
00234 Edje_Internal_Aspect prefer;
00235 };
00236
00237 struct _Edje_Aspect
00238 {
00239 int w, h;
00240 Edje_Aspect_Control mode;
00241 };
00242
00243 struct _Edje_String
00244 {
00245 const char *str;
00246 unsigned int id;
00247 };
00248
00249 typedef struct _Edje_Position_Scale Edje_Alignment;
00250 typedef struct _Edje_Position_Scale Edje_Position_Scale;
00251 typedef struct _Edje_Position Edje_Position;
00252 typedef struct _Edje_Size Edje_Size;
00253 typedef struct _Edje_Rectangle Edje_Rectangle;
00254 typedef struct _Edje_Color Edje_Color;
00255 typedef struct _Edje_Aspect_Prefer Edje_Aspect_Prefer;
00256 typedef struct _Edje_Aspect Edje_Aspect;
00257 typedef struct _Edje_String Edje_String;
00258
00259 typedef struct _Edje_File Edje_File;
00260 typedef struct _Edje_Style Edje_Style;
00261 typedef struct _Edje_Style_Tag Edje_Style_Tag;
00262 typedef struct _Edje_External_Directory Edje_External_Directory;
00263 typedef struct _Edje_External_Directory_Entry Edje_External_Directory_Entry;
00264 typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
00265 typedef struct _Edje_Image_Directory Edje_Image_Directory;
00266 typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
00267 typedef struct _Edje_Image_Directory_Set Edje_Image_Directory_Set;
00268 typedef struct _Edje_Image_Directory_Set_Entry Edje_Image_Directory_Set_Entry;
00269 typedef struct _Edje_Program Edje_Program;
00270 typedef struct _Edje_Program_Target Edje_Program_Target;
00271 typedef struct _Edje_Program_After Edje_Program_After;
00272 typedef struct _Edje_Part_Collection_Directory_Entry Edje_Part_Collection_Directory_Entry;
00273 typedef struct _Edje_Pack_Element Edje_Pack_Element;
00274 typedef struct _Edje_Part_Collection Edje_Part_Collection;
00275 typedef struct _Edje_Part Edje_Part;
00276 typedef struct _Edje_Part_Api Edje_Part_Api;
00277 typedef struct _Edje_Part_Dragable Edje_Part_Dragable;
00278 typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
00279 typedef struct _Edje_Part_Description_Image Edje_Part_Description_Image;
00280 typedef struct _Edje_Part_Description_Text Edje_Part_Description_Text;
00281 typedef struct _Edje_Part_Description_Box Edje_Part_Description_Box;
00282 typedef struct _Edje_Part_Description_Table Edje_Part_Description_Table;
00283 typedef struct _Edje_Part_Description_External Edje_Part_Description_External;
00284 typedef struct _Edje_Part_Description_Common Edje_Part_Description_Common;
00285 typedef struct _Edje_Part_Description_Spec_Fill Edje_Part_Description_Spec_Fill;
00286 typedef struct _Edje_Part_Description_Spec_Border Edje_Part_Description_Spec_Border;
00287 typedef struct _Edje_Part_Description_Spec_Image Edje_Part_Description_Spec_Image;
00288 typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text;
00289 typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box;
00290 typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table;
00291 typedef struct _Edje_Patterns Edje_Patterns;
00292 typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation;
00293
00294 #define EDJE_INF_MAX_W 100000
00295 #define EDJE_INF_MAX_H 100000
00296
00297 #define EDJE_IMAGE_SOURCE_TYPE_NONE 0
00298 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT 1
00299 #define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY 2
00300 #define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL 3
00301 #define EDJE_IMAGE_SOURCE_TYPE_LAST 4
00302
00303 #define EDJE_VAR_NONE 0
00304 #define EDJE_VAR_INT 1
00305 #define EDJE_VAR_FLOAT 2
00306 #define EDJE_VAR_STRING 3
00307 #define EDJE_VAR_LIST 4
00308 #define EDJE_VAR_HASH 5
00309
00310 #define EDJE_VAR_MAGIC_BASE 0x12fe84ba
00311
00312 #define EDJE_STATE_PARAM_NONE 0
00313 #define EDJE_STATE_PARAM_ALIGNMENT 1
00314 #define EDJE_STATE_PARAM_MIN 2
00315 #define EDJE_STATE_PARAM_MAX 3
00316 #define EDJE_STATE_PARAM_STEP 4
00317 #define EDJE_STATE_PARAM_ASPECT 5
00318 #define EDJE_STATE_PARAM_ASPECT_PREF 6
00319 #define EDJE_STATE_PARAM_COLOR 7
00320 #define EDJE_STATE_PARAM_COLOR2 8
00321 #define EDJE_STATE_PARAM_COLOR3 9
00322 #define EDJE_STATE_PARAM_COLOR_CLASS 10
00323 #define EDJE_STATE_PARAM_REL1 11
00324 #define EDJE_STATE_PARAM_REL1_TO 12
00325 #define EDJE_STATE_PARAM_REL1_OFFSET 13
00326 #define EDJE_STATE_PARAM_REL2 14
00327 #define EDJE_STATE_PARAM_REL2_TO 15
00328 #define EDJE_STATE_PARAM_REL2_OFFSET 16
00329 #define EDJE_STATE_PARAM_IMAGE 17
00330 #define EDJE_STATE_PARAM_BORDER 18
00331 #define EDJE_STATE_PARAM_FILL_SMOOTH 19
00332 #define EDJE_STATE_PARAM_FILL_POS 20
00333 #define EDJE_STATE_PARAM_FILL_SIZE 21
00334 #define EDJE_STATE_PARAM_TEXT 22
00335 #define EDJE_STATE_PARAM_TEXT_CLASS 23
00336 #define EDJE_STATE_PARAM_TEXT_FONT 24
00337 #define EDJE_STATE_PARAM_TEXT_STYLE 25
00338 #define EDJE_STATE_PARAM_TEXT_SIZE 26
00339 #define EDJE_STATE_PARAM_TEXT_FIT 27
00340 #define EDJE_STATE_PARAM_TEXT_MIN 28
00341 #define EDJE_STATE_PARAM_TEXT_MAX 29
00342 #define EDJE_STATE_PARAM_TEXT_ALIGN 30
00343 #define EDJE_STATE_PARAM_VISIBLE 31
00344 #define EDJE_STATE_PARAM_MAP_OM 32
00345 #define EDJE_STATE_PARAM_MAP_PERSP 33
00346 #define EDJE_STATE_PARAM_MAP_LIGNT 34
00347 #define EDJE_STATE_PARAM_MAP_ROT_CENTER 35
00348 #define EDJE_STATE_PARAM_MAP_ROT_X 36
00349 #define EDJE_STATE_PARAM_MAP_ROT_Y 37
00350 #define EDJE_STATE_PARAM_MAP_ROT_Z 38
00351 #define EDJE_STATE_PARAM_MAP_BACK_CULL 39
00352 #define EDJE_STATE_PARAM_MAP_PERSP_ON 40
00353 #define EDJE_STATE_PARAM_PERSP_ZPLANE 41
00354 #define EDJE_STATE_PARAM_PERSP_FOCAL 42
00355 #define EDJE_STATE_PARAM_LAST 43
00356
00357 #define EDJE_ENTRY_EDIT_MODE_NONE 0
00358 #define EDJE_ENTRY_EDIT_MODE_SELECTABLE 1
00359 #define EDJE_ENTRY_EDIT_MODE_EDITABLE 2
00360 #define EDJE_ENTRY_EDIT_MODE_PASSWORD 3
00361
00362 #define EDJE_ENTRY_SELECTION_MODE_DEFAULT 0
00363 #define EDJE_ENTRY_SELECTION_MODE_EXPLICIT 1
00364
00365 #define EDJE_PART_PATH_SEPARATOR ':'
00366 #define EDJE_PART_PATH_SEPARATOR_STRING ":"
00367 #define EDJE_PART_PATH_SEPARATOR_INDEXL '['
00368 #define EDJE_PART_PATH_SEPARATOR_INDEXR ']'
00369
00370
00371 struct _Edje_File
00372 {
00373 const char *path;
00374 time_t mtime;
00375
00376 Edje_External_Directory *external_dir;
00377 Edje_Image_Directory *image_dir;
00378 Eina_List *styles;
00379 Eina_List *color_classes;
00380
00381 int references;
00382 const char *compiler;
00383 int version;
00384 int minor;
00385 int feature_ver;
00386
00387 Eina_Hash *data;
00388 Eina_Hash *fonts;
00389
00390 Eina_Hash *collection;
00391 Eina_List *collection_cache;
00392
00393 Edje_Patterns *collection_patterns;
00394
00395 Eet_File *ef;
00396
00397 unsigned char free_strings : 1;
00398 unsigned char dangling : 1;
00399 unsigned char warning : 1;
00400 };
00401
00402 struct _Edje_Style
00403 {
00404 char *name;
00405 Eina_List *tags;
00406 Evas_Textblock_Style *style;
00407 };
00408
00409 struct _Edje_Style_Tag
00410 {
00411 const char *key;
00412 const char *value;
00413 const char *font;
00414 double font_size;
00415 const char *text_class;
00416 };
00417
00418
00419
00420
00421 struct _Edje_Font_Directory_Entry
00422 {
00423 const char *entry;
00424 const char *file;
00425 };
00426
00427
00428
00429 struct _Edje_External_Directory
00430 {
00431 Edje_External_Directory_Entry *entries;
00432 unsigned int entries_count;
00433 };
00434
00435 struct _Edje_External_Directory_Entry
00436 {
00437 const char *entry;
00438 };
00439
00440
00441
00442
00443
00444
00445
00446
00447 struct _Edje_Image_Directory
00448 {
00449 Edje_Image_Directory_Entry *entries;
00450 unsigned int entries_count;
00451
00452 Edje_Image_Directory_Set *sets;
00453 unsigned int sets_count;
00454 };
00455
00456 struct _Edje_Image_Directory_Entry
00457 {
00458 const char *entry;
00459 int source_type;
00460 int source_param;
00461 int id;
00462 };
00463
00464 struct _Edje_Image_Directory_Set
00465 {
00466 char *name;
00467 Eina_List *entries;
00468
00469 int id;
00470 };
00471
00472 struct _Edje_Image_Directory_Set_Entry
00473 {
00474 const char *name;
00475 int id;
00476
00477 struct {
00478 struct {
00479 int w;
00480 int h;
00481 } min, max;
00482 } size;
00483 };
00484
00485
00486
00487 struct _Edje_Program
00488 {
00489 int id;
00490 const char *name;
00491
00492 const char *signal;
00493 const char *source;
00494
00495 struct {
00496 const char *part;
00497 const char *state;
00498 } filter;
00499
00500 struct {
00501 double from;
00502 double range;
00503 } in;
00504
00505 int action;
00506 const char *state;
00507 const char *state2;
00508 double value;
00509 double value2;
00510
00511 struct {
00512 int mode;
00513 FLOAT_T time;
00514 } tween;
00515
00516 Eina_List *targets;
00517
00518 Eina_List *after;
00519
00520 struct {
00521 const char *name;
00522 const char *description;
00523 } api;
00524
00525
00526 struct {
00527 int src;
00528 int dst;
00529 } param;
00530 };
00531
00532 struct _Edje_Program_Target
00533 {
00534 int id;
00535 };
00536
00537 struct _Edje_Program_After
00538 {
00539 int id;
00540 };
00541
00542
00543
00544 struct _Edje_Part_Collection_Directory_Entry
00545 {
00546 const char *entry;
00547 int id;
00548
00549 struct
00550 {
00551 int RECTANGLE;
00552 int TEXT;
00553 int IMAGE;
00554 int SWALLOW;
00555 int TEXTBLOCK;
00556 int GROUP;
00557 int BOX;
00558 int TABLE;
00559 int EXTERNAL;
00560 int part;
00561 } count;
00562
00563 struct
00564 {
00565 Eina_Mempool *RECTANGLE;
00566 Eina_Mempool *TEXT;
00567 Eina_Mempool *IMAGE;
00568 Eina_Mempool *SWALLOW;
00569 Eina_Mempool *TEXTBLOCK;
00570 Eina_Mempool *GROUP;
00571 Eina_Mempool *BOX;
00572 Eina_Mempool *TABLE;
00573 Eina_Mempool *EXTERNAL;
00574 Eina_Mempool *part;
00575 } mp;
00576
00577 Edje_Part_Collection *ref;
00578 };
00579
00580
00581
00582
00583
00584 struct _Edje_Pack_Element
00585 {
00586 unsigned char type;
00587 const char *name;
00588 const char *source;
00589 Edje_Size min, prefer, max;
00590 struct {
00591 int l, r, t, b;
00592 } padding;
00593 Edje_Alignment align;
00594 Edje_Alignment weight;
00595 Edje_Aspect aspect;
00596 const char *options;
00597
00598 int col, row;
00599 unsigned short colspan, rowspan;
00600 };
00601
00602
00603
00604 struct _Edje_Part_Collection
00605 {
00606 struct {
00607 Edje_Program **fnmatch;
00608 unsigned int fnmatch_count;
00609
00610 Edje_Program **strcmp;
00611 unsigned int strcmp_count;
00612
00613 Edje_Program **strncmp;
00614 unsigned int strncmp_count;
00615
00616 Edje_Program **strrncmp;
00617 unsigned int strrncmp_count;
00618
00619 Edje_Program **nocmp;
00620 unsigned int nocmp_count;
00621 } programs;
00622
00623 Edje_Part **parts;
00624 unsigned int parts_count;
00625
00626 Eina_Hash *data;
00627
00628 int id;
00629
00630 Eina_Hash *alias;
00631 Eina_Hash *aliased;
00632
00633 struct {
00634 Edje_Size min, max;
00635 } prop;
00636
00637 int references;
00638
00639 #ifdef EDJE_PROGRAM_CACHE
00640 struct {
00641 Eina_Hash *no_matches;
00642 Eina_Hash *matches;
00643 } prog_cache;
00644 #endif
00645
00646 Embryo_Program *script;
00647 const char *part;
00648
00649 unsigned char script_only;
00650
00651 unsigned char lua_script_only;
00652
00653 unsigned char checked : 1;
00654 };
00655
00656 struct _Edje_Part_Dragable
00657 {
00658 int step_x;
00659 int step_y;
00660
00661 int count_x;
00662 int count_y;
00663
00664 int confine_id;
00665
00666
00667 int event_id;
00668
00669 signed char x;
00670 signed char y;
00671 };
00672
00673 struct _Edje_Part_Api
00674 {
00675 const char *name;
00676 const char *description;
00677 };
00678
00679 typedef struct _Edje_Part_Description_List Edje_Part_Description_List;
00680 struct _Edje_Part_Description_List
00681 {
00682 Edje_Part_Description_Common **desc;
00683 unsigned int desc_count;
00684 };
00685
00686 struct _Edje_Part
00687 {
00688 const char *name;
00689 Edje_Part_Description_Common *default_desc;
00690
00691 Edje_Part_Description_List other;
00692
00693 const char *source, *source2, *source3, *source4, *source5, *source6;
00694 int id;
00695 int clip_to_id;
00696 Edje_Part_Dragable dragable;
00697 Edje_Pack_Element **items;
00698 unsigned int items_count;
00699 unsigned char type;
00700 unsigned char effect;
00701 unsigned char mouse_events;
00702 unsigned char repeat_events;
00703 Evas_Event_Flags ignore_flags;
00704 unsigned char scale;
00705 unsigned char precise_is_inside;
00706 unsigned char use_alternate_font_metrics;
00707 unsigned char pointer_mode;
00708 unsigned char entry_mode;
00709 unsigned char select_mode;
00710 unsigned char multiline;
00711 Edje_Part_Api api;
00712 };
00713
00714 struct _Edje_Part_Image_Id
00715 {
00716 int id;
00717 Eina_Bool set;
00718 };
00719
00720 struct _Edje_Part_Description_Common
00721 {
00722 struct {
00723 double value;
00724 const char *name;
00725 } state;
00726
00727 Edje_Alignment align;
00728
00729 struct {
00730 unsigned char w, h;
00731 } fixed;
00732
00733 Edje_Size min, max;
00734 Edje_Position step;
00735 Edje_Aspect_Prefer aspect;
00736
00737 char *color_class;
00738 Edje_Color color;
00739 Edje_Color color2;
00740
00741 struct {
00742 FLOAT_T relative_x;
00743 FLOAT_T relative_y;
00744 int offset_x;
00745 int offset_y;
00746 int id_x;
00747 int id_y;
00748 } rel1, rel2;
00749
00750 struct {
00751 int id_persp;
00752 int id_light;
00753 struct {
00754 int id_center;
00755 FLOAT_T x, y, z;
00756 } rot;
00757 unsigned char backcull;
00758 unsigned char on;
00759 unsigned char persp_on;
00760 unsigned char smooth;
00761 unsigned char alpha;
00762 } map;
00763
00764 struct {
00765 int zplane;
00766 int focal;
00767 } persp;
00768
00769 unsigned char visible;
00770 };
00771
00772 struct _Edje_Part_Description_Spec_Fill
00773 {
00774 FLOAT_T pos_rel_x;
00775 FLOAT_T rel_x;
00776 FLOAT_T pos_rel_y;
00777 FLOAT_T rel_y;
00778 int pos_abs_x;
00779 int abs_x;
00780 int pos_abs_y;
00781 int abs_y;
00782 int angle;
00783 int spread;
00784 char smooth;
00785 unsigned char type;
00786 };
00787
00788 struct _Edje_Part_Description_Spec_Border
00789 {
00790 int l, r, t, b;
00791 unsigned char no_fill;
00792 unsigned char scale;
00793 };
00794
00795 struct _Edje_Part_Description_Spec_Image
00796 {
00797 Edje_Part_Image_Id **tweens;
00798 unsigned int tweens_count;
00799
00800 int id;
00801 int scale_hint;
00802 Eina_Bool set;
00803
00804 Edje_Part_Description_Spec_Border border;
00805 Edje_Part_Description_Spec_Fill fill;
00806 };
00807
00808 struct _Edje_Part_Description_Spec_Text
00809 {
00810 Edje_String text;
00811 char *text_class;
00812 Edje_String style;
00813 Edje_String font;
00814 Edje_String repch;
00815
00816 Edje_Alignment align;
00817 Edje_Color color3;
00818
00819 double elipsis;
00820 int size;
00821 int id_source;
00822 int id_text_source;
00823
00824 unsigned char fit_x;
00825 unsigned char fit_y;
00826 unsigned char min_x;
00827 unsigned char min_y;
00828 unsigned char max_x;
00829 unsigned char max_y;
00830 };
00831
00832 struct _Edje_Part_Description_Spec_Box
00833 {
00834 char *layout, *alt_layout;
00835 Edje_Alignment align;
00836 struct {
00837 int x, y;
00838 } padding;
00839 struct {
00840 Eina_Bool h, v;
00841 } min;
00842 };
00843
00844 struct _Edje_Part_Description_Spec_Table
00845 {
00846 unsigned char homogeneous;
00847 Edje_Alignment align;
00848 struct {
00849 int x, y;
00850 } padding;
00851 };
00852
00853 struct _Edje_Part_Description_Image
00854 {
00855 Edje_Part_Description_Common common;
00856 Edje_Part_Description_Spec_Image image;
00857 };
00858
00859 struct _Edje_Part_Description_Text
00860 {
00861 Edje_Part_Description_Common common;
00862 Edje_Part_Description_Spec_Text text;
00863 };
00864
00865 struct _Edje_Part_Description_Box
00866 {
00867 Edje_Part_Description_Common common;
00868 Edje_Part_Description_Spec_Box box;
00869 };
00870
00871 struct _Edje_Part_Description_Table
00872 {
00873 Edje_Part_Description_Common common;
00874 Edje_Part_Description_Spec_Table table;
00875 };
00876
00877 struct _Edje_Part_Description_External
00878 {
00879 Edje_Part_Description_Common common;
00880 Eina_List *external_params;
00881 };
00882
00883
00884
00885
00886 typedef struct _Edje Edje;
00887 typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
00888 typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
00889 typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
00890 typedef struct _Edje_Real_Part Edje_Real_Part;
00891 typedef struct _Edje_Running_Program Edje_Running_Program;
00892 typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
00893 typedef struct _Edje_Calc_Params Edje_Calc_Params;
00894 typedef struct _Edje_Pending_Program Edje_Pending_Program;
00895 typedef struct _Edje_Text_Style Edje_Text_Style;
00896 typedef struct _Edje_Color_Class Edje_Color_Class;
00897 typedef struct _Edje_Text_Class Edje_Text_Class;
00898 typedef struct _Edje_Var Edje_Var;
00899 typedef struct _Edje_Var_Int Edje_Var_Int;
00900 typedef struct _Edje_Var_Float Edje_Var_Float;
00901 typedef struct _Edje_Var_String Edje_Var_String;
00902 typedef struct _Edje_Var_List Edje_Var_List;
00903 typedef struct _Edje_Var_Hash Edje_Var_Hash;
00904 typedef struct _Edje_Var_Animator Edje_Var_Animator;
00905 typedef struct _Edje_Var_Timer Edje_Var_Timer;
00906 typedef struct _Edje_Var_Pool Edje_Var_Pool;
00907 typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char;
00908 typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback;
00909
00910 struct _Edje_Signal_Source_Char
00911 {
00912 EINA_RBTREE;
00913
00914 const char *signal;
00915 const char *source;
00916
00917 Eina_List *list;
00918 };
00919
00920 struct _Edje_Signals_Sources_Patterns
00921
00922 {
00923 Edje_Patterns *signals_patterns;
00924 Edje_Patterns *sources_patterns;
00925
00926 Eina_Rbtree *exact_match;
00927
00928 union {
00929 struct {
00930 Edje_Program **globing;
00931 unsigned int count;
00932 } programs;
00933 struct {
00934 Eina_List *globing;
00935 } callbacks;
00936 } u;
00937 };
00938
00939 typedef struct _Edje_Signals_Sources_Patterns Edje_Signals_Sources_Patterns;
00940
00941 struct _Edje
00942 {
00943 const Edje_Smart_Api *api;
00944 const char *path;
00945 const char *group;
00946 const char *parent;
00947
00948 Evas_Coord x, y, w, h;
00949 Edje_Size min;
00950 double paused_at;
00951 Evas *evas;
00952 Evas_Object *obj;
00953 Evas_Object *clipper;
00954 Edje_File *file;
00955 Edje_Part_Collection *collection;
00956 Eina_List *actions;
00957 Eina_List *callbacks;
00958 Eina_List *pending_actions;
00959 Eina_List *color_classes;
00960 Eina_List *text_classes;
00961
00962 Edje_Var_Pool *var_pool;
00963
00964 Edje_Real_Part **table_parts;
00965 Edje_Program **table_programs;
00966 Edje_Real_Part *focused_part;
00967 Eina_List *subobjs;
00968 Eina_List *text_insert_filter_callbacks;
00969 void *script_only_data;
00970 int table_programs_size;
00971 unsigned int table_parts_size;
00972
00973 Edje_Perspective *persp;
00974
00975 struct {
00976 Edje_Signals_Sources_Patterns callbacks;
00977 Edje_Signals_Sources_Patterns programs;
00978 } patterns;
00979
00980 int references;
00981 int block;
00982 int load_error;
00983 int freeze;
00984 FLOAT_T scale;
00985
00986 struct {
00987 Edje_Text_Change_Cb func;
00988 void *data;
00989 } text_change;
00990
00991 struct {
00992 Edje_Message_Handler_Cb func;
00993 void *data;
00994 int num;
00995 } message;
00996 int processing_messages;
00997
00998 int state;
00999
01000 int preload_count;
01001
01002 unsigned int dirty : 1;
01003 unsigned int recalc : 1;
01004 unsigned int walking_callbacks : 1;
01005 unsigned int delete_callbacks : 1;
01006 unsigned int just_added_callbacks : 1;
01007 unsigned int have_objects : 1;
01008 unsigned int paused : 1;
01009 unsigned int no_anim : 1;
01010 unsigned int calc_only : 1;
01011 unsigned int walking_actions : 1;
01012 unsigned int block_break : 1;
01013 unsigned int delete_me : 1;
01014 unsigned int postponed : 1;
01015 unsigned int freeze_calc : 1;
01016 unsigned int has_entries : 1;
01017 unsigned int entries_inited : 1;
01018 #ifdef EDJE_CALC_CACHE
01019 unsigned int text_part_change : 1;
01020 unsigned int all_part_change : 1;
01021 #endif
01022 unsigned int have_mapped_part : 1;
01023
01024 lua_State *L;
01025 Eina_Inlist *lua_objs;
01026 int lua_ref;
01027
01028 struct {
01029 Edje_Item_Provider_Cb func;
01030 void *data;
01031 } item_provider;
01032 };
01033
01034 struct _Edje_Calc_Params
01035 {
01036 int x, y, w, h;
01037 Edje_Rectangle req;
01038 Edje_Rectangle req_drag;
01039 Edje_Color color;
01040 union {
01041 struct {
01042 struct {
01043 int x, y, w, h;
01044 int angle;
01045 int spread;
01046 } fill;
01047
01048 union {
01049 struct {
01050 int l, r, t, b;
01051 } image;
01052 } spec;
01053 } common;
01054 struct {
01055 Edje_Alignment align;
01056 double elipsis;
01057 int size;
01058 Edje_Color color2, color3;
01059 } text;
01060 } type;
01061 unsigned char visible : 1;
01062 unsigned char smooth : 1;
01063 };
01064
01065 struct _Edje_Real_Part_Set
01066 {
01067 Edje_Image_Directory_Set_Entry *entry;
01068 Edje_Image_Directory_Set *set;
01069
01070 int id;
01071 };
01072
01073 struct _Edje_Real_Part_State
01074 {
01075 Edje_Part_Description_Common *description;
01076 Edje_Real_Part *rel1_to_x;
01077 Edje_Real_Part *rel1_to_y;
01078 Edje_Real_Part *rel2_to_x;
01079 Edje_Real_Part *rel2_to_y;
01080 #ifdef EDJE_CALC_CACHE
01081 int state;
01082 Edje_Calc_Params p;
01083 #endif
01084 void *external_params;
01085 Edje_Real_Part_Set *set;
01086 };
01087
01088
01089 struct _Edje_Real_Part_Drag
01090 {
01091 FLOAT_T x, y;
01092 Edje_Position_Scale val, size, step, page;
01093 struct {
01094 unsigned int count;
01095 int x, y;
01096 } down;
01097 struct {
01098 int x, y;
01099 } tmp;
01100 unsigned char need_reset : 1;
01101 Edje_Real_Part *confine_to;
01102 };
01103
01104 struct _Edje_Real_Part
01105 {
01106 Edje *edje;
01107 Edje_Part *part;
01108 Evas_Object *object;
01109 int x, y, w, h;
01110 Edje_Rectangle req;
01111
01112 Eina_List *items;
01113 Edje_Part_Box_Animation *anim;
01114 void *entry_data;
01115 Evas_Object *cursorbg_object;
01116 Evas_Object *cursorfg_object;
01117
01118 Evas_Object *swallowed_object;
01119 struct {
01120 Edje_Size min, max;
01121 Edje_Aspect aspect;
01122 } swallow_params;
01123
01124 Edje_Real_Part_Drag *drag;
01125 Edje_Real_Part *events_to;
01126
01127 struct {
01128 Edje_Real_Part *source;
01129 Edje_Real_Part *text_source;
01130 const char *text;
01131 Edje_Position offset;
01132 const char *font;
01133 const char *style;
01134 int size;
01135 struct {
01136 double in_w, in_h;
01137 int in_size;
01138 const char *in_str;
01139 const char *out_str;
01140 int out_size;
01141 FLOAT_T align_x, align_y;
01142 double elipsis;
01143 int fit_x, fit_y;
01144 } cache;
01145 } text;
01146
01147
01148
01149 FLOAT_T description_pos;
01150 Edje_Part_Description_Common *chosen_description;
01151 Edje_Real_Part_State param1;
01152
01153 Edje_Real_Part_State *param2, *custom;
01154
01155 #ifdef EDJE_CALC_CACHE
01156 int state;
01157 #endif
01158
01159 Edje_Real_Part *clip_to;
01160
01161 Edje_Running_Program *program;
01162
01163 int clicked_button;
01164
01165 unsigned char calculated;
01166 unsigned char calculating;
01167
01168 unsigned char still_in : 1;
01169 #ifdef EDJE_CALC_CACHE
01170 unsigned char invalidate : 1;
01171 #endif
01172 };
01173
01174
01175 struct _Edje_Running_Program
01176 {
01177 Edje *edje;
01178 Edje_Program *program;
01179 double start_time;
01180 char delete_me : 1;
01181 };
01182
01183 struct _Edje_Signal_Callback
01184 {
01185 const char *signal;
01186 const char *source;
01187 Edje_Signal_Cb func;
01188 void *data;
01189 unsigned char just_added : 1;
01190 unsigned char delete_me : 1;
01191 };
01192
01193 struct _Edje_Text_Insert_Filter_Callback
01194 {
01195 const char *part;
01196 Edje_Text_Filter_Cb func;
01197 void *data;
01198 };
01199
01200 struct _Edje_Pending_Program
01201 {
01202 Edje *edje;
01203 Edje_Program *program;
01204 Ecore_Timer *timer;
01205 };
01206
01207 struct _Edje_Text_Style
01208 {
01209 struct {
01210 unsigned char x, y;
01211 } offset;
01212 struct {
01213 unsigned char l, r, t, b;
01214 } pad;
01215 int num;
01216 struct {
01217 unsigned char color;
01218 signed char x, y;
01219 unsigned char alpha;
01220 } members[32];
01221 };
01222
01223 struct _Edje_Color_Class
01224 {
01225 const char *name;
01226 unsigned char r, g, b, a;
01227 unsigned char r2, g2, b2, a2;
01228 unsigned char r3, g3, b3, a3;
01229 };
01230
01231 struct _Edje_Text_Class
01232 {
01233 const char *name;
01234 const char *font;
01235 Evas_Font_Size size;
01236 };
01237
01238 struct _Edje_Var_Int
01239 {
01240 int v;
01241 };
01242
01243 struct _Edje_Var_Float
01244 {
01245 double v;
01246 };
01247
01248 struct _Edje_Var_String
01249 {
01250 char *v;
01251 };
01252
01253 struct _Edje_Var_List
01254 {
01255 Eina_List *v;
01256 };
01257
01258 struct _Edje_Var_Hash
01259 {
01260 Eina_Hash *v;
01261 };
01262
01263 struct _Edje_Var_Timer
01264 {
01265 Edje *edje;
01266 int id;
01267 Embryo_Function func;
01268 int val;
01269 Ecore_Timer *timer;
01270 };
01271
01272 struct _Edje_Var_Animator
01273 {
01274 Edje *edje;
01275 int id;
01276 Embryo_Function func;
01277 int val;
01278 double start, len;
01279 char delete_me;
01280 };
01281
01282 struct _Edje_Var_Pool
01283 {
01284 int id_count;
01285 Eina_List *timers;
01286 Eina_List *animators;
01287 int size;
01288 Edje_Var *vars;
01289 int walking_list;
01290 };
01291
01292 struct _Edje_Var
01293 {
01294 union {
01295 Edje_Var_Int i;
01296 Edje_Var_Float f;
01297 Edje_Var_String s;
01298 Edje_Var_List l;
01299 Edje_Var_Hash h;
01300 } data;
01301 unsigned char type;
01302 };
01303
01304 typedef enum _Edje_Queue
01305 {
01306 EDJE_QUEUE_APP,
01307 EDJE_QUEUE_SCRIPT
01308 } Edje_Queue;
01309
01310 typedef struct _Edje_Message_Signal Edje_Message_Signal;
01311 typedef struct _Edje_Message Edje_Message;
01312
01313 struct _Edje_Message_Signal
01314 {
01315 const char *sig;
01316 const char *src;
01317 };
01318
01319 struct _Edje_Message
01320 {
01321 Edje *edje;
01322 Edje_Queue queue;
01323 Edje_Message_Type type;
01324 int id;
01325 unsigned char *msg;
01326 };
01327
01328 typedef enum _Edje_Fill
01329 {
01330 EDJE_FILL_TYPE_SCALE = 0,
01331 EDJE_FILL_TYPE_TILE
01332 } Edje_Fill;
01333
01334 typedef enum _Edje_Match_Error
01335 {
01336 EDJE_MATCH_OK,
01337 EDJE_MATCH_ALLOC_ERROR,
01338 EDJE_MATCH_SYNTAX_ERROR
01339
01340 } Edje_Match_Error;
01341
01342 typedef struct _Edje_States Edje_States;
01343 struct _Edje_Patterns
01344 {
01345 const char **patterns;
01346
01347 Edje_States *states;
01348
01349 int ref;
01350 Eina_Bool delete_me : 1;
01351
01352 size_t patterns_size;
01353 size_t max_length;
01354 size_t finals[];
01355 };
01356
01357 Edje_Patterns *edje_match_collection_dir_init(const Eina_List *lst);
01358 Edje_Patterns *edje_match_programs_signal_init(Edje_Program * const *array,
01359 unsigned int count);
01360 Edje_Patterns *edje_match_programs_source_init(Edje_Program * const *array,
01361 unsigned int count);
01362 Edje_Patterns *edje_match_callback_signal_init(const Eina_List *lst);
01363 Edje_Patterns *edje_match_callback_source_init(const Eina_List *lst);
01364
01365 Eina_Bool edje_match_collection_dir_exec(const Edje_Patterns *ppat,
01366 const char *string);
01367 Eina_Bool edje_match_programs_exec(const Edje_Patterns *ppat_signal,
01368 const Edje_Patterns *ppat_source,
01369 const char *signal,
01370 const char *source,
01371 Edje_Program **programs,
01372 Eina_Bool (*func)(Edje_Program *pr, void *data),
01373 void *data);
01374 int edje_match_callback_exec(Edje_Patterns *ppat_signal,
01375 Edje_Patterns *ppat_source,
01376 const char *signal,
01377 const char *source,
01378 Eina_List *callbacks,
01379 Edje *ed);
01380
01381 void edje_match_patterns_free(Edje_Patterns *ppat);
01382
01383 Eina_List *edje_match_program_hash_build(Edje_Program * const * programs,
01384 unsigned int count,
01385 Eina_Rbtree **tree);
01386 Eina_List *edje_match_callback_hash_build(const Eina_List *callbacks,
01387 Eina_Rbtree **tree);
01388 const Eina_List *edje_match_signal_source_hash_get(const char *signal,
01389 const char *source,
01390 const Eina_Rbtree *tree);
01391 void edje_match_signal_source_free(Edje_Signal_Source_Char *key, void *data);
01392
01393
01394 EAPI void _edje_edd_init(void);
01395 EAPI void _edje_edd_shutdown(void);
01396
01397 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
01398 EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
01399
01400 extern int _edje_anim_count;
01401 extern Ecore_Animator *_edje_timer;
01402 extern Eina_List *_edje_animators;
01403 extern Eina_List *_edje_edjes;
01404
01405 extern char *_edje_fontset_append;
01406 extern FLOAT_T _edje_scale;
01407 extern int _edje_freeze_val;
01408 extern int _edje_freeze_calc_count;
01409 extern Eina_List *_edje_freeze_calc_list;
01410
01411 extern Eina_Mempool *_edje_real_part_mp;
01412 extern Eina_Mempool *_edje_real_part_state_mp;
01413
01414 extern Eina_Mempool *_emp_RECTANGLE;
01415 extern Eina_Mempool *_emp_TEXT;
01416 extern Eina_Mempool *_emp_IMAGE;
01417 extern Eina_Mempool *_emp_SWALLOW;
01418 extern Eina_Mempool *_emp_TEXTBLOCK;
01419 extern Eina_Mempool *_emp_GROUP;
01420 extern Eina_Mempool *_emp_BOX;
01421 extern Eina_Mempool *_emp_TABLE;
01422 extern Eina_Mempool *_emp_EXTERNAL;
01423 extern Eina_Mempool *_emp_part;
01424
01425 void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos);
01426 Edje_Part_Description_Common *_edje_part_description_find(Edje *ed,
01427 Edje_Real_Part *rp,
01428 const char *name, double val);
01429 void _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, double v1, const char *d2, double v2);
01430 void _edje_recalc(Edje *ed);
01431 void _edje_recalc_do(Edje *ed);
01432 void _edje_part_recalc_1(Edje *ed, Edje_Real_Part *ep);
01433 int _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y);
01434 void _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y);
01435
01436 Eina_Bool _edje_timer_cb(void *data);
01437 Eina_Bool _edje_pending_timer_cb(void *data);
01438 void _edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
01439 void _edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
01440 void _edje_callbacks_del(Evas_Object *obj, Edje *ed);
01441 void _edje_callbacks_focus_del(Evas_Object *obj, Edje *ed);
01442
01443 void _edje_edd_init(void);
01444 void _edje_edd_shutdown(void);
01445
01446 int _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, Eina_List *group_path);
01447
01448 void _edje_file_add(Edje *ed);
01449 void _edje_file_del(Edje *ed);
01450 void _edje_file_free(Edje_File *edf);
01451 void _edje_file_cache_shutdown(void);
01452 void _edje_collection_free(Edje_File *edf,
01453 Edje_Part_Collection *ec,
01454 Edje_Part_Collection_Directory_Entry *ce);
01455 void _edje_collection_free_part_description_clean(int type,
01456 Edje_Part_Description_Common *desc,
01457 Eina_Bool free_strings);
01458 void _edje_collection_free_part_description_free(int type,
01459 Edje_Part_Description_Common *desc,
01460 Edje_Part_Collection_Directory_Entry *ce,
01461 Eina_Bool free_strings);
01462
01463 void _edje_object_smart_set(Edje_Smart_Api *sc);
01464 const Edje_Smart_Api * _edje_object_smart_class_get(void);
01465
01466 void _edje_del(Edje *ed);
01467 void _edje_ref(Edje *ed);
01468 void _edje_unref(Edje *ed);
01469 void _edje_clean_objects(Edje *ed);
01470 void _edje_ref(Edje *ed);
01471 void _edje_unref(Edje *ed);
01472
01473 Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
01474 void _edje_program_end(Edje *ed, Edje_Running_Program *runp);
01475 void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
01476 void _edje_programs_patterns_clean(Edje *ed);
01477 void _edje_programs_patterns_init(Edje *ed);
01478 void _edje_emit(Edje *ed, const char *sig, const char *src);
01479 void _edje_emit_handle(Edje *ed, const char *sig, const char *src);
01480 void _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp);
01481 void _edje_callbacks_patterns_clean(Edje *ed);
01482
01483 void _edje_text_init(void);
01484 void _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep);
01485 void _edje_text_part_on_del(Edje *ed, Edje_Part *ep);
01486 void _edje_text_recalc_apply(Edje *ed,
01487 Edje_Real_Part *ep,
01488 Edje_Calc_Params *params,
01489 Edje_Part_Description_Text *chosen_desc);
01490 Evas_Font_Size _edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc);
01491 const char * _edje_text_class_font_get(Edje *ed,
01492 Edje_Part_Description_Text *chosen_desc,
01493 int *size, char **free_later);
01494
01495
01496 Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part);
01497 Edje_Real_Part *_edje_real_part_recursive_get(const Edje *ed, const char *part);
01498 Edje *_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp);
01499 Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class);
01500 void _edje_color_class_member_add(Edje *ed, const char *color_class);
01501 void _edje_color_class_member_del(Edje *ed, const char *color_class);
01502 void _edje_color_class_on_del(Edje *ed, Edje_Part *ep);
01503 void _edje_color_class_members_free(void);
01504 void _edje_color_class_hash_free(void);
01505
01506 Edje_Text_Class *_edje_text_class_find(Edje *ed, const char *text_class);
01507 void _edje_text_class_member_add(Edje *ed, const char *text_class);
01508 void _edje_text_class_member_del(Edje *ed, const char *text_class);
01509 void _edje_text_class_members_free(void);
01510 void _edje_text_class_hash_free(void);
01511
01512 Edje *_edje_fetch(const Evas_Object *obj);
01513 int _edje_freeze(Edje *ed);
01514 int _edje_thaw(Edje *ed);
01515 int _edje_block(Edje *ed);
01516 int _edje_unblock(Edje *ed);
01517 int _edje_block_break(Edje *ed);
01518 void _edje_block_violate(Edje *ed);
01519 void _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
01520 void _edje_object_part_swallow_changed_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
01521 void _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow);
01522 void _edje_real_part_swallow_clear(Edje_Real_Part *rp);
01523 void _edje_box_init(void);
01524 void _edje_box_shutdown(void);
01525 Eina_Bool _edje_box_layout_find(const char *name, Evas_Object_Box_Layout *cb, void **data, void (**free_data)(void *data));
01526 void _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Box *chosen_desc);
01527 Eina_Bool _edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj);
01528 void _edje_box_layout_remove_child(Edje_Real_Part *rp, Evas_Object *child_obj);
01529 Edje_Part_Box_Animation * _edje_box_layout_anim_new(Evas_Object *box);
01530 void _edje_box_layout_free_data(void *data);
01531
01532 Eina_Bool _edje_real_part_box_append(Edje_Real_Part *rp, Evas_Object *child_obj);
01533 Eina_Bool _edje_real_part_box_prepend(Edje_Real_Part *rp, Evas_Object *child_obj);
01534 Eina_Bool _edje_real_part_box_insert_before(Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
01535 Eina_Bool _edje_real_part_box_insert_at(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos);
01536 Evas_Object *_edje_real_part_box_remove(Edje_Real_Part *rp, Evas_Object *child_obj);
01537 Evas_Object *_edje_real_part_box_remove_at(Edje_Real_Part *rp, unsigned int pos);
01538 Eina_Bool _edje_real_part_box_remove_all(Edje_Real_Part *rp, Eina_Bool clear);
01539 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);
01540 Eina_Bool _edje_real_part_table_unpack(Edje_Real_Part *rp, Evas_Object *child_obj);
01541 void _edje_real_part_table_clear(Edje_Real_Part *rp, Eina_Bool clear);
01542 Evas_Object *_edje_children_get(Edje_Real_Part *rp, const char *partid);
01543
01544 Eina_Bool _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text);
01545 char *_edje_text_escape(const char *text);
01546 char *_edje_text_unescape(const char *text);
01547
01548 void _edje_embryo_script_init (Edje_Part_Collection *edc);
01549 void _edje_embryo_script_shutdown (Edje_Part_Collection *edc);
01550 void _edje_embryo_script_reset (Edje *ed);
01551 void _edje_embryo_test_run (Edje *ed, const char *fname, const char *sig, const char *src);
01552 Edje_Var *_edje_var_new (void);
01553 void _edje_var_free (Edje_Var *var);
01554 void _edje_var_init (Edje *ed);
01555 void _edje_var_shutdown (Edje *ed);
01556 int _edje_var_string_id_get (Edje *ed, const char *string);
01557 int _edje_var_var_int_get (Edje *ed, Edje_Var *var);
01558 void _edje_var_var_int_set (Edje *ed, Edje_Var *var, int v);
01559 double _edje_var_var_float_get (Edje *ed, Edje_Var *var);
01560 void _edje_var_var_float_set (Edje *ed, Edje_Var *var, double v);
01561 const char *_edje_var_var_str_get (Edje *ed, Edje_Var *var);
01562 void _edje_var_var_str_set (Edje *ed, Edje_Var *var, const char *str);
01563 int _edje_var_int_get (Edje *ed, int id);
01564 void _edje_var_int_set (Edje *ed, int id, int v);
01565 double _edje_var_float_get (Edje *ed, int id);
01566 void _edje_var_float_set (Edje *ed, int id, double v);
01567 const char *_edje_var_str_get (Edje *ed, int id);
01568 void _edje_var_str_set (Edje *ed, int id, const char *str);
01569
01570 void _edje_var_list_var_append(Edje *ed, int id, Edje_Var *var);
01571 void _edje_var_list_var_prepend(Edje *ed, int id, Edje_Var *var);
01572 void _edje_var_list_var_append_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
01573 void _edje_var_list_var_prepend_relative(Edje *ed, int id, Edje_Var *var, Edje_Var *relative);
01574 Edje_Var *_edje_var_list_nth(Edje *ed, int id, int n);
01575
01576 int _edje_var_list_count_get(Edje *ed, int id);
01577 void _edje_var_list_remove_nth(Edje *ed, int id, int n);
01578
01579 int _edje_var_list_nth_int_get(Edje *ed, int id, int n);
01580 void _edje_var_list_nth_int_set(Edje *ed, int id, int n, int v);
01581 void _edje_var_list_int_append(Edje *ed, int id, int v);
01582 void _edje_var_list_int_prepend(Edje *ed, int id, int v);
01583 void _edje_var_list_int_insert(Edje *ed, int id, int n, int v);
01584
01585 double _edje_var_list_nth_float_get(Edje *ed, int id, int n);
01586 void _edje_var_list_nth_float_set(Edje *ed, int id, int n, double v);
01587 void _edje_var_list_float_append(Edje *ed, int id, double v);
01588 void _edje_var_list_float_prepend(Edje *ed, int id, double v);
01589 void _edje_var_list_float_insert(Edje *ed, int id, int n, double v);
01590
01591 const char *_edje_var_list_nth_str_get(Edje *ed, int id, int n);
01592 void _edje_var_list_nth_str_set(Edje *ed, int id, int n, const char *v);
01593 void _edje_var_list_str_append(Edje *ed, int id, const char *v);
01594 void _edje_var_list_str_prepend(Edje *ed, int id, const char *v);
01595 void _edje_var_list_str_insert(Edje *ed, int id, int n, const char *v);
01596
01597 int _edje_var_timer_add (Edje *ed, double in, const char *fname, int val);
01598 void _edje_var_timer_del (Edje *ed, int id);
01599
01600 int _edje_var_anim_add (Edje *ed, double len, const char *fname, int val);
01601 void _edje_var_anim_del (Edje *ed, int id);
01602
01603 void _edje_message_init (void);
01604 void _edje_message_shutdown (void);
01605 void _edje_message_cb_set (Edje *ed, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data);
01606 Edje_Message *_edje_message_new (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id);
01607 void _edje_message_free (Edje_Message *em);
01608 void _edje_message_send (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, void *emsg);
01609 void _edje_message_parameters_push (Edje_Message *em);
01610 void _edje_message_process (Edje_Message *em);
01611 void _edje_message_queue_process (void);
01612 void _edje_message_queue_clear (void);
01613 void _edje_message_del (Edje *ed);
01614
01615 void _edje_textblock_styles_add(Edje *ed);
01616 void _edje_textblock_styles_del(Edje *ed);
01617 void _edje_textblock_style_all_update(Edje *ed);
01618 void _edje_textblock_style_parse_and_fix(Edje_File *edf);
01619 void _edje_textblock_style_cleanup(Edje_File *edf);
01620 Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret);
01621 void _edje_cache_coll_clean(Edje_File *edf);
01622 void _edje_cache_coll_flush(Edje_File *edf);
01623 void _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc);
01624 void _edje_cache_file_unref(Edje_File *edf);
01625
01626 void _edje_embryo_globals_init(Edje *ed);
01627
01628 #define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return -1;
01629 #define GETSTR(str, par) { \
01630 Embryo_Cell *___cptr; \
01631 int ___l; \
01632 str = NULL; \
01633 if ((___cptr = embryo_data_address_get(ep, (par)))) { \
01634 ___l = embryo_data_string_length_get(ep, ___cptr); \
01635 if (((str) = alloca(___l + 1))) \
01636 embryo_data_string_get(ep, ___cptr, (str)); } }
01637 #define GETSTREVAS(str, par) { \
01638 if ((str)) { \
01639 if ((par) && (!strcmp((par), (str)))) return 0; \
01640 if ((par)) eina_stringshare_del((par)); \
01641 (par) = (char *)eina_stringshare_add((str)); } \
01642 else (par) = NULL; }
01643 #define GETFLOAT(val, par) { \
01644 float *___cptr; \
01645 if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
01646 val = *___cptr; } }
01647
01648 #define GETFLOAT_T(val, par) \
01649 { \
01650 float *___cptr; \
01651 if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \
01652 { \
01653 val = FROM_DOUBLE(*___cptr); \
01654 } \
01655 }
01656
01657 #define GETINT(val, par) { \
01658 int *___cptr; \
01659 if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
01660 val = *___cptr; } }
01661 #define SETSTR(str, par) { \
01662 Embryo_Cell *___cptr; \
01663 if ((___cptr = embryo_data_address_get(ep, (par)))) { \
01664 embryo_data_string_set(ep, str, ___cptr); } }
01665 #define SETSTRALLOCATE(s) \
01666 { \
01667 if (s) { \
01668 if ((int) strlen((s)) < params[4]) { \
01669 SETSTR((s), params[3]); } \
01670 else { \
01671 char *ss; \
01672 ss = alloca(strlen((s)) + 1); \
01673 strcpy(ss, (s)); \
01674 ss[params[4] - 2] = 0; \
01675 SETSTR(ss, params[3]); } } \
01676 else \
01677 SETSTR("", params[3]); \
01678 }
01679 #define SETFLOAT(val, par) { \
01680 float *___cptr; \
01681 if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \
01682 *___cptr = (float)val; } }
01683 #define SETFLOAT_T(val, par) \
01684 { \
01685 float *___cptr; \
01686 if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \
01687 { \
01688 *___cptr = (float) TO_DOUBLE(val); \
01689 } \
01690 }
01691 #define SETINT(val, par) { \
01692 int *___cptr; \
01693 if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
01694 *___cptr = (int)val; } }
01695
01696 Eina_Bool _edje_script_only(Edje *ed);
01697 void _edje_script_only_init(Edje *ed);
01698 void _edje_script_only_shutdown(Edje *ed);
01699 void _edje_script_only_show(Edje *ed);
01700 void _edje_script_only_hide(Edje *ed);
01701 void _edje_script_only_move(Edje *ed);
01702 void _edje_script_only_resize(Edje *ed);
01703 void _edje_script_only_message(Edje *ed, Edje_Message *em);
01704
01705 extern jmp_buf _edje_lua_panic_jmp;
01706 #define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp)
01707
01708 lua_State *_edje_lua_state_get();
01709 lua_State *_edje_lua_new_thread(Edje *ed, lua_State *L);
01710 void _edje_lua_free_thread(Edje *ed, lua_State *L);
01711 void _edje_lua_new_reg(lua_State *L, int index, void *ptr);
01712 void _edje_lua_get_reg(lua_State *L, void *ptr);
01713 void _edje_lua_free_reg(lua_State *L, void *ptr);
01714 void _edje_lua_script_fn_new(Edje *ed);
01715 void _edje_lua_group_fn_new(Edje *ed);
01716 void _edje_lua_init();
01717 void _edje_lua_shutdown();
01718
01719 void __edje_lua_error(const char *file, const char *fnc, int line, lua_State *L, int err_code);
01720 #define _edje_lua_error(L, err_code) \
01721 __edje_lua_error(__FILE__, __FUNCTION__, __LINE__, L, err_code)
01722
01723 Eina_Bool _edje_lua_script_only(Edje *ed);
01724 void _edje_lua_script_only_init(Edje *ed);
01725 void _edje_lua_script_only_shutdown(Edje *ed);
01726 void _edje_lua_script_only_show(Edje *ed);
01727 void _edje_lua_script_only_hide(Edje *ed);
01728 void _edje_lua_script_only_move(Edje *ed);
01729 void _edje_lua_script_only_resize(Edje *ed);
01730 void _edje_lua_script_only_message(Edje *ed, Edje_Message *em);
01731
01732 void _edje_entry_init(Edje *ed);
01733 void _edje_entry_shutdown(Edje *ed);
01734 void _edje_entry_real_part_init(Edje_Real_Part *rp);
01735 void _edje_entry_real_part_shutdown(Edje_Real_Part *rp);
01736 void _edje_entry_real_part_configure(Edje_Real_Part *rp);
01737 const char *_edje_entry_selection_get(Edje_Real_Part *rp);
01738 const char *_edje_entry_text_get(Edje_Real_Part *rp);
01739 void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
01740 void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
01741 void _edje_entry_set_cursor_start(Edje_Real_Part *rp);
01742 void _edje_entry_set_cursor_end(Edje_Real_Part *rp);
01743 void _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst);
01744 void _edje_entry_select_none(Edje_Real_Part *rp);
01745 void _edje_entry_select_all(Edje_Real_Part *rp);
01746 void _edje_entry_select_begin(Edje_Real_Part *rp);
01747 void _edje_entry_select_extend(Edje_Real_Part *rp);
01748 const Eina_List *_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor);
01749 const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp);
01750 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);
01751 const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp);
01752 void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
01753 void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow);
01754 Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp);
01755 void _edje_entry_select_abort(Edje_Real_Part *rp);
01756
01757 Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur);
01758 Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur);
01759 Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur);
01760 Eina_Bool _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur);
01761 void _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur);
01762 void _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur);
01763 void _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur);
01764 void _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur);
01765 Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y);
01766 Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur);
01767 Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur);
01768 const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur);
01769
01770 void _edje_external_init();
01771 void _edje_external_shutdown();
01772 Evas_Object *_edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name);
01773 void _edje_external_signal_emit(Evas_Object *obj, const char *emission, const char *source);
01774 Eina_Bool _edje_external_param_set(Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param) EINA_ARG_NONNULL(1, 2);
01775 Eina_Bool _edje_external_param_get(const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param) EINA_ARG_NONNULL(1, 2);
01776 Evas_Object *_edje_external_content_get(const Evas_Object *obj, const char *content) EINA_ARG_NONNULL(1, 2);
01777 void _edje_external_params_free(Eina_List *params, Eina_Bool free_strings);
01778 void _edje_external_recalc_apply(Edje *ed, Edje_Real_Part *ep,
01779 Edje_Calc_Params *params,
01780 Edje_Part_Description_Common *chosen_desc);
01781 void *_edje_external_params_parse(Evas_Object *obj, const Eina_List *params);
01782 void _edje_external_parsed_params_free(Evas_Object *obj, void *params);
01783
01784 EAPI void _edje_module_init();
01785 EAPI void _edje_module_shutdown();
01786
01787 static inline Eina_Bool
01788 edje_program_is_strncmp(const char *str)
01789 {
01790 size_t length;
01791
01792 length = strlen(str);
01793
01794 if (strpbrk(str, "*?[\\") != str + length)
01795 return EINA_FALSE;
01796 if (str[length] == '['
01797 || str[length] == '\\')
01798 return EINA_FALSE;
01799 return EINA_TRUE;
01800 }
01801
01802 static inline Eina_Bool
01803 edje_program_is_strrncmp(const char *str)
01804 {
01805 if (*str != '*' && *str != '?')
01806 return EINA_FALSE;
01807 if (strpbrk(str + 1, "*?[\\"))
01808 return EINA_FALSE;
01809 return EINA_TRUE;
01810 }
01811
01812 EAPI void _edje_program_insert(Edje_Part_Collection *ed, Edje_Program *p);
01813 EAPI void _edje_program_remove(Edje_Part_Collection *ed, Edje_Program *p);
01814
01815 void _edje_lua2_error_full(const char *file, const char *fnc, int line, lua_State *L, int err_code);
01816 #define _edje_lua2_error(L, err_code) _edje_lua2_error_full(__FILE__, __FUNCTION__, __LINE__, L, err_code)
01817 void _edje_lua2_script_init(Edje *ed);
01818 void _edje_lua2_script_shutdown(Edje *ed);
01819 void _edje_lua2_script_load(Edje_Part_Collection *edc, void *data, int size);
01820 void _edje_lua2_script_unload(Edje_Part_Collection *edc);
01821
01822 void _edje_lua2_script_func_shutdown(Edje *ed);
01823 void _edje_lua2_script_func_show(Edje *ed);
01824 void _edje_lua2_script_func_hide(Edje *ed);
01825 void _edje_lua2_script_func_move(Edje *ed);
01826 void _edje_lua2_script_func_resize(Edje *ed);
01827 void _edje_lua2_script_func_message(Edje *ed, Edje_Message *em);
01828 void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
01829
01830 const char *edje_string_get(const Edje_String *es);
01831 const char *edje_string_id_get(const Edje_String *es);
01832
01833 #endif