summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-25 15:09:00 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-25 15:09:00 +0900
commitee0eb1336b0879351b9ff838adbd640f02d05527 (patch)
treebe3447e4c48c8267f76cf9f89a976fa0e795572d
parent26c943bac0d4b62bce63a6b575c58d15e5e6113f (diff)
edje - remove old script_only code that used embryo (not lua)
thjis was deprecated even before efl 1.0 by never removed. lua replaced it for script_only objects and you havent been able to compile an edje file with script_only enabled since 1.0, so no point having the code here. this cleans up that code and cruft.
-rw-r--r--src/Makefile_Edje.am1
-rw-r--r--src/bin/edje/edje_cc_handlers.c9
-rw-r--r--src/bin/edje/edje_convert.c1
-rw-r--r--src/bin/edje/edje_data_convert.c1
-rw-r--r--src/lib/edje/edje_convert.c1
-rw-r--r--src/lib/edje/edje_convert.h2
-rw-r--r--src/lib/edje/edje_data.c1
-rw-r--r--src/lib/edje/edje_load.c13
-rw-r--r--src/lib/edje/edje_message_queue.c5
-rw-r--r--src/lib/edje/edje_private.h12
-rw-r--r--src/lib/edje/edje_script_only.c643
-rw-r--r--src/lib/edje/edje_smart.c21
12 files changed, 5 insertions, 705 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index e7cc6dd63a..3492e6b45e 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -73,7 +73,6 @@ lib/edje/edje_misc.c \
73lib/edje/edje_module.c \ 73lib/edje/edje_module.c \
74lib/edje/edje_multisense.c \ 74lib/edje/edje_multisense.c \
75lib/edje/edje_program.c \ 75lib/edje/edje_program.c \
76lib/edje/edje_script_only.c \
77lib/edje/edje_smart.c \ 76lib/edje/edje_smart.c \
78lib/edje/edje_text.c \ 77lib/edje/edje_text.c \
79lib/edje/edje_textblock_styles.c \ 78lib/edje/edje_textblock_styles.c \
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 845aa53ab2..289708f032 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -214,7 +214,7 @@ static void st_collections_group_inherit(void);
214static void st_collections_group_program_source(void); 214static void st_collections_group_program_source(void);
215static void st_collections_group_part_remove(void); 215static void st_collections_group_part_remove(void);
216static void st_collections_group_program_remove(void); 216static void st_collections_group_program_remove(void);
217static void st_collections_group_script_only(void); 217static void st_collections_group_lua_script_only(void);
218static void st_collections_group_script_recursion(void); 218static void st_collections_group_script_recursion(void);
219static void st_collections_group_alias(void); 219static void st_collections_group_alias(void);
220static void st_collections_group_min(void); 220static void st_collections_group_min(void);
@@ -540,9 +540,8 @@ New_Statement_Handler statement_handlers[] =
540 {"collections.group.target_group", st_collections_group_target_group}, /* dup */ 540 {"collections.group.target_group", st_collections_group_target_group}, /* dup */
541 {"collections.group.part_remove", st_collections_group_part_remove}, 541 {"collections.group.part_remove", st_collections_group_part_remove},
542 {"collections.group.program_remove", st_collections_group_program_remove}, 542 {"collections.group.program_remove", st_collections_group_program_remove},
543 {"collections.group.script_only", st_collections_group_script_only}, 543 {"collections.group.lua_script_only", st_collections_group_lua_script_only},
544 {"collections.group.script_recursion", st_collections_group_script_recursion}, 544 {"collections.group.script_recursion", st_collections_group_script_recursion},
545 {"collections.group.lua_script_only", st_collections_group_script_only},
546 {"collections.group.alias", st_collections_group_alias}, 545 {"collections.group.alias", st_collections_group_alias},
547 {"collections.group.min", st_collections_group_min}, 546 {"collections.group.min", st_collections_group_min},
548 {"collections.group.max", st_collections_group_max}, 547 {"collections.group.max", st_collections_group_max},
@@ -3475,7 +3474,7 @@ st_collections_group_inherit(void)
3475/** 3474/**
3476 @page edcref 3475 @page edcref
3477 @property 3476 @property
3478 script_only 3477 lua_script_only
3479 @parameters 3478 @parameters
3480 [on/off] 3479 [on/off]
3481 @effect 3480 @effect
@@ -3484,7 +3483,7 @@ st_collections_group_inherit(void)
3484 @endproperty 3483 @endproperty
3485*/ 3484*/
3486static void 3485static void
3487st_collections_group_script_only(void) 3486st_collections_group_lua_script_only(void)
3488{ 3487{
3489 Edje_Part_Collection *pc; 3488 Edje_Part_Collection *pc;
3490 3489
diff --git a/src/bin/edje/edje_convert.c b/src/bin/edje/edje_convert.c
index 41e319b6b6..fc98722a7b 100644
--- a/src/bin/edje/edje_convert.c
+++ b/src/bin/edje/edje_convert.c
@@ -371,7 +371,6 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
371 edc->prop.max = oedc->prop.max; 371 edc->prop.max = oedc->prop.max;
372 edc->script = oedc->script; 372 edc->script = oedc->script;
373 edc->part = oedc->part; 373 edc->part = oedc->part;
374 edc->script_only = oedc->script_only;
375 edc->lua_script_only = oedc->lua_script_only; 374 edc->lua_script_only = oedc->lua_script_only;
376 edc->checked = oedc->checked; 375 edc->checked = oedc->checked;
377 376
diff --git a/src/bin/edje/edje_data_convert.c b/src/bin/edje/edje_data_convert.c
index 0f72a296fe..3d451bb617 100644
--- a/src/bin/edje/edje_data_convert.c
+++ b/src/bin/edje/edje_data_convert.c
@@ -437,7 +437,6 @@ _edje_edd_old_init(void)
437 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); 437 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT);
438 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); 438 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT);
439 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "id", id, EET_T_INT); 439 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "id", id, EET_T_INT);
440 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR);
441 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); 440 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR);
442 441
443 { 442 {
diff --git a/src/lib/edje/edje_convert.c b/src/lib/edje/edje_convert.c
index 2f923e1923..4a04ff4d1a 100644
--- a/src/lib/edje/edje_convert.c
+++ b/src/lib/edje/edje_convert.c
@@ -412,7 +412,6 @@ _edje_collection_convert(Edje_File *file, Old_Edje_Part_Collection *oedc)
412 edc->prop.max = oedc->prop.max; 412 edc->prop.max = oedc->prop.max;
413 edc->script = oedc->script; 413 edc->script = oedc->script;
414 edc->part = oedc->part; 414 edc->part = oedc->part;
415 edc->script_only = oedc->script_only;
416 edc->lua_script_only = oedc->lua_script_only; 415 edc->lua_script_only = oedc->lua_script_only;
417 edc->checked = oedc->checked; 416 edc->checked = oedc->checked;
418 417
diff --git a/src/lib/edje/edje_convert.h b/src/lib/edje/edje_convert.h
index c37afd7bb8..951d0c6f24 100644
--- a/src/lib/edje/edje_convert.h
+++ b/src/lib/edje/edje_convert.h
@@ -103,8 +103,6 @@ struct _Old_Edje_Part_Collection
103 Embryo_Program *script; /**< all the embryo script code for this group */ 103 Embryo_Program *script; /**< all the embryo script code for this group */
104 const char *part; /**< part name */ 104 const char *part; /**< part name */
105 105
106 unsigned char script_only; /**< script only */
107
108 unsigned char lua_script_only; /** LUA script only */ 106 unsigned char lua_script_only; /** LUA script only */
109 107
110 unsigned char checked : 1; /**< contents checked and registered */ 108 unsigned char checked : 1; /**< contents checked and registered */
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index ca1cbeea03..0220ecf265 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1069,7 +1069,6 @@ _edje_edd_init(void)
1069 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); 1069 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT);
1070 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); 1070 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT);
1071 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "part", part, EET_T_STRING); 1071 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "part", part, EET_T_STRING);
1072 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR);
1073 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); 1072 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR);
1074 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT); 1073 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT);
1075 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR); 1074 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR);
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index f9af9e3de9..9914ced7d0 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -352,7 +352,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
352 352
353 collect = _edje_object_collect(ed); 353 collect = _edje_object_collect(ed);
354 354
355 if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
356 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed); 355 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
357 356
358#ifdef HAVE_EPHYSICS 357#ifdef HAVE_EPHYSICS
@@ -398,12 +397,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
398 397
399 ed->groups = eina_list_append(ed->groups, ed); 398 ed->groups = eina_list_append(ed->groups, ed);
400 399
401 if (ed->collection->script_only) 400 if (ed->collection->lua_script_only)
402 {
403 ed->load_error = EDJE_LOAD_ERROR_NONE;
404 _edje_script_only_init(ed);
405 }
406 else if (ed->collection->lua_script_only)
407 { 401 {
408 ed->load_error = EDJE_LOAD_ERROR_NONE; 402 ed->load_error = EDJE_LOAD_ERROR_NONE;
409 _edje_lua_script_only_init(ed); 403 _edje_lua_script_only_init(ed);
@@ -759,7 +753,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
759 _edje_ref(ed); 753 _edje_ref(ed);
760 _edje_block(ed); 754 _edje_block(ed);
761 _edje_util_freeze(ed); 755 _edje_util_freeze(ed);
762 // if (ed->collection->script) _edje_embryo_script_init(ed);
763 _edje_var_init(ed); 756 _edje_var_init(ed);
764 for (i = 0; i < ed->table_parts_size; i++) 757 for (i = 0; i < ed->table_parts_size; i++)
765 { 758 {
@@ -1258,10 +1251,6 @@ _edje_file_del(Edje *ed)
1258 _edje_message_del(ed); 1251 _edje_message_del(ed);
1259 _edje_block_violate(ed); 1252 _edje_block_violate(ed);
1260 _edje_var_shutdown(ed); 1253 _edje_var_shutdown(ed);
1261 // if (ed->collection)
1262 // {
1263 // if (ed->collection->script) _edje_embryo_script_shutdown(ed);
1264 // }
1265 1254
1266 if (!((ed->file) && (ed->collection))) 1255 if (!((ed->file) && (ed->collection)))
1267 { 1256 {
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index 524ed75f7a..4ed5a07ebe 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -665,11 +665,6 @@ _edje_message_process(Edje_Message *em)
665 } 665 }
666 /* now this message is destined for the script message handler fn */ 666 /* now this message is destined for the script message handler fn */
667 if (!(em->edje->collection)) return; 667 if (!(em->edje->collection)) return;
668 if ((em->edje->collection->script) && _edje_script_only (em->edje))
669 {
670 _edje_script_only_message(em->edje, em);
671 return;
672 }
673 if (em->edje->L) 668 if (em->edje->L)
674 { 669 {
675 _edje_lua_script_only_message(em->edje, em); 670 _edje_lua_script_only_message(em->edje, em);
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 32c5506507..a298684ac3 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1016,8 +1016,6 @@ struct _Edje_Part_Collection
1016 } patterns; 1016 } patterns;
1017 /* *** *** */ 1017 /* *** *** */
1018 1018
1019 unsigned char script_only;
1020
1021 unsigned char lua_script_only; 1019 unsigned char lua_script_only;
1022 1020
1023 unsigned char broadcast_signal; 1021 unsigned char broadcast_signal;
@@ -1488,7 +1486,6 @@ struct _Edje
1488 Eina_List *subobjs; 1486 Eina_List *subobjs;
1489 Eina_List *text_insert_filter_callbacks; 1487 Eina_List *text_insert_filter_callbacks;
1490 Eina_List *markup_filter_callbacks; 1488 Eina_List *markup_filter_callbacks;
1491 void *script_only_data;
1492 1489
1493 Eina_List *groups; 1490 Eina_List *groups;
1494 1491
@@ -2443,15 +2440,6 @@ void _edje_embryo_globals_init(Edje *ed);
2443 if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ 2440 if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
2444 *___cptr = (int)val; } } 2441 *___cptr = (int)val; } }
2445 2442
2446Eina_Bool _edje_script_only(Edje *ed);
2447void _edje_script_only_init(Edje *ed);
2448void _edje_script_only_shutdown(Edje *ed);
2449void _edje_script_only_show(Edje *ed);
2450void _edje_script_only_hide(Edje *ed);
2451void _edje_script_only_move(Edje *ed);
2452void _edje_script_only_resize(Edje *ed);
2453void _edje_script_only_message(Edje *ed, Edje_Message *em);
2454
2455extern jmp_buf _edje_lua_panic_jmp; 2443extern jmp_buf _edje_lua_panic_jmp;
2456#define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp) 2444#define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp)
2457 2445
diff --git a/src/lib/edje/edje_script_only.c b/src/lib/edje/edje_script_only.c
deleted file mode 100644
index 480e107455..0000000000
--- a/src/lib/edje/edje_script_only.c
+++ /dev/null
@@ -1,643 +0,0 @@
1#include "edje_private.h"
2
3/*
4 * ALREADY EXPORTED BY EMBRYO:
5 *
6 * enum Float_Round_Method {
7 * ROUND, FLOOR, CEIL, TOZERO
8 * };
9 * enum Float_Angle_Mode {
10 * RADIAN, DEGREES, GRADES
11 * };
12 *
13 * numargs();
14 * getarg(arg, index=0);
15 * setarg(arg, index=0, value);
16 *
17 * Float:atof(string[]);
18 * Float:fract(Float:value);
19 * round(Float:value, Float_Round_Method:method=ROUND);
20 * Float:sqrt(Float:value);
21 * Float:pow(Float:value, Float:exponent);
22 * Float:log(Float:value, Float:base=10.0);
23 * Float:sin(Float:value, Float_Angle_Mode:mode=RADIAN);
24 * Float:cos(Float:value, Float_Angle_Mode:mode=RADIAN);
25 * Float:tan(Float:value, Float_Angle_Mode:mode=RADIAN);
26 * Float:abs(Float:value);
27 * atoi(str[]);
28 * fnmatch(glob[], str[]);
29 * strcmp(str1[], str2[]);
30 * strncmp(str1[], str2[]);
31 * strcpy(dst[], src[]);
32 * strncpy(dst[], src[], n);
33 * strlen(str[]);
34 * strcat(dst[], src[]);
35 * strncat(dst[], src[], n);
36 * strprep(dst[], src[]);
37 * strnprep(dst[], src[], n);
38 * strcut(dst[], str[], n, n2);
39 * snprintf(dst[], dstn, fmt[], ...);
40 * strstr(str[], ndl[]);
41 * strchr(str[], ch[]);
42 * strrchr(str[], ch[]);
43 * rand();
44 * Float:randf();
45 * Float:seconds();
46 * date(&year, &month, &day, &yearday, &weekday, &hr, &min, &Float:sec);
47 *
48 */
49
50typedef struct _Sinfo Sinfo;
51
52struct _Sinfo
53{
54 struct
55 {
56 Embryo_Function
57 obj_init, obj_shutdown, obj_show, obj_show_immediate,
58 obj_hide, obj_hide_immediate, obj_move, obj_move_immediate,
59 obj_resize, obj_resize_immediate, obj_message;
60 } fn;
61 struct
62 {
63 Ecore_Job * show, *hide, *move, *resize;
64 } job;
65 struct
66 {
67 int id;
68 Eina_Hash *hash; // FIXME: hash -> bad. too big. one-way lookup etc.
69 } oid;
70};
71
72static void _call_fn(Edje * ed, const char *fname, Embryo_Function fn);
73
74/* frankly - these make the code shorter to type and read - just sanity for
75 * development */
76#define IFFN(func) if (si->fn.func != EMBRYO_FUNCTION_NONE)
77#define IFNO(func) if (si->fn.func == EMBRYO_FUNCTION_NONE)
78#define CLFN(func) IFFN(func) {_call_fn(ed, #func, si->fn.func);}
79#define SI Sinfo *si; si = ed->script_only_data; if (!si) return
80#define SI_RETURN(ret) Sinfo *si; si = ed->script_only_data; if (!si) return (ret)
81#define PINT(val) embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)(val))
82#define PSTR(val) embryo_parameter_string_push(ed->collection->script, val)
83#define GTFN(func) si->fn.func = embryo_program_function_find(ed->collection->script, #func)
84#define DELJ(type) if (si->job.type) ecore_job_del(si->job.type);
85#define ADDJ(type, func) si->job.type = ecore_job_add(func, ed);
86#define ZERJ(type) si->job.type = NULL;
87#define IFNJ(type) if (!si->job.type)
88#define EXPF(func) embryo_program_native_call_add(ed->collection->script, #func, _exp_##func)
89
90typedef struct _Oid Oid;
91
92struct _Oid
93{
94 Edje *ed;
95 Evas_Object *obj;
96 Evas_Coord x, y, w, h;
97 int oid;
98};
99
100/* FIXME: using eina_hash and strings is just nasty! make a custom int hash */
101static int
102_oid_alloc(Edje * ed)
103{
104 SI_RETURN(0);
105
106 si->oid.id++;
107 return si->oid.id;
108}
109
110static Oid *
111_oid_track(Edje * ed, Evas_Object * o)
112{
113 Oid *oi;
114
115 char buf[64];
116
117 SI_RETURN(NULL);
118
119 oi = calloc(1, sizeof(Oid));
120 if (!oi)
121 return NULL;
122 oi->oid = _oid_alloc(ed);
123 if (!oi->oid)
124 {
125 free(oi);
126 return NULL;
127 }
128 oi->ed = ed;
129 oi->obj = o;
130 evas_object_smart_member_add(oi->obj, oi->ed->obj);
131 evas_object_clip_set(oi->obj, oi->ed->base->clipper);
132 evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
133 snprintf(buf, sizeof(buf), "%i", oi->oid);
134 if (!si->oid.hash)
135 si->oid.hash = eina_hash_string_superfast_new(NULL);
136 eina_hash_add(si->oid.hash, buf, oi);
137 return oi;
138}
139
140static Oid *
141_oid_find(Edje * ed, int oid)
142{
143 char buf[64];
144
145 SI_RETURN(NULL);
146
147 snprintf(buf, sizeof(buf), "%i", oid);
148 return eina_hash_find(si->oid.hash, buf);
149}
150
151static void
152_oid_del(Edje * ed, int oid)
153{
154 char buf[64];
155
156 SI;
157
158 snprintf(buf, sizeof(buf), "%i", oid);
159 eina_hash_del(si->oid.hash, buf, NULL);
160}
161
162static void
163_oid_free(Oid * oid)
164{
165 free(oid);
166}
167
168static Eina_Bool
169_oid_freeall_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
170{
171 Oid *oid = data;
172
173 evas_object_del(oid->obj);
174 free(oid);
175 return EINA_TRUE;
176}
177
178static void
179_oid_freeall(Edje * ed)
180{
181 SI;
182 if (!si->oid.hash)
183 return;
184 eina_hash_foreach(si->oid.hash, _oid_freeall_cb, ed);
185 eina_hash_free(si->oid.hash);
186 si->oid.hash = NULL;
187}
188
189static Eina_Bool
190_oid_moveall_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
191{
192 Oid *oid = data;
193
194 evas_object_move(oid->obj, oid->ed->x + oid->x, oid->ed->y + oid->y);
195 return EINA_TRUE;
196}
197
198static void
199_oid_moveall(Edje * ed)
200{
201 SI;
202 if (!si->oid.hash)
203 return;
204 eina_hash_foreach(si->oid.hash, _oid_moveall_cb, ed);
205}
206
207/**********/
208
209static Embryo_Cell
210_exp_e_obj_del(Embryo_Program * ep, Embryo_Cell * params)
211{
212 Edje *ed = embryo_program_data_get(ep);
213
214 Oid *oid;
215
216 SI_RETURN(-1);
217
218 CHKPARAM(1);
219 if (!(oid = _oid_find(ed, params[1])))
220 return -1;
221 evas_object_del(oid->obj);
222 _oid_del(ed, oid->oid);
223 _oid_free(oid);
224 return 0;
225}
226
227static Embryo_Cell
228_exp_e_obj_rect_add(Embryo_Program * ep, Embryo_Cell * params EINA_UNUSED)
229{
230 Edje *ed = embryo_program_data_get(ep);
231
232 Evas_Object *o;
233
234 Oid *oid;
235
236 SI_RETURN(-1);
237
238 o = evas_object_rectangle_add(evas_object_evas_get(ed->obj));
239 if (!o)
240 return 0;
241 oid = _oid_track(ed, o);
242 if (oid)
243 return oid->oid;
244 return 0;
245}
246
247static Embryo_Cell
248_exp_e_obj_show(Embryo_Program * ep, Embryo_Cell * params)
249{
250 Edje *ed = embryo_program_data_get(ep);
251
252 Oid *oid;
253
254 SI_RETURN(-1);
255
256 CHKPARAM(1);
257 if (!(oid = _oid_find(ed, params[1])))
258 return -1;
259 evas_object_show(oid->obj);
260 return 0;
261}
262
263static Embryo_Cell
264_exp_e_obj_hide(Embryo_Program * ep, Embryo_Cell * params)
265{
266 Edje *ed = embryo_program_data_get(ep);
267
268 Oid *oid;
269
270 SI_RETURN(-1);
271
272 CHKPARAM(1);
273 if (!(oid = _oid_find(ed, params[1])))
274 return -1;
275 evas_object_hide(oid->obj);
276 return 0;
277}
278
279static Embryo_Cell
280_exp_e_obj_move(Embryo_Program * ep, Embryo_Cell * params)
281{
282 Edje *ed = embryo_program_data_get(ep);
283
284 Oid *oid;
285
286 SI_RETURN(-1);
287
288 CHKPARAM(3);
289 if (!(oid = _oid_find(ed, params[1])))
290 return -1;
291 if ((oid->x == params[2]) && (oid->y == params[3]))
292 return -1;
293 oid->x = params[2];
294 oid->y = params[3];
295 evas_object_move(oid->obj, ed->x + oid->x, ed->y + oid->y);
296 return 0;
297}
298
299static Embryo_Cell
300_exp_e_obj_resize(Embryo_Program * ep, Embryo_Cell * params)
301{
302 Edje *ed = embryo_program_data_get(ep);
303
304 Oid *oid;
305
306 SI_RETURN(-1);
307
308 CHKPARAM(3);
309 if (!(oid = _oid_find(ed, params[1])))
310 return -1;
311 if ((oid->w == params[2]) && (oid->h == params[3]))
312 return -1;
313 oid->w = params[2];
314 oid->h = params[3];
315 evas_object_resize(oid->obj, oid->w, oid->h);
316 return 0;
317}
318
319static Embryo_Cell
320_exp_e_obj_geometry_set(Embryo_Program * ep, Embryo_Cell * params)
321{
322 Edje *ed = embryo_program_data_get(ep);
323
324 Oid *oid;
325
326 SI_RETURN(-1);
327
328 CHKPARAM(5);
329 if (!(oid = _oid_find(ed, params[1])))
330 return -1;
331 if ((oid->x == params[2]) && (oid->y == params[3]) &&
332 (oid->w == params[4]) && (oid->h == params[5]))
333 return -1;
334 oid->x = params[2];
335 oid->y = params[3];
336 oid->w = params[4];
337 oid->h = params[5];
338 evas_object_move(oid->obj, ed->x + oid->x, ed->y + oid->y);
339 evas_object_resize(oid->obj, oid->w, oid->h);
340 return 0;
341}
342
343static Embryo_Cell
344_exp_e_obj_geometry_get(Embryo_Program * ep, Embryo_Cell * params)
345{
346 Edje *ed = embryo_program_data_get(ep);
347
348 Oid *oid;
349
350 SI_RETURN(-1);
351
352 CHKPARAM(5);
353 if (!(oid = _oid_find(ed, params[1])))
354 return -1;
355 SETINT(oid->x, params[2]);
356 SETINT(oid->y, params[3]);
357 SETINT(oid->w, params[4]);
358 SETINT(oid->h, params[5]);
359 return 0;
360}
361
362static Embryo_Cell
363_exp_e_obj_color_set(Embryo_Program * ep, Embryo_Cell * params)
364{
365 Edje *ed = embryo_program_data_get(ep);
366
367 Oid *oid;
368
369 SI_RETURN(-1);
370
371 CHKPARAM(5);
372 if (!(oid = _oid_find(ed, params[1])))
373 return -1;
374 evas_object_color_set(oid->obj, params[2], params[3], params[4], params[5]);
375 return 0;
376}
377
378static Embryo_Cell
379_exp_e_obj_color_get(Embryo_Program * ep, Embryo_Cell * params)
380{
381 Edje *ed = embryo_program_data_get(ep);
382
383 Oid *oid;
384
385 int r, g, b, a;
386
387 SI_RETURN(-1);
388
389 CHKPARAM(5);
390 if (!(oid = _oid_find(ed, params[1])))
391 return -1;
392 evas_object_color_get(oid->obj, &r, &g, &b, &a);
393 SETINT(r, params[2]);
394 SETINT(g, params[3]);
395 SETINT(b, params[4]);
396 SETINT(a, params[5]);
397 return 0;
398}
399
400static Embryo_Cell
401_exp_e_signal_emit(Embryo_Program * ep, Embryo_Cell * params)
402{
403 Edje *ed = embryo_program_data_get(ep);
404
405 char *sig = NULL, *src = NULL;
406
407 SI_RETURN(-1);
408
409 CHKPARAM(2);
410 GETSTR(sig, params[1]);
411 GETSTR(src, params[2]);
412 if ((!sig) || (!src))
413 return -1;
414 _edje_emit(ed, sig, src);
415 return 0;
416}
417
418/**********/
419
420Eina_Bool
421_edje_script_only(Edje * ed)
422{
423 if ((ed->collection) && (ed->collection->script) &&
424 (ed->collection->script_only))
425 return EINA_TRUE;
426 return EINA_FALSE;
427}
428
429void
430_edje_script_only_init(Edje * ed)
431{
432 Sinfo *si;
433
434 si = calloc(1, sizeof(Sinfo));
435 if (!si)
436 return;
437 ed->script_only_data = si;
438
439 embryo_program_data_set(ed->collection->script, ed);
440
441 EXPF(e_obj_del);
442 EXPF(e_obj_rect_add);
443 EXPF(e_obj_show);
444 EXPF(e_obj_hide);
445 EXPF(e_obj_move);
446 EXPF(e_obj_resize);
447 EXPF(e_obj_geometry_set);
448 EXPF(e_obj_geometry_get);
449 EXPF(e_obj_color_set);
450 EXPF(e_obj_color_get);
451 EXPF(e_signal_emit);
452
453 embryo_program_vm_push(ed->collection->script);
454 embryo_program_max_cycle_run_set(ed->collection->script, 5000000);
455
456 GTFN(obj_init);
457 GTFN(obj_shutdown);
458 GTFN(obj_show);
459 GTFN(obj_show_immediate);
460 GTFN(obj_hide);
461 GTFN(obj_hide_immediate);
462 GTFN(obj_move);
463 GTFN(obj_move_immediate);
464 GTFN(obj_resize);
465 GTFN(obj_resize_immediate);
466 GTFN(obj_message);
467
468 CLFN(obj_init);
469 _edje_script_only_move(ed);
470}
471
472void
473_edje_script_only_shutdown(Edje * ed)
474{
475 SI;
476
477 CLFN(obj_shutdown);
478 DELJ(show);
479 DELJ(hide);
480 DELJ(move);
481 DELJ(resize);
482 _oid_freeall(ed);
483}
484
485static void
486_show_job(void *data)
487{
488 Edje *ed = data;
489
490 SI;
491
492 ZERJ(show);
493 CLFN(obj_show);
494}
495void
496_edje_script_only_show(Edje * ed)
497{
498 SI;
499
500 IFFN(obj_show)
501 {
502 IFNJ(hide)
503 {
504 DELJ(show);
505 ADDJ(show, _show_job);
506 }
507 else
508 {
509 DELJ(hide);
510 }
511 }
512 IFNO(obj_show_immediate) return;
513 CLFN(obj_show_immediate);
514}
515
516static void
517_hide_job(void *data)
518{
519 Edje *ed = data;
520
521 SI;
522
523 ZERJ(hide);
524 CLFN(obj_hide);
525}
526void
527_edje_script_only_hide(Edje * ed)
528{
529 SI;
530
531 IFFN(obj_hide)
532 {
533 IFNJ(show)
534 {
535 DELJ(hide);
536 ADDJ(hide, _hide_job);
537 }
538 else
539 {
540 DELJ(show);
541 }
542 }
543 IFNO(obj_hide_immediate) return;
544 CLFN(obj_hide_immediate);
545}
546
547static void
548_move_job(void *data)
549{
550 Edje *ed = data;
551
552 SI;
553
554 _oid_moveall(ed);
555 ZERJ(move);
556 IFNO(obj_move) return;
557 PINT(ed->x);
558 PINT(ed->y);
559 CLFN(obj_move);
560}
561void
562_edje_script_only_move(Edje * ed)
563{
564 SI;
565
566 DELJ(move);
567 ADDJ(move, _move_job);
568 IFNO(obj_move_immediate) return;
569 PINT(ed->x);
570 PINT(ed->y);
571 CLFN(obj_move_immediate);
572}
573
574static void
575_resize_job(void *data)
576{
577 Edje *ed = data;
578
579 SI;
580
581 ZERJ(resize);
582 PINT(ed->w);
583 PINT(ed->h);
584 CLFN(obj_resize);
585}
586void
587_edje_script_only_resize(Edje * ed)
588{
589 SI;
590
591 IFFN(obj_resize)
592 {
593 DELJ(resize);
594 ADDJ(resize, _resize_job);
595 }
596 PINT(ed->w);
597 PINT(ed->h);
598 CLFN(obj_resize_immediate);
599}
600
601void
602_edje_script_only_message(Edje * ed, Edje_Message * em)
603{
604 SI;
605
606 IFNO(obj_message) return;
607 _edje_message_parameters_push(em);
608 CLFN(obj_message);
609}
610
611/**************************************************/
612
613static void
614_call_fn(Edje * ed, const char *fname, Embryo_Function fn)
615{
616 int ret;
617
618 ret = embryo_program_run(ed->collection->script, fn);
619 if (ret == EMBRYO_PROGRAM_FAIL)
620 {
621 ERR("ERROR with embryo script. "
622 "OBJECT NAME: '%s', "
623 "OBJECT FILE: '%s', "
624 "ENTRY POINT: '%s', "
625 "ERROR: '%s'",
626 ed->collection->part,
627 ed->file->path,
628 fname,
629 embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
630 }
631 else if (ret == EMBRYO_PROGRAM_TOOLONG)
632 {
633 ERR("ERROR with embryo script. "
634 "OBJECT NAME: '%s', "
635 "OBJECT FILE: '%s', "
636 "ENTRY POINT: '%s', "
637 "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
638 ed->collection->part,
639 ed->file->path,
640 fname,
641 embryo_program_max_cycle_run_get(ed->collection->script));
642 }
643}
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index e35e9d5518..6a76abc72d 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -120,7 +120,6 @@ _edje_object_evas_object_smart_del(Eo *obj, Edje *ed)
120 ed->delete_me = 1; 120 ed->delete_me = 1;
121 _edje_edjes = eina_list_remove(_edje_edjes, obj); 121 _edje_edjes = eina_list_remove(_edje_edjes, obj);
122 evas_object_smart_data_set(obj, NULL); 122 evas_object_smart_data_set(obj, NULL);
123 if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
124 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed); 123 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
125#ifdef HAVE_EPHYSICS 124#ifdef HAVE_EPHYSICS
126 /* clear physics world / shutdown ephysics */ 125 /* clear physics world / shutdown ephysics */
@@ -147,11 +146,6 @@ _edje_object_evas_object_smart_move(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord x,
147 ed->y = y; 146 ed->y = y;
148// evas_object_move(ed->clipper, ed->x, ed->y); 147// evas_object_move(ed->clipper, ed->x, ed->y);
149 148
150 if (_edje_script_only(ed))
151 {
152 _edje_script_only_move(ed);
153 return;
154 }
155 if (_edje_lua_script_only(ed)) 149 if (_edje_lua_script_only(ed))
156 { 150 {
157 _edje_lua_script_only_move(ed); 151 _edje_lua_script_only_move(ed);
@@ -252,11 +246,6 @@ _edje_object_evas_object_smart_resize(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord
252#ifdef EDJE_CALC_CACHE 246#ifdef EDJE_CALC_CACHE
253 ed->all_part_change = EINA_TRUE; 247 ed->all_part_change = EINA_TRUE;
254#endif 248#endif
255 if (_edje_script_only(ed))
256 {
257 _edje_script_only_resize(ed);
258 return;
259 }
260 if (_edje_lua_script_only(ed)) 249 if (_edje_lua_script_only(ed))
261 { 250 {
262 _edje_lua_script_only_resize(ed); 251 _edje_lua_script_only_resize(ed);
@@ -276,11 +265,6 @@ _edje_object_evas_object_smart_show(Eo *obj, Edje *ed)
276 265
277 eo_do_super(obj, MY_CLASS, evas_obj_smart_show()); 266 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
278 if (evas_object_visible_get(obj)) return; 267 if (evas_object_visible_get(obj)) return;
279 if (_edje_script_only(ed))
280 {
281 _edje_script_only_show(ed);
282 return;
283 }
284 if (_edje_lua_script_only(ed)) 268 if (_edje_lua_script_only(ed))
285 { 269 {
286 _edje_lua_script_only_show(ed); 270 _edje_lua_script_only_show(ed);
@@ -309,11 +293,6 @@ _edje_object_evas_object_smart_hide(Eo *obj, Edje *ed)
309 293
310 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); 294 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
311 if (!evas_object_visible_get(obj)) return; 295 if (!evas_object_visible_get(obj)) return;
312 if (_edje_script_only(ed))
313 {
314 _edje_script_only_hide(ed);
315 return;
316 }
317 if (_edje_lua_script_only(ed)) 296 if (_edje_lua_script_only(ed))
318 { 297 {
319 _edje_lua_script_only_hide(ed); 298 _edje_lua_script_only_hide(ed);