1 /* Edje exported calls */
3 /************************************************/
4 /* Basic data storage/retrieval (it's explicit) */
5 /************************************************/
8 * In the "global" script section of a group:
11 * public global_value1;
12 * public global_value2;
13 * public global_value3;
16 * In the program script sections, OR in any global functions/routines:
17 * ( several examples of setting/getting values)
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);
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 /********************/
39 /********************/
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);
67 native anim (Float:len, fname[], val);
68 native cancel_anim(id);
70 /***********************************************************/
71 /* Edje utility calls for dealing with edjes/programs etc. */
72 /***********************************************************/
75 * emit("this_thing", "clicked");
76 * emit("state", "playing");
78 * set_state(PART:"logo", "glowing", 0.0);
79 * set_state(PART:"button", "default", 0.0);
81 * set_tween_state(PART:"button", 0.5, "default", 0.0, "clicked", 0.0);
83 * run_program(PROGRAM:"program_name");
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);
140 MSG_STRING_FLOAT = 9,
141 MSG_STRING_INT_SET = 10,
142 MSG_STRING_FLOAT_SET = 11
145 native send_message(Msg_Type:type, id, ...);
147 /**********************/
148 /* Custom state calls */
149 /**********************/
153 * Create the custom state for "my_part", based on the
154 * default description of the same part:
156 * custom_state(PART:"my_part", "default", 0.0);
158 * Later, use set_state_val() to change the properties of the custom
161 * set_state_val(PART:"my_part", STATE_ALIGNMENT, 0.5, 0.5);
163 * get_state_val() works the same way.
166 native custom_state(part_id, state[], Float:state_val = 0.0);
175 STATE_ASPECT_PREF = 6,
179 STATE_COLOR_CLASS = 10,
182 STATE_REL1_OFFSET = 13,
185 STATE_REL2_OFFSET = 16,
188 STATE_FILL_SMOOTH = 19,
190 STATE_FILL_SIZE = 21,
192 STATE_TEXT_CLASS = 23,
193 STATE_TEXT_FONT = 24,
194 STATE_TEXT_STYLE = 25,
195 STATE_TEXT_SIZE = 26,
199 STATE_TEXT_ALIGN = 30,
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
214 native set_state_val(part_id, State_Param:p, ...);
215 native get_state_val(part_id, State_Param:p, ...);
218 native play_sample (sample_name[], Float:speed);
219 native play_tone (tone_name[], Float:duration);