New embryo function: get_program_id
[platform/upstream/edje.git] / data / include / edje.inc
1 /* Edje exported calls */
2
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[]);
36
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);
57
58 /********************/
59 /* Edje timer calls */
60 /********************/
61 native       timer       (Float:in, fname[], val);
62 native       cancel_timer(id);
63
64 /*******************/
65 /* Edje anim calls */
66 /*******************/
67 native       anim       (Float:len, fname[], val);
68 native       cancel_anim(id);
69
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       get_program_id   (program[]);
88 native       set_state        (part_id, state[], Float:state_val);
89 native       get_state        (part_id, dst[], maxlen, &Float:val);
90 native       set_tween_state  (part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val);
91 native       run_program      (program_id);
92 native       get_drag_dir     (part_id);
93 native       get_drag         (part_id, &Float:dx, &Float:dy);
94 native       set_drag         (part_id, Float:dx, Float:dy);
95 native       get_drag_size    (part_id, &Float:dx, &Float:dy);
96 native       set_drag_size    (part_id, Float:dx, Float:dy);
97 native       get_drag_step    (part_id, &Float:dx, &Float:dy);
98 native       set_drag_step    (part_id, Float:dx, Float:dy);
99 native       get_drag_page    (part_id, &Float:dx, &Float:dy);
100 native       set_drag_page    (part_id, Float:dx, Float:dy);
101 native       set_text         (part_id, str[]);
102 native       get_text         (part_id, dst[], maxlen);
103 native       get_min_size     (&w, &h);
104 native       get_max_size     (&w, &h);
105 native       get_color_class  (class[], &r, &g, &b, &a);
106 native       set_color_class  (class[], r, g, b, a);
107 native       set_text_class   (class[], font[], Float:size);
108 native       get_text_class   (class[], font[], &Float:size);
109 native       get_geometry     (part_id, &x, &y, &w, &h);
110 native       get_mouse        (&x, &y);
111 native       get_mouse_buttons();
112 native       stop_program     (program_id);
113 native       stop_programs_on (part_id);
114 native       set_min_size     (Float:w, Float:h);
115 native       set_max_size     (Float:w, Float:h);
116 native       part_swallow     (part_id, GROUP:str[]);
117
118 native       external_param_get_int(id, param_name[]);
119 native       external_param_set_int(id, param_name[], value);
120 native Float:external_param_get_float(id, param_name[]);
121 native       external_param_set_float(id, param_name[], Float:value);
122 native       external_param_get_strlen(id, param_name[]);
123 native       external_param_get_str(id, param_name[], value[], value_maxlen);
124 native       external_param_set_str(id, param_name[], value[]);
125 native       external_param_get_choice_len(id, param_name[]);
126 native       external_param_get_choice(id, param_name[], value[], value_maxlen);
127 native       external_param_set_choice(id, param_name[], value[]);
128 native       external_param_get_bool(id, param_name[]);
129 native       external_param_set_bool(id, param_name[], value);
130
131 enum Msg_Type
132 {
133    MSG_NONE = 0,
134      MSG_STRING = 2,
135      MSG_INT = 3,
136      MSG_FLOAT = 4,
137      MSG_STRING_SET = 5,
138      MSG_INT_SET = 6,
139      MSG_FLOAT_SET = 7,
140      MSG_STRING_INT = 8,
141      MSG_STRING_FLOAT = 9,
142      MSG_STRING_INT_SET = 10,
143      MSG_STRING_FLOAT_SET = 11
144 };
145
146 native send_message(Msg_Type:type, id, ...);
147
148 /**********************/
149 /* Custom state calls */
150 /**********************/
151
152 /* Example:
153  *
154  * Create the custom state for "my_part", based on the
155  * default description of the same part:
156  *
157  * custom_state(PART:"my_part", "default", 0.0);
158  *
159  * Later, use set_state_val() to change the properties of the custom
160  * state:
161  *
162  * set_state_val(PART:"my_part", STATE_ALIGNMENT, 0.5, 0.5);
163  *
164  * get_state_val() works the same way.
165  */
166
167 native custom_state(part_id, state[], Float:state_val = 0.0);
168
169 enum State_Param
170 {
171         STATE_ALIGNMENT = 1,
172         STATE_MIN = 2,
173         STATE_MAX = 3,
174         STATE_STEP = 4,
175         STATE_ASPECT = 5,
176         STATE_ASPECT_PREF = 6,
177         STATE_COLOR = 7,
178         STATE_COLOR2 = 8,
179         STATE_COLOR3 = 9,
180         STATE_COLOR_CLASS = 10,
181         STATE_REL1 = 11,
182         STATE_REL1_TO = 12,
183         STATE_REL1_OFFSET = 13,
184         STATE_REL2 = 14,
185         STATE_REL2_TO = 15,
186         STATE_REL2_OFFSET = 16,
187         STATE_IMAGE = 17,
188         STATE_BORDER = 18,
189         STATE_FILL_SMOOTH = 19,
190         STATE_FILL_POS = 20,
191         STATE_FILL_SIZE = 21,
192         STATE_TEXT = 22,
193         STATE_TEXT_CLASS = 23,
194         STATE_TEXT_FONT = 24,
195         STATE_TEXT_STYLE = 25,
196         STATE_TEXT_SIZE = 26,
197         STATE_TEXT_FIT = 27,
198         STATE_TEXT_MIN = 28,
199         STATE_TEXT_MAX = 29,
200         STATE_TEXT_ALIGN = 30,
201         STATE_VISIBLE = 31,
202         STATE_MAP_ON = 32,
203         STATE_MAP_PERSP = 33,
204         STATE_MAP_LIGHT = 34,
205         STATE_MAP_ROT_CENTER = 35,
206         STATE_MAP_ROT_X = 36,
207         STATE_MAP_ROT_Y = 37,
208         STATE_MAP_ROT_Z = 38,
209         STATE_MAP_BACK_CULL = 39,
210         STATE_MAP_PERSP_ON = 40,
211         STATE_PERSP_ZPLANE = 41,
212         STATE_PERSP_FOCAL = 42
213 };
214
215 native set_state_val(part_id, State_Param:p, ...);
216 native get_state_val(part_id, State_Param:p, ...);
217
218 /* Multisense */
219 native       play_sample      (sample_name[], Float:speed);
220 native       play_tone        (tone_name[], Float:duration);