Languages

Menu
Sites
Language
How to write Embryo Script in .edc file?

Where could i found some docs regarding the embryo script api?

for example, the api i could call includes: set_state, custom_state, get_int....

Thanks!

View Selected Answer

Responses

8 Replies
Jean Yang

Hi, 

Do you mean the signal in EDC file? If yes, you can find some clue in Help ducuments.

Tizen Mobile Native App Programming > Programming Guide > UI: Creating the Application UI > Event Handling

And there is one document about this:

http://brunodilly.org/blog/debugging-edje-themes-edc-edje-player/

 

 

roc john
Are there some reference documents for writing script? I want to learn how to ineract with parts and with main program~ Thanks for your answers!
Jean Yang

Hi, 

The below link has some introduction about edje, hope this can help you.

https://developer.tizen.org/documentation/guides/native-application/ui/edje/edje-parts-and-blocks

https://developer.tizen.org/documentation/tutorials/native-application/ui/event-and-effect/animation-and-effect-types/edje-animation

roc john

Thank you firstly!

I've read these articles, but can't find the details of embryo script and it's full functions lists.

Perhaps, i have to read the source to find out these?

Are there some articles to introduce the embryo script or lua script syntax?

Are there some articles to introduce the functions which can be called in the script?

Thanks again!

Mark as answer
MinSeo Park

HI.

I found this article, by same question.

After visiting some web sites. I found below.

If U can follow link 1 or follow 2

1. https://review.tizen.org/git/?p=framework/uifw/edje.git;a=blob;f=data/include/edje.inc;h=dfa541606991f612bc838d35514b4c903fb31979;hb=HEAD

2. https://source.tizen.org > select "Tizen source > source code" > Search "framework/uifw/edje.git" > check "data / include / edje.inc" via web or after clone

 

I found functions which I can use in edc file

I hope , this can help U

I attach 

/* Edje exported calls */
3 /************************************************/
4 /* Basic data storage/retrieval (it's explicit) */
5 /************************************************/
6 /* Example:
7  * 
8  * In the "global" script section of a group:
9  * 
10  * script {
11  *   public global_value1;
12  *   public global_value2;
13  *   public global_value3;
14  * }
15  * 
16  * In the program script sections, OR in any global functions/routines:
17  * ( several examples of setting/getting values)
18  * 
19  * set_int(global_value1, 7);
20  * set_float(global_value2, 42.0);
21  * set_str(global_value3, "I am a smelly fish!");
22  * new value1 = get_int(global_value1);
23  * new Float:value2 = get_float(global_value2);
24  * new value3[100]; get_str(global_value3, value3, 100);
25  * set_int(global_value1, value1);
26  * set_float(global_value2, value2);
27  * set_str(global_value3, value3);
28  */
29 native       get_int   (id);
30 native       set_int   (id, val);
31 native Float:get_float (id);
32 native       set_float (id, Float:val);
33 native       get_strlen(id);
34 native       get_str   (id, dst[], maxlen);
35 native       set_str   (id, str[]);
37 /********************/
38 /* Edje list calls */
39 /********************/
40 native       count      (id);
41 native       remove     (id, n);
42 native       append_int (id, v);
43 native       prepend_int(id, v);
44 native       insert_int (id, pos, v);
45 native       replace_int (id, pos, v);
46 native       fetch_int  (id, pos);
47 native       append_str (id, str[]);
48 native       prepend_str(id, str[]);
49 native       insert_str (id, pos, str[]);
50 native       replace_str(id, pos, str[]);
51 native       fetch_str  (id, pos, dst[], maxlen);
52 native       append_float (id, Float:v);
53 native       prepend_float(id, Float:v);
54 native       insert_float (id, pos, Float:v);
55 native       replace_float(id, pos, Float:v);
56 native Float:fetch_float  (id, pos);
58 /********************/
59 /* Edje timer calls */
60 /********************/
61 native       timer       (Float:in, fname[], val);
62 native       cancel_timer(id);
64 /*******************/
65 /* Edje anim calls */
66 /*******************/
67 native       anim       (Float:len, fname[], val);
68 native       cancel_anim(id);
70 /***********************************************************/
71 /* Edje utility calls for dealing with edjes/programs etc. */
72 /***********************************************************/
73 /* Example:
74  * 
75  * emit("this_thing", "clicked");
76  * emit("state", "playing");
77  * 
78  * set_state(PART:"logo", "glowing", 0.0);
79  * set_state(PART:"button", "default", 0.0);
80  * 
81  * set_tween_state(PART:"button", 0.5, "default", 0.0, "clicked", 0.0);
82  * 
83  * run_program(PROGRAM:"program_name");
84  */
85 native       emit             (sig[], src[]);
86 native       get_part_id      (part[]);
87 native       set_state        (part_id, state[], Float:state_val);
88 native       get_state        (part_id, dst[], maxlen, &Float:val);
89 native       set_tween_state  (part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val);
90 native       run_program      (program_id);
91 native       get_drag_dir     (part_id);
92 native       get_drag         (part_id, &Float:dx, &Float:dy);
93 native       set_drag         (part_id, Float:dx, Float:dy);
94 native       get_drag_size    (part_id, &Float:dx, &Float:dy);
95 native       set_drag_size    (part_id, Float:dx, Float:dy);
96 native       get_drag_step    (part_id, &Float:dx, &Float:dy);
97 native       set_drag_step    (part_id, Float:dx, Float:dy);
98 native       get_drag_page    (part_id, &Float:dx, &Float:dy);
99 native       set_drag_page    (part_id, Float:dx, Float:dy);
100 native       set_text         (part_id, str[]);
101 native       get_text         (part_id, dst[], maxlen);
102 native       get_min_size     (&w, &h);
103 native       get_max_size     (&w, &h);
104 native       get_color_class  (class[], &r, &g, &b, &a);
105 native       set_color_class  (class[], r, g, b, a);
106 native       set_text_class   (class[], font[], Float:size);
107 native       get_text_class   (class[], font[], &Float:size);
108 native       get_geometry     (part_id, &x, &y, &w, &h);
109 native       get_mouse        (&x, &y);
110 native       get_mouse_buttons();
111 native       stop_program     (program_id);
112 native       stop_programs_on (part_id);
113 native       set_min_size     (Float:w, Float:h);
114 native       set_max_size     (Float:w, Float:h);
115 native       part_swallow     (part_id, GROUP:str[]);
117 native       external_param_get_int(id, param_name[]);
118 native       external_param_set_int(id, param_name[], value);
119 native Float:external_param_get_float(id, param_name[]);
120 native       external_param_set_float(id, param_name[], Float:value);
121 native       external_param_get_strlen(id, param_name[]);
122 native       external_param_get_str(id, param_name[], value[], value_maxlen);
123 native       external_param_set_str(id, param_name[], value[]);
124 native       external_param_get_choice_len(id, param_name[]);
125 native       external_param_get_choice(id, param_name[], value[], value_maxlen);
126 native       external_param_set_choice(id, param_name[], value[]);
127 native       external_param_get_bool(id, param_name[]);
128 native       external_param_set_bool(id, param_name[], value);
130 enum Msg_Type
131 {
132    MSG_NONE = 0,
133      MSG_STRING = 2,
134      MSG_INT = 3,
135      MSG_FLOAT = 4,
136      MSG_STRING_SET = 5,
137      MSG_INT_SET = 6,
138      MSG_FLOAT_SET = 7,
139      MSG_STRING_INT = 8,
140      MSG_STRING_FLOAT = 9,
141      MSG_STRING_INT_SET = 10,
142      MSG_STRING_FLOAT_SET = 11
143 };
145 native send_message(Msg_Type:type, id, ...);
147 /**********************/
148 /* Custom state calls */
149 /**********************/
151 /* Example:
152  *
153  * Create the custom state for "my_part", based on the
154  * default description of the same part:
155  *
156  * custom_state(PART:"my_part", "default", 0.0);
157  *
158  * Later, use set_state_val() to change the properties of the custom
159  * state:
160  *
161  * set_state_val(PART:"my_part", STATE_ALIGNMENT, 0.5, 0.5);
162  *
163  * get_state_val() works the same way.
164  */
166 native custom_state(part_id, state[], Float:state_val = 0.0);
168 enum State_Param
169 {
170         STATE_ALIGNMENT = 1,
171         STATE_MIN = 2,
172         STATE_MAX = 3,
173         STATE_STEP = 4,
174         STATE_ASPECT = 5,
175         STATE_ASPECT_PREF = 6,
176         STATE_COLOR = 7,
177         STATE_COLOR2 = 8,
178         STATE_COLOR3 = 9,
179         STATE_COLOR_CLASS = 10,
180         STATE_REL1 = 11,
181         STATE_REL1_TO = 12,
182         STATE_REL1_OFFSET = 13,
183         STATE_REL2 = 14,
184         STATE_REL2_TO = 15,
185         STATE_REL2_OFFSET = 16,
186         STATE_IMAGE = 17,
187         STATE_BORDER = 18,
188         STATE_FILL_SMOOTH = 19,
189         STATE_FILL_POS = 20,
190         STATE_FILL_SIZE = 21,
191         STATE_TEXT = 22,
192         STATE_TEXT_CLASS = 23,
193         STATE_TEXT_FONT = 24,
194         STATE_TEXT_STYLE = 25,
195         STATE_TEXT_SIZE = 26,
196         STATE_TEXT_FIT = 27,
197         STATE_TEXT_MIN = 28,
198         STATE_TEXT_MAX = 29,
199         STATE_TEXT_ALIGN = 30,
200         STATE_VISIBLE = 31,
201         STATE_MAP_ON = 32,
202         STATE_MAP_PERSP = 33,
203         STATE_MAP_LIGHT = 34,
204         STATE_MAP_ROT_CENTER = 35,
205         STATE_MAP_ROT_X = 36,
206         STATE_MAP_ROT_Y = 37,
207         STATE_MAP_ROT_Z = 38,
208         STATE_MAP_BACK_CULL = 39,
209         STATE_MAP_PERSP_ON = 40,
210         STATE_PERSP_ZPLANE = 41,
211         STATE_PERSP_FOCAL = 42
212 };
214 native set_state_val(part_id, State_Param:p, ...);
215 native get_state_val(part_id, State_Param:p, ...);
217 /* Multisense */
218 native       play_sample      (sample_name[], Float:speed);
219 native       play_tone        (tone_name[], Float:duration);

 

MinSeo Park

I found some more.

U can found some samples under " / src / examples"

in same repository.

 

roc john

Thanks again !

:-)

roc john

Thanks you very much !

You are a good man :-D