diff options
Diffstat (limited to 'libraries/edje/src/bin/edje_cc_handlers.c')
-rw-r--r-- | libraries/edje/src/bin/edje_cc_handlers.c | 7763 |
1 files changed, 7763 insertions, 0 deletions
diff --git a/libraries/edje/src/bin/edje_cc_handlers.c b/libraries/edje/src/bin/edje_cc_handlers.c new file mode 100644 index 0000000..8bfc262 --- /dev/null +++ b/libraries/edje/src/bin/edje_cc_handlers.c | |||
@@ -0,0 +1,7763 @@ | |||
1 | /* | ||
2 | Concerning the EDC reference: | ||
3 | |||
4 | The formatting for blocks and properties has been implemented as a table | ||
5 | which is filled using ALIASES. | ||
6 | For maximum flexibility I implemented them in the \@code/\@encode style, | ||
7 | this means that missing one or changing the order most certainly cause | ||
8 | formatting errors. | ||
9 | |||
10 | \@block | ||
11 | block name | ||
12 | \@context | ||
13 | code sample of the block | ||
14 | \@description | ||
15 | the block's description | ||
16 | \@endblock | ||
17 | |||
18 | \@property | ||
19 | property name | ||
20 | \@parameters | ||
21 | property's parameter list | ||
22 | \@effect | ||
23 | the property description (lol) | ||
24 | \@endproperty | ||
25 | */ | ||
26 | |||
27 | #ifdef HAVE_CONFIG_H | ||
28 | # include "config.h" | ||
29 | #endif | ||
30 | |||
31 | #include <string.h> | ||
32 | #include <errno.h> | ||
33 | #include <sys/stat.h> | ||
34 | #include <fcntl.h> | ||
35 | #include <sys/mman.h> | ||
36 | #include <unistd.h> | ||
37 | |||
38 | #include "edje_cc.h" | ||
39 | |||
40 | /** | ||
41 | * @page edcref Edje Data Collection reference | ||
42 | * An Edje Data Collection, it's a plain text file (normally identified with the | ||
43 | * .edc extension),consisting of instructions for the Edje Compiler. | ||
44 | * | ||
45 | * The syntax for the edje data collection files follows a simple structure of | ||
46 | * "blocks { .. }" that can contain "properties: ..", more blocks, or both. | ||
47 | * | ||
48 | * @anchor sec_quickaccess Quick access to block descriptions: | ||
49 | * <ul> | ||
50 | * <li>@ref sec_toplevel "Top-Level"</li> | ||
51 | * <li>@ref sec_group "Group"</li> | ||
52 | * <li>@ref sec_description "State description"</li> | ||
53 | * <ul> | ||
54 | * <li>@ref sec_description_image "Image"</li> | ||
55 | * <li>@ref sec_description_text "Text"</li> | ||
56 | * <li>@ref sec_description_box "Box"</li> | ||
57 | * <li>@ref sec_description_table "Table"</li> | ||
58 | * <li>@ref sec_description_map "Map (3d/transformations)"</li> | ||
59 | * </ul> | ||
60 | * <li>@ref sec_program "Program block"</li> | ||
61 | * </ul> | ||
62 | * | ||
63 | * @author Andres Blanc (dresb) andresblanc@gmail.com | ||
64 | * | ||
65 | * <table class="edcref" border="0"> | ||
66 | */ | ||
67 | |||
68 | static Edje_Part_Collection_Directory_Entry *current_de = NULL; | ||
69 | static Edje_Part *current_part = NULL; | ||
70 | static Edje_Pack_Element *current_item = NULL; | ||
71 | static Edje_Part_Description_Common *current_desc = NULL; | ||
72 | static Edje_Part_Description_Common *parent_desc = NULL; | ||
73 | static Edje_Program *current_program = NULL; | ||
74 | |||
75 | static void st_externals_external(void); | ||
76 | |||
77 | static void st_images_image(void); | ||
78 | static void ob_images_set(void); | ||
79 | static void st_images_set_name(void); | ||
80 | static void ob_images_set_image(void); | ||
81 | static void st_images_set_image_image(void); | ||
82 | static void st_images_set_image_size(void); | ||
83 | |||
84 | static void st_fonts_font(void); | ||
85 | |||
86 | static void st_data_item(void); | ||
87 | static void st_data_file(void); | ||
88 | |||
89 | static void ob_styles_style(void); | ||
90 | static void st_styles_style_name(void); | ||
91 | static void st_styles_style_base(void); | ||
92 | static void st_styles_style_tag(void); | ||
93 | |||
94 | static void ob_color_class(void); | ||
95 | static void st_color_class_name(void); | ||
96 | static void st_color_class_color(void); | ||
97 | static void st_color_class_color2(void); | ||
98 | static void st_color_class_color3(void); | ||
99 | |||
100 | static void ob_collections(void); | ||
101 | |||
102 | static void ob_collections_group(void); | ||
103 | static void st_collections_group_name(void); | ||
104 | static void st_collections_group_inherit(void); | ||
105 | static void st_collections_group_script_only(void); | ||
106 | static void st_collections_group_alias(void); | ||
107 | static void st_collections_group_min(void); | ||
108 | static void st_collections_group_max(void); | ||
109 | static void st_collections_group_data_item(void); | ||
110 | static void st_collections_group_orientation(void); | ||
111 | |||
112 | static void st_collections_group_limits_vertical(void); | ||
113 | static void st_collections_group_limits_horizontal(void); | ||
114 | |||
115 | static void ob_collections_group_script(void); | ||
116 | static void ob_collections_group_lua_script(void); | ||
117 | |||
118 | static void st_collections_group_parts_alias(void); | ||
119 | |||
120 | static void ob_collections_group_parts_part(void); | ||
121 | static void st_collections_group_parts_part_name(void); | ||
122 | static void st_collections_group_parts_part_type(void); | ||
123 | static void st_collections_group_parts_part_insert_before(void); | ||
124 | static void st_collections_group_parts_part_insert_after(void); | ||
125 | static void st_collections_group_parts_part_effect(void); | ||
126 | static void st_collections_group_parts_part_mouse_events(void); | ||
127 | static void st_collections_group_parts_part_repeat_events(void); | ||
128 | static void st_collections_group_parts_part_ignore_flags(void); | ||
129 | static void st_collections_group_parts_part_scale(void); | ||
130 | static void st_collections_group_parts_part_pointer_mode(void); | ||
131 | static void st_collections_group_parts_part_precise_is_inside(void); | ||
132 | static void st_collections_group_parts_part_use_alternate_font_metrics(void); | ||
133 | static void st_collections_group_parts_part_clip_to_id(void); | ||
134 | static void st_collections_group_parts_part_source(void); | ||
135 | static void st_collections_group_parts_part_source2(void); | ||
136 | static void st_collections_group_parts_part_source3(void); | ||
137 | static void st_collections_group_parts_part_source4(void); | ||
138 | static void st_collections_group_parts_part_source5(void); | ||
139 | static void st_collections_group_parts_part_source6(void); | ||
140 | static void st_collections_group_parts_part_entry_mode(void); | ||
141 | static void st_collections_group_parts_part_select_mode(void); | ||
142 | static void st_collections_group_parts_part_cursor_mode(void); | ||
143 | static void st_collections_group_parts_part_multiline(void); | ||
144 | static void st_collections_group_parts_part_dragable_x(void); | ||
145 | static void st_collections_group_parts_part_dragable_y(void); | ||
146 | static void st_collections_group_parts_part_dragable_confine(void); | ||
147 | static void st_collections_group_parts_part_dragable_events(void); | ||
148 | |||
149 | /* box and table items share these */ | ||
150 | static void ob_collections_group_parts_part_box_items_item(void); | ||
151 | static void st_collections_group_parts_part_box_items_item_type(void); | ||
152 | static void st_collections_group_parts_part_box_items_item_name(void); | ||
153 | static void st_collections_group_parts_part_box_items_item_source(void); | ||
154 | static void st_collections_group_parts_part_box_items_item_min(void); | ||
155 | static void st_collections_group_parts_part_box_items_item_prefer(void); | ||
156 | static void st_collections_group_parts_part_box_items_item_max(void); | ||
157 | static void st_collections_group_parts_part_box_items_item_padding(void); | ||
158 | static void st_collections_group_parts_part_box_items_item_align(void); | ||
159 | static void st_collections_group_parts_part_box_items_item_weight(void); | ||
160 | static void st_collections_group_parts_part_box_items_item_aspect(void); | ||
161 | static void st_collections_group_parts_part_box_items_item_aspect_mode(void); | ||
162 | static void st_collections_group_parts_part_box_items_item_options(void); | ||
163 | /* but these are only for table */ | ||
164 | static void st_collections_group_parts_part_table_items_item_position(void); | ||
165 | static void st_collections_group_parts_part_table_items_item_span(void); | ||
166 | |||
167 | static void ob_collections_group_parts_part_description(void); | ||
168 | static void st_collections_group_parts_part_description_inherit(void); | ||
169 | static void st_collections_group_parts_part_description_source(void); | ||
170 | static void st_collections_group_parts_part_description_state(void); | ||
171 | static void st_collections_group_parts_part_description_visible(void); | ||
172 | static void st_collections_group_parts_part_description_align(void); | ||
173 | static void st_collections_group_parts_part_description_fixed(void); | ||
174 | static void st_collections_group_parts_part_description_min(void); | ||
175 | static void st_collections_group_parts_part_description_max(void); | ||
176 | static void st_collections_group_parts_part_description_step(void); | ||
177 | static void st_collections_group_parts_part_description_aspect(void); | ||
178 | static void st_collections_group_parts_part_description_aspect_preference(void); | ||
179 | static void st_collections_group_parts_part_description_rel1_relative(void); | ||
180 | static void st_collections_group_parts_part_description_rel1_offset(void); | ||
181 | static void st_collections_group_parts_part_description_rel1_to(void); | ||
182 | static void st_collections_group_parts_part_description_rel1_to_x(void); | ||
183 | static void st_collections_group_parts_part_description_rel1_to_y(void); | ||
184 | static void st_collections_group_parts_part_description_rel2_relative(void); | ||
185 | static void st_collections_group_parts_part_description_rel2_offset(void); | ||
186 | static void st_collections_group_parts_part_description_rel2_to(void); | ||
187 | static void st_collections_group_parts_part_description_rel2_to_x(void); | ||
188 | static void st_collections_group_parts_part_description_rel2_to_y(void); | ||
189 | static void st_collections_group_parts_part_description_image_normal(void); | ||
190 | static void st_collections_group_parts_part_description_image_tween(void); | ||
191 | static void st_collections_group_parts_part_description_image_border(void); | ||
192 | static void st_collections_group_parts_part_description_image_middle(void); | ||
193 | static void st_collections_group_parts_part_description_image_border_scale(void); | ||
194 | static void st_collections_group_parts_part_description_image_border_scale_by(void); | ||
195 | static void st_collections_group_parts_part_description_image_scale_hint(void); | ||
196 | static void st_collections_group_parts_part_description_fill_smooth(void); | ||
197 | static void st_collections_group_parts_part_description_fill_origin_relative(void); | ||
198 | static void st_collections_group_parts_part_description_fill_origin_offset(void); | ||
199 | static void st_collections_group_parts_part_description_fill_size_relative(void); | ||
200 | static void st_collections_group_parts_part_description_fill_size_offset(void); | ||
201 | static void st_collections_group_parts_part_description_fill_spread(void); | ||
202 | static void st_collections_group_parts_part_description_fill_type(void); | ||
203 | static void st_collections_group_parts_part_description_color_class(void); | ||
204 | static void st_collections_group_parts_part_description_color(void); | ||
205 | static void st_collections_group_parts_part_description_color2(void); | ||
206 | static void st_collections_group_parts_part_description_color3(void); | ||
207 | static void st_collections_group_parts_part_description_text_text(void); | ||
208 | static void st_collections_group_parts_part_description_text_text_class(void); | ||
209 | static void st_collections_group_parts_part_description_text_font(void); | ||
210 | static void st_collections_group_parts_part_description_text_style(void); | ||
211 | static void st_collections_group_parts_part_description_text_repch(void); | ||
212 | static void st_collections_group_parts_part_description_text_size(void); | ||
213 | static void st_collections_group_parts_part_description_text_size_range(void); | ||
214 | static void st_collections_group_parts_part_description_text_fit(void); | ||
215 | static void st_collections_group_parts_part_description_text_min(void); | ||
216 | static void st_collections_group_parts_part_description_text_max(void); | ||
217 | static void st_collections_group_parts_part_description_text_align(void); | ||
218 | static void st_collections_group_parts_part_description_text_source(void); | ||
219 | static void st_collections_group_parts_part_description_text_text_source(void); | ||
220 | static void st_collections_group_parts_part_description_text_elipsis(void); | ||
221 | static void st_collections_group_parts_part_description_box_layout(void); | ||
222 | static void st_collections_group_parts_part_description_box_align(void); | ||
223 | static void st_collections_group_parts_part_description_box_padding(void); | ||
224 | static void st_collections_group_parts_part_description_box_min(void); | ||
225 | static void st_collections_group_parts_part_description_table_homogeneous(void); | ||
226 | static void st_collections_group_parts_part_description_table_align(void); | ||
227 | static void st_collections_group_parts_part_description_table_padding(void); | ||
228 | static void st_collections_group_parts_part_description_table_min(void); | ||
229 | static void st_collections_group_parts_part_description_map_perspective(void); | ||
230 | static void st_collections_group_parts_part_description_map_light(void); | ||
231 | static void st_collections_group_parts_part_description_map_rotation_center(void); | ||
232 | static void st_collections_group_parts_part_description_map_rotation_x(void); | ||
233 | static void st_collections_group_parts_part_description_map_rotation_y(void); | ||
234 | static void st_collections_group_parts_part_description_map_rotation_z(void); | ||
235 | static void st_collections_group_parts_part_description_map_on(void); | ||
236 | static void st_collections_group_parts_part_description_map_smooth(void); | ||
237 | static void st_collections_group_parts_part_description_map_alpha(void); | ||
238 | static void st_collections_group_parts_part_description_map_backface_cull(void); | ||
239 | static void st_collections_group_parts_part_description_map_perspective_on(void); | ||
240 | static void st_collections_group_parts_part_description_perspective_zplane(void); | ||
241 | static void st_collections_group_parts_part_description_perspective_focal(void); | ||
242 | static void st_collections_group_parts_part_api(void); | ||
243 | |||
244 | /* external part parameters */ | ||
245 | static void st_collections_group_parts_part_description_params_int(void); | ||
246 | static void ob_collections_group_programs_program(void); | ||
247 | static void st_collections_group_parts_part_description_params_double(void); | ||
248 | |||
249 | static void st_collections_group_programs_program_name(void); | ||
250 | static void st_collections_group_parts_part_description_params_string(void); | ||
251 | static void st_collections_group_parts_part_description_params_bool(void); | ||
252 | static void st_collections_group_parts_part_description_params_choice(void); | ||
253 | static void st_collections_group_programs_program_signal(void); | ||
254 | static void st_collections_group_programs_program_source(void); | ||
255 | static void st_collections_group_programs_program_filter(void); | ||
256 | static void st_collections_group_programs_program_in(void); | ||
257 | static void st_collections_group_programs_program_action(void); | ||
258 | static void st_collections_group_programs_program_transition(void); | ||
259 | static void st_collections_group_programs_program_target(void); | ||
260 | static void st_collections_group_programs_program_after(void); | ||
261 | static void st_collections_group_programs_program_api(void); | ||
262 | |||
263 | static void ob_collections_group_programs_program_script(void); | ||
264 | |||
265 | #ifdef ENABLE_MULTISENSE | ||
266 | static void st_collections_group_sound_sample_name(void); | ||
267 | static void st_collections_group_sound_sample_source(void); | ||
268 | static void st_collections_group_sound_tone(void); | ||
269 | #endif | ||
270 | |||
271 | /*****/ | ||
272 | |||
273 | New_Statement_Handler statement_handlers[] = | ||
274 | { | ||
275 | {"externals.external", st_externals_external}, | ||
276 | {"images.image", st_images_image}, | ||
277 | {"images.set.name", st_images_set_name}, | ||
278 | {"images.set.image.image", st_images_set_image_image}, | ||
279 | {"images.set.image.size", st_images_set_image_size}, | ||
280 | {"fonts.font", st_fonts_font}, | ||
281 | {"data.item", st_data_item}, | ||
282 | {"data.file", st_data_file}, | ||
283 | {"styles.style.name", st_styles_style_name}, | ||
284 | {"styles.style.base", st_styles_style_base}, | ||
285 | {"styles.style.tag", st_styles_style_tag}, | ||
286 | {"color_classes.color_class.name", st_color_class_name}, | ||
287 | {"color_classes.color_class.color", st_color_class_color}, | ||
288 | {"color_classes.color_class.color2", st_color_class_color2}, | ||
289 | {"color_classes.color_class.color3", st_color_class_color3}, | ||
290 | {"collections.externals.external", st_externals_external}, /* dup */ | ||
291 | {"collections.image", st_images_image}, /* dup */ | ||
292 | {"collections.set.name", st_images_set_name}, /* dup */ | ||
293 | {"collections.set.image.image", st_images_set_image_image}, /* dup */ | ||
294 | {"collections.set.image.size", st_images_set_image_size}, /* dup */ | ||
295 | {"collections.images.image", st_images_image}, /* dup */ | ||
296 | {"collections.images.set.name", st_images_set_name}, /* dup */ | ||
297 | {"collections.images.set.image.image", st_images_set_image_image}, /* dup */ | ||
298 | {"collections.images.set.image.size", st_images_set_image_size}, /* dup */ | ||
299 | {"collections.font", st_fonts_font}, /* dup */ | ||
300 | {"collections.fonts.font", st_fonts_font}, /* dup */ | ||
301 | {"collections.styles.style.name", st_styles_style_name}, /* dup */ | ||
302 | {"collections.styles.style.base", st_styles_style_base}, /* dup */ | ||
303 | {"collections.styles.style.tag", st_styles_style_tag}, /* dup */ | ||
304 | {"collections.color_classes.color_class.name", st_color_class_name}, /* dup */ | ||
305 | {"collections.color_classes.color_class.color", st_color_class_color}, /* dup */ | ||
306 | {"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */ | ||
307 | {"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */ | ||
308 | #ifdef ENABLE_MULTISENSE | ||
309 | {"collections.sounds.sample.name", st_collections_group_sound_sample_name}, | ||
310 | {"collections.sounds.sample.source", st_collections_group_sound_sample_source}, | ||
311 | {"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */ | ||
312 | {"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */ | ||
313 | {"collections.sounds.tone", st_collections_group_sound_tone}, | ||
314 | {"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */ | ||
315 | #endif | ||
316 | {"collections.group.name", st_collections_group_name}, | ||
317 | {"collections.group.inherit", st_collections_group_inherit}, | ||
318 | {"collections.group.script_only", st_collections_group_script_only}, | ||
319 | {"collections.group.lua_script_only", st_collections_group_script_only}, | ||
320 | {"collections.group.alias", st_collections_group_alias}, | ||
321 | {"collections.group.min", st_collections_group_min}, | ||
322 | {"collections.group.max", st_collections_group_max}, | ||
323 | {"collections.group.orientation", st_collections_group_orientation}, | ||
324 | {"collections.group.data.item", st_collections_group_data_item}, | ||
325 | {"collections.group.limits.horizontal", st_collections_group_limits_horizontal}, | ||
326 | {"collections.group.limits.vertical", st_collections_group_limits_vertical}, | ||
327 | {"collections.group.externals.external", st_externals_external}, /* dup */ | ||
328 | {"collections.group.image", st_images_image}, /* dup */ | ||
329 | {"collections.group.set.name", st_images_set_name}, | ||
330 | {"collections.group.set.image.image", st_images_set_image_image}, | ||
331 | {"collections.group.set.image.size", st_images_set_image_size}, | ||
332 | {"collections.group.images.image", st_images_image}, /* dup */ | ||
333 | {"collections.group.images.set.name", st_images_set_name}, | ||
334 | {"collections.group.images.set.image.image", st_images_set_image_image}, | ||
335 | {"collections.group.images.set.image.size", st_images_set_image_size}, | ||
336 | {"collections.group.font", st_fonts_font}, /* dup */ | ||
337 | {"collections.group.fonts.font", st_fonts_font}, /* dup */ | ||
338 | {"collections.group.styles.style.name", st_styles_style_name}, /* dup */ | ||
339 | {"collections.group.styles.style.base", st_styles_style_base}, /* dup */ | ||
340 | {"collections.group.styles.style.tag", st_styles_style_tag}, /* dup */ | ||
341 | {"collections.group.color_classes.color_class.name", st_color_class_name}, /* dup */ | ||
342 | {"collections.group.color_classes.color_class.color", st_color_class_color}, /* dup */ | ||
343 | {"collections.group.color_classes.color_class.color2", st_color_class_color2}, /* dup */ | ||
344 | {"collections.group.color_classes.color_class.color3", st_color_class_color3}, /* dup */ | ||
345 | {"collections.group.parts.alias", st_collections_group_parts_alias }, | ||
346 | {"collections.group.parts.image", st_images_image}, /* dup */ | ||
347 | {"collections.group.parts.set.name", st_images_set_name}, | ||
348 | {"collections.group.parts.set.image.image", st_images_set_image_image}, | ||
349 | {"collections.group.parts.set.image.size", st_images_set_image_size}, | ||
350 | {"collections.group.parts.images.image", st_images_image}, /* dup */ | ||
351 | {"collections.group.parts.images.set.name", st_images_set_name}, | ||
352 | {"collections.group.parts.images.set.image.image", st_images_set_image_image}, | ||
353 | {"collections.group.parts.images.set.image.size", st_images_set_image_size}, | ||
354 | {"collections.group.parts.font", st_fonts_font}, /* dup */ | ||
355 | {"collections.group.parts.fonts.font", st_fonts_font}, /* dup */ | ||
356 | {"collections.group.parts.styles.style.name", st_styles_style_name}, /* dup */ | ||
357 | {"collections.group.parts.styles.style.base", st_styles_style_base}, /* dup */ | ||
358 | {"collections.group.parts.styles.style.tag", st_styles_style_tag}, /* dup */ | ||
359 | {"collections.group.parts.color_classes.color_class.name", st_color_class_name}, /* dup */ | ||
360 | {"collections.group.parts.color_classes.color_class.color", st_color_class_color}, /* dup */ | ||
361 | {"collections.group.parts.color_classes.color_class.color2", st_color_class_color2}, /* dup */ | ||
362 | {"collections.group.parts.color_classes.color_class.color3", st_color_class_color3}, /* dup */ | ||
363 | {"collections.group.parts.part.name", st_collections_group_parts_part_name}, | ||
364 | {"collections.group.parts.part.api", st_collections_group_parts_part_api}, | ||
365 | {"collections.group.parts.part.type", st_collections_group_parts_part_type}, | ||
366 | {"collections.group.parts.part.insert_before", st_collections_group_parts_part_insert_before}, | ||
367 | {"collections.group.parts.part.insert_after", st_collections_group_parts_part_insert_after}, | ||
368 | {"collections.group.parts.part.effect", st_collections_group_parts_part_effect}, | ||
369 | {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events}, | ||
370 | {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events}, | ||
371 | {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags}, | ||
372 | {"collections.group.parts.part.scale", st_collections_group_parts_part_scale}, | ||
373 | {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode}, | ||
374 | {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside}, | ||
375 | {"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics}, | ||
376 | {"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id}, | ||
377 | {"collections.group.parts.part.source", st_collections_group_parts_part_source}, | ||
378 | {"collections.group.parts.part.source2", st_collections_group_parts_part_source2}, | ||
379 | {"collections.group.parts.part.source3", st_collections_group_parts_part_source3}, | ||
380 | {"collections.group.parts.part.source4", st_collections_group_parts_part_source4}, | ||
381 | {"collections.group.parts.part.source5", st_collections_group_parts_part_source5}, | ||
382 | {"collections.group.parts.part.source6", st_collections_group_parts_part_source6}, | ||
383 | {"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x}, | ||
384 | {"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y}, | ||
385 | {"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine}, | ||
386 | {"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events}, | ||
387 | {"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode}, | ||
388 | {"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode}, | ||
389 | {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode}, | ||
390 | {"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline}, | ||
391 | {"collections.group.parts.part.image", st_images_image}, /* dup */ | ||
392 | {"collections.group.parts.part.set.name", st_images_set_name}, | ||
393 | {"collections.group.parts.part.set.image.image", st_images_set_image_image}, | ||
394 | {"collections.group.parts.part.set.image.size", st_images_set_image_size}, | ||
395 | {"collections.group.parts.part.images.image", st_images_image}, /* dup */ | ||
396 | {"collections.group.parts.part.images.set.name", st_images_set_name}, | ||
397 | {"collections.group.parts.part.images.set.image.image", st_images_set_image_image}, | ||
398 | {"collections.group.parts.part.images.set.image.size", st_images_set_image_size}, | ||
399 | {"collections.group.parts.part.font", st_fonts_font}, /* dup */ | ||
400 | {"collections.group.parts.part.fonts.font", st_fonts_font}, /* dup */ | ||
401 | {"collections.group.parts.part.styles.style.name", st_styles_style_name}, /* dup */ | ||
402 | {"collections.group.parts.part.styles.style.base", st_styles_style_base}, /* dup */ | ||
403 | {"collections.group.parts.part.styles.style.tag", st_styles_style_tag}, /* dup */ | ||
404 | {"collections.group.parts.part.color_classes.color_class.name", st_color_class_name}, /* dup */ | ||
405 | {"collections.group.parts.part.color_classes.color_class.color", st_color_class_color}, /* dup */ | ||
406 | {"collections.group.parts.part.color_classes.color_class.color2", st_color_class_color2}, /* dup */ | ||
407 | {"collections.group.parts.part.color_classes.color_class.color3", st_color_class_color3}, /* dup */ | ||
408 | {"collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type}, | ||
409 | {"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name}, | ||
410 | {"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source}, | ||
411 | {"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min}, | ||
412 | {"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, | ||
413 | {"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max}, | ||
414 | {"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, | ||
415 | {"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align}, | ||
416 | {"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, | ||
417 | {"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, | ||
418 | {"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, | ||
419 | {"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options}, | ||
420 | {"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */ | ||
421 | {"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */ | ||
422 | {"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */ | ||
423 | {"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */ | ||
424 | {"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */ | ||
425 | {"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */ | ||
426 | {"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */ | ||
427 | {"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */ | ||
428 | {"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */ | ||
429 | {"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */ | ||
430 | {"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */ | ||
431 | {"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */ | ||
432 | {"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position}, | ||
433 | {"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span}, | ||
434 | {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit}, | ||
435 | {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source}, | ||
436 | {"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state}, | ||
437 | {"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible}, | ||
438 | {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align}, | ||
439 | {"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed}, | ||
440 | {"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min}, | ||
441 | {"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max}, | ||
442 | {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step}, | ||
443 | {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect}, | ||
444 | {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference}, | ||
445 | {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative}, | ||
446 | {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset}, | ||
447 | {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to}, | ||
448 | {"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x}, | ||
449 | {"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y}, | ||
450 | {"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative}, | ||
451 | {"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset}, | ||
452 | {"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to}, | ||
453 | {"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x}, | ||
454 | {"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y}, | ||
455 | {"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal}, | ||
456 | {"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween}, | ||
457 | {"collections.group.parts.part.description.image.image", st_images_image}, /* dup */ | ||
458 | {"collections.group.parts.part.description.image.set.name", st_images_set_name}, | ||
459 | {"collections.group.parts.part.description.image.set.image.image", st_images_set_image_image}, | ||
460 | {"collections.group.parts.part.description.image.set.image.size", st_images_set_image_size}, | ||
461 | {"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */ | ||
462 | {"collections.group.parts.part.description.image.images.set.name", st_images_set_name}, | ||
463 | {"collections.group.parts.part.description.image.images.set.image.image", st_images_set_image_image}, | ||
464 | {"collections.group.parts.part.description.image.images.set.image.size", st_images_set_image_size}, | ||
465 | {"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border}, | ||
466 | {"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle}, | ||
467 | {"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale}, | ||
468 | {"collections.group.parts.part.description.image.border_scale_by", st_collections_group_parts_part_description_image_border_scale_by}, | ||
469 | {"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint}, | ||
470 | {"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth}, | ||
471 | {"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative}, | ||
472 | {"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset}, | ||
473 | {"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative}, | ||
474 | {"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset}, | ||
475 | {"collections.group.parts.part.description.fill.spread", st_collections_group_parts_part_description_fill_spread}, | ||
476 | {"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type}, | ||
477 | {"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class}, | ||
478 | {"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color}, | ||
479 | {"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2}, | ||
480 | {"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3}, | ||
481 | {"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text}, | ||
482 | {"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class}, | ||
483 | {"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font}, | ||
484 | {"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style}, | ||
485 | {"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch}, | ||
486 | {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size}, | ||
487 | {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range}, | ||
488 | {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit}, | ||
489 | {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min}, | ||
490 | {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max}, | ||
491 | {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align}, | ||
492 | {"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source}, | ||
493 | {"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source}, | ||
494 | {"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */ | ||
495 | {"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */ | ||
496 | {"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis}, | ||
497 | {"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_elipsis}, | ||
498 | {"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout}, | ||
499 | {"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align}, | ||
500 | {"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding}, | ||
501 | {"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min}, | ||
502 | {"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous}, | ||
503 | {"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align}, | ||
504 | {"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding}, | ||
505 | {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min}, | ||
506 | {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective}, | ||
507 | {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light}, | ||
508 | {"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center}, | ||
509 | {"collections.group.parts.part.description.map.rotation.x", st_collections_group_parts_part_description_map_rotation_x}, | ||
510 | {"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y}, | ||
511 | {"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z}, | ||
512 | {"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on}, | ||
513 | {"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth}, | ||
514 | {"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha}, | ||
515 | {"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull}, | ||
516 | {"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on}, | ||
517 | {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane}, | ||
518 | {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal}, | ||
519 | {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int}, | ||
520 | {"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double}, | ||
521 | {"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string}, | ||
522 | {"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool}, | ||
523 | {"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice}, | ||
524 | {"collections.group.parts.part.description.images.image", st_images_image}, /* dup */ | ||
525 | {"collections.group.parts.part.description.images.set.name", st_images_set_name}, | ||
526 | {"collections.group.parts.part.description.images.set.image.image", st_images_set_image_image}, | ||
527 | {"collections.group.parts.part.description.images.set.image.size", st_images_set_image_size}, | ||
528 | {"collections.group.parts.part.description.font", st_fonts_font}, /* dup */ | ||
529 | {"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */ | ||
530 | {"collections.group.parts.part.description.styles.style.name", st_styles_style_name}, /* dup */ | ||
531 | {"collections.group.parts.part.description.styles.style.base", st_styles_style_base}, /* dup */ | ||
532 | {"collections.group.parts.part.description.styles.style.tag", st_styles_style_tag}, /* dup */ | ||
533 | {"collections.group.parts.part.description.color_classes.color_class.name", st_color_class_name}, /* dup */ | ||
534 | {"collections.group.parts.part.description.color_classes.color_class.color", st_color_class_color}, /* dup */ | ||
535 | {"collections.group.parts.part.description.color_classes.color_class.color2", st_color_class_color2}, /* dup */ | ||
536 | {"collections.group.parts.part.description.color_classes.color_class.color3", st_color_class_color3}, /* dup */ | ||
537 | {"collections.group.parts.part.description.programs.image", st_images_image}, /* dup */ | ||
538 | {"collections.group.parts.part.description.programs.set.name", st_images_set_name}, | ||
539 | {"collections.group.parts.part.description.programs.set.image.image", st_images_set_image_image}, | ||
540 | {"collections.group.parts.part.description.programs.set.image.size", st_images_set_image_size}, | ||
541 | {"collections.group.parts.part.description.programs.images.image", st_images_image}, /* dup */ | ||
542 | {"collections.group.parts.part.description.programs.images.set.name", st_images_set_name}, | ||
543 | {"collections.group.parts.part.description.programs.images.set.image.image", st_images_set_image_image}, | ||
544 | {"collections.group.parts.part.description.programs.images.set.image.size", st_images_set_image_size}, | ||
545 | {"collections.group.parts.part.description.programs.font", st_fonts_font}, /* dup */ | ||
546 | {"collections.group.parts.part.description.programs.fonts.font", st_fonts_font}, /* dup */ | ||
547 | {"collections.group.parts.part.description.programs.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
548 | {"collections.group.parts.part.description.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
549 | {"collections.group.parts.part.description.programs.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
550 | {"collections.group.parts.part.description.programs.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
551 | {"collections.group.parts.part.description.programs.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
552 | {"collections.group.parts.part.description.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
553 | {"collections.group.parts.part.description.programs.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
554 | {"collections.group.parts.part.description.programs.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
555 | {"collections.group.parts.part.description.programs.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
556 | {"collections.group.parts.part.description.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
557 | {"collections.group.parts.part.description.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
558 | {"collections.group.parts.part.description.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
559 | {"collections.group.parts.part.description.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
560 | {"collections.group.parts.part.description.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
561 | {"collections.group.parts.part.description.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
562 | {"collections.group.parts.part.description.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
563 | {"collections.group.parts.part.description.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
564 | {"collections.group.parts.part.description.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
565 | {"collections.group.parts.part.programs.image", st_images_image}, /* dup */ | ||
566 | {"collections.group.parts.part.programs.set.name", st_images_set_name}, | ||
567 | {"collections.group.parts.part.programs.set.image.image", st_images_set_image_image}, | ||
568 | {"collections.group.parts.part.programs.set.image.size", st_images_set_image_size}, | ||
569 | {"collections.group.parts.part.programs.images.image", st_images_image}, /* dup */ | ||
570 | {"collections.group.parts.part.programs.images.set.name", st_images_set_name}, | ||
571 | {"collections.group.parts.part.programs.images.set.image.image", st_images_set_image_image}, | ||
572 | {"collections.group.parts.part.programs.images.set.image.size", st_images_set_image_size}, | ||
573 | {"collections.group.parts.part.programs.font", st_fonts_font}, /* dup */ | ||
574 | {"collections.group.parts.part.programs.fonts.font", st_fonts_font}, /* dup */ | ||
575 | {"collections.group.parts.part.programs.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
576 | {"collections.group.parts.part.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
577 | {"collections.group.parts.part.programs.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
578 | {"collections.group.parts.part.programs.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
579 | {"collections.group.parts.part.programs.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
580 | {"collections.group.parts.part.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
581 | {"collections.group.parts.part.programs.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
582 | {"collections.group.parts.part.programs.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
583 | {"collections.group.parts.part.programs.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
584 | {"collections.group.parts.part.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
585 | {"collections.group.parts.part.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
586 | {"collections.group.parts.part.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
587 | {"collections.group.parts.part.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
588 | {"collections.group.parts.part.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
589 | {"collections.group.parts.part.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
590 | {"collections.group.parts.part.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
591 | {"collections.group.parts.part.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
592 | {"collections.group.parts.part.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
593 | {"collections.group.parts.programs.image", st_images_image}, /* dup */ | ||
594 | {"collections.group.parts.programs.set.name", st_images_set_name}, | ||
595 | {"collections.group.parts.programs.set.image.image", st_images_set_image_image}, | ||
596 | {"collections.group.parts.programs.set.image.size", st_images_set_image_size}, | ||
597 | {"collections.group.parts.programs.images.image", st_images_image}, /* dup */ | ||
598 | {"collections.group.parts.programs.images.set.name", st_images_set_name}, | ||
599 | {"collections.group.parts.programs.images.set.image.image", st_images_set_image_image}, | ||
600 | {"collections.group.parts.programs.images.set.image.size", st_images_set_image_size}, | ||
601 | {"collections.group.parts.programs.font", st_fonts_font}, /* dup */ | ||
602 | {"collections.group.parts.programs.fonts.font", st_fonts_font}, /* dup */ | ||
603 | {"collections.group.parts.programs.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
604 | {"collections.group.parts.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
605 | {"collections.group.parts.programs.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
606 | {"collections.group.parts.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */ | ||
607 | {"collections.group.parts.programs.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
608 | {"collections.group.parts.programs.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
609 | {"collections.group.parts.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
610 | {"collections.group.parts.programs.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
611 | {"collections.group.parts.programs.program.after", st_collections_group_programs_program_after}, | ||
612 | {"collections.group.parts.programs.program.api", st_collections_group_programs_program_api}, | ||
613 | {"collections.group.parts.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
614 | {"collections.group.parts.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
615 | {"collections.group.parts.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
616 | {"collections.group.parts.program.filter", st_collections_group_programs_program_filter}, /* dup */ | ||
617 | {"collections.group.parts.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
618 | {"collections.group.parts.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
619 | {"collections.group.parts.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
620 | {"collections.group.parts.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
621 | {"collections.group.parts.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
622 | {"collections.group.parts.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
623 | {"collections.group.program.name", st_collections_group_programs_program_name}, /* dup */ | ||
624 | {"collections.group.program.signal", st_collections_group_programs_program_signal}, /* dup */ | ||
625 | {"collections.group.program.source", st_collections_group_programs_program_source}, /* dup */ | ||
626 | {"collections.group.program.filter", st_collections_group_programs_program_filter}, /* dup */ | ||
627 | {"collections.group.program.in", st_collections_group_programs_program_in}, /* dup */ | ||
628 | {"collections.group.program.action", st_collections_group_programs_program_action}, /* dup */ | ||
629 | {"collections.group.program.transition", st_collections_group_programs_program_transition}, /* dup */ | ||
630 | {"collections.group.program.target", st_collections_group_programs_program_target}, /* dup */ | ||
631 | {"collections.group.program.after", st_collections_group_programs_program_after}, /* dup */ | ||
632 | {"collections.group.program.api", st_collections_group_programs_program_api}, /* dup */ | ||
633 | {"collections.group.programs.program.name", st_collections_group_programs_program_name}, | ||
634 | {"collections.group.programs.program.signal", st_collections_group_programs_program_signal}, | ||
635 | {"collections.group.programs.program.source", st_collections_group_programs_program_source}, | ||
636 | {"collections.group.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */ | ||
637 | {"collections.group.programs.program.in", st_collections_group_programs_program_in}, | ||
638 | {"collections.group.programs.program.action", st_collections_group_programs_program_action}, | ||
639 | {"collections.group.programs.program.transition", st_collections_group_programs_program_transition}, | ||
640 | {"collections.group.programs.program.target", st_collections_group_programs_program_target}, | ||
641 | {"collections.group.programs.program.after", st_collections_group_programs_program_after}, | ||
642 | {"collections.group.programs.program.api", st_collections_group_programs_program_api}, | ||
643 | {"collections.group.programs.image", st_images_image}, /* dup */ | ||
644 | {"collections.group.programs.set.name", st_images_set_name}, | ||
645 | {"collections.group.programs.set.image.image", st_images_set_image_image}, | ||
646 | {"collections.group.programs.set.image.size", st_images_set_image_size}, | ||
647 | {"collections.group.programs.images.image", st_images_image}, /* dup */ | ||
648 | {"collections.group.programs.images.set.name", st_images_set_name}, | ||
649 | {"collections.group.programs.images.set.image.image", st_images_set_image_image}, | ||
650 | {"collections.group.programs.images.set.image.size", st_images_set_image_size}, | ||
651 | {"collections.group.programs.font", st_fonts_font}, /* dup */ | ||
652 | {"collections.group.programs.fonts.font", st_fonts_font} /* dup */ | ||
653 | }; | ||
654 | |||
655 | New_Object_Handler object_handlers[] = | ||
656 | { | ||
657 | {"externals", NULL}, | ||
658 | {"images", NULL}, | ||
659 | {"images.set", ob_images_set}, | ||
660 | {"images.set.image", ob_images_set_image}, | ||
661 | {"fonts", NULL}, | ||
662 | {"data", NULL}, | ||
663 | {"styles", NULL}, | ||
664 | {"styles.style", ob_styles_style}, | ||
665 | {"color_classes", NULL}, | ||
666 | {"color_classes.color_class", ob_color_class}, | ||
667 | {"spectra", NULL}, | ||
668 | {"collections", ob_collections}, | ||
669 | {"collections.externals", NULL}, /* dup */ | ||
670 | {"collections.set", ob_images_set}, /* dup */ | ||
671 | {"collections.set.image", ob_images_set_image}, /* dup */ | ||
672 | {"collections.images", NULL}, /* dup */ | ||
673 | {"collections.images.set", ob_images_set}, /* dup */ | ||
674 | {"collections.images.set.image", ob_images_set_image}, /* dup */ | ||
675 | {"collections.fonts", NULL}, /* dup */ | ||
676 | {"collections.styles", NULL}, /* dup */ | ||
677 | {"collections.styles.style", ob_styles_style}, /* dup */ | ||
678 | {"collections.color_classes", NULL}, /* dup */ | ||
679 | {"collections.color_classes.color_class", ob_color_class}, /* dup */ | ||
680 | #ifdef ENABLE_MULTISENSE | ||
681 | {"collections.sounds", NULL}, | ||
682 | {"collections.group.sounds", NULL}, /* dup */ | ||
683 | {"collections.sounds.sample", NULL}, | ||
684 | {"collections.group.sounds.sample", NULL}, /* dup */ | ||
685 | #endif | ||
686 | {"collections.group", ob_collections_group}, | ||
687 | {"collections.group.data", NULL}, | ||
688 | {"collections.group.script", ob_collections_group_script}, | ||
689 | {"collections.group.lua_script", ob_collections_group_lua_script}, | ||
690 | {"collections.group.externals", NULL}, /* dup */ | ||
691 | {"collections.group.set", ob_images_set}, /* dup */ | ||
692 | {"collections.group.set.image", ob_images_set_image}, /* dup */ | ||
693 | {"collections.group.images", NULL}, /* dup */ | ||
694 | {"collections.group.images.set", ob_images_set}, /* dup */ | ||
695 | {"collections.group.images.set.image", ob_images_set_image}, /* dup */ | ||
696 | {"collections.group.fonts", NULL}, /* dup */ | ||
697 | {"collections.group.styles", NULL}, /* dup */ | ||
698 | {"collections.group.styles.style", ob_styles_style}, /* dup */ | ||
699 | {"collections.group.color_classes", NULL}, /* dup */ | ||
700 | {"collections.group.color_classes.color_class", ob_color_class}, /* dup */ | ||
701 | {"collections.group.parts", NULL}, | ||
702 | {"collections.group.parts.set", ob_images_set}, /* dup */ | ||
703 | {"collections.group.parts.set.image", ob_images_set_image}, /* dup */ | ||
704 | {"collections.group.parts.images", NULL}, /* dup */ | ||
705 | {"collections.group.parts.images.set", ob_images_set}, /* dup */ | ||
706 | {"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */ | ||
707 | {"collections.group.parts.fonts", NULL}, /* dup */ | ||
708 | {"collections.group.parts.styles", NULL}, /* dup */ | ||
709 | {"collections.group.parts.styles.style", ob_styles_style}, /* dup */ | ||
710 | {"collections.group.parts.color_classes", NULL}, /* dup */ | ||
711 | {"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */ | ||
712 | {"collections.group.parts.part", ob_collections_group_parts_part}, | ||
713 | {"collections.group.parts.part.dragable", NULL}, | ||
714 | {"collections.group.parts.part.set", ob_images_set}, /* dup */ | ||
715 | {"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */ | ||
716 | {"collections.group.parts.part.images", NULL}, /* dup */ | ||
717 | {"collections.group.parts.part.images.set", ob_images_set}, /* dup */ | ||
718 | {"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */ | ||
719 | {"collections.group.parts.part.fonts", NULL}, /* dup */ | ||
720 | {"collections.group.parts.part.styles", NULL}, /* dup */ | ||
721 | {"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */ | ||
722 | {"collections.group.parts.part.color_classes", NULL}, /* dup */ | ||
723 | {"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */ | ||
724 | {"collections.group.parts.part.box", NULL}, | ||
725 | {"collections.group.parts.part.box.items", NULL}, | ||
726 | {"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item}, | ||
727 | {"collections.group.parts.part.table", NULL}, | ||
728 | {"collections.group.parts.part.table.items", NULL}, | ||
729 | {"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */ | ||
730 | {"collections.group.parts.part.description", ob_collections_group_parts_part_description}, | ||
731 | {"collections.group.parts.part.description.rel1", NULL}, | ||
732 | {"collections.group.parts.part.description.rel2", NULL}, | ||
733 | {"collections.group.parts.part.description.image", NULL}, /* dup */ | ||
734 | {"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */ | ||
735 | {"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */ | ||
736 | {"collections.group.parts.part.description.image.images", NULL}, /* dup */ | ||
737 | {"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */ | ||
738 | {"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */ | ||
739 | {"collections.group.parts.part.description.fill", NULL}, | ||
740 | {"collections.group.parts.part.description.fill.origin", NULL}, | ||
741 | {"collections.group.parts.part.description.fill.size", NULL}, | ||
742 | {"collections.group.parts.part.description.text", NULL}, | ||
743 | {"collections.group.parts.part.description.text.fonts", NULL}, /* dup */ | ||
744 | {"collections.group.parts.part.description.images", NULL}, /* dup */ | ||
745 | {"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */ | ||
746 | {"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */ | ||
747 | {"collections.group.parts.part.description.fonts", NULL}, /* dup */ | ||
748 | {"collections.group.parts.part.description.styles", NULL}, /* dup */ | ||
749 | {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */ | ||
750 | {"collections.group.parts.part.description.box", NULL}, | ||
751 | {"collections.group.parts.part.description.table", NULL}, | ||
752 | {"collections.group.parts.part.description.map", NULL}, | ||
753 | {"collections.group.parts.part.description.map.rotation", NULL}, | ||
754 | {"collections.group.parts.part.description.perspective", NULL}, | ||
755 | {"collections.group.parts.part.description.params", NULL}, | ||
756 | {"collections.group.parts.part.description.color_classes", NULL}, /* dup */ | ||
757 | {"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */ | ||
758 | {"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */ | ||
759 | {"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
760 | {"collections.group.parts.part.description.programs", NULL}, /* dup */ | ||
761 | {"collections.group.parts.part.description.programs.set", ob_images_set}, /* dup */ | ||
762 | {"collections.group.parts.part.description.programs.set.image", ob_images_set_image}, /* dup */ | ||
763 | {"collections.group.parts.part.description.programs.images", NULL}, /* dup */ | ||
764 | {"collections.group.parts.part.description.programs.images.set", ob_images_set}, | ||
765 | {"collections.group.parts.part.description.programs.images.set.image", ob_images_set_image}, /* dup */ | ||
766 | {"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */ | ||
767 | {"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */ | ||
768 | {"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
769 | {"collections.group.parts.part.description.script", ob_collections_group_script}, /* dup */ | ||
770 | {"collections.group.parts.part.program", ob_collections_group_programs_program}, /* dup */ | ||
771 | {"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
772 | {"collections.group.parts.part.programs", NULL}, /* dup */ | ||
773 | {"collections.group.parts.part.programs.set", ob_images_set}, /* dup */ | ||
774 | {"collections.group.parts.part.programs.set.image", ob_images_set_image}, /* dup */ | ||
775 | {"collections.group.parts.part.programs.images", NULL}, /* dup */ | ||
776 | {"collections.group.parts.part.programs.images.set", ob_images_set}, /* dup */ | ||
777 | {"collections.group.parts.part.programs.images.set.image", ob_images_set_image}, /* dup */ | ||
778 | {"collections.group.parts.part.programs.fonts", NULL}, /* dup */ | ||
779 | {"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */ | ||
780 | {"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
781 | {"collections.group.parts.part.script", ob_collections_group_script}, /* dup */ | ||
782 | {"collections.group.parts.program", ob_collections_group_programs_program}, /* dup */ | ||
783 | {"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
784 | {"collections.group.parts.programs", NULL}, /* dup */ | ||
785 | {"collections.group.parts.programs.set", ob_images_set}, /* dup */ | ||
786 | {"collections.group.parts.programs.set.image", ob_images_set_image}, /* dup */ | ||
787 | {"collections.group.parts.programs.images", NULL}, /* dup */ | ||
788 | {"collections.group.parts.programs.images.set", ob_images_set}, /* dup */ | ||
789 | {"collections.group.parts.programs.images.set.image", ob_images_set_image}, /* dup */ | ||
790 | {"collections.group.parts.programs.fonts", NULL}, /* dup */ | ||
791 | {"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */ | ||
792 | {"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
793 | {"collections.group.parts.script", ob_collections_group_script}, /* dup */ | ||
794 | {"collections.group.program", ob_collections_group_programs_program}, /* dup */ | ||
795 | {"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */ | ||
796 | {"collections.group.programs", NULL}, | ||
797 | {"collections.group.programs.set", ob_images_set}, /* dup */ | ||
798 | {"collections.group.programs.set.image", ob_images_set_image}, /* dup */ | ||
799 | {"collections.group.programs.images", NULL}, /* dup */ | ||
800 | {"collections.group.programs.images.set", ob_images_set}, /* dup */ | ||
801 | {"collections.group.programs.images.set.image", ob_images_set_image}, /* dup */ | ||
802 | {"collections.group.programs.fonts", NULL}, /* dup */ | ||
803 | {"collections.group.programs.program", ob_collections_group_programs_program}, | ||
804 | {"collections.group.programs.program.script", ob_collections_group_programs_program_script}, | ||
805 | {"collections.group.programs.script", ob_collections_group_script} /* dup */ | ||
806 | }; | ||
807 | |||
808 | /*****/ | ||
809 | |||
810 | int | ||
811 | object_handler_num(void) | ||
812 | { | ||
813 | return sizeof(object_handlers) / sizeof (New_Object_Handler); | ||
814 | } | ||
815 | |||
816 | int | ||
817 | statement_handler_num(void) | ||
818 | { | ||
819 | return sizeof(statement_handlers) / sizeof (New_Object_Handler); | ||
820 | } | ||
821 | |||
822 | static void | ||
823 | _edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill) | ||
824 | { | ||
825 | fill->smooth = 1; | ||
826 | fill->pos_rel_x = FROM_DOUBLE(0.0); | ||
827 | fill->pos_abs_x = 0; | ||
828 | fill->rel_x = FROM_DOUBLE(1.0); | ||
829 | fill->abs_x = 0; | ||
830 | fill->pos_rel_y = FROM_DOUBLE(0.0); | ||
831 | fill->pos_abs_y = 0; | ||
832 | fill->rel_y = FROM_DOUBLE(1.0); | ||
833 | fill->abs_y = 0; | ||
834 | fill->angle = 0; | ||
835 | fill->spread = 0; | ||
836 | fill->type = EDJE_FILL_TYPE_SCALE; | ||
837 | } | ||
838 | |||
839 | static Edje_Part_Description_Common * | ||
840 | _edje_part_description_alloc(unsigned char type, const char *collection, const char *part) | ||
841 | { | ||
842 | Edje_Part_Description_Common *result = NULL; | ||
843 | |||
844 | switch (type) | ||
845 | { | ||
846 | case EDJE_PART_TYPE_RECTANGLE: | ||
847 | case EDJE_PART_TYPE_SWALLOW: | ||
848 | case EDJE_PART_TYPE_GROUP: | ||
849 | result = mem_alloc(SZ(Edje_Part_Description_Common)); | ||
850 | break; | ||
851 | case EDJE_PART_TYPE_TEXT: | ||
852 | case EDJE_PART_TYPE_TEXTBLOCK: | ||
853 | { | ||
854 | Edje_Part_Description_Text *ed; | ||
855 | |||
856 | ed = mem_alloc(SZ(Edje_Part_Description_Text)); | ||
857 | |||
858 | ed->text.color3.r = 0; | ||
859 | ed->text.color3.g = 0; | ||
860 | ed->text.color3.b = 0; | ||
861 | ed->text.color3.a = 128; | ||
862 | ed->text.align.x = FROM_DOUBLE(0.5); | ||
863 | ed->text.align.y = FROM_DOUBLE(0.5); | ||
864 | ed->text.id_source = -1; | ||
865 | ed->text.id_text_source = -1; | ||
866 | |||
867 | result = &ed->common; | ||
868 | break; | ||
869 | } | ||
870 | case EDJE_PART_TYPE_IMAGE: | ||
871 | { | ||
872 | Edje_Part_Description_Image *ed; | ||
873 | |||
874 | ed = mem_alloc(SZ(Edje_Part_Description_Image)); | ||
875 | |||
876 | ed->image.id = -1; | ||
877 | |||
878 | _edje_part_description_fill(&ed->image.fill); | ||
879 | |||
880 | result = &ed->common; | ||
881 | break; | ||
882 | } | ||
883 | case EDJE_PART_TYPE_PROXY: | ||
884 | { | ||
885 | Edje_Part_Description_Proxy *ed; | ||
886 | |||
887 | ed = mem_alloc(SZ(Edje_Part_Description_Proxy)); | ||
888 | |||
889 | ed->proxy.id = -1; | ||
890 | |||
891 | _edje_part_description_fill(&ed->proxy.fill); | ||
892 | |||
893 | result = &ed->common; | ||
894 | break; | ||
895 | } | ||
896 | case EDJE_PART_TYPE_BOX: | ||
897 | { | ||
898 | Edje_Part_Description_Box *ed; | ||
899 | |||
900 | ed = mem_alloc(SZ(Edje_Part_Description_Box)); | ||
901 | |||
902 | ed->box.layout = NULL; | ||
903 | ed->box.alt_layout = NULL; | ||
904 | ed->box.align.x = FROM_DOUBLE(0.5); | ||
905 | ed->box.align.y = FROM_DOUBLE(0.5); | ||
906 | ed->box.padding.x = 0; | ||
907 | ed->box.padding.y = 0; | ||
908 | |||
909 | result = &ed->common; | ||
910 | break; | ||
911 | } | ||
912 | case EDJE_PART_TYPE_TABLE: | ||
913 | { | ||
914 | Edje_Part_Description_Table *ed; | ||
915 | |||
916 | ed = mem_alloc(SZ(Edje_Part_Description_Table)); | ||
917 | |||
918 | ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE; | ||
919 | ed->table.align.x = FROM_DOUBLE(0.5); | ||
920 | ed->table.align.y = FROM_DOUBLE(0.5); | ||
921 | ed->table.padding.x = 0; | ||
922 | ed->table.padding.y = 0; | ||
923 | |||
924 | result = &ed->common; | ||
925 | break; | ||
926 | } | ||
927 | case EDJE_PART_TYPE_EXTERNAL: | ||
928 | { | ||
929 | Edje_Part_Description_External *ed; | ||
930 | |||
931 | ed = mem_alloc(SZ(Edje_Part_Description_External)); | ||
932 | |||
933 | ed->external_params = NULL; | ||
934 | |||
935 | result = &ed->common; | ||
936 | break; | ||
937 | } | ||
938 | } | ||
939 | |||
940 | if (!result) | ||
941 | { | ||
942 | ERR("%s: Error. Unknown type %i of part %s in collection %s.", progname, type, part, collection); | ||
943 | exit(-1); | ||
944 | } | ||
945 | |||
946 | return result; | ||
947 | } | ||
948 | |||
949 | static void | ||
950 | _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, unsigned int count) | ||
951 | { | ||
952 | Edje_Part_Collection *pc; | ||
953 | unsigned int i; | ||
954 | Edje_Program_Parser *epp; | ||
955 | |||
956 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
957 | |||
958 | for (i = 0; i < count; ++i) | ||
959 | if (pgrms[i]->name) | ||
960 | if (pgrms[i] != me && (!strcmp(name, pgrms[i]->name))) | ||
961 | { | ||
962 | epp = (Edje_Program_Parser *)pgrms[i]; | ||
963 | if (!epp->can_override) | ||
964 | { | ||
965 | ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n", | ||
966 | progname, file_in, line - 1, name); | ||
967 | exit(-1); | ||
968 | } | ||
969 | else | ||
970 | { | ||
971 | _edje_program_remove(pc, me); | ||
972 | current_program = pgrms[i]; | ||
973 | epp->can_override = EINA_FALSE; | ||
974 | return; | ||
975 | } | ||
976 | } | ||
977 | } | ||
978 | |||
979 | static void | ||
980 | _edje_program_copy(Edje_Program *ep, Edje_Program *ep2) | ||
981 | { | ||
982 | Edje_Part_Collection *pc; | ||
983 | Edje_Program_Target *et, *et2; | ||
984 | Edje_Program_After *pa, *pa2; | ||
985 | Edje_Program_Parser *epp; | ||
986 | Eina_List *l; | ||
987 | char *name; | ||
988 | char *copy; | ||
989 | |||
990 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
991 | |||
992 | #define STRDUP(x) x ? strdup(x) : NULL | ||
993 | ep->name = STRDUP(ep2->name); | ||
994 | |||
995 | _edje_program_remove(pc, current_program); | ||
996 | ep->signal = STRDUP(ep2->signal); | ||
997 | ep->source = STRDUP(ep2->source); | ||
998 | _edje_program_insert(pc, current_program); | ||
999 | |||
1000 | ep->filter.part = STRDUP(ep2->filter.part); | ||
1001 | ep->filter.state = STRDUP(ep2->filter.state); | ||
1002 | ep->in.from = ep2->in.from; | ||
1003 | ep->in.range = ep2->in.range; | ||
1004 | ep->action = ep2->action; | ||
1005 | ep->state = STRDUP(ep2->state); | ||
1006 | ep->state2 = STRDUP(ep2->state2); | ||
1007 | ep->value = ep2->value; | ||
1008 | ep->value2 = ep2->value2; | ||
1009 | ep->tween.mode = ep2->tween.mode; | ||
1010 | ep->tween.time = ep2->tween.time; | ||
1011 | ep->tween.v1 = ep2->tween.v1; | ||
1012 | ep->tween.v2 = ep2->tween.v2; | ||
1013 | |||
1014 | EINA_LIST_FOREACH(ep2->targets, l, et2) | ||
1015 | { | ||
1016 | name = (char*) (et2 + 1); | ||
1017 | et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1); | ||
1018 | ep->targets = eina_list_append(ep->targets, et); | ||
1019 | copy = (char*) (et + 1); | ||
1020 | |||
1021 | memcpy(copy, name, strlen(name) + 1); | ||
1022 | |||
1023 | if (ep2->action == EDJE_ACTION_TYPE_STATE_SET) | ||
1024 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1025 | else if (ep2->action == EDJE_ACTION_TYPE_ACTION_STOP) | ||
1026 | data_queue_copied_program_lookup(pc, &(et2->id), &(et->id)); | ||
1027 | else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_SET) | ||
1028 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1029 | else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP) | ||
1030 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1031 | else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE) | ||
1032 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1033 | else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_SET) | ||
1034 | |||
1035 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1036 | else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_OBJECT) | ||
1037 | data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); | ||
1038 | else | ||
1039 | { | ||
1040 | ERR("%s: Error. parse error %s:%i. " | ||
1041 | "target may only be used after action", | ||
1042 | progname, file_in, line - 1); | ||
1043 | exit(-1); | ||
1044 | } | ||
1045 | } | ||
1046 | |||
1047 | EINA_LIST_FOREACH(ep2->after, l, pa2) | ||
1048 | { | ||
1049 | pa = mem_alloc(SZ(Edje_Program_After)); | ||
1050 | ep->after = eina_list_append(ep->after, pa); | ||
1051 | |||
1052 | data_queue_copied_program_lookup(pc, &(pa2->id), &(pa->id)); | ||
1053 | } | ||
1054 | |||
1055 | ep->api.name = STRDUP(ep2->api.name); | ||
1056 | ep->api.description = STRDUP(ep2->api.description); | ||
1057 | data_queue_copied_part_lookup(pc, &(ep2->param.src), &(ep->param.src)); | ||
1058 | data_queue_copied_part_lookup(pc, &(ep2->param.dst), &(ep->param.dst)); | ||
1059 | |||
1060 | epp = (Edje_Program_Parser *)ep; | ||
1061 | epp->can_override = EINA_TRUE; | ||
1062 | |||
1063 | #undef STRDUP | ||
1064 | } | ||
1065 | |||
1066 | /*****/ | ||
1067 | |||
1068 | /** | ||
1069 | @edcsection{toplevel,Top-Level blocks} | ||
1070 | */ | ||
1071 | |||
1072 | /** | ||
1073 | @page edcref | ||
1074 | |||
1075 | @block | ||
1076 | externals | ||
1077 | @context | ||
1078 | externals { | ||
1079 | external: "name"; | ||
1080 | } | ||
1081 | @description | ||
1082 | The "externals" block is used to list each external module file that will be used in others | ||
1083 | programs. | ||
1084 | @endblock | ||
1085 | |||
1086 | @property | ||
1087 | external | ||
1088 | @parameters | ||
1089 | [external filename] | ||
1090 | @effect | ||
1091 | Used to add a file to the externals list. | ||
1092 | @endproperty | ||
1093 | */ | ||
1094 | static void | ||
1095 | st_externals_external(void) | ||
1096 | { | ||
1097 | External *ex; | ||
1098 | |||
1099 | check_arg_count(1); | ||
1100 | |||
1101 | if (!edje_file->external_dir) | ||
1102 | edje_file->external_dir = mem_alloc(SZ(Edje_External_Directory)); | ||
1103 | |||
1104 | ex = mem_alloc(SZ(External)); | ||
1105 | ex->name = parse_str(0); | ||
1106 | { | ||
1107 | Eina_List *l; | ||
1108 | External *lex; | ||
1109 | |||
1110 | EINA_LIST_FOREACH(externals, l, lex) | ||
1111 | { | ||
1112 | if (!strcmp(lex->name, ex->name)) | ||
1113 | { | ||
1114 | free(ex->name); | ||
1115 | free(ex); | ||
1116 | return; | ||
1117 | } | ||
1118 | } | ||
1119 | } | ||
1120 | externals = eina_list_append(externals, ex); | ||
1121 | |||
1122 | if (edje_file->external_dir) | ||
1123 | { | ||
1124 | edje_file->external_dir->entries_count++; | ||
1125 | edje_file->external_dir->entries = realloc(edje_file->external_dir->entries, | ||
1126 | sizeof (Edje_External_Directory) * edje_file->external_dir->entries_count); | ||
1127 | memset(edje_file->external_dir->entries + edje_file->external_dir->entries_count - 1, | ||
1128 | 0, sizeof (Edje_External_Directory)); | ||
1129 | if (!edje_file->external_dir->entries) | ||
1130 | { | ||
1131 | ERR("%s: Error. not enough memory", progname); | ||
1132 | exit(-1); | ||
1133 | } | ||
1134 | |||
1135 | edje_file->external_dir->entries[edje_file->external_dir->entries_count - 1].entry = mem_strdup(ex->name); | ||
1136 | } | ||
1137 | } | ||
1138 | |||
1139 | /** | ||
1140 | @page edcref | ||
1141 | |||
1142 | @block | ||
1143 | images | ||
1144 | @context | ||
1145 | images { | ||
1146 | image: "filename1.ext" COMP; | ||
1147 | image: "filename2.ext" LOSSY 99; | ||
1148 | set { | ||
1149 | name: "image_name_used"; | ||
1150 | image { | ||
1151 | image: "filename3.ext" LOSSY 90; | ||
1152 | size: 201 201 500 500; | ||
1153 | } | ||
1154 | image { | ||
1155 | image: "filename4.ext" COMP; | ||
1156 | size: 51 51 200 200; | ||
1157 | } | ||
1158 | image { | ||
1159 | image: "filename5.ext" COMP; | ||
1160 | size: 11 11 50 50; | ||
1161 | } | ||
1162 | image { | ||
1163 | image: "filename6.ext" RAW; | ||
1164 | size: 0 0 10 10; | ||
1165 | } | ||
1166 | } | ||
1167 | .. | ||
1168 | } | ||
1169 | @description | ||
1170 | The "images" block is used to list each image file that will be used in | ||
1171 | the theme along with its compression method (if any). | ||
1172 | Besides the document's root, additional "images" blocks can be | ||
1173 | included inside other blocks, normally "collections", "group" and | ||
1174 | "part", easing maintenance of the file list when the theme is split | ||
1175 | among multiple files. | ||
1176 | @endblock | ||
1177 | |||
1178 | @property | ||
1179 | image | ||
1180 | @parameters | ||
1181 | [image file] [compression method] (compression level) | ||
1182 | @effect | ||
1183 | Used to include each image file. The full path to the directory holding | ||
1184 | the images can be defined later with edje_cc's "-id" option. | ||
1185 | Compression methods: | ||
1186 | @li RAW: Uncompressed. | ||
1187 | @li COMP: Lossless compression. | ||
1188 | @li LOSSY [0-100]: Lossy comression with quality from 0 to 100. | ||
1189 | @li USER: Do not embed the file, refer to the external file instead. | ||
1190 | @endproperty | ||
1191 | */ | ||
1192 | static void | ||
1193 | st_images_image(void) | ||
1194 | { | ||
1195 | Edje_Image_Directory_Entry *img; | ||
1196 | const char *tmp; | ||
1197 | unsigned int i; | ||
1198 | int v; | ||
1199 | |||
1200 | if (!edje_file->image_dir) | ||
1201 | edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory)); | ||
1202 | |||
1203 | tmp = parse_str(0); | ||
1204 | |||
1205 | for (i = 0; i < edje_file->image_dir->entries_count; ++i) | ||
1206 | if (!strcmp(edje_file->image_dir->entries[i].entry, tmp)) | ||
1207 | { | ||
1208 | free((char*) tmp); | ||
1209 | return; | ||
1210 | } | ||
1211 | |||
1212 | edje_file->image_dir->entries_count++; | ||
1213 | edje_file->image_dir->entries = realloc(edje_file->image_dir->entries, | ||
1214 | sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count); | ||
1215 | memset(edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1, | ||
1216 | 0, sizeof (Edje_Image_Directory_Entry)); | ||
1217 | if (!edje_file->image_dir->entries) | ||
1218 | { | ||
1219 | ERR("%s: Error. No enough memory.", progname); | ||
1220 | exit(-1); | ||
1221 | } | ||
1222 | |||
1223 | img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1; | ||
1224 | |||
1225 | img->entry = tmp; | ||
1226 | img->id = edje_file->image_dir->entries_count - 1; | ||
1227 | v = parse_enum(1, | ||
1228 | "RAW", 0, | ||
1229 | "COMP", 1, | ||
1230 | "LOSSY", 2, | ||
1231 | "USER", 3, | ||
1232 | NULL); | ||
1233 | if (v == 0) | ||
1234 | { | ||
1235 | img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT; | ||
1236 | img->source_param = 0; | ||
1237 | } | ||
1238 | else if (v == 1) | ||
1239 | { | ||
1240 | img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT; | ||
1241 | img->source_param = 1; | ||
1242 | } | ||
1243 | else if (v == 2) | ||
1244 | { | ||
1245 | img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY; | ||
1246 | img->source_param = 0; | ||
1247 | } | ||
1248 | else if (v == 3) | ||
1249 | { | ||
1250 | img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL; | ||
1251 | img->source_param = 0; | ||
1252 | } | ||
1253 | if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY) | ||
1254 | check_arg_count(2); | ||
1255 | else | ||
1256 | { | ||
1257 | img->source_param = parse_int_range(2, 0, 100); | ||
1258 | check_arg_count(3); | ||
1259 | } | ||
1260 | } | ||
1261 | |||
1262 | /** | ||
1263 | @page edcref | ||
1264 | |||
1265 | @block | ||
1266 | set | ||
1267 | @context | ||
1268 | set { | ||
1269 | name: "image_name_used"; | ||
1270 | image { | ||
1271 | image: "filename3.ext" LOSSY 90; | ||
1272 | size: 201 201 500 500; | ||
1273 | } | ||
1274 | image { | ||
1275 | image: "filename4.ext" COMP; | ||
1276 | size: 51 51 200 200; | ||
1277 | } | ||
1278 | image { | ||
1279 | image: "filename5.ext" COMP; | ||
1280 | size: 11 11 50 50; | ||
1281 | } | ||
1282 | image { | ||
1283 | image: "filename6.ext" RAW; | ||
1284 | size: 0 0 10 10; | ||
1285 | } | ||
1286 | } | ||
1287 | @description | ||
1288 | The "set" block is used to define an image with different content depending on their size. | ||
1289 | Besides the document's root, additional "set" blocks can be | ||
1290 | included inside other blocks, normally "collections", "group" and | ||
1291 | "part", easing maintenance of the file list when the theme is split | ||
1292 | among multiple files. | ||
1293 | @endblock | ||
1294 | */ | ||
1295 | static void | ||
1296 | ob_images_set(void) | ||
1297 | { | ||
1298 | if (!edje_file->image_dir) | ||
1299 | edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory)); | ||
1300 | |||
1301 | edje_file->image_dir->sets_count++; | ||
1302 | edje_file->image_dir->sets = realloc(edje_file->image_dir->sets, | ||
1303 | sizeof (Edje_Image_Directory_Set) * edje_file->image_dir->sets_count); | ||
1304 | memset(edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1, | ||
1305 | 0, sizeof (Edje_Image_Directory_Set)); | ||
1306 | if (!edje_file->image_dir->sets) | ||
1307 | { | ||
1308 | ERR("%s: Error. Not enough memory.", progname); | ||
1309 | exit(-1); | ||
1310 | } | ||
1311 | edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1; | ||
1312 | } | ||
1313 | |||
1314 | /** | ||
1315 | @page edcref | ||
1316 | |||
1317 | @property | ||
1318 | name | ||
1319 | @parameters | ||
1320 | [image name] | ||
1321 | @effect | ||
1322 | Define the name that refer to this image description. | ||
1323 | @endproperty | ||
1324 | */ | ||
1325 | static void | ||
1326 | st_images_set_name(void) | ||
1327 | { | ||
1328 | check_arg_count(1); | ||
1329 | |||
1330 | edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].name = parse_str(0); | ||
1331 | } | ||
1332 | |||
1333 | static void | ||
1334 | ob_images_set_image(void) | ||
1335 | { | ||
1336 | Edje_Image_Directory_Set_Entry *entry; | ||
1337 | Edje_Image_Directory_Set *set; | ||
1338 | |||
1339 | set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1; | ||
1340 | |||
1341 | entry = mem_alloc(SZ(Edje_Image_Directory_Set_Entry)); | ||
1342 | |||
1343 | set->entries = eina_list_append(set->entries, entry); | ||
1344 | } | ||
1345 | |||
1346 | static void | ||
1347 | st_images_set_image_image(void) | ||
1348 | { | ||
1349 | Edje_Image_Directory_Set_Entry *entry; | ||
1350 | Edje_Image_Directory_Set *set; | ||
1351 | unsigned int i; | ||
1352 | |||
1353 | set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1; | ||
1354 | entry = eina_list_data_get(eina_list_last(set->entries)); | ||
1355 | |||
1356 | /* Add the image to the global pool with the same syntax. */ | ||
1357 | st_images_image(); | ||
1358 | |||
1359 | entry->name = parse_str(0); | ||
1360 | |||
1361 | for (i = 0; i < edje_file->image_dir->entries_count; ++i) | ||
1362 | if (!strcmp(edje_file->image_dir->entries[i].entry, entry->name)) | ||
1363 | { | ||
1364 | entry->id = i; | ||
1365 | return; | ||
1366 | } | ||
1367 | } | ||
1368 | |||
1369 | /** | ||
1370 | @page edcref | ||
1371 | |||
1372 | @property | ||
1373 | size | ||
1374 | @parameters | ||
1375 | [minw minh maxw mawh] | ||
1376 | @effect | ||
1377 | Define the minimal and maximal size that will select the specified image. | ||
1378 | @endproperty | ||
1379 | */ | ||
1380 | static void | ||
1381 | st_images_set_image_size(void) | ||
1382 | { | ||
1383 | Edje_Image_Directory_Set_Entry *entry; | ||
1384 | Edje_Image_Directory_Set *set; | ||
1385 | |||
1386 | set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1; | ||
1387 | entry = eina_list_data_get(eina_list_last(set->entries)); | ||
1388 | |||
1389 | entry->size.min.w = parse_int(0); | ||
1390 | entry->size.min.h = parse_int(1); | ||
1391 | entry->size.max.w = parse_int(2); | ||
1392 | entry->size.max.h = parse_int(3); | ||
1393 | |||
1394 | if (entry->size.min.w > entry->size.max.w | ||
1395 | || entry->size.min.h > entry->size.max.h) | ||
1396 | { | ||
1397 | ERR("%s: Error. parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])", | ||
1398 | progname, file_in, line - 1, | ||
1399 | entry->size.min.w, entry->size.min.h, | ||
1400 | entry->size.max.w, entry->size.max.h); | ||
1401 | exit(-1); | ||
1402 | } | ||
1403 | } | ||
1404 | |||
1405 | /** | ||
1406 | @page edcref | ||
1407 | |||
1408 | @block | ||
1409 | fonts | ||
1410 | @context | ||
1411 | fonts { | ||
1412 | font: "filename1.ext" "fontname"; | ||
1413 | font: "filename2.ext" "otherfontname"; | ||
1414 | .. | ||
1415 | } | ||
1416 | @description | ||
1417 | The "fonts" block is used to list each font file with an alias used later | ||
1418 | in the theme. As with the "images" block, additional "fonts" blocks can | ||
1419 | be included inside other blocks. | ||
1420 | @endblock | ||
1421 | |||
1422 | @property | ||
1423 | font | ||
1424 | @parameters | ||
1425 | [font filename] [font alias] | ||
1426 | @effect | ||
1427 | Defines each font "file" and "alias", the full path to the directory | ||
1428 | holding the font files can be defined with edje_cc's "-fd" option. | ||
1429 | @endproperty | ||
1430 | */ | ||
1431 | static void | ||
1432 | st_fonts_font(void) | ||
1433 | { | ||
1434 | Font *fn; | ||
1435 | |||
1436 | check_arg_count(2); | ||
1437 | |||
1438 | if (!edje_file->fonts) | ||
1439 | edje_file->fonts = eina_hash_string_small_new(free); | ||
1440 | |||
1441 | fn = mem_alloc(SZ(Font)); | ||
1442 | fn->file = parse_str(0); | ||
1443 | fn->name = parse_str(1); | ||
1444 | |||
1445 | if (eina_hash_find(edje_file->fonts, fn->name)) | ||
1446 | { | ||
1447 | free(fn->file); | ||
1448 | free(fn->name); | ||
1449 | free(fn); | ||
1450 | return; | ||
1451 | } | ||
1452 | |||
1453 | eina_hash_direct_add(edje_file->fonts, fn->name, fn); | ||
1454 | } | ||
1455 | |||
1456 | /** | ||
1457 | @page edcref | ||
1458 | @block | ||
1459 | data | ||
1460 | @context | ||
1461 | data { | ||
1462 | item: "key" "value"; | ||
1463 | file: "otherkey" "filename.ext"; | ||
1464 | .. | ||
1465 | } | ||
1466 | @description | ||
1467 | The "data" block is used to pass arbitrary parameters from the theme to | ||
1468 | the application. Unlike the "images" and "fonts" blocks, additional | ||
1469 | "data" blocks can only be included inside the "group" block. | ||
1470 | @endblock | ||
1471 | |||
1472 | @property | ||
1473 | item | ||
1474 | @parameters | ||
1475 | [parameter name] [parameter value] | ||
1476 | @effect | ||
1477 | Defines a new parameter, the value will be the string specified next to | ||
1478 | it. | ||
1479 | @endproperty | ||
1480 | */ | ||
1481 | static void | ||
1482 | st_data_item(void) | ||
1483 | { | ||
1484 | Edje_String *es; | ||
1485 | char *key; | ||
1486 | |||
1487 | check_arg_count(2); | ||
1488 | |||
1489 | key = parse_str(0); | ||
1490 | |||
1491 | es = mem_alloc(SZ(Edje_String)); | ||
1492 | es->str = parse_str(1); | ||
1493 | |||
1494 | if (!edje_file->data) | ||
1495 | edje_file->data = eina_hash_string_small_new(free); | ||
1496 | |||
1497 | /* FIXME: check if data already exist */ | ||
1498 | eina_hash_direct_add(edje_file->data, key, es); | ||
1499 | } | ||
1500 | |||
1501 | /** | ||
1502 | @page edcref | ||
1503 | @property | ||
1504 | file | ||
1505 | @parameters | ||
1506 | [parameter name] [parameter filename] | ||
1507 | @effect | ||
1508 | Defines a new parameter , the value will be the contents of the | ||
1509 | specified file formated as a single string of text. This property only | ||
1510 | works with plain text files. | ||
1511 | @endproperty | ||
1512 | */ | ||
1513 | static void | ||
1514 | st_data_file(void) | ||
1515 | { | ||
1516 | const char *data; | ||
1517 | const char *over; | ||
1518 | Edje_String *es; | ||
1519 | char *filename; | ||
1520 | char *value; | ||
1521 | char *key; | ||
1522 | int fd; | ||
1523 | int i; | ||
1524 | struct stat buf; | ||
1525 | |||
1526 | check_arg_count(2); | ||
1527 | |||
1528 | key = parse_str(0); | ||
1529 | |||
1530 | es = mem_alloc(SZ(Edje_String)); | ||
1531 | filename = parse_str(1); | ||
1532 | |||
1533 | fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR); | ||
1534 | if (fd < 0) | ||
1535 | { | ||
1536 | ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"", | ||
1537 | progname, file_in, line, filename, strerror(errno)); | ||
1538 | exit(-1); | ||
1539 | } | ||
1540 | |||
1541 | if (fstat(fd, &buf)) | ||
1542 | { | ||
1543 | ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"", | ||
1544 | progname, file_in, line, filename, strerror(errno)); | ||
1545 | exit(-1); | ||
1546 | } | ||
1547 | |||
1548 | data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0); | ||
1549 | if (data == MAP_FAILED) | ||
1550 | { | ||
1551 | ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"", | ||
1552 | progname, file_in, line, filename, strerror(errno)); | ||
1553 | exit(-1); | ||
1554 | } | ||
1555 | |||
1556 | over = data; | ||
1557 | for (i = 0; i < buf.st_size; ++i, ++over) | ||
1558 | if (*over == '\0') | ||
1559 | { | ||
1560 | ERR("%s: Error. %s:%i file \"%s\" is a binary file.", | ||
1561 | progname, file_in, line, filename); | ||
1562 | exit(-1); | ||
1563 | } | ||
1564 | |||
1565 | value = malloc(sizeof (char) * buf.st_size + 1); | ||
1566 | snprintf(value, buf.st_size + 1, "%s", data); | ||
1567 | |||
1568 | munmap((void*)data, buf.st_size); | ||
1569 | close(fd); | ||
1570 | |||
1571 | es->str = value; | ||
1572 | |||
1573 | eina_hash_direct_add(edje_file->data, key, es); | ||
1574 | |||
1575 | free(filename); | ||
1576 | } | ||
1577 | |||
1578 | /** | ||
1579 | @page edcref | ||
1580 | @block | ||
1581 | color_classes | ||
1582 | @context | ||
1583 | color_classes { | ||
1584 | color_class { | ||
1585 | name: "colorclassname"; | ||
1586 | color: [0-255] [0-255] [0-255] [0-255]; | ||
1587 | color2: [0-255] [0-255] [0-255] [0-255]; | ||
1588 | color3: [0-255] [0-255] [0-255] [0-255] | ||
1589 | } | ||
1590 | .. | ||
1591 | } | ||
1592 | @description | ||
1593 | The "color_classes" block contains a list of one or more "color_class" | ||
1594 | blocks. Each "color_class" allows the designer to name an arbitrary | ||
1595 | group of colors to be used in the theme, the application can use that | ||
1596 | name to alter the color values at runtime. | ||
1597 | @endblock | ||
1598 | */ | ||
1599 | static void | ||
1600 | ob_color_class(void) | ||
1601 | { | ||
1602 | Edje_Color_Class *cc; | ||
1603 | |||
1604 | cc = mem_alloc(SZ(Edje_Color_Class)); | ||
1605 | edje_file->color_classes = eina_list_append(edje_file->color_classes, cc); | ||
1606 | |||
1607 | cc->r = 0; | ||
1608 | cc->g = 0; | ||
1609 | cc->b = 0; | ||
1610 | cc->a = 0; | ||
1611 | cc->r2 = 0; | ||
1612 | cc->g2 = 0; | ||
1613 | cc->b2 = 0; | ||
1614 | cc->a2 = 0; | ||
1615 | cc->r3 = 0; | ||
1616 | cc->g3 = 0; | ||
1617 | cc->b3 = 0; | ||
1618 | cc->a3 = 0; | ||
1619 | } | ||
1620 | |||
1621 | /** | ||
1622 | @page edcref | ||
1623 | |||
1624 | @property | ||
1625 | name | ||
1626 | @parameters | ||
1627 | [color class name] | ||
1628 | @effect | ||
1629 | Sets the name for the color class, used as reference by both the theme | ||
1630 | and the application. | ||
1631 | @endproperty | ||
1632 | */ | ||
1633 | static void | ||
1634 | st_color_class_name(void) | ||
1635 | { | ||
1636 | Edje_Color_Class *cc, *tcc; | ||
1637 | Eina_List *l; | ||
1638 | |||
1639 | cc = eina_list_data_get(eina_list_last(edje_file->color_classes)); | ||
1640 | cc->name = parse_str(0); | ||
1641 | EINA_LIST_FOREACH(edje_file->color_classes, l, tcc) | ||
1642 | { | ||
1643 | if ((cc != tcc) && (!strcmp(cc->name, tcc->name))) | ||
1644 | { | ||
1645 | fprintf(stderr, "%s: Error. parse error %s:%i. There is already a color class named \"%s\"\n", | ||
1646 | progname, file_in, line - 1, cc->name); | ||
1647 | exit(-1); | ||
1648 | } | ||
1649 | } | ||
1650 | } | ||
1651 | |||
1652 | /** | ||
1653 | @page edcref | ||
1654 | @property | ||
1655 | color | ||
1656 | @parameters | ||
1657 | [red] [green] [blue] [alpha] | ||
1658 | @effect | ||
1659 | The main color. | ||
1660 | @endproperty | ||
1661 | */ | ||
1662 | static void | ||
1663 | st_color_class_color(void) | ||
1664 | { | ||
1665 | Edje_Color_Class *cc; | ||
1666 | |||
1667 | check_arg_count(4); | ||
1668 | |||
1669 | cc = eina_list_data_get(eina_list_last(edje_file->color_classes)); | ||
1670 | cc->r = parse_int_range(0, 0, 255); | ||
1671 | cc->g = parse_int_range(1, 0, 255); | ||
1672 | cc->b = parse_int_range(2, 0, 255); | ||
1673 | cc->a = parse_int_range(3, 0, 255); | ||
1674 | } | ||
1675 | |||
1676 | /** | ||
1677 | @page edcref | ||
1678 | @property | ||
1679 | color2 | ||
1680 | @parameters | ||
1681 | [red] [green] [blue] [alpha] | ||
1682 | @effect | ||
1683 | Used as shadow in text and textblock parts. | ||
1684 | @endproperty | ||
1685 | */ | ||
1686 | static void | ||
1687 | st_color_class_color2(void) | ||
1688 | { | ||
1689 | Edje_Color_Class *cc; | ||
1690 | |||
1691 | check_arg_count(4); | ||
1692 | |||
1693 | cc = eina_list_data_get(eina_list_last(edje_file->color_classes)); | ||
1694 | cc->r2 = parse_int_range(0, 0, 255); | ||
1695 | cc->g2 = parse_int_range(1, 0, 255); | ||
1696 | cc->b2 = parse_int_range(2, 0, 255); | ||
1697 | cc->a2 = parse_int_range(3, 0, 255); | ||
1698 | } | ||
1699 | |||
1700 | /** | ||
1701 | @page edcref | ||
1702 | @property | ||
1703 | color3 | ||
1704 | @parameters | ||
1705 | [red] [green] [blue] [alpha] | ||
1706 | @effect | ||
1707 | Used as outline in text and textblock parts. | ||
1708 | @endproperty | ||
1709 | */ | ||
1710 | static void | ||
1711 | st_color_class_color3(void) | ||
1712 | { | ||
1713 | Edje_Color_Class *cc; | ||
1714 | |||
1715 | check_arg_count(4); | ||
1716 | |||
1717 | cc = eina_list_data_get(eina_list_last(edje_file->color_classes)); | ||
1718 | cc->r3 = parse_int_range(0, 0, 255); | ||
1719 | cc->g3 = parse_int_range(1, 0, 255); | ||
1720 | cc->b3 = parse_int_range(2, 0, 255); | ||
1721 | cc->a3 = parse_int_range(3, 0, 255); | ||
1722 | } | ||
1723 | |||
1724 | /** | ||
1725 | @page edcref | ||
1726 | @block | ||
1727 | styles | ||
1728 | @context | ||
1729 | styles { | ||
1730 | style { | ||
1731 | name: "stylename"; | ||
1732 | base: "..default style properties.."; | ||
1733 | |||
1734 | tag: "tagname" "..style properties.."; | ||
1735 | .. | ||
1736 | } | ||
1737 | .. | ||
1738 | } | ||
1739 | @description | ||
1740 | The "styles" block contains a list of one or more "style" blocks. A | ||
1741 | "style" block is used to create style \<tags\> for advanced TEXTBLOCK | ||
1742 | formatting. | ||
1743 | @endblock | ||
1744 | */ | ||
1745 | static void | ||
1746 | ob_styles_style(void) | ||
1747 | { | ||
1748 | Edje_Style *stl; | ||
1749 | |||
1750 | stl = mem_alloc(SZ(Edje_Style)); | ||
1751 | edje_file->styles = eina_list_append(edje_file->styles, stl); | ||
1752 | } | ||
1753 | |||
1754 | /** | ||
1755 | @page edcref | ||
1756 | @property | ||
1757 | name | ||
1758 | @parameters | ||
1759 | [style name] | ||
1760 | @effect | ||
1761 | The name of the style to be used as reference later in the theme. | ||
1762 | @endproperty | ||
1763 | */ | ||
1764 | static void | ||
1765 | st_styles_style_name(void) | ||
1766 | { | ||
1767 | Edje_Style *stl, *tstl; | ||
1768 | Eina_List *l; | ||
1769 | |||
1770 | stl = eina_list_data_get(eina_list_last(edje_file->styles)); | ||
1771 | stl->name = parse_str(0); | ||
1772 | EINA_LIST_FOREACH(edje_file->styles, l, tstl) | ||
1773 | { | ||
1774 | if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name))) | ||
1775 | { | ||
1776 | ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"", | ||
1777 | progname, file_in, line - 1, stl->name); | ||
1778 | exit(-1); | ||
1779 | } | ||
1780 | } | ||
1781 | } | ||
1782 | |||
1783 | /** | ||
1784 | @page edcref | ||
1785 | @property | ||
1786 | base | ||
1787 | @parameters | ||
1788 | [style properties string] | ||
1789 | @effect | ||
1790 | The default style properties that will be applied to the complete | ||
1791 | text. | ||
1792 | @endproperty | ||
1793 | */ | ||
1794 | static void | ||
1795 | st_styles_style_base(void) | ||
1796 | { | ||
1797 | Edje_Style *stl; | ||
1798 | Edje_Style_Tag *tag; | ||
1799 | |||
1800 | stl = eina_list_data_get(eina_list_last(edje_file->styles)); | ||
1801 | if (stl->tags) | ||
1802 | { | ||
1803 | ERR("%s: Error. parse error %s:%i. There is already a basic format for the style", | ||
1804 | progname, file_in, line - 1); | ||
1805 | exit(-1); | ||
1806 | } | ||
1807 | tag = mem_alloc(SZ(Edje_Style_Tag)); | ||
1808 | tag->key = mem_strdup("DEFAULT"); | ||
1809 | tag->value = parse_str(0); | ||
1810 | stl->tags = eina_list_append(stl->tags, tag); | ||
1811 | } | ||
1812 | |||
1813 | /** | ||
1814 | @page edcref | ||
1815 | @property | ||
1816 | tag | ||
1817 | @parameters | ||
1818 | [tag name] [style properties string] | ||
1819 | @effect | ||
1820 | Style to be applied only to text between style \<tags\>..\</tags\>. | ||
1821 | When creating "paired" tags, like \<bold\>\</bold\>, A '+' should be added at the start of the style properties of the first part (\<bold\>). | ||
1822 | If the second part (\</bold\>) is also defined, a '-' should be prepended to it's style properties. | ||
1823 | This only applies to paired tags; Single tags, like \<tab\>, must not include a starting '+'. | ||
1824 | @endproperty | ||
1825 | */ | ||
1826 | static void | ||
1827 | st_styles_style_tag(void) | ||
1828 | { | ||
1829 | Edje_Style *stl; | ||
1830 | Edje_Style_Tag *tag; | ||
1831 | |||
1832 | stl = eina_list_data_get(eina_list_last(edje_file->styles)); | ||
1833 | tag = mem_alloc(SZ(Edje_Style_Tag)); | ||
1834 | tag->key = parse_str(0); | ||
1835 | tag->value = parse_str(1); | ||
1836 | stl->tags = eina_list_append(stl->tags, tag); | ||
1837 | } | ||
1838 | |||
1839 | #ifdef ENABLE_MULTISENSE | ||
1840 | /* add to below doc | ||
1841 | sounds { } | ||
1842 | */ | ||
1843 | #endif | ||
1844 | |||
1845 | /** | ||
1846 | @page edcref | ||
1847 | @block | ||
1848 | collections | ||
1849 | @context | ||
1850 | collections { | ||
1851 | .. | ||
1852 | group { } | ||
1853 | group { } | ||
1854 | .. | ||
1855 | } | ||
1856 | @description | ||
1857 | The "collections" block is used to list the groups that compose the | ||
1858 | theme. Additional "collections" blocks do not prevent overriding group | ||
1859 | names. The "sounds" block comprises of all sound definitions. | ||
1860 | @endblock | ||
1861 | */ | ||
1862 | static void | ||
1863 | ob_collections(void) | ||
1864 | { | ||
1865 | if (!edje_file->collection) | ||
1866 | edje_file->collection = eina_hash_string_small_new(NULL); | ||
1867 | } | ||
1868 | |||
1869 | #ifdef ENABLE_MULTISENSE | ||
1870 | /* * delete space before * | ||
1871 | @page edcref | ||
1872 | @block | ||
1873 | sounds | ||
1874 | @context | ||
1875 | sounds { | ||
1876 | sample { | ||
1877 | name: "sound_file1" COMP; | ||
1878 | source: "sound_file1.wav"; | ||
1879 | } | ||
1880 | sample { | ||
1881 | name: "sound_file2" LOSSY 0.4; | ||
1882 | source: "sound_file2.wav"; | ||
1883 | } | ||
1884 | tone: "tone-1" 2300; | ||
1885 | } | ||
1886 | |||
1887 | @description | ||
1888 | The "sounds" block contains a list of one or more sound sample and tones items. | ||
1889 | @endblock | ||
1890 | @block | ||
1891 | sample | ||
1892 | @context | ||
1893 | sample { | ||
1894 | name: "sound_file1" RAW; | ||
1895 | source: "sound_file1.wav"; | ||
1896 | } | ||
1897 | sample { | ||
1898 | name: "sound_file2" LOSSY 0.5; | ||
1899 | source: "sound_file2.wav"; | ||
1900 | } | ||
1901 | sample { | ||
1902 | name: "sound_file3" COMP; | ||
1903 | source: "sound_file3.wav"; | ||
1904 | } | ||
1905 | sample { | ||
1906 | name: "sound_file4" AS-IS; | ||
1907 | source: "sound_file1.wav"; | ||
1908 | } | ||
1909 | @description | ||
1910 | The sample block defines the sound sample. | ||
1911 | @endblock | ||
1912 | @property | ||
1913 | name | ||
1914 | @parameters | ||
1915 | [sample name] [compression type] [if lossy, then quality] | ||
1916 | @effect | ||
1917 | Used to include each sound file. The full path to the directory holding | ||
1918 | the sounds can be defined later with edje_cc's "-sd" option. | ||
1919 | @li RAW: Uncompressed. | ||
1920 | @li COMP: Lossless compression. | ||
1921 | @li LOSSY [-0.1 - 1.0]: Lossy comression with quality from 0 to 1.0. | ||
1922 | @li AS_IS: Check for re-encoding, no compression/encoding, just write the file information as it is. | ||
1923 | @endproperty | ||
1924 | @since 1.1.0 | ||
1925 | */ | ||
1926 | static void | ||
1927 | st_collections_group_sound_sample_name(void) | ||
1928 | { | ||
1929 | Edje_Sound_Sample *sample; | ||
1930 | const char *tmp; | ||
1931 | unsigned int i; | ||
1932 | |||
1933 | if (!edje_file->sound_dir) | ||
1934 | edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory)); | ||
1935 | |||
1936 | tmp = parse_str(0); | ||
1937 | |||
1938 | for (i = 0; i < edje_file->sound_dir->samples_count; i++) | ||
1939 | { | ||
1940 | if (!strcmp(edje_file->sound_dir->samples[i].name, tmp)) | ||
1941 | { | ||
1942 | free((char *)tmp); | ||
1943 | return; | ||
1944 | } | ||
1945 | } | ||
1946 | |||
1947 | edje_file->sound_dir->samples_count++; | ||
1948 | edje_file->sound_dir->samples = | ||
1949 | realloc(edje_file->sound_dir->samples, | ||
1950 | sizeof(Edje_Sound_Sample) * | ||
1951 | edje_file->sound_dir->samples_count); | ||
1952 | |||
1953 | if (!edje_file->sound_dir->samples) | ||
1954 | { | ||
1955 | ERR("%s: Error. No enough memory.", progname); | ||
1956 | exit(-1); | ||
1957 | } | ||
1958 | |||
1959 | sample = | ||
1960 | edje_file->sound_dir->samples + | ||
1961 | edje_file->sound_dir->samples_count - 1; | ||
1962 | memset(sample, 0, sizeof (Edje_Sound_Sample)); | ||
1963 | |||
1964 | sample->name = tmp; | ||
1965 | sample->id = edje_file->sound_dir->samples_count - 1; | ||
1966 | sample->compression = parse_enum(1, | ||
1967 | "RAW", EDJE_SOUND_SOURCE_TYPE_INLINE_RAW, | ||
1968 | "COMP", EDJE_SOUND_SOURCE_TYPE_INLINE_COMP, | ||
1969 | "LOSSY", EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY, | ||
1970 | "AS_IS", EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS, | ||
1971 | NULL); | ||
1972 | |||
1973 | if (sample->compression == EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY) | ||
1974 | { | ||
1975 | sample->quality = parse_float_range(2, 45.0, 1000.0); | ||
1976 | check_arg_count(3); | ||
1977 | } | ||
1978 | else | ||
1979 | check_arg_count(2); | ||
1980 | |||
1981 | } | ||
1982 | |||
1983 | /* * delete space before * | ||
1984 | @page edcref | ||
1985 | @property | ||
1986 | source | ||
1987 | @parameters | ||
1988 | [sound file name] | ||
1989 | @effect | ||
1990 | The Sound source file name (Source can be mono/stereo WAV file. | ||
1991 | Only files with 44.1 KHz sample rate supported now) | ||
1992 | @endproperty | ||
1993 | @since 1.1.0 | ||
1994 | */ | ||
1995 | static void | ||
1996 | st_collections_group_sound_sample_source(void) | ||
1997 | { | ||
1998 | Edje_Sound_Sample *sample; | ||
1999 | |||
2000 | if (!edje_file->sound_dir->samples) | ||
2001 | { | ||
2002 | ERR("%s: Error. Invalid sound sample source definition.", progname); | ||
2003 | exit(-1); | ||
2004 | } | ||
2005 | |||
2006 | sample = | ||
2007 | edje_file->sound_dir->samples + | ||
2008 | edje_file->sound_dir->samples_count - 1; | ||
2009 | |||
2010 | if (!sample) | ||
2011 | { | ||
2012 | ERR("%s: Error. Invalid sound sample source definition.", progname); | ||
2013 | exit(-1); | ||
2014 | } | ||
2015 | sample->snd_src = parse_str(0); | ||
2016 | check_arg_count(1); | ||
2017 | } | ||
2018 | |||
2019 | /* * delete space before * | ||
2020 | @page edcref | ||
2021 | @property | ||
2022 | tone | ||
2023 | @parameters | ||
2024 | [tone name] [frequency] | ||
2025 | @effect | ||
2026 | sound of specific frequency | ||
2027 | @endproperty | ||
2028 | @since 1.1.0 | ||
2029 | */ | ||
2030 | static void | ||
2031 | st_collections_group_sound_tone(void) | ||
2032 | { | ||
2033 | Edje_Sound_Tone *tone; | ||
2034 | const char *tmp; | ||
2035 | unsigned int i; | ||
2036 | int value; | ||
2037 | |||
2038 | check_arg_count(2); | ||
2039 | |||
2040 | if (!edje_file->sound_dir) | ||
2041 | edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory)); | ||
2042 | |||
2043 | tmp = parse_str(0); | ||
2044 | /* Audible range 20 to 20KHz */ | ||
2045 | value = parse_int_range(1, 20, 20000); | ||
2046 | |||
2047 | /* Check for Tone duplication */ | ||
2048 | for (i = 0; i < edje_file->sound_dir->tones_count; i++) | ||
2049 | { | ||
2050 | if (!strcmp(edje_file->sound_dir->tones[i].name, tmp)) | ||
2051 | { | ||
2052 | ERR("%s: Error. Tone name: %s already exist.", progname, tmp); | ||
2053 | free((char *)tmp); | ||
2054 | exit(-1); | ||
2055 | } | ||
2056 | if (edje_file->sound_dir->tones[i].value == value) | ||
2057 | { | ||
2058 | ERR("%s: Error. Tone name %s with same frequency %d exist.", | ||
2059 | progname, edje_file->sound_dir->tones[i].name, value); | ||
2060 | exit(-1); | ||
2061 | } | ||
2062 | } | ||
2063 | edje_file->sound_dir->tones_count++; | ||
2064 | edje_file->sound_dir->tones = | ||
2065 | realloc(edje_file->sound_dir->tones, | ||
2066 | sizeof (Edje_Sound_Tone) * | ||
2067 | edje_file->sound_dir->tones_count); | ||
2068 | |||
2069 | if (!edje_file->sound_dir->tones) | ||
2070 | { | ||
2071 | ERR("%s: Error. No enough memory.", progname); | ||
2072 | exit(-1); | ||
2073 | } | ||
2074 | |||
2075 | tone = edje_file->sound_dir->tones + edje_file->sound_dir->tones_count - 1; | ||
2076 | memset(tone, 0, sizeof (Edje_Sound_Tone)); | ||
2077 | |||
2078 | tone->name = tmp; | ||
2079 | tone->value = value; | ||
2080 | tone->id = edje_file->sound_dir->tones_count - 1; | ||
2081 | } | ||
2082 | #endif | ||
2083 | |||
2084 | /** | ||
2085 | @edcsection{group,Group sub blocks} | ||
2086 | */ | ||
2087 | |||
2088 | /** | ||
2089 | @page edcref | ||
2090 | @block | ||
2091 | group | ||
2092 | @context | ||
2093 | collections { | ||
2094 | .. | ||
2095 | group { | ||
2096 | name: "nameusedbytheapplication"; | ||
2097 | alias: "anothername"; | ||
2098 | min: width height; | ||
2099 | max: width height; | ||
2100 | |||
2101 | data { } | ||
2102 | script { } | ||
2103 | parts { } | ||
2104 | programs { } | ||
2105 | } | ||
2106 | .. | ||
2107 | } | ||
2108 | @description | ||
2109 | A "group" block contains the list of parts and programs that compose a | ||
2110 | given Edje Object. | ||
2111 | @endblock | ||
2112 | */ | ||
2113 | static void | ||
2114 | ob_collections_group(void) | ||
2115 | { | ||
2116 | Edje_Part_Collection *pc; | ||
2117 | Code *cd; | ||
2118 | |||
2119 | if (current_de && !current_de->entry) | ||
2120 | { | ||
2121 | ERR("%p: Error. A collection without a name was detected, that's not allowed.", progname); | ||
2122 | exit(-1); | ||
2123 | } | ||
2124 | |||
2125 | current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry)); | ||
2126 | current_de->id = eina_list_count(edje_collections); | ||
2127 | |||
2128 | pc = mem_alloc(SZ(Edje_Part_Collection)); | ||
2129 | edje_collections = eina_list_append(edje_collections, pc); | ||
2130 | pc->id = current_de->id; | ||
2131 | |||
2132 | cd = mem_alloc(SZ(Code)); | ||
2133 | codes = eina_list_append(codes, cd); | ||
2134 | } | ||
2135 | |||
2136 | /** | ||
2137 | @page edcref | ||
2138 | @property | ||
2139 | name | ||
2140 | @parameters | ||
2141 | [group name] | ||
2142 | @effect | ||
2143 | The name that will be used by the application to load the resulting | ||
2144 | Edje object and to identify the group to swallow in a GROUP part. If a | ||
2145 | group with the same name exists already it will be completely overriden | ||
2146 | by the new group. | ||
2147 | @endproperty | ||
2148 | */ | ||
2149 | static void | ||
2150 | st_collections_group_name(void) | ||
2151 | { | ||
2152 | Edje_Part_Collection_Directory_Entry *older; | ||
2153 | Edje_Part_Collection *current_pc; | ||
2154 | |||
2155 | check_arg_count(1); | ||
2156 | |||
2157 | current_pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2158 | |||
2159 | current_de->entry = parse_str(0); | ||
2160 | current_pc->part = current_de->entry; | ||
2161 | |||
2162 | older = eina_hash_find(edje_file->collection, current_de->entry); | ||
2163 | |||
2164 | if (older) | ||
2165 | { | ||
2166 | Edje_Part_Collection *pc; | ||
2167 | Eina_List *l; | ||
2168 | Code *cd; | ||
2169 | int i = 0; | ||
2170 | |||
2171 | pc = eina_list_nth(edje_collections, older->id); | ||
2172 | cd = eina_list_nth(codes, older->id); | ||
2173 | |||
2174 | eina_hash_del(edje_file->collection, current_de->entry, older); | ||
2175 | edje_collections = eina_list_remove(edje_collections, pc); | ||
2176 | codes = eina_list_remove(codes, cd); | ||
2177 | |||
2178 | EINA_LIST_FOREACH(edje_collections, l, pc) | ||
2179 | { | ||
2180 | older = eina_hash_find(edje_file->collection, pc->part); | ||
2181 | |||
2182 | pc->id = i++; | ||
2183 | if (older) older->id = pc->id; | ||
2184 | } | ||
2185 | } | ||
2186 | |||
2187 | eina_hash_direct_add(edje_file->collection, current_de->entry, current_de); | ||
2188 | } | ||
2189 | |||
2190 | typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; | ||
2191 | struct _Edje_List_Foreach_Data | ||
2192 | { | ||
2193 | Eina_List *list; | ||
2194 | }; | ||
2195 | |||
2196 | static Eina_Bool | ||
2197 | _edje_data_item_list_foreach(const Eina_Hash *hash __UNUSED__, const void *key, void *data __UNUSED__, void *fdata) | ||
2198 | { | ||
2199 | Edje_List_Foreach_Data *fd; | ||
2200 | |||
2201 | fd = fdata; | ||
2202 | fd->list = eina_list_append(fd->list, strdup(key)); | ||
2203 | |||
2204 | return EINA_TRUE; | ||
2205 | } | ||
2206 | |||
2207 | /** | ||
2208 | @page edcref | ||
2209 | @property | ||
2210 | inherit | ||
2211 | @parameters | ||
2212 | [parent group name] | ||
2213 | @effect | ||
2214 | Parent group name for inheritance. | ||
2215 | Group "inherit" is used to inherit any predefined group and change | ||
2216 | some property which belongs to "part", "description", "items" or "program". | ||
2217 | The child group has the same property as parent group. If you specify the | ||
2218 | type again in an inherited part, it will cause an error (unless you plan | ||
2219 | to fix that). | ||
2220 | @endproperty | ||
2221 | @since 1.1.0 | ||
2222 | */ | ||
2223 | static void | ||
2224 | st_collections_group_inherit(void) | ||
2225 | { | ||
2226 | Edje_Part_Collection *pc, *pc2; | ||
2227 | Edje_Part *ep, *ep2; | ||
2228 | Edje_Part_Parser *epp, *epp2; | ||
2229 | Edje_Pack_Element *item, *item2; | ||
2230 | Edje_Pack_Element_Parser *pitem; | ||
2231 | Edje_Part_Description_Common *ed, *ed2; | ||
2232 | Edje_List_Foreach_Data fdata; | ||
2233 | Edje_String *es; | ||
2234 | Eina_List *l; | ||
2235 | char *parent_name; | ||
2236 | unsigned int i, j; | ||
2237 | |||
2238 | check_arg_count(1); | ||
2239 | |||
2240 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2241 | |||
2242 | parent_name = parse_str(0); | ||
2243 | |||
2244 | EINA_LIST_FOREACH(edje_collections, l, pc2) | ||
2245 | { | ||
2246 | if (!strcmp(parent_name, pc2->part)) | ||
2247 | break; | ||
2248 | } | ||
2249 | if (!pc2) | ||
2250 | { | ||
2251 | ERR("%s: Error. parse error %s:%i. There isn't a group with the name %s", | ||
2252 | progname, file_in, line - 1, parent_name); | ||
2253 | exit(-1); | ||
2254 | } | ||
2255 | |||
2256 | if (pc2->data) | ||
2257 | { | ||
2258 | char *key; | ||
2259 | |||
2260 | memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); | ||
2261 | eina_hash_foreach(pc2->data, | ||
2262 | _edje_data_item_list_foreach, &fdata); | ||
2263 | |||
2264 | if (!pc->data) | ||
2265 | pc->data = eina_hash_string_small_new(free); | ||
2266 | |||
2267 | |||
2268 | EINA_LIST_FREE(fdata.list, key) | ||
2269 | { | ||
2270 | es = mem_alloc(SZ(Edje_String)); | ||
2271 | es = (Edje_String *)eina_hash_find(pc2->data, key); | ||
2272 | eina_hash_direct_add(pc->data, key, es); | ||
2273 | } | ||
2274 | } | ||
2275 | |||
2276 | pc->prop.min.w = pc2->prop.min.w; | ||
2277 | pc->prop.min.h = pc2->prop.min.h; | ||
2278 | pc->prop.orientation = pc2->prop.orientation; | ||
2279 | |||
2280 | pc->lua_script_only = pc2->lua_script_only; | ||
2281 | |||
2282 | #define STRDUP(x) x ? strdup(x) : NULL | ||
2283 | for (i = 0 ; i < pc2->parts_count ; i++) | ||
2284 | { | ||
2285 | // copy the part | ||
2286 | ob_collections_group_parts_part(); | ||
2287 | ep = pc->parts[i]; | ||
2288 | ep2 = pc2->parts[i]; | ||
2289 | ep->name = STRDUP(ep2->name); | ||
2290 | ep->source = STRDUP(ep2->source); | ||
2291 | ep->source2 = STRDUP(ep2->source2); | ||
2292 | ep->source3 = STRDUP(ep2->source3); | ||
2293 | ep->source4 = STRDUP(ep2->source4); | ||
2294 | ep->source5 = STRDUP(ep2->source5); | ||
2295 | ep->source6 = STRDUP(ep2->source6); | ||
2296 | |||
2297 | data_queue_copied_part_lookup(pc, &(ep2->clip_to_id), &(ep->clip_to_id)); | ||
2298 | |||
2299 | ep->type = ep2->type; | ||
2300 | ep->mouse_events = ep2->mouse_events; | ||
2301 | ep->repeat_events = ep2->repeat_events; | ||
2302 | ep->ignore_flags = ep2->ignore_flags; | ||
2303 | ep->scale = ep2->scale; | ||
2304 | ep->pointer_mode = ep2->pointer_mode; | ||
2305 | ep->precise_is_inside = ep2->precise_is_inside; | ||
2306 | ep->use_alternate_font_metrics = ep2->use_alternate_font_metrics; | ||
2307 | ep->effect = ep2->effect; | ||
2308 | ep->entry_mode = ep2->entry_mode; | ||
2309 | ep->select_mode = ep2->select_mode; | ||
2310 | ep->cursor_mode = ep2->cursor_mode; | ||
2311 | ep->multiline = ep2->multiline; | ||
2312 | ep->dragable.x = ep2->dragable.x; | ||
2313 | ep->dragable.step_x = ep2->dragable.step_x; | ||
2314 | ep->dragable.count_x = ep2->dragable.count_x; | ||
2315 | ep->dragable.y = ep2->dragable.y; | ||
2316 | ep->dragable.step_y = ep2->dragable.step_y; | ||
2317 | ep->dragable.count_y = ep2->dragable.count_y; | ||
2318 | |||
2319 | data_queue_copied_part_lookup(pc, &(ep2->dragable.confine_id), &(ep->dragable.confine_id)); | ||
2320 | data_queue_copied_part_lookup(pc, &(ep2->dragable.event_id), &(ep->dragable.event_id)); | ||
2321 | |||
2322 | epp = (Edje_Part_Parser *)ep; | ||
2323 | epp2 = (Edje_Part_Parser *)ep2; | ||
2324 | epp->reorder.insert_before = STRDUP(epp2->reorder.insert_before); | ||
2325 | epp->reorder.insert_after = STRDUP(epp2->reorder.insert_after); | ||
2326 | epp->can_override = EINA_TRUE; | ||
2327 | |||
2328 | for (j = 0 ; j < ep2->items_count ; j++) | ||
2329 | { | ||
2330 | ob_collections_group_parts_part_box_items_item(); | ||
2331 | item = ep->items[j]; | ||
2332 | item2 = ep2->items[j]; | ||
2333 | item->type = item2->type; | ||
2334 | item->name = STRDUP(item2->name); | ||
2335 | item->source = STRDUP(item2->source); | ||
2336 | item->min.w = item2->min.w; | ||
2337 | item->min.h = item2->min.h; | ||
2338 | item->prefer.w = item2->prefer.w; | ||
2339 | item->prefer.h = item2->prefer.h; | ||
2340 | item->max.w = item2->max.w; | ||
2341 | item->max.h = item2->max.h; | ||
2342 | item->padding.l = item2->padding.l; | ||
2343 | item->padding.r = item2->padding.r; | ||
2344 | item->padding.t = item2->padding.t; | ||
2345 | item->padding.b = item2->padding.b; | ||
2346 | item->align.x = item2->align.x; | ||
2347 | item->align.y = item2->align.y; | ||
2348 | item->weight.x = item2->weight.x; | ||
2349 | item->weight.y = item2->weight.y; | ||
2350 | item->aspect.w = item2->aspect.w; | ||
2351 | item->aspect.h = item2->aspect.h; | ||
2352 | item->aspect.mode = item2->aspect.mode; | ||
2353 | item->options = STRDUP(item2->options); | ||
2354 | item->col = item2->col; | ||
2355 | item->row = item2->row; | ||
2356 | item->colspan = item2->colspan; | ||
2357 | item->rowspan = item2->rowspan; | ||
2358 | |||
2359 | pitem = (Edje_Pack_Element_Parser *)item; | ||
2360 | pitem->can_override = EINA_TRUE; | ||
2361 | } | ||
2362 | |||
2363 | ep->api.name = STRDUP(ep2->api.name); | ||
2364 | if (ep2->api.description) ep->api.description = STRDUP(ep2->api.description); | ||
2365 | |||
2366 | // copy default description | ||
2367 | ob_collections_group_parts_part_description(); | ||
2368 | ed = ep->default_desc; | ||
2369 | parent_desc = ed2 = ep2->default_desc; | ||
2370 | ed->state.name = STRDUP(ed2->state.name); | ||
2371 | ed->state.value = ed2->state.value; | ||
2372 | st_collections_group_parts_part_description_inherit(); | ||
2373 | parent_desc = NULL; | ||
2374 | |||
2375 | // copy other description | ||
2376 | for (j = 0 ; j < ep2->other.desc_count ; j++) | ||
2377 | { | ||
2378 | ob_collections_group_parts_part_description(); | ||
2379 | ed = ep->other.desc[j]; | ||
2380 | parent_desc = ed2 = ep2->other.desc[j]; | ||
2381 | ed->state.name = STRDUP(ed2->state.name); | ||
2382 | ed->state.value = ed2->state.value; | ||
2383 | st_collections_group_parts_part_description_inherit(); | ||
2384 | parent_desc = NULL; | ||
2385 | } | ||
2386 | } | ||
2387 | |||
2388 | //copy programs | ||
2389 | for (j = 0 ; j < pc2->programs.fnmatch_count ; j++) | ||
2390 | { | ||
2391 | ob_collections_group_programs_program(); | ||
2392 | _edje_program_copy(current_program, pc2->programs.fnmatch[j]); | ||
2393 | } | ||
2394 | for (j = 0 ; j < pc2->programs.strcmp_count ; j++) | ||
2395 | { | ||
2396 | ob_collections_group_programs_program(); | ||
2397 | _edje_program_copy(current_program, pc2->programs.strcmp[j]); | ||
2398 | } | ||
2399 | for (j = 0 ; j < pc2->programs.strncmp_count ; j++) | ||
2400 | { | ||
2401 | ob_collections_group_programs_program(); | ||
2402 | _edje_program_copy(current_program, pc2->programs.strncmp[j]); | ||
2403 | } | ||
2404 | for (j = 0 ; j < pc2->programs.strrncmp_count ; j++) | ||
2405 | { | ||
2406 | ob_collections_group_programs_program(); | ||
2407 | _edje_program_copy(current_program, pc2->programs.strrncmp[j]); | ||
2408 | } | ||
2409 | for (j = 0 ; j < pc2->programs.nocmp_count ; j++) | ||
2410 | { | ||
2411 | ob_collections_group_programs_program(); | ||
2412 | _edje_program_copy(current_program, pc2->programs.nocmp[j]); | ||
2413 | } | ||
2414 | |||
2415 | Code *cd, *cd2; | ||
2416 | Code_Program *cp, *cp2; | ||
2417 | Edje_Part_Collection_Directory_Entry *de; | ||
2418 | |||
2419 | de = eina_hash_find(edje_file->collection, pc2->part); | ||
2420 | cd2 = eina_list_nth(codes, de->id); | ||
2421 | cd = eina_list_data_get(eina_list_last(codes)); | ||
2422 | |||
2423 | EINA_LIST_FOREACH(cd2->programs, l, cp2) | ||
2424 | { | ||
2425 | cp = mem_alloc(SZ(Code_Program)); | ||
2426 | |||
2427 | cp->l1 = cp2->l1; | ||
2428 | cp->l2 = cp2->l2; | ||
2429 | cp->script = STRDUP(cp2->script); | ||
2430 | cd->is_lua = cd2->is_lua; | ||
2431 | cd->programs = eina_list_append(cd->programs, cp); | ||
2432 | data_queue_copied_anonymous_lookup(pc, &(cp2->id), &(cp->id)); | ||
2433 | } | ||
2434 | |||
2435 | free(parent_name); | ||
2436 | #undef STRDUP | ||
2437 | } | ||
2438 | |||
2439 | /** | ||
2440 | @page edcref | ||
2441 | @property | ||
2442 | script_only | ||
2443 | @parameters | ||
2444 | [on/off] | ||
2445 | @effect | ||
2446 | The flag (on/off) as to if this group is defined ONLY by script | ||
2447 | callbacks such as init(), resize() and shutdown() | ||
2448 | @endproperty | ||
2449 | */ | ||
2450 | static void | ||
2451 | st_collections_group_script_only(void) | ||
2452 | { | ||
2453 | Edje_Part_Collection *pc; | ||
2454 | |||
2455 | check_arg_count(1); | ||
2456 | |||
2457 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2458 | pc->lua_script_only = parse_bool(0); | ||
2459 | } | ||
2460 | |||
2461 | /** | ||
2462 | @page edcref | ||
2463 | @property | ||
2464 | alias | ||
2465 | @parameters | ||
2466 | [aditional group name] | ||
2467 | @effect | ||
2468 | Additional name to serve as identifier. Defining multiple aliases is | ||
2469 | supported. | ||
2470 | @endproperty | ||
2471 | */ | ||
2472 | static void | ||
2473 | st_collections_group_alias(void) | ||
2474 | { | ||
2475 | Edje_Part_Collection_Directory_Entry *alias; | ||
2476 | |||
2477 | check_arg_count(1); | ||
2478 | |||
2479 | alias = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry)); | ||
2480 | alias->id = current_de->id; | ||
2481 | alias->entry = parse_str(0); | ||
2482 | |||
2483 | aliases = eina_list_append(aliases, alias); | ||
2484 | } | ||
2485 | |||
2486 | /** | ||
2487 | @page edcref | ||
2488 | @property | ||
2489 | min | ||
2490 | @parameters | ||
2491 | [width] [height] | ||
2492 | @effect | ||
2493 | The minimum size for the container defined by the composition of the | ||
2494 | parts. It is not enforced. | ||
2495 | @endproperty | ||
2496 | */ | ||
2497 | static void | ||
2498 | st_collections_group_min(void) | ||
2499 | { | ||
2500 | Edje_Part_Collection *pc; | ||
2501 | |||
2502 | check_arg_count(2); | ||
2503 | |||
2504 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2505 | pc->prop.min.w = parse_int_range(0, 0, 0x7fffffff); | ||
2506 | pc->prop.min.h = parse_int_range(1, 0, 0x7fffffff); | ||
2507 | } | ||
2508 | |||
2509 | /** | ||
2510 | @page edcref | ||
2511 | @property | ||
2512 | max | ||
2513 | @parameters | ||
2514 | [width] [height] | ||
2515 | @effect | ||
2516 | The maximum size for the container defined by the totality of the | ||
2517 | parts. It is not enforced. | ||
2518 | @endproperty | ||
2519 | */ | ||
2520 | static void | ||
2521 | st_collections_group_max(void) | ||
2522 | { | ||
2523 | Edje_Part_Collection *pc; | ||
2524 | |||
2525 | check_arg_count(2); | ||
2526 | |||
2527 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2528 | pc->prop.max.w = parse_int_range(0, 0, 0x7fffffff); | ||
2529 | pc->prop.max.h = parse_int_range(1, 0, 0x7fffffff); | ||
2530 | } | ||
2531 | |||
2532 | /** | ||
2533 | @page edcref | ||
2534 | @block | ||
2535 | script | ||
2536 | @context | ||
2537 | .. | ||
2538 | group { | ||
2539 | script { | ||
2540 | //embryo script | ||
2541 | } | ||
2542 | .. | ||
2543 | program { | ||
2544 | script { | ||
2545 | //embryo script | ||
2546 | } | ||
2547 | } | ||
2548 | .. | ||
2549 | } | ||
2550 | .. | ||
2551 | @description | ||
2552 | This block is used to "inject" embryo scripts to a given Edje theme and | ||
2553 | it functions in two modalities. When it's included inside a "program" | ||
2554 | block, the script will be executed every time the program is run, on | ||
2555 | the other hand, when included directly into a "group", "part" or | ||
2556 | "description" block, it will be executed once at load time, in the | ||
2557 | load order. | ||
2558 | @endblock | ||
2559 | */ | ||
2560 | static void | ||
2561 | ob_collections_group_script(void) | ||
2562 | { | ||
2563 | Code *cd; | ||
2564 | |||
2565 | cd = eina_list_data_get(eina_list_last(codes)); | ||
2566 | |||
2567 | if (!is_verbatim()) track_verbatim(1); | ||
2568 | else | ||
2569 | { | ||
2570 | char *s; | ||
2571 | |||
2572 | s = get_verbatim(); | ||
2573 | if (s) | ||
2574 | { | ||
2575 | cd->l1 = get_verbatim_line1(); | ||
2576 | cd->l2 = get_verbatim_line2(); | ||
2577 | if (cd->shared) | ||
2578 | { | ||
2579 | ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group", | ||
2580 | progname, file_in, line - 1); | ||
2581 | exit(-1); | ||
2582 | } | ||
2583 | cd->shared = s; | ||
2584 | cd->original = strdup(s); | ||
2585 | cd->is_lua = 0; | ||
2586 | set_verbatim(NULL, 0, 0); | ||
2587 | } | ||
2588 | } | ||
2589 | } | ||
2590 | |||
2591 | static void | ||
2592 | ob_collections_group_lua_script(void) | ||
2593 | { | ||
2594 | Code *cd; | ||
2595 | |||
2596 | cd = eina_list_data_get(eina_list_last(codes)); | ||
2597 | |||
2598 | if (!is_verbatim()) track_verbatim(1); | ||
2599 | else | ||
2600 | { | ||
2601 | char *s; | ||
2602 | |||
2603 | s = get_verbatim(); | ||
2604 | if (s) | ||
2605 | { | ||
2606 | cd->l1 = get_verbatim_line1(); | ||
2607 | cd->l2 = get_verbatim_line2(); | ||
2608 | if (cd->shared) | ||
2609 | { | ||
2610 | ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group", | ||
2611 | progname, file_in, line - 1); | ||
2612 | exit(-1); | ||
2613 | } | ||
2614 | cd->shared = s; | ||
2615 | cd->is_lua = 1; | ||
2616 | set_verbatim(NULL, 0, 0); | ||
2617 | } | ||
2618 | } | ||
2619 | } | ||
2620 | |||
2621 | static void | ||
2622 | st_collections_group_data_item(void) | ||
2623 | { | ||
2624 | Edje_Part_Collection *pc; | ||
2625 | Edje_String *es; | ||
2626 | char *key; | ||
2627 | |||
2628 | check_arg_count(2); | ||
2629 | |||
2630 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2631 | |||
2632 | if (!pc->data) | ||
2633 | pc->data = eina_hash_string_small_new(free); | ||
2634 | |||
2635 | key = parse_str(0); | ||
2636 | |||
2637 | es = mem_alloc(SZ(Edje_String)); | ||
2638 | es->str = parse_str(1); | ||
2639 | |||
2640 | if (eina_hash_find(pc->data, key)) | ||
2641 | eina_hash_modify(pc->data, key, es); | ||
2642 | else | ||
2643 | eina_hash_direct_add(pc->data, key, es); | ||
2644 | } | ||
2645 | |||
2646 | /** | ||
2647 | @page edcref | ||
2648 | @property | ||
2649 | orientation | ||
2650 | @parameters | ||
2651 | enum AUTO, LTR, RTL | ||
2652 | @effect | ||
2653 | This defines GROUP orientation. | ||
2654 | This is useful if you want match interface orientation with language. | ||
2655 | AUTO - Follow system defs. | ||
2656 | LTR - suitable for Left To Right Languages (latin) | ||
2657 | RTL - suitable for Right To Left Languages (Hebrew, Arabic interface) | ||
2658 | @endproperty | ||
2659 | */ | ||
2660 | static void | ||
2661 | st_collections_group_orientation(void) | ||
2662 | { | ||
2663 | Edje_Part_Collection *pc; | ||
2664 | |||
2665 | check_arg_count(1); | ||
2666 | |||
2667 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2668 | pc->prop.orientation = parse_enum(0, | ||
2669 | "AUTO", EDJE_ORIENTATION_AUTO, | ||
2670 | "LTR", EDJE_ORIENTATION_LTR, | ||
2671 | "RTL", EDJE_ORIENTATION_RTL, | ||
2672 | NULL); | ||
2673 | } | ||
2674 | |||
2675 | /** | ||
2676 | @page edcref | ||
2677 | @block | ||
2678 | limits | ||
2679 | @context | ||
2680 | group { | ||
2681 | limits { | ||
2682 | vertical: "limit_name" height_barrier; | ||
2683 | horizontal: "limit_name" width_barrier; | ||
2684 | .. | ||
2685 | } | ||
2686 | .. | ||
2687 | } | ||
2688 | .. | ||
2689 | @description | ||
2690 | This block is used to trigger some signal when the Edje object is resized. | ||
2691 | @endblock | ||
2692 | |||
2693 | @edcref | ||
2694 | @property | ||
2695 | vertical | ||
2696 | @parameters | ||
2697 | [name] [height barrier] | ||
2698 | @effect | ||
2699 | It will send a signal: "limit,name,over" when the object is resized and pass | ||
2700 | the limit by growing over it. And it will send: "limit,name,below" when | ||
2701 | it pass below that limit. | ||
2702 | This limit will be applied on the y absis. | ||
2703 | @endproperty | ||
2704 | */ | ||
2705 | static void | ||
2706 | st_collections_group_limits_vertical(void) | ||
2707 | { | ||
2708 | Edje_Part_Collection *pc; | ||
2709 | Edje_Limit *el; | ||
2710 | |||
2711 | check_arg_count(2); | ||
2712 | |||
2713 | el = mem_alloc(SZ(Edje_Limit)); | ||
2714 | |||
2715 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2716 | pc->limits.vertical_count++; | ||
2717 | pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *)); | ||
2718 | if (!pc->limits.vertical || !el) | ||
2719 | { | ||
2720 | ERR("%s: Error. Not enough memory.", progname); | ||
2721 | exit(-1); | ||
2722 | } | ||
2723 | |||
2724 | pc->limits.vertical[pc->limits.vertical_count - 1] = el; | ||
2725 | |||
2726 | el->name = parse_str(0); | ||
2727 | el->value = parse_int_range(1, 1, 0xffff); | ||
2728 | } | ||
2729 | |||
2730 | /** | ||
2731 | @page edcref | ||
2732 | @property | ||
2733 | horizontal | ||
2734 | @parameters | ||
2735 | [name] [width barrier] | ||
2736 | @effect | ||
2737 | It will send a signal: "limit,name,over" when the object is resized and pass | ||
2738 | the limit by growing over it. And it will send: "limit,name,below" when | ||
2739 | it pass below that limit. | ||
2740 | This limit will be applied on the x absis. | ||
2741 | @endproperty | ||
2742 | */ | ||
2743 | static void | ||
2744 | st_collections_group_limits_horizontal(void) | ||
2745 | { | ||
2746 | Edje_Part_Collection *pc; | ||
2747 | Edje_Limit *el; | ||
2748 | |||
2749 | check_arg_count(2); | ||
2750 | |||
2751 | el = mem_alloc(SZ(Edje_Limit)); | ||
2752 | |||
2753 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2754 | pc->limits.horizontal_count++; | ||
2755 | pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *)); | ||
2756 | if (!pc->limits.horizontal || !el) | ||
2757 | { | ||
2758 | ERR("%s: Error. Not enough memory.", progname); | ||
2759 | exit(-1); | ||
2760 | } | ||
2761 | |||
2762 | pc->limits.horizontal[pc->limits.horizontal_count - 1] = el; | ||
2763 | |||
2764 | el->name = parse_str(0); | ||
2765 | el->value = parse_int_range(1, 1, 0xffff); | ||
2766 | } | ||
2767 | |||
2768 | /** | ||
2769 | @page edcref | ||
2770 | @block | ||
2771 | parts | ||
2772 | @context | ||
2773 | group { | ||
2774 | parts { | ||
2775 | alias: "theme_part_path" "real_part_path"; | ||
2776 | .. | ||
2777 | } | ||
2778 | } | ||
2779 | @description | ||
2780 | Alias of part give a chance to let the designer put the real one | ||
2781 | in a box or reuse one from a GROUP or inside a BOX. | ||
2782 | @endblock | ||
2783 | */ | ||
2784 | static void | ||
2785 | st_collections_group_parts_alias(void) | ||
2786 | { | ||
2787 | Edje_Part_Collection *pc; | ||
2788 | const char *alias; | ||
2789 | const char *aliased; | ||
2790 | |||
2791 | check_arg_count(2); | ||
2792 | |||
2793 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2794 | |||
2795 | alias = parse_str(0); | ||
2796 | aliased = parse_str(1); | ||
2797 | |||
2798 | if (!pc->alias) pc->alias = eina_hash_string_small_new(NULL); | ||
2799 | eina_hash_add(pc->alias, alias, aliased); | ||
2800 | |||
2801 | if (!pc->aliased) pc->aliased = eina_hash_string_small_new(NULL); | ||
2802 | eina_hash_add(pc->aliased, aliased, alias); | ||
2803 | } | ||
2804 | |||
2805 | |||
2806 | /** | ||
2807 | @page edcref | ||
2808 | @block | ||
2809 | part | ||
2810 | @context | ||
2811 | group { | ||
2812 | parts { | ||
2813 | .. | ||
2814 | part { | ||
2815 | name: "partname"; | ||
2816 | type: IMAGE; | ||
2817 | mouse_events: 1; | ||
2818 | repeat_events: 0; | ||
2819 | ignore_flags: NONE; | ||
2820 | clip_to: "anotherpart"; | ||
2821 | source: "groupname"; | ||
2822 | pointer_mode: AUTOGRAB; | ||
2823 | use_alternate_font_metrics: 0; | ||
2824 | |||
2825 | description { } | ||
2826 | dragable { } | ||
2827 | items { } | ||
2828 | } | ||
2829 | .. | ||
2830 | } | ||
2831 | } | ||
2832 | @description | ||
2833 | Parts are used to represent the most basic design elements of the | ||
2834 | theme, for example, a part can represent a line in a border or a label | ||
2835 | on a button. | ||
2836 | @endblock | ||
2837 | */ | ||
2838 | static void | ||
2839 | ob_collections_group_parts_part(void) | ||
2840 | { | ||
2841 | Edje_Part_Collection *pc; | ||
2842 | Edje_Part *ep; | ||
2843 | Edje_Part_Parser *epp; | ||
2844 | |||
2845 | ep = mem_alloc(SZ(Edje_Part_Parser)); | ||
2846 | |||
2847 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2848 | pc->parts_count++; | ||
2849 | pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *)); | ||
2850 | if (!pc->parts) | ||
2851 | { | ||
2852 | ERR("%s: Error. Not enough memory.", progname); | ||
2853 | exit(-1); | ||
2854 | } | ||
2855 | current_part = pc->parts[pc->parts_count - 1] = ep; | ||
2856 | |||
2857 | ep->id = pc->parts_count - 1; | ||
2858 | ep->type = EDJE_PART_TYPE_IMAGE; | ||
2859 | ep->mouse_events = 1; | ||
2860 | ep->repeat_events = 0; | ||
2861 | ep->ignore_flags = EVAS_EVENT_FLAG_NONE; | ||
2862 | ep->scale = 0; | ||
2863 | ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB; | ||
2864 | ep->precise_is_inside = 0; | ||
2865 | ep->use_alternate_font_metrics = 0; | ||
2866 | ep->clip_to_id = -1; | ||
2867 | ep->dragable.confine_id = -1; | ||
2868 | ep->dragable.event_id = -1; | ||
2869 | ep->items = NULL; | ||
2870 | |||
2871 | epp = (Edje_Part_Parser *)ep; | ||
2872 | epp->reorder.insert_before = NULL; | ||
2873 | epp->reorder.insert_after = NULL; | ||
2874 | epp->reorder.before = NULL; | ||
2875 | epp->reorder.after = NULL; | ||
2876 | epp->reorder.linked_prev = 0; | ||
2877 | epp->reorder.linked_next = 0; | ||
2878 | epp->reorder.done = EINA_FALSE; | ||
2879 | epp->can_override = EINA_FALSE; | ||
2880 | } | ||
2881 | |||
2882 | /** | ||
2883 | @page edcref | ||
2884 | @property | ||
2885 | name | ||
2886 | @parameters | ||
2887 | [part name] | ||
2888 | @effect | ||
2889 | The part's name will be used as reference in the theme's relative | ||
2890 | positioning system, by programs and in some cases by the application. | ||
2891 | It must be unique within the group. | ||
2892 | @endproperty | ||
2893 | */ | ||
2894 | static void | ||
2895 | st_collections_group_parts_part_name(void) | ||
2896 | { | ||
2897 | Edje_Part_Collection *pc; | ||
2898 | Edje_Part *ep; | ||
2899 | Edje_Part_Parser *epp; | ||
2900 | |||
2901 | check_arg_count(1); | ||
2902 | |||
2903 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2904 | ep = current_part; | ||
2905 | ep->name = parse_str(0); | ||
2906 | |||
2907 | if (ep->name) | ||
2908 | { | ||
2909 | unsigned int i; | ||
2910 | |||
2911 | for (i = 0; i < (pc->parts_count - 1); i++) | ||
2912 | { | ||
2913 | if (pc->parts[i]->name && (!strcmp(pc->parts[i]->name, ep->name))) | ||
2914 | { | ||
2915 | epp = (Edje_Part_Parser *)pc->parts[i]; | ||
2916 | if (!epp->can_override) | ||
2917 | { | ||
2918 | ERR("%s: Error. parse error %s:%i. There is already a part of the name %s", | ||
2919 | progname, file_in, line - 1, ep->name); | ||
2920 | exit(-1); | ||
2921 | } | ||
2922 | else | ||
2923 | { | ||
2924 | free(ep); | ||
2925 | pc->parts_count--; | ||
2926 | pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *)); | ||
2927 | ep = current_part = pc->parts[i]; | ||
2928 | epp->can_override = EINA_FALSE; | ||
2929 | break; | ||
2930 | } | ||
2931 | } | ||
2932 | } | ||
2933 | } | ||
2934 | } | ||
2935 | |||
2936 | /** | ||
2937 | @page edcref | ||
2938 | @property | ||
2939 | type | ||
2940 | @parameters | ||
2941 | [TYPE] | ||
2942 | @effect | ||
2943 | Set the type (all caps) from among the available types, it's set to | ||
2944 | IMAGE by default. Valid types: | ||
2945 | @li RECT | ||
2946 | @li TEXT | ||
2947 | @li IMAGE | ||
2948 | @li SWALLOW | ||
2949 | @li TEXTBLOCK | ||
2950 | @li GROUP | ||
2951 | @li BOX | ||
2952 | @li TABLE | ||
2953 | @li EXTERNAL | ||
2954 | @li PROXY | ||
2955 | @endproperty | ||
2956 | */ | ||
2957 | static void | ||
2958 | st_collections_group_parts_part_type(void) | ||
2959 | { | ||
2960 | check_arg_count(1); | ||
2961 | |||
2962 | current_part->type = parse_enum(0, | ||
2963 | "NONE", EDJE_PART_TYPE_NONE, | ||
2964 | "RECT", EDJE_PART_TYPE_RECTANGLE, | ||
2965 | "TEXT", EDJE_PART_TYPE_TEXT, | ||
2966 | "IMAGE", EDJE_PART_TYPE_IMAGE, | ||
2967 | "SWALLOW", EDJE_PART_TYPE_SWALLOW, | ||
2968 | "TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK, | ||
2969 | "GROUP", EDJE_PART_TYPE_GROUP, | ||
2970 | "BOX", EDJE_PART_TYPE_BOX, | ||
2971 | "TABLE", EDJE_PART_TYPE_TABLE, | ||
2972 | "EXTERNAL", EDJE_PART_TYPE_EXTERNAL, | ||
2973 | "PROXY", EDJE_PART_TYPE_PROXY, | ||
2974 | NULL); | ||
2975 | } | ||
2976 | |||
2977 | /** | ||
2978 | @page edcref | ||
2979 | @property | ||
2980 | insert_before | ||
2981 | @parameters | ||
2982 | [another part's name] | ||
2983 | @effect | ||
2984 | The part's name which this part is inserted before. One part cannot | ||
2985 | have both insert_before and insert_after. One part cannot refer | ||
2986 | more than one by insert_before. | ||
2987 | @endproperty | ||
2988 | @since 1.1.0 | ||
2989 | */ | ||
2990 | static void | ||
2991 | st_collections_group_parts_part_insert_before(void) | ||
2992 | { | ||
2993 | Edje_Part_Parser *epp; | ||
2994 | check_arg_count(1); | ||
2995 | |||
2996 | epp = (Edje_Part_Parser *)current_part; | ||
2997 | epp->reorder.insert_before = parse_str(0); | ||
2998 | } | ||
2999 | |||
3000 | /** | ||
3001 | @page edcref | ||
3002 | @property | ||
3003 | insert_after | ||
3004 | @parameters | ||
3005 | [another part's name] | ||
3006 | @effect | ||
3007 | The part's name which this part is inserted after. One part cannot | ||
3008 | have both insert_before and insert_after. One part cannot refer | ||
3009 | more than one by insert_after. | ||
3010 | @endproperty | ||
3011 | @since 1.1.0 | ||
3012 | */ | ||
3013 | static void | ||
3014 | st_collections_group_parts_part_insert_after(void) | ||
3015 | { | ||
3016 | Edje_Part_Parser *epp; | ||
3017 | check_arg_count(1); | ||
3018 | |||
3019 | epp = (Edje_Part_Parser *)current_part; | ||
3020 | epp->reorder.insert_after = parse_str(0); | ||
3021 | } | ||
3022 | |||
3023 | /** | ||
3024 | @page edcref | ||
3025 | @property | ||
3026 | mouse_events | ||
3027 | @parameters | ||
3028 | [1 or 0] | ||
3029 | @effect | ||
3030 | Specifies whether the part will emit signals, although it is named | ||
3031 | "mouse_events", disabling it (0) will prevent the part from emitting | ||
3032 | any type of signal at all. It's set to 1 by default. | ||
3033 | @endproperty | ||
3034 | */ | ||
3035 | static void | ||
3036 | st_collections_group_parts_part_mouse_events(void) | ||
3037 | { | ||
3038 | check_arg_count(1); | ||
3039 | |||
3040 | current_part->mouse_events = parse_bool(0); | ||
3041 | } | ||
3042 | |||
3043 | /** | ||
3044 | @page edcref | ||
3045 | @property | ||
3046 | repeat_events | ||
3047 | @parameters | ||
3048 | [1 or 0] | ||
3049 | @effect | ||
3050 | Specifies whether a part echoes a mouse event to other parts below the | ||
3051 | pointer (1), or not (0). It's set to 0 by default. | ||
3052 | @endproperty | ||
3053 | */ | ||
3054 | static void | ||
3055 | st_collections_group_parts_part_repeat_events(void) | ||
3056 | { | ||
3057 | check_arg_count(1); | ||
3058 | |||
3059 | current_part->repeat_events = parse_bool(0); | ||
3060 | } | ||
3061 | |||
3062 | /** | ||
3063 | @page edcref | ||
3064 | @property | ||
3065 | ignore_flags | ||
3066 | @parameters | ||
3067 | [FLAG] ... | ||
3068 | @effect | ||
3069 | Specifies whether events with the given flags should be ignored, | ||
3070 | i.e., will not have the signals emitted to the parts. Multiple flags | ||
3071 | must be separated by spaces, the effect will be ignoring all events | ||
3072 | with one of the flags specified. Possible flags: | ||
3073 | @li NONE (default value, no event will be ignored) | ||
3074 | @li ON_HOLD | ||
3075 | @endproperty | ||
3076 | */ | ||
3077 | static void | ||
3078 | st_collections_group_parts_part_ignore_flags(void) | ||
3079 | { | ||
3080 | check_min_arg_count(1); | ||
3081 | |||
3082 | current_part->ignore_flags = parse_flags(0, | ||
3083 | "NONE", EVAS_EVENT_FLAG_NONE, | ||
3084 | "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD, | ||
3085 | NULL); | ||
3086 | } | ||
3087 | |||
3088 | /** | ||
3089 | @page edcref | ||
3090 | @property | ||
3091 | scale | ||
3092 | @parameters | ||
3093 | [1 or 0] | ||
3094 | @effect | ||
3095 | Specifies whether the part will scale its size with an edje scaling | ||
3096 | factor. By default scale is off (0) and the default scale factor is | ||
3097 | 1.0 - that means no scaling. This would be used to scale properties | ||
3098 | such as font size, min/max size of the part, and possibly can be used | ||
3099 | to scale based on DPI of the target device. The reason to be selective | ||
3100 | is that some things work well being scaled, others do not, so the | ||
3101 | designer gets to choose what works best. | ||
3102 | @endproperty | ||
3103 | */ | ||
3104 | static void | ||
3105 | st_collections_group_parts_part_scale(void) | ||
3106 | { | ||
3107 | check_arg_count(1); | ||
3108 | |||
3109 | current_part->scale = parse_bool(0); | ||
3110 | } | ||
3111 | |||
3112 | /** | ||
3113 | @page edcref | ||
3114 | @property | ||
3115 | pointer_mode | ||
3116 | @parameters | ||
3117 | [MODE] | ||
3118 | @effect | ||
3119 | Sets the mouse pointer behavior for a given part. The default value is | ||
3120 | AUTOGRAB. Aviable modes: | ||
3121 | @li AUTOGRAB, when the part is clicked and the button remains | ||
3122 | pressed, the part will be the source of all future mouse | ||
3123 | signals emitted, even outside the object, until the button is | ||
3124 | released. | ||
3125 | @li NOGRAB, the effect will be limited to the part's container. | ||
3126 | @endproperty | ||
3127 | */ | ||
3128 | static void | ||
3129 | st_collections_group_parts_part_pointer_mode(void) | ||
3130 | { | ||
3131 | check_arg_count(1); | ||
3132 | |||
3133 | current_part->pointer_mode = parse_enum(0, | ||
3134 | "AUTOGRAB", EVAS_OBJECT_POINTER_MODE_AUTOGRAB, | ||
3135 | "NOGRAB", EVAS_OBJECT_POINTER_MODE_NOGRAB, | ||
3136 | NULL); | ||
3137 | } | ||
3138 | |||
3139 | /** | ||
3140 | @page edcref | ||
3141 | @property | ||
3142 | precise_is_inside | ||
3143 | @parameters | ||
3144 | [1 or 0] | ||
3145 | @effect | ||
3146 | Enables precise point collision detection for the part, which is more | ||
3147 | resource intensive. Disabled by default. | ||
3148 | @endproperty | ||
3149 | */ | ||
3150 | static void | ||
3151 | st_collections_group_parts_part_precise_is_inside(void) | ||
3152 | { | ||
3153 | check_arg_count(1); | ||
3154 | |||
3155 | current_part->precise_is_inside = parse_bool(0); | ||
3156 | } | ||
3157 | |||
3158 | /** | ||
3159 | @page edcref | ||
3160 | @property | ||
3161 | use_alternate_font_metrics | ||
3162 | @parameters | ||
3163 | [1 or 0] | ||
3164 | @effect | ||
3165 | Only affects text and textblock parts, when enabled Edje will use | ||
3166 | different size measurement functions. Disabled by default. (note from | ||
3167 | the author: I don't know what this is exactlu useful for?) | ||
3168 | @endproperty | ||
3169 | */ | ||
3170 | static void | ||
3171 | st_collections_group_parts_part_use_alternate_font_metrics(void) | ||
3172 | { | ||
3173 | check_arg_count(1); | ||
3174 | |||
3175 | current_part->use_alternate_font_metrics = parse_bool(0); | ||
3176 | } | ||
3177 | |||
3178 | /** | ||
3179 | @page edcref | ||
3180 | @property | ||
3181 | clip_to | ||
3182 | @parameters | ||
3183 | [another part's name] | ||
3184 | @effect | ||
3185 | Only renders the area of part that coincides with another part's | ||
3186 | container. Overflowing content will not be displayed. | ||
3187 | @endproperty | ||
3188 | */ | ||
3189 | static void | ||
3190 | st_collections_group_parts_part_clip_to_id(void) | ||
3191 | { | ||
3192 | Edje_Part_Collection *pc; | ||
3193 | |||
3194 | check_arg_count(1); | ||
3195 | |||
3196 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
3197 | { | ||
3198 | char *name; | ||
3199 | |||
3200 | name = parse_str(0); | ||
3201 | data_queue_part_lookup(pc, name, &(current_part->clip_to_id)); | ||
3202 | free(name); | ||
3203 | } | ||
3204 | } | ||
3205 | |||
3206 | /** | ||
3207 | @page edcref | ||
3208 | @property | ||
3209 | source | ||
3210 | @parameters | ||
3211 | [another group's name] | ||
3212 | @effect | ||
3213 | Only available to GROUP or TEXTBLOCK parts. Swallows the specified | ||
3214 | group into the part's container if a GROUP. If TEXTBLOCK it is used | ||
3215 | for the group to be loaded and used for selection display UNDER the | ||
3216 | selected text. source2 is used for on top of the selected text, if | ||
3217 | source2 is specified. | ||
3218 | @endproperty | ||
3219 | */ | ||
3220 | static void | ||
3221 | st_collections_group_parts_part_source(void) | ||
3222 | { | ||
3223 | check_arg_count(1); | ||
3224 | |||
3225 | //FIXME: validate this somehow (need to decide on the format also) | ||
3226 | current_part->source = parse_str(0); | ||
3227 | } | ||
3228 | |||
3229 | /** | ||
3230 | @page edcref | ||
3231 | @property | ||
3232 | source2 | ||
3233 | @parameters | ||
3234 | [another group's name] | ||
3235 | @effect | ||
3236 | Only available to TEXTBLOCK parts. It is used for the group to be | ||
3237 | loaded and used for selection display OVER the selected text. source | ||
3238 | is used for under of the selected text, if source is specified. | ||
3239 | @endproperty | ||
3240 | */ | ||
3241 | static void | ||
3242 | st_collections_group_parts_part_source2(void) | ||
3243 | { | ||
3244 | check_arg_count(1); | ||
3245 | |||
3246 | //FIXME: validate this somehow (need to decide on the format also) | ||
3247 | current_part->source2 = parse_str(0); | ||
3248 | } | ||
3249 | |||
3250 | /** | ||
3251 | @page edcref | ||
3252 | @property | ||
3253 | source3 | ||
3254 | @parameters | ||
3255 | [another group's name] | ||
3256 | @effect | ||
3257 | Only available to TEXTBLOCK parts. It is used for the group to be | ||
3258 | loaded and used for cursor display UNDER the cursor position. source4 | ||
3259 | is used for over the cursor text, if source4 is specified. | ||
3260 | @endproperty | ||
3261 | */ | ||
3262 | static void | ||
3263 | st_collections_group_parts_part_source3(void) | ||
3264 | { | ||
3265 | check_arg_count(1); | ||
3266 | |||
3267 | //FIXME: validate this somehow (need to decide on the format also) | ||
3268 | current_part->source3 = parse_str(0); | ||
3269 | } | ||
3270 | |||
3271 | /** | ||
3272 | @page edcref | ||
3273 | @property | ||
3274 | source4 | ||
3275 | @parameters | ||
3276 | [another group's name] | ||
3277 | @effect | ||
3278 | Only available to TEXTBLOCK parts. It is used for the group to be | ||
3279 | loaded and used for cursor display OVER the cursor position. source3 | ||
3280 | is used for under the cursor text, if source4 is specified. | ||
3281 | @endproperty | ||
3282 | */ | ||
3283 | static void | ||
3284 | st_collections_group_parts_part_source4(void) | ||
3285 | { | ||
3286 | check_arg_count(1); | ||
3287 | |||
3288 | //FIXME: validate this somehow (need to decide on the format also) | ||
3289 | current_part->source4 = parse_str(0); | ||
3290 | } | ||
3291 | |||
3292 | /** | ||
3293 | @page edcref | ||
3294 | @property | ||
3295 | source5 | ||
3296 | @parameters | ||
3297 | [another group's name] | ||
3298 | @effect | ||
3299 | Only available to TEXTBLOCK parts. It is used for the group to be | ||
3300 | loaded and used for anchors display UNDER the anchor position. source6 | ||
3301 | is used for over the anchors text, if source6 is specified. | ||
3302 | @endproperty | ||
3303 | */ | ||
3304 | static void | ||
3305 | st_collections_group_parts_part_source5(void) | ||
3306 | { | ||
3307 | check_arg_count(1); | ||
3308 | |||
3309 | //FIXME: validate this somehow (need to decide on the format also) | ||
3310 | current_part->source5 = parse_str(0); | ||
3311 | } | ||
3312 | |||
3313 | /** | ||
3314 | @page edcref | ||
3315 | @property | ||
3316 | source6 | ||
3317 | @parameters | ||
3318 | [another group's name] | ||
3319 | @effect | ||
3320 | Only available to TEXTBLOCK parts. It is used for the group to be | ||
3321 | loaded and used for anchor display OVER the anchor position. source5 | ||
3322 | is used for under the anchor text, if source6 is specified. | ||
3323 | @endproperty | ||
3324 | */ | ||
3325 | static void | ||
3326 | st_collections_group_parts_part_source6(void) | ||
3327 | { | ||
3328 | check_arg_count(1); | ||
3329 | |||
3330 | //FIXME: validate this somehow (need to decide on the format also) | ||
3331 | current_part->source6 = parse_str(0); | ||
3332 | } | ||
3333 | |||
3334 | /** | ||
3335 | @page edcref | ||
3336 | |||
3337 | @property | ||
3338 | effect | ||
3339 | @parameters | ||
3340 | [EFFECT] | ||
3341 | (optional) [SHADOW DIRECTION] | ||
3342 | @effect | ||
3343 | Causes Edje to draw the selected effect among: | ||
3344 | @li PLAIN | ||
3345 | @li OUTLINE | ||
3346 | @li SOFT_OUTLINE | ||
3347 | @li SHADOW | ||
3348 | @li SOFT_SHADOW | ||
3349 | @li OUTLINE_SHADOW | ||
3350 | @li OUTLINE_SOFT_SHADOW | ||
3351 | @li FAR_SHADOW | ||
3352 | @li FAR_SOFT_SHADOW | ||
3353 | @li GLOW | ||
3354 | |||
3355 | Shadow directions (default if not given is BOTTOM_RIGHT): | ||
3356 | @li BOTTOM_RIGHT | ||
3357 | @li BOTTOM | ||
3358 | @li BOTTOM_LEFT | ||
3359 | @li LEFT | ||
3360 | @li TOP_LEFT | ||
3361 | @li TOP | ||
3362 | @li TOP_RIGHT | ||
3363 | @li RIGHT | ||
3364 | @endproperty | ||
3365 | */ | ||
3366 | static void | ||
3367 | st_collections_group_parts_part_effect(void) | ||
3368 | { | ||
3369 | check_min_arg_count(1); | ||
3370 | |||
3371 | current_part->effect = parse_enum(0, | ||
3372 | "NONE", EDJE_TEXT_EFFECT_NONE, | ||
3373 | "PLAIN", EDJE_TEXT_EFFECT_PLAIN, | ||
3374 | "OUTLINE", EDJE_TEXT_EFFECT_OUTLINE, | ||
3375 | "SOFT_OUTLINE", EDJE_TEXT_EFFECT_SOFT_OUTLINE, | ||
3376 | "SHADOW", EDJE_TEXT_EFFECT_SHADOW, | ||
3377 | "SOFT_SHADOW", EDJE_TEXT_EFFECT_SOFT_SHADOW, | ||
3378 | "OUTLINE_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SHADOW, | ||
3379 | "OUTLINE_SOFT_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW, | ||
3380 | "FAR_SHADOW", EDJE_TEXT_EFFECT_FAR_SHADOW, | ||
3381 | "FAR_SOFT_SHADOW", EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW, | ||
3382 | "GLOW", EDJE_TEXT_EFFECT_GLOW, | ||
3383 | NULL); | ||
3384 | if (get_arg_count() >= 2) | ||
3385 | { | ||
3386 | unsigned char shadow; | ||
3387 | |||
3388 | shadow = parse_enum(1, | ||
3389 | "BOTTOM_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT, | ||
3390 | "BOTTOM", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM, | ||
3391 | "BOTTOM_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT, | ||
3392 | "LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT, | ||
3393 | "TOP_LEFT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT, | ||
3394 | "TOP", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP, | ||
3395 | "TOP_RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT, | ||
3396 | "RIGHT", EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT, | ||
3397 | NULL); | ||
3398 | EDJE_TEXT_EFFECT_SHADOW_DIRECTION_SET(current_part->effect, shadow); | ||
3399 | } | ||
3400 | } | ||
3401 | |||
3402 | /** | ||
3403 | @page edcref | ||
3404 | @property | ||
3405 | entry_mode | ||
3406 | @parameters | ||
3407 | [MODE] | ||
3408 | @effect | ||
3409 | Sets the edit mode for a textblock part to one of: | ||
3410 | @li NONE | ||
3411 | @li PLAIN | ||
3412 | @li EDITABLE | ||
3413 | @li PASSWORD | ||
3414 | It causes the part be editable if the edje object has the keyboard | ||
3415 | focus AND the part has the edje focus (or selectable always | ||
3416 | regardless of focus) and in the event of password mode, not | ||
3417 | selectable and all text chars replaced with *'s but editable and | ||
3418 | pastable. | ||
3419 | @endproperty | ||
3420 | */ | ||
3421 | static void | ||
3422 | st_collections_group_parts_part_entry_mode(void) | ||
3423 | { | ||
3424 | check_arg_count(1); | ||
3425 | |||
3426 | current_part->entry_mode = parse_enum(0, | ||
3427 | "NONE", EDJE_ENTRY_EDIT_MODE_NONE, | ||
3428 | "PLAIN", EDJE_ENTRY_EDIT_MODE_SELECTABLE, | ||
3429 | "EDITABLE", EDJE_ENTRY_EDIT_MODE_EDITABLE, | ||
3430 | "PASSWORD", EDJE_ENTRY_EDIT_MODE_PASSWORD, | ||
3431 | NULL); | ||
3432 | } | ||
3433 | |||
3434 | /** | ||
3435 | @page edcref | ||
3436 | @property | ||
3437 | select_mode | ||
3438 | @parameters | ||
3439 | [MODE] | ||
3440 | @effect | ||
3441 | Sets the selection mode for a textblock part to one of: | ||
3442 | @li DEFAULT | ||
3443 | @li EXPLICIT | ||
3444 | DEFAULT selection mode is what you would expect on any desktop. Press | ||
3445 | mouse, drag and release to end. EXPLICIT mode requires the application | ||
3446 | controlling the edje object has to explicitly begin and end selection | ||
3447 | modes, and the selection itself is dragable at both ends. | ||
3448 | @endproperty | ||
3449 | */ | ||
3450 | static void | ||
3451 | st_collections_group_parts_part_select_mode(void) | ||
3452 | { | ||
3453 | check_arg_count(1); | ||
3454 | |||
3455 | current_part->select_mode = parse_enum(0, | ||
3456 | "DEFAULT", EDJE_ENTRY_SELECTION_MODE_DEFAULT, | ||
3457 | "EXPLICIT", EDJE_ENTRY_SELECTION_MODE_EXPLICIT, | ||
3458 | NULL); | ||
3459 | } | ||
3460 | |||
3461 | /** | ||
3462 | @page edcref | ||
3463 | @property | ||
3464 | cursor_mode | ||
3465 | @parameters | ||
3466 | [MODE] | ||
3467 | @effect | ||
3468 | Sets the cursor mode for a textblock part to one of: | ||
3469 | @li UNDER | ||
3470 | @li BEFORE | ||
3471 | UNDER cursor mode means the cursor will draw below the character pointed | ||
3472 | at. That's the default. | ||
3473 | BEFORE cursor mode means the cursor is drawn as a vertical line before | ||
3474 | the current character, just like many other GUI toolkits handle it. | ||
3475 | @endproperty | ||
3476 | */ | ||
3477 | static void | ||
3478 | st_collections_group_parts_part_cursor_mode(void) | ||
3479 | { | ||
3480 | check_arg_count(1); | ||
3481 | |||
3482 | current_part->cursor_mode = parse_enum(0, | ||
3483 | "UNDER", EDJE_ENTRY_CURSOR_MODE_UNDER, | ||
3484 | "BEFORE", EDJE_ENTRY_CURSOR_MODE_BEFORE, | ||
3485 | NULL); | ||
3486 | } | ||
3487 | |||
3488 | /** | ||
3489 | @page edcref | ||
3490 | @property | ||
3491 | multiline | ||
3492 | @parameters | ||
3493 | [1 or 0] | ||
3494 | @effect | ||
3495 | It causes a textblock that is editable to allow multiple lines for | ||
3496 | editing. | ||
3497 | @endproperty | ||
3498 | */ | ||
3499 | static void | ||
3500 | st_collections_group_parts_part_multiline(void) | ||
3501 | { | ||
3502 | check_arg_count(1); | ||
3503 | |||
3504 | current_part->multiline = parse_bool(0); | ||
3505 | } | ||
3506 | |||
3507 | /** | ||
3508 | @page edcref | ||
3509 | @block | ||
3510 | dragable | ||
3511 | @context | ||
3512 | part { | ||
3513 | .. | ||
3514 | dragable { | ||
3515 | confine: "another part"; | ||
3516 | events: "another dragable part"; | ||
3517 | x: 0 0 0; | ||
3518 | y: 0 0 0; | ||
3519 | } | ||
3520 | .. | ||
3521 | } | ||
3522 | @description | ||
3523 | When this block is used the resulting part can be dragged around the | ||
3524 | interface, do not confuse with external drag & drop. By default Edje | ||
3525 | (and most applications) will attempt to use the minimal size possible | ||
3526 | for a dragable part. If the min property is not set in the description | ||
3527 | the part will be (most likely) set to 0px width and 0px height, thus | ||
3528 | invisible. | ||
3529 | @endblock | ||
3530 | |||
3531 | @property | ||
3532 | x | ||
3533 | @parameters | ||
3534 | [enable/disable] [step] [count] | ||
3535 | @effect | ||
3536 | Used to setup dragging events for the X axis. The first parameter is | ||
3537 | used to enable (1 or -1) and disable (0) dragging along the axis. When | ||
3538 | enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second | ||
3539 | parameter takes any integer and will limit movement to values | ||
3540 | divisible by it, causing the part to jump from position to position. | ||
3541 | The third parameter, (question from the author: What is count for?). | ||
3542 | @endproperty | ||
3543 | */ | ||
3544 | static void | ||
3545 | st_collections_group_parts_part_dragable_x(void) | ||
3546 | { | ||
3547 | check_arg_count(3); | ||
3548 | |||
3549 | current_part->dragable.x = parse_int_range(0, -1, 1); | ||
3550 | current_part->dragable.step_x = parse_int_range(1, 0, 0x7fffffff); | ||
3551 | current_part->dragable.count_x = parse_int_range(2, 0, 0x7fffffff); | ||
3552 | } | ||
3553 | |||
3554 | /** | ||
3555 | @page edcref | ||
3556 | @property | ||
3557 | y | ||
3558 | @parameters | ||
3559 | [enable/disable] [step] [count] | ||
3560 | @effect | ||
3561 | Used to setup dragging events for the Y axis. The first parameter is | ||
3562 | used to enable (1 or -1) and disable (0) dragging along the axis. When | ||
3563 | enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second | ||
3564 | parameter takes any integer and will limit movement to values | ||
3565 | divisibles by it, causing the part to jump from position to position. | ||
3566 | The third parameter, (question from the author: What is count for?). | ||
3567 | @endproperty | ||
3568 | */ | ||
3569 | static void | ||
3570 | st_collections_group_parts_part_dragable_y(void) | ||
3571 | { | ||
3572 | check_arg_count(3); | ||
3573 | |||
3574 | current_part->dragable.y = parse_int_range(0, -1, 1); | ||
3575 | current_part->dragable.step_y = parse_int_range(1, 0, 0x7fffffff); | ||
3576 | current_part->dragable.count_y = parse_int_range(2, 0, 0x7fffffff); | ||
3577 | } | ||
3578 | |||
3579 | /** | ||
3580 | @page edcref | ||
3581 | @property | ||
3582 | confine | ||
3583 | @parameters | ||
3584 | [another part's name] | ||
3585 | @effect | ||
3586 | When set, limits the movement of the dragged part to another part's | ||
3587 | container. When you use confine don't forget to set a min size for the | ||
3588 | part, or the draggie will not show up. | ||
3589 | @endproperty | ||
3590 | */ | ||
3591 | static void | ||
3592 | st_collections_group_parts_part_dragable_confine(void) | ||
3593 | { | ||
3594 | Edje_Part_Collection *pc; | ||
3595 | |||
3596 | check_arg_count(1); | ||
3597 | |||
3598 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
3599 | { | ||
3600 | char *name; | ||
3601 | |||
3602 | name = parse_str(0); | ||
3603 | data_queue_part_lookup(pc, name, &(current_part->dragable.confine_id)); | ||
3604 | free(name); | ||
3605 | } | ||
3606 | } | ||
3607 | |||
3608 | /** | ||
3609 | @page edcref | ||
3610 | @property | ||
3611 | events | ||
3612 | @parameters | ||
3613 | [another dragable part's name] | ||
3614 | @effect | ||
3615 | It causes the part to forward the drag events to another part, thus | ||
3616 | ignoring them for itself. | ||
3617 | @endproperty | ||
3618 | */ | ||
3619 | static void | ||
3620 | st_collections_group_parts_part_dragable_events(void) | ||
3621 | { | ||
3622 | Edje_Part_Collection *pc; | ||
3623 | |||
3624 | check_arg_count(1); | ||
3625 | |||
3626 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
3627 | { | ||
3628 | char *name; | ||
3629 | |||
3630 | name = parse_str(0); | ||
3631 | data_queue_part_lookup(pc, name, &(current_part->dragable.event_id)); | ||
3632 | free(name); | ||
3633 | } | ||
3634 | } | ||
3635 | |||
3636 | /** | ||
3637 | @page edcref | ||
3638 | @block | ||
3639 | items | ||
3640 | @context | ||
3641 | part { | ||
3642 | .. | ||
3643 | box { | ||
3644 | items { | ||
3645 | item { | ||
3646 | type: TYPE; | ||
3647 | source: "some source"; | ||
3648 | min: 1 1; | ||
3649 | max: 100 100; | ||
3650 | padding: 1 1 2 2; | ||
3651 | } | ||
3652 | item { | ||
3653 | type: TYPE; | ||
3654 | source: "some other source"; | ||
3655 | name: "some name"; | ||
3656 | align: 1.0 0.5; | ||
3657 | } | ||
3658 | .. | ||
3659 | } | ||
3660 | } | ||
3661 | .. | ||
3662 | } | ||
3663 | @description | ||
3664 | On a part of type BOX, this block can be used to set other groups | ||
3665 | as elements of the box. These can be mixed with external objects set | ||
3666 | by the application through the edje_object_part_box_* API. | ||
3667 | @endblock | ||
3668 | */ | ||
3669 | static void ob_collections_group_parts_part_box_items_item(void) | ||
3670 | { | ||
3671 | Edje_Part *ep; | ||
3672 | Edje_Pack_Element *item; | ||
3673 | Edje_Pack_Element_Parser *pitem; | ||
3674 | |||
3675 | ep = current_part; | ||
3676 | |||
3677 | if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE)) | ||
3678 | { | ||
3679 | ERR("%s: Error. parse error %s:%i. " | ||
3680 | "box attributes in non-BOX or TABLE part.", | ||
3681 | progname, file_in, line - 1); | ||
3682 | exit(-1); | ||
3683 | } | ||
3684 | |||
3685 | ep->items_count++; | ||
3686 | ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count); | ||
3687 | if (!ep->items) | ||
3688 | { | ||
3689 | ERR("%s: Error. Not enough memory.", progname); | ||
3690 | exit(-1); | ||
3691 | } | ||
3692 | |||
3693 | item = mem_alloc(SZ(Edje_Pack_Element_Parser)); | ||
3694 | current_item = ep->items[ep->items_count - 1] = item; | ||
3695 | item->type = EDJE_PART_TYPE_GROUP; | ||
3696 | item->name = NULL; | ||
3697 | item->source = NULL; | ||
3698 | item->min.w = 0; | ||
3699 | item->min.h = 0; | ||
3700 | item->prefer.w = 0; | ||
3701 | item->prefer.h = 0; | ||
3702 | item->max.w = -1; | ||
3703 | item->max.h = -1; | ||
3704 | item->padding.l = 0; | ||
3705 | item->padding.r = 0; | ||
3706 | item->padding.t = 0; | ||
3707 | item->padding.b = 0; | ||
3708 | item->align.x = FROM_DOUBLE(0.5); | ||
3709 | item->align.y = FROM_DOUBLE(0.5); | ||
3710 | item->weight.x = FROM_DOUBLE(0.0); | ||
3711 | item->weight.y = FROM_DOUBLE(0.0); | ||
3712 | item->aspect.w = 0; | ||
3713 | item->aspect.h = 0; | ||
3714 | item->aspect.mode = EDJE_ASPECT_CONTROL_NONE; | ||
3715 | item->options = NULL; | ||
3716 | item->col = -1; | ||
3717 | item->row = -1; | ||
3718 | item->colspan = 1; | ||
3719 | item->rowspan = 1; | ||
3720 | pitem = (Edje_Pack_Element_Parser *)item; | ||
3721 | pitem->can_override = EINA_FALSE; | ||
3722 | } | ||
3723 | |||
3724 | /** | ||
3725 | @page edcref | ||
3726 | @property | ||
3727 | type | ||
3728 | @parameters | ||
3729 | Only GROUP for now (defaults to it) | ||
3730 | @effect | ||
3731 | Sets the type of the object this item will hold. | ||
3732 | @endproperty | ||
3733 | */ | ||
3734 | static void st_collections_group_parts_part_box_items_item_type(void) | ||
3735 | { | ||
3736 | check_arg_count(1); | ||
3737 | |||
3738 | { | ||
3739 | char *s; | ||
3740 | |||
3741 | s = parse_str(0); | ||
3742 | if (strcmp(s, "GROUP")) | ||
3743 | { | ||
3744 | ERR("%s: Error. parse error %s:%i. " | ||
3745 | "token %s not one of: GROUP.", | ||
3746 | progname, file_in, line - 1, s); | ||
3747 | exit(-1); | ||
3748 | } | ||
3749 | /* FIXME: handle the enum, once everything else is supported */ | ||
3750 | current_item->type = EDJE_PART_TYPE_GROUP; | ||
3751 | } | ||
3752 | } | ||
3753 | |||
3754 | /** | ||
3755 | @page edcref | ||
3756 | @property | ||
3757 | name | ||
3758 | @parameters | ||
3759 | [name for the object] | ||
3760 | @effect | ||
3761 | Sets the name of the object via evas_object_name_set(). | ||
3762 | @endproperty | ||
3763 | */ | ||
3764 | static void st_collections_group_parts_part_box_items_item_name(void) | ||
3765 | { | ||
3766 | Edje_Part *ep; | ||
3767 | Edje_Pack_Element *item; | ||
3768 | Edje_Pack_Element_Parser *pitem; | ||
3769 | |||
3770 | check_arg_count(1); | ||
3771 | |||
3772 | ep = current_part; | ||
3773 | item = ep->items[ep->items_count - 1]; | ||
3774 | |||
3775 | item->name = parse_str(0); | ||
3776 | |||
3777 | { | ||
3778 | unsigned int i; | ||
3779 | |||
3780 | for (i = 0; i < ep->items_count - 1; ++i) | ||
3781 | { | ||
3782 | if (ep->items[i]->name && (!strcmp(ep->items[i]->name, item->name))) | ||
3783 | { | ||
3784 | pitem = (Edje_Pack_Element_Parser *)ep->items[i]; | ||
3785 | if (!pitem->can_override) | ||
3786 | { | ||
3787 | ERR("%s: Error. parse error %s:%i. There is already a item of the name %s", | ||
3788 | progname, file_in, line - 1, item->name); | ||
3789 | exit(-1); | ||
3790 | } | ||
3791 | else | ||
3792 | { | ||
3793 | free(item); | ||
3794 | ep->items_count--; | ||
3795 | ep->items = realloc(ep->items, ep->items_count * sizeof (Edje_Pack_Element *)); | ||
3796 | current_item = ep->items[i]; | ||
3797 | pitem->can_override = EINA_FALSE; | ||
3798 | } | ||
3799 | } | ||
3800 | } | ||
3801 | } | ||
3802 | } | ||
3803 | |||
3804 | /** | ||
3805 | @page edcref | ||
3806 | @property | ||
3807 | source | ||
3808 | @parameters | ||
3809 | [another group's name] | ||
3810 | @effect | ||
3811 | Sets the group this object will be made from. | ||
3812 | @endproperty | ||
3813 | */ | ||
3814 | static void st_collections_group_parts_part_box_items_item_source(void) | ||
3815 | { | ||
3816 | check_arg_count(1); | ||
3817 | |||
3818 | current_item->source = parse_str(0); | ||
3819 | } | ||
3820 | |||
3821 | /** | ||
3822 | @page edcref | ||
3823 | @property | ||
3824 | min | ||
3825 | @parameters | ||
3826 | [width] [height] | ||
3827 | @effect | ||
3828 | Sets the minimum size hints for this object. | ||
3829 | @endproperty | ||
3830 | */ | ||
3831 | static void st_collections_group_parts_part_box_items_item_min(void) | ||
3832 | { | ||
3833 | check_arg_count(2); | ||
3834 | |||
3835 | current_item->min.w = parse_int_range(0, 0, 0x7ffffff); | ||
3836 | current_item->min.h = parse_int_range(1, 0, 0x7ffffff); | ||
3837 | } | ||
3838 | |||
3839 | /** | ||
3840 | @page edcref | ||
3841 | @property | ||
3842 | prefer | ||
3843 | @parameters | ||
3844 | [width] [height] | ||
3845 | @effect | ||
3846 | Sets the preferred size hints for this object. | ||
3847 | @endproperty | ||
3848 | */ | ||
3849 | static void st_collections_group_parts_part_box_items_item_prefer(void) | ||
3850 | { | ||
3851 | check_arg_count(2); | ||
3852 | |||
3853 | current_item->prefer.w = parse_int_range(0, 0, 0x7ffffff); | ||
3854 | current_item->prefer.h = parse_int_range(1, 0, 0x7ffffff); | ||
3855 | } | ||
3856 | /** | ||
3857 | @page edcref | ||
3858 | @property | ||
3859 | max | ||
3860 | @parameters | ||
3861 | [width] [height] | ||
3862 | @effect | ||
3863 | Sets the maximum size hints for this object. | ||
3864 | @endproperty | ||
3865 | */ | ||
3866 | static void st_collections_group_parts_part_box_items_item_max(void) | ||
3867 | { | ||
3868 | check_arg_count(2); | ||
3869 | |||
3870 | current_item->max.w = parse_int_range(0, 0, 0x7ffffff); | ||
3871 | current_item->max.h = parse_int_range(1, 0, 0x7ffffff); | ||
3872 | } | ||
3873 | |||
3874 | /** | ||
3875 | @page edcref | ||
3876 | @property | ||
3877 | padding | ||
3878 | @parameters | ||
3879 | [left] [right] [top] [bottom] | ||
3880 | @effect | ||
3881 | Sets the padding hints for this object. | ||
3882 | @endproperty | ||
3883 | */ | ||
3884 | static void st_collections_group_parts_part_box_items_item_padding(void) | ||
3885 | { | ||
3886 | check_arg_count(4); | ||
3887 | |||
3888 | current_item->padding.l = parse_int_range(0, 0, 0x7ffffff); | ||
3889 | current_item->padding.r = parse_int_range(1, 0, 0x7ffffff); | ||
3890 | current_item->padding.t = parse_int_range(2, 0, 0x7ffffff); | ||
3891 | current_item->padding.b = parse_int_range(3, 0, 0x7ffffff); | ||
3892 | } | ||
3893 | |||
3894 | /** | ||
3895 | @page edcref | ||
3896 | @property | ||
3897 | align | ||
3898 | @parameters | ||
3899 | [x] [y] | ||
3900 | @effect | ||
3901 | Sets the alignment hints for this object. | ||
3902 | @endproperty | ||
3903 | */ | ||
3904 | static void st_collections_group_parts_part_box_items_item_align(void) | ||
3905 | { | ||
3906 | check_arg_count(2); | ||
3907 | |||
3908 | current_item->align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0)); | ||
3909 | current_item->align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0)); | ||
3910 | } | ||
3911 | |||
3912 | /** | ||
3913 | @page edcref | ||
3914 | @property | ||
3915 | weight | ||
3916 | @parameters | ||
3917 | [x] [y] | ||
3918 | @effect | ||
3919 | Sets the weight hints for this object. | ||
3920 | @endproperty | ||
3921 | */ | ||
3922 | static void st_collections_group_parts_part_box_items_item_weight(void) | ||
3923 | { | ||
3924 | check_arg_count(2); | ||
3925 | |||
3926 | current_item->weight.x = FROM_DOUBLE(parse_float_range(0, 0.0, 99999.99)); | ||
3927 | current_item->weight.y = FROM_DOUBLE(parse_float_range(1, 0.0, 99999.99)); | ||
3928 | } | ||
3929 | |||
3930 | /** | ||
3931 | @page edcref | ||
3932 | @property | ||
3933 | aspect | ||
3934 | @parameters | ||
3935 | [w] [h] | ||
3936 | @effect | ||
3937 | Sets the aspect width and height hints for this object. | ||
3938 | @endproperty | ||
3939 | */ | ||
3940 | static void st_collections_group_parts_part_box_items_item_aspect(void) | ||
3941 | { | ||
3942 | check_arg_count(2); | ||
3943 | |||
3944 | current_item->aspect.w = parse_int_range(0, 0, 0x7fffffff); | ||
3945 | current_item->aspect.h = parse_int_range(1, 0, 0x7fffffff); | ||
3946 | } | ||
3947 | |||
3948 | /** | ||
3949 | @page edcref | ||
3950 | @property | ||
3951 | aspect_mode | ||
3952 | @parameters | ||
3953 | NONE, NEITHER, HORIZONTAL, VERTICAL, BOTH | ||
3954 | @effect | ||
3955 | Sets the aspect control hints for this object. | ||
3956 | @endproperty | ||
3957 | */ | ||
3958 | static void st_collections_group_parts_part_box_items_item_aspect_mode(void) | ||
3959 | { | ||
3960 | check_arg_count(1); | ||
3961 | |||
3962 | current_item->aspect.mode = parse_enum(0, | ||
3963 | "NONE", EDJE_ASPECT_CONTROL_NONE, | ||
3964 | "NEITHER", EDJE_ASPECT_CONTROL_NEITHER, | ||
3965 | "HORIZONTAL", EDJE_ASPECT_CONTROL_HORIZONTAL, | ||
3966 | "VERTICAL", EDJE_ASPECT_CONTROL_VERTICAL, | ||
3967 | "BOTH", EDJE_ASPECT_CONTROL_BOTH, | ||
3968 | NULL); | ||
3969 | } | ||
3970 | |||
3971 | /** | ||
3972 | @page edcref | ||
3973 | @property | ||
3974 | options | ||
3975 | @parameters | ||
3976 | [extra options] | ||
3977 | @effect | ||
3978 | Sets extra options for the object. Unused for now. | ||
3979 | @endproperty | ||
3980 | */ | ||
3981 | static void st_collections_group_parts_part_box_items_item_options(void) | ||
3982 | { | ||
3983 | check_arg_count(1); | ||
3984 | |||
3985 | current_item->options = parse_str(0); | ||
3986 | } | ||
3987 | |||
3988 | /** | ||
3989 | @page edcref | ||
3990 | @property | ||
3991 | position | ||
3992 | @parameters | ||
3993 | [col] [row] | ||
3994 | @effect | ||
3995 | Sets the position this item will have in the table. | ||
3996 | This is required for parts of type TABLE. | ||
3997 | @endproperty | ||
3998 | */ | ||
3999 | static void st_collections_group_parts_part_table_items_item_position(void) | ||
4000 | { | ||
4001 | check_arg_count(2); | ||
4002 | |||
4003 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
4004 | { | ||
4005 | ERR("%s: Error. parse error %s:%i. " | ||
4006 | "table attributes in non-TABLE part.", | ||
4007 | progname, file_in, line - 1); | ||
4008 | exit(-1); | ||
4009 | } | ||
4010 | |||
4011 | current_item->col = parse_int_range(0, 0, 0xffff); | ||
4012 | current_item->row = parse_int_range(1, 0, 0xffff); | ||
4013 | } | ||
4014 | |||
4015 | /** | ||
4016 | @page edcref | ||
4017 | @property | ||
4018 | span | ||
4019 | @parameters | ||
4020 | [col] [row] | ||
4021 | @effect | ||
4022 | Sets how many columns/rows this item will use. | ||
4023 | Defaults to 1 1. | ||
4024 | @endproperty | ||
4025 | */ | ||
4026 | static void st_collections_group_parts_part_table_items_item_span(void) | ||
4027 | { | ||
4028 | check_arg_count(2); | ||
4029 | |||
4030 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
4031 | { | ||
4032 | ERR("%s: Error. parse error %s:%i. " | ||
4033 | "table attributes in non-TABLE part.", | ||
4034 | progname, file_in, line - 1); | ||
4035 | exit(-1); | ||
4036 | } | ||
4037 | |||
4038 | current_item->colspan = parse_int_range(0, 1, 0xffff); | ||
4039 | current_item->rowspan = parse_int_range(1, 1, 0xffff); | ||
4040 | } | ||
4041 | |||
4042 | /** | ||
4043 | @edcsection{description,State description sub blocks} | ||
4044 | */ | ||
4045 | |||
4046 | /** | ||
4047 | @page edcref | ||
4048 | @block | ||
4049 | description | ||
4050 | @context | ||
4051 | description { | ||
4052 | inherit: "another_description" INDEX; | ||
4053 | state: "description_name" INDEX; | ||
4054 | visible: 1; | ||
4055 | min: 0 0; | ||
4056 | max: -1 -1; | ||
4057 | align: 0.5 0.5; | ||
4058 | fixed: 0 0; | ||
4059 | step: 0 0; | ||
4060 | aspect: 1 1; | ||
4061 | |||
4062 | rel1 { | ||
4063 | .. | ||
4064 | } | ||
4065 | |||
4066 | rel2 { | ||
4067 | .. | ||
4068 | } | ||
4069 | } | ||
4070 | @description | ||
4071 | Every part can have one or more description blocks. Each description is | ||
4072 | used to define style and layout properties of a part in a given | ||
4073 | "state". | ||
4074 | @endblock | ||
4075 | */ | ||
4076 | static void | ||
4077 | ob_collections_group_parts_part_description(void) | ||
4078 | { | ||
4079 | Edje_Part_Collection *pc; | ||
4080 | Edje_Part *ep; | ||
4081 | Edje_Part_Description_Common *ed; | ||
4082 | |||
4083 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4084 | ep = current_part; | ||
4085 | |||
4086 | ed = _edje_part_description_alloc(ep->type, pc->part, ep->name); | ||
4087 | |||
4088 | if (!ep->default_desc) | ||
4089 | { | ||
4090 | current_desc = ep->default_desc = ed; | ||
4091 | } | ||
4092 | else | ||
4093 | { | ||
4094 | ep->other.desc_count++; | ||
4095 | ep->other.desc = realloc(ep->other.desc, | ||
4096 | sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); | ||
4097 | current_desc = ep->other.desc[ep->other.desc_count - 1] = ed; | ||
4098 | } | ||
4099 | |||
4100 | ed->visible = 1; | ||
4101 | ed->align.x = FROM_DOUBLE(0.5); | ||
4102 | ed->align.y = FROM_DOUBLE(0.5); | ||
4103 | ed->min.w = 0; | ||
4104 | ed->min.h = 0; | ||
4105 | ed->fixed.w = 0; | ||
4106 | ed->fixed.h = 0; | ||
4107 | ed->max.w = -1; | ||
4108 | ed->max.h = -1; | ||
4109 | ed->rel1.relative_x = FROM_DOUBLE(0.0); | ||
4110 | ed->rel1.relative_y = FROM_DOUBLE(0.0); | ||
4111 | ed->rel1.offset_x = 0; | ||
4112 | ed->rel1.offset_y = 0; | ||
4113 | ed->rel1.id_x = -1; | ||
4114 | ed->rel1.id_y = -1; | ||
4115 | ed->rel2.relative_x = FROM_DOUBLE(1.0); | ||
4116 | ed->rel2.relative_y = FROM_DOUBLE(1.0); | ||
4117 | ed->rel2.offset_x = -1; | ||
4118 | ed->rel2.offset_y = -1; | ||
4119 | ed->rel2.id_x = -1; | ||
4120 | ed->rel2.id_y = -1; | ||
4121 | ed->color_class = NULL; | ||
4122 | ed->color.r = 255; | ||
4123 | ed->color.g = 255; | ||
4124 | ed->color.b = 255; | ||
4125 | ed->color.a = 255; | ||
4126 | ed->color2.r = 0; | ||
4127 | ed->color2.g = 0; | ||
4128 | ed->color2.b = 0; | ||
4129 | ed->color2.a = 255; | ||
4130 | ed->map.id_persp = -1; | ||
4131 | ed->map.id_light = -1; | ||
4132 | ed->map.rot.id_center = -1; | ||
4133 | ed->map.rot.x = FROM_DOUBLE(0.0); | ||
4134 | ed->map.rot.y = FROM_DOUBLE(0.0); | ||
4135 | ed->map.rot.z = FROM_DOUBLE(0.0); | ||
4136 | ed->map.on = 0; | ||
4137 | ed->map.smooth = 1; | ||
4138 | ed->map.alpha = 1; | ||
4139 | ed->map.backcull = 0; | ||
4140 | ed->map.persp_on = 0; | ||
4141 | ed->persp.zplane = 0; | ||
4142 | ed->persp.focal = 1000; | ||
4143 | } | ||
4144 | |||
4145 | /** | ||
4146 | @page edcref | ||
4147 | @property | ||
4148 | inherit | ||
4149 | @parameters | ||
4150 | [another description's name] [another description's index] | ||
4151 | @effect | ||
4152 | When set, the description will inherit all the properties from the | ||
4153 | named description. The properties defined in this part will override | ||
4154 | the inherited properties, reducing the amount of necessary code for | ||
4155 | simple state changes. Note: inheritance in Edje is single level only. | ||
4156 | @endproperty | ||
4157 | */ | ||
4158 | static void | ||
4159 | st_collections_group_parts_part_description_inherit(void) | ||
4160 | { | ||
4161 | Edje_Part_Collection *pc; | ||
4162 | Edje_Part *ep; | ||
4163 | Edje_Part_Description_Common *ed, *parent = NULL; | ||
4164 | Edje_Part_Image_Id *iid; | ||
4165 | char *parent_name; | ||
4166 | const char *state_name; | ||
4167 | double parent_val, state_val; | ||
4168 | |||
4169 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4170 | ep = current_part; | ||
4171 | ed = current_desc; | ||
4172 | |||
4173 | if (!ed->state.name) | ||
4174 | { | ||
4175 | ERR("%s: Error. parse error %s:%i. " | ||
4176 | "inherit may only be used after state", | ||
4177 | progname, file_in, line - 1); | ||
4178 | exit(-1); | ||
4179 | } | ||
4180 | |||
4181 | parent = parent_desc; | ||
4182 | if (!parent) | ||
4183 | { | ||
4184 | check_arg_count(2); | ||
4185 | |||
4186 | /* inherit may not be used in the default description */ | ||
4187 | if (!ep->other.desc_count) | ||
4188 | { | ||
4189 | ERR("%s: Error. parse error %s:%i. " | ||
4190 | "inherit may not be used in the default description", | ||
4191 | progname, file_in, line - 1); | ||
4192 | exit(-1); | ||
4193 | } | ||
4194 | |||
4195 | /* find the description that we inherit from */ | ||
4196 | parent_name = parse_str(0); | ||
4197 | parent_val = parse_float_range(1, 0.0, 1.0); | ||
4198 | |||
4199 | if (!strcmp (parent_name, "default") && parent_val == 0.0) | ||
4200 | parent = ep->default_desc; | ||
4201 | else | ||
4202 | { | ||
4203 | Edje_Part_Description_Common *d; | ||
4204 | double min_dst = 999.0; | ||
4205 | unsigned int i; | ||
4206 | |||
4207 | if (!strcmp(parent_name, "default")) | ||
4208 | { | ||
4209 | parent = ep->default_desc; | ||
4210 | min_dst = ABS(ep->default_desc->state.value - parent_val); | ||
4211 | } | ||
4212 | |||
4213 | for (i = 0; i < ep->other.desc_count; ++i) | ||
4214 | { | ||
4215 | d = ep->other.desc[i]; | ||
4216 | |||
4217 | if (!strcmp (d->state.name, parent_name)) | ||
4218 | { | ||
4219 | |||
4220 | double dst; | ||
4221 | |||
4222 | dst = ABS(d->state.value - parent_val); | ||
4223 | if (dst < min_dst) | ||
4224 | { | ||
4225 | parent = d; | ||
4226 | min_dst = dst; | ||
4227 | } | ||
4228 | } | ||
4229 | } | ||
4230 | } | ||
4231 | |||
4232 | if (!parent) | ||
4233 | { | ||
4234 | ERR("%s: Error. parse error %s:%i. " | ||
4235 | "cannot find referenced part state %s %lf", | ||
4236 | ep->name, file_in, line - 1, parent_name, parent_val); | ||
4237 | exit(-1); | ||
4238 | } | ||
4239 | |||
4240 | free(parent_name); | ||
4241 | } | ||
4242 | /* now do a full copy, only state info will be kept */ | ||
4243 | state_name = ed->state.name; | ||
4244 | state_val = ed->state.value; | ||
4245 | |||
4246 | *ed = *parent; | ||
4247 | |||
4248 | ed->state.name = state_name; | ||
4249 | ed->state.value = state_val; | ||
4250 | |||
4251 | data_queue_copied_part_lookup(pc, &parent->rel1.id_x, &ed->rel1.id_x); | ||
4252 | data_queue_copied_part_lookup(pc, &parent->rel1.id_y, &ed->rel1.id_y); | ||
4253 | data_queue_copied_part_lookup(pc, &parent->rel2.id_x, &ed->rel2.id_x); | ||
4254 | data_queue_copied_part_lookup(pc, &parent->rel2.id_y, &ed->rel2.id_y); | ||
4255 | |||
4256 | data_queue_copied_part_lookup(pc, &parent->map.id_persp, &ed->map.id_persp); | ||
4257 | data_queue_copied_part_lookup(pc, &parent->map.id_light, &ed->map.id_light); | ||
4258 | data_queue_copied_part_lookup(pc, &parent->map.rot.id_center, &ed->map.rot.id_center); | ||
4259 | |||
4260 | /* make sure all the allocated memory is getting copied, not just | ||
4261 | * referenced | ||
4262 | */ | ||
4263 | #define STRDUP(x) x ? strdup(x) : NULL | ||
4264 | |||
4265 | ed->color_class = STRDUP(ed->color_class); | ||
4266 | switch (ep->type) | ||
4267 | { | ||
4268 | case EDJE_PART_TYPE_RECTANGLE: | ||
4269 | case EDJE_PART_TYPE_SWALLOW: | ||
4270 | case EDJE_PART_TYPE_GROUP: | ||
4271 | /* Nothing todo, this part only have a common description. */ | ||
4272 | break; | ||
4273 | case EDJE_PART_TYPE_TEXT: | ||
4274 | case EDJE_PART_TYPE_TEXTBLOCK: | ||
4275 | { | ||
4276 | Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed; | ||
4277 | Edje_Part_Description_Text *tparent = (Edje_Part_Description_Text*) parent; | ||
4278 | |||
4279 | ted->text = tparent->text; | ||
4280 | |||
4281 | ted->text.text.str = STRDUP(ted->text.text.str); | ||
4282 | ted->text.text_class = STRDUP(ted->text.text_class); | ||
4283 | ted->text.font.str = STRDUP(ted->text.font.str); | ||
4284 | |||
4285 | data_queue_copied_part_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source)); | ||
4286 | data_queue_copied_part_lookup(pc, &(tparent->text.id_text_source), &(ted->text.id_text_source)); | ||
4287 | |||
4288 | break; | ||
4289 | } | ||
4290 | case EDJE_PART_TYPE_IMAGE: | ||
4291 | { | ||
4292 | Edje_Part_Description_Image *ied = (Edje_Part_Description_Image *) ed; | ||
4293 | Edje_Part_Description_Image *iparent = (Edje_Part_Description_Image *) parent; | ||
4294 | unsigned int i; | ||
4295 | |||
4296 | ied->image = iparent->image; | ||
4297 | |||
4298 | data_queue_copied_image_lookup(&iparent->image.id, &ied->image.id, &ied->image.set); | ||
4299 | |||
4300 | ied->image.tweens = calloc(iparent->image.tweens_count, | ||
4301 | sizeof (Edje_Part_Image_Id*)); | ||
4302 | for (i = 0; i < iparent->image.tweens_count; i++) | ||
4303 | { | ||
4304 | Edje_Part_Image_Id *iid_new; | ||
4305 | |||
4306 | iid = iparent->image.tweens[i]; | ||
4307 | |||
4308 | iid_new = mem_alloc(SZ(Edje_Part_Image_Id)); | ||
4309 | data_queue_copied_image_lookup(&(iid->id), &(iid_new->id), &(iid_new->set)); | ||
4310 | ied->image.tweens[i] = iid_new; | ||
4311 | } | ||
4312 | |||
4313 | break; | ||
4314 | } | ||
4315 | case EDJE_PART_TYPE_PROXY: | ||
4316 | { | ||
4317 | Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed; | ||
4318 | Edje_Part_Description_Proxy *pparent = (Edje_Part_Description_Proxy*) parent; | ||
4319 | |||
4320 | data_queue_copied_part_lookup(pc, &(pparent->proxy.id), &(ped->proxy.id)); | ||
4321 | |||
4322 | break; | ||
4323 | } | ||
4324 | case EDJE_PART_TYPE_BOX: | ||
4325 | { | ||
4326 | Edje_Part_Description_Box *bed = (Edje_Part_Description_Box *) ed; | ||
4327 | Edje_Part_Description_Box *bparent = (Edje_Part_Description_Box *) parent; | ||
4328 | |||
4329 | bed->box = bparent->box; | ||
4330 | |||
4331 | break; | ||
4332 | } | ||
4333 | case EDJE_PART_TYPE_TABLE: | ||
4334 | { | ||
4335 | Edje_Part_Description_Table *ted = (Edje_Part_Description_Table *) ed; | ||
4336 | Edje_Part_Description_Table *tparent = (Edje_Part_Description_Table *) parent; | ||
4337 | |||
4338 | ted->table = tparent->table; | ||
4339 | |||
4340 | break; | ||
4341 | } | ||
4342 | case EDJE_PART_TYPE_EXTERNAL: | ||
4343 | { | ||
4344 | Edje_Part_Description_External *eed = (Edje_Part_Description_External *) ed; | ||
4345 | Edje_Part_Description_External *eparent = (Edje_Part_Description_External *) parent; | ||
4346 | |||
4347 | if (eparent->external_params) | ||
4348 | { | ||
4349 | Eina_List *l; | ||
4350 | Edje_External_Param *param, *new_param; | ||
4351 | |||
4352 | eed->external_params = NULL; | ||
4353 | EINA_LIST_FOREACH(eparent->external_params, l, param) | ||
4354 | { | ||
4355 | new_param = mem_alloc(SZ(Edje_External_Param)); | ||
4356 | *new_param = *param; | ||
4357 | eed->external_params = eina_list_append(eed->external_params, new_param); | ||
4358 | } | ||
4359 | } | ||
4360 | break; | ||
4361 | } | ||
4362 | } | ||
4363 | |||
4364 | #undef STRDUP | ||
4365 | } | ||
4366 | |||
4367 | /** | ||
4368 | @page edcref | ||
4369 | |||
4370 | @property | ||
4371 | source | ||
4372 | @parameters | ||
4373 | [another part's name] | ||
4374 | @effect | ||
4375 | Causes the part to use another part content as the content of this part. | ||
4376 | Only work with PROXY part. | ||
4377 | @endproperty | ||
4378 | */ | ||
4379 | static void | ||
4380 | st_collections_group_parts_part_description_source(void) | ||
4381 | { | ||
4382 | Edje_Part_Collection *pc; | ||
4383 | Edje_Part_Description_Proxy *ed; | ||
4384 | char *name; | ||
4385 | |||
4386 | check_arg_count(1); | ||
4387 | |||
4388 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4389 | |||
4390 | if (current_part->type != EDJE_PART_TYPE_PROXY) | ||
4391 | { | ||
4392 | ERR("%s: Error. parse error %s:%i. " | ||
4393 | "source attributes in non-PROXY part.", | ||
4394 | progname, file_in, line - 1); | ||
4395 | exit(-1); | ||
4396 | } | ||
4397 | |||
4398 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
4399 | |||
4400 | name = parse_str(0); | ||
4401 | |||
4402 | data_queue_part_lookup(pc, name, &(ed->proxy.id)); | ||
4403 | free(name); | ||
4404 | } | ||
4405 | |||
4406 | /** | ||
4407 | @page edcref | ||
4408 | @property | ||
4409 | state | ||
4410 | @parameters | ||
4411 | [a name for the description] [an index] | ||
4412 | @effect | ||
4413 | Sets a name used to identify a description inside a given part. | ||
4414 | Multiple descriptions are used to declare different states of the same | ||
4415 | part, like "clicked" or "invisible". All states declarations are also | ||
4416 | coupled with an index number between 0.0 and 1.0. All parts must have | ||
4417 | at least one description named "default 0.0". | ||
4418 | @endproperty | ||
4419 | */ | ||
4420 | static void | ||
4421 | st_collections_group_parts_part_description_state(void) | ||
4422 | { | ||
4423 | Edje_Part *ep; | ||
4424 | Edje_Part_Description_Common *ed; | ||
4425 | char *s; | ||
4426 | |||
4427 | check_arg_count(2); | ||
4428 | |||
4429 | ep = current_part; | ||
4430 | |||
4431 | ed = ep->default_desc; | ||
4432 | if (ep->other.desc_count) ed = ep->other.desc[ep->other.desc_count - 1]; | ||
4433 | |||
4434 | s = parse_str(0); | ||
4435 | if (!strcmp (s, "custom")) | ||
4436 | { | ||
4437 | ERR("%s: Error. parse error %s:%i. " | ||
4438 | "invalid state name: '%s'.", | ||
4439 | progname, file_in, line - 1, s); | ||
4440 | exit(-1); | ||
4441 | } | ||
4442 | |||
4443 | ed->state.name = s; | ||
4444 | ed->state.value = parse_float_range(1, 0.0, 1.0); | ||
4445 | |||
4446 | if (ed != ep->default_desc) | ||
4447 | { | ||
4448 | if ((ep->default_desc->state.name && !strcmp(s, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) || | ||
4449 | (!ep->default_desc->state.name && !strcmp(s, "default") && ed->state.value == ep->default_desc->state.value)) | ||
4450 | { | ||
4451 | free(ed); | ||
4452 | ep->other.desc_count--; | ||
4453 | ep->other.desc = realloc(ep->other.desc, | ||
4454 | sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); | ||
4455 | current_desc = ep->default_desc; | ||
4456 | } | ||
4457 | else if (ep->other.desc_count) | ||
4458 | { | ||
4459 | unsigned int i; | ||
4460 | for (i = 0; i < ep->other.desc_count - 1; ++i) | ||
4461 | { | ||
4462 | if (!strcmp(s, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) | ||
4463 | { | ||
4464 | free(ed); | ||
4465 | ep->other.desc_count--; | ||
4466 | ep->other.desc = realloc(ep->other.desc, | ||
4467 | sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); | ||
4468 | current_desc = ep->other.desc[i]; | ||
4469 | break; | ||
4470 | } | ||
4471 | } | ||
4472 | } | ||
4473 | } | ||
4474 | } | ||
4475 | |||
4476 | /** | ||
4477 | @page edcref | ||
4478 | @property | ||
4479 | visible | ||
4480 | @parameters | ||
4481 | [0 or 1] | ||
4482 | @effect | ||
4483 | Takes a boolean value specifying whether part is visible (1) or not | ||
4484 | (0). Non-visible parts do not emit signals. The default value is 1. | ||
4485 | @endproperty | ||
4486 | */ | ||
4487 | static void | ||
4488 | st_collections_group_parts_part_description_visible(void) | ||
4489 | { | ||
4490 | check_arg_count(1); | ||
4491 | |||
4492 | current_desc->visible = parse_bool(0); | ||
4493 | } | ||
4494 | |||
4495 | /** | ||
4496 | @page edcref | ||
4497 | @property | ||
4498 | align | ||
4499 | @parameters | ||
4500 | [X axis] [Y axis] | ||
4501 | @effect | ||
4502 | When the displayed object's size is smaller than its container, this | ||
4503 | property moves it relatively along both axis inside its container. The | ||
4504 | default value is "0.5 0.5". | ||
4505 | @endproperty | ||
4506 | */ | ||
4507 | static void | ||
4508 | st_collections_group_parts_part_description_align(void) | ||
4509 | { | ||
4510 | check_arg_count(2); | ||
4511 | |||
4512 | current_desc->align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0)); | ||
4513 | current_desc->align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0)); | ||
4514 | } | ||
4515 | |||
4516 | /** | ||
4517 | @page edcref | ||
4518 | @property | ||
4519 | fixed | ||
4520 | @parameters | ||
4521 | [width, 0 or 1] [height, 0 or 1] | ||
4522 | @effect | ||
4523 | This affects the minimum size calculation. See | ||
4524 | edje_object_size_min_calc() and edje_object_size_min_restricted_calc(). | ||
4525 | This tells the min size calculation routine that this part does not | ||
4526 | change size in width or height (1 for it doesn't, 0 for it does), so | ||
4527 | the routine should not try and expand or contract the part. | ||
4528 | @endproperty | ||
4529 | */ | ||
4530 | static void | ||
4531 | st_collections_group_parts_part_description_fixed(void) | ||
4532 | { | ||
4533 | check_arg_count(2); | ||
4534 | |||
4535 | current_desc->fixed.w = parse_float_range(0, 0, 1); | ||
4536 | current_desc->fixed.h = parse_float_range(1, 0, 1); | ||
4537 | } | ||
4538 | |||
4539 | /** | ||
4540 | @page edcref | ||
4541 | @property | ||
4542 | min | ||
4543 | @parameters | ||
4544 | [width] [height] | ||
4545 | @effect | ||
4546 | The minimum size of the state. | ||
4547 | @endproperty | ||
4548 | */ | ||
4549 | static void | ||
4550 | st_collections_group_parts_part_description_min(void) | ||
4551 | { | ||
4552 | check_arg_count(2); | ||
4553 | |||
4554 | current_desc->min.w = parse_float_range(0, 0, 0x7fffffff); | ||
4555 | current_desc->min.h = parse_float_range(1, 0, 0x7fffffff); | ||
4556 | } | ||
4557 | |||
4558 | /** | ||
4559 | @page edcref | ||
4560 | @property | ||
4561 | max | ||
4562 | @parameters | ||
4563 | [width] [height] | ||
4564 | @effect | ||
4565 | The maximum size of the state. A size of -1.0 means that it will be ignored in one direction. | ||
4566 | @endproperty | ||
4567 | */ | ||
4568 | static void | ||
4569 | st_collections_group_parts_part_description_max(void) | ||
4570 | { | ||
4571 | check_arg_count(2); | ||
4572 | |||
4573 | current_desc->max.w = parse_float_range(0, -1.0, 0x7fffffff); | ||
4574 | current_desc->max.h = parse_float_range(1, -1.0, 0x7fffffff); | ||
4575 | } | ||
4576 | |||
4577 | /** | ||
4578 | @page edcref | ||
4579 | @property | ||
4580 | step | ||
4581 | @parameters | ||
4582 | [width] [height] | ||
4583 | @effect | ||
4584 | Restricts resizing of each dimension to values divisibles by its value. | ||
4585 | This causes the part to jump from value to value while resizing. The | ||
4586 | default value is "0 0" disabling stepping. | ||
4587 | @endproperty | ||
4588 | */ | ||
4589 | static void | ||
4590 | st_collections_group_parts_part_description_step(void) | ||
4591 | { | ||
4592 | check_arg_count(2); | ||
4593 | |||
4594 | current_desc->step.x = parse_float_range(0, 0, 0x7fffffff); | ||
4595 | current_desc->step.y = parse_float_range(1, 0, 0x7fffffff); | ||
4596 | } | ||
4597 | |||
4598 | /** | ||
4599 | @page edcref | ||
4600 | @property | ||
4601 | aspect | ||
4602 | @parameters | ||
4603 | [min] [max] | ||
4604 | @effect | ||
4605 | Normally width and height can be resized to any values independently. | ||
4606 | The aspect property forces the width to height ratio to be kept between | ||
4607 | the minimum and maximum set. For example, "1.0 1.0" will increase the | ||
4608 | width a pixel for every pixel added to heigh. The default value is | ||
4609 | "0.0 0.0" disabling aspect. | ||
4610 | @endproperty | ||
4611 | */ | ||
4612 | static void | ||
4613 | st_collections_group_parts_part_description_aspect(void) | ||
4614 | { | ||
4615 | check_arg_count(2); | ||
4616 | |||
4617 | current_desc->aspect.min = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); | ||
4618 | current_desc->aspect.max = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0)); | ||
4619 | } | ||
4620 | |||
4621 | /** | ||
4622 | @page edcref | ||
4623 | @property | ||
4624 | aspect_preference | ||
4625 | @parameters | ||
4626 | [DIMENSION] | ||
4627 | @effect | ||
4628 | Sets the scope of the "aspect" property to a given dimension. Available | ||
4629 | options are BOTH, VERTICAL, HORIZONTAL and NONE | ||
4630 | @endproperty | ||
4631 | */ | ||
4632 | static void | ||
4633 | st_collections_group_parts_part_description_aspect_preference(void) | ||
4634 | { | ||
4635 | check_arg_count(1); | ||
4636 | |||
4637 | current_desc->aspect.prefer = parse_enum(0, | ||
4638 | "NONE", EDJE_ASPECT_PREFER_NONE, | ||
4639 | "VERTICAL", EDJE_ASPECT_PREFER_VERTICAL, | ||
4640 | "HORIZONTAL", EDJE_ASPECT_PREFER_HORIZONTAL, | ||
4641 | "BOTH", EDJE_ASPECT_PREFER_BOTH, | ||
4642 | NULL); | ||
4643 | } | ||
4644 | |||
4645 | /** | ||
4646 | @page edcref | ||
4647 | @property | ||
4648 | color_class | ||
4649 | @parameters | ||
4650 | [color class name] | ||
4651 | @effect | ||
4652 | The part will use the color values of the named color_class, these | ||
4653 | values can be overrided by the "color", "color2" and "color3" | ||
4654 | properties set below. | ||
4655 | @endproperty | ||
4656 | */ | ||
4657 | static void | ||
4658 | st_collections_group_parts_part_description_color_class(void) | ||
4659 | { | ||
4660 | check_arg_count(1); | ||
4661 | |||
4662 | current_desc->color_class = parse_str(0); | ||
4663 | } | ||
4664 | |||
4665 | /** | ||
4666 | @page edcref | ||
4667 | @property | ||
4668 | color | ||
4669 | @parameters | ||
4670 | [red] [green] [blue] [alpha] | ||
4671 | @effect | ||
4672 | Sets the main color to the specified values (between 0 and 255). | ||
4673 | @endproperty | ||
4674 | */ | ||
4675 | static void | ||
4676 | st_collections_group_parts_part_description_color(void) | ||
4677 | { | ||
4678 | check_arg_count(4); | ||
4679 | |||
4680 | current_desc->color.r = parse_int_range(0, 0, 255); | ||
4681 | current_desc->color.g = parse_int_range(1, 0, 255); | ||
4682 | current_desc->color.b = parse_int_range(2, 0, 255); | ||
4683 | current_desc->color.a = parse_int_range(3, 0, 255); | ||
4684 | } | ||
4685 | |||
4686 | /** | ||
4687 | @page edcref | ||
4688 | @property | ||
4689 | color2 | ||
4690 | @parameters | ||
4691 | [red] [green] [blue] [alpha] | ||
4692 | @effect | ||
4693 | Sets the text shadow color to the specified values (0 to 255). | ||
4694 | @endproperty | ||
4695 | */ | ||
4696 | static void | ||
4697 | st_collections_group_parts_part_description_color2(void) | ||
4698 | { | ||
4699 | check_arg_count(4); | ||
4700 | |||
4701 | current_desc->color2.r = parse_int_range(0, 0, 255); | ||
4702 | current_desc->color2.g = parse_int_range(1, 0, 255); | ||
4703 | current_desc->color2.b = parse_int_range(2, 0, 255); | ||
4704 | current_desc->color2.a = parse_int_range(3, 0, 255); | ||
4705 | } | ||
4706 | |||
4707 | /** | ||
4708 | @page edcref | ||
4709 | @property | ||
4710 | color3 | ||
4711 | @parameters | ||
4712 | [red] [green] [blue] [alpha] | ||
4713 | @effect | ||
4714 | Sets the text outline color to the specified values (0 to 255). | ||
4715 | @endproperty | ||
4716 | */ | ||
4717 | static void | ||
4718 | st_collections_group_parts_part_description_color3(void) | ||
4719 | { | ||
4720 | Edje_Part_Collection *pc; | ||
4721 | Edje_Part_Description_Text *ed; | ||
4722 | |||
4723 | check_arg_count(4); | ||
4724 | |||
4725 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4726 | |||
4727 | if (current_part->type != EDJE_PART_TYPE_TEXT | ||
4728 | && current_part->type != EDJE_PART_TYPE_TEXTBLOCK) | ||
4729 | { | ||
4730 | ERR("%s: Error. Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.", progname, current_part->name, pc->part); | ||
4731 | exit(-1); | ||
4732 | } | ||
4733 | |||
4734 | ed = (Edje_Part_Description_Text*)current_desc; | ||
4735 | |||
4736 | ed->text.color3.r = parse_int_range(0, 0, 255); | ||
4737 | ed->text.color3.g = parse_int_range(1, 0, 255); | ||
4738 | ed->text.color3.b = parse_int_range(2, 0, 255); | ||
4739 | ed->text.color3.a = parse_int_range(3, 0, 255); | ||
4740 | } | ||
4741 | |||
4742 | /** | ||
4743 | @page edcref | ||
4744 | @block | ||
4745 | rel1/rel2 | ||
4746 | @context | ||
4747 | description { | ||
4748 | .. | ||
4749 | rel1 { | ||
4750 | relative: 0.0 0.0; | ||
4751 | offset: 0 0; | ||
4752 | } | ||
4753 | .. | ||
4754 | rel2 { | ||
4755 | relative: 1.0 1.0; | ||
4756 | offset: -1 -1; | ||
4757 | } | ||
4758 | .. | ||
4759 | } | ||
4760 | @description | ||
4761 | The rel1 and rel2 blocks are used to define the position of each corner | ||
4762 | of the part's container. With rel1 being the left-up corner and rel2 | ||
4763 | being the right-down corner. | ||
4764 | @endblock | ||
4765 | |||
4766 | @property | ||
4767 | relative | ||
4768 | @parameters | ||
4769 | [X axis] [Y axis] | ||
4770 | @effect | ||
4771 | Moves a corner to a relative position inside the container of the | ||
4772 | relative "to" part. Values from 0.0 (0%, beginning) to 1.0 (100%, end) | ||
4773 | of each axis. | ||
4774 | @endproperty | ||
4775 | */ | ||
4776 | static void | ||
4777 | st_collections_group_parts_part_description_rel1_relative(void) | ||
4778 | { | ||
4779 | check_arg_count(2); | ||
4780 | |||
4781 | current_desc->rel1.relative_x = FROM_DOUBLE(parse_float(0)); | ||
4782 | current_desc->rel1.relative_y = FROM_DOUBLE(parse_float(1)); | ||
4783 | } | ||
4784 | |||
4785 | /** | ||
4786 | @page edcref | ||
4787 | @property | ||
4788 | offset | ||
4789 | @parameters | ||
4790 | [X axis] [Y axis] | ||
4791 | @effect | ||
4792 | Affects the corner position a fixed number of pixels along each axis. | ||
4793 | @endproperty | ||
4794 | */ | ||
4795 | static void | ||
4796 | st_collections_group_parts_part_description_rel1_offset(void) | ||
4797 | { | ||
4798 | check_arg_count(2); | ||
4799 | |||
4800 | current_desc->rel1.offset_x = parse_int(0); | ||
4801 | current_desc->rel1.offset_y = parse_int(1); | ||
4802 | } | ||
4803 | |||
4804 | /** | ||
4805 | @page edcref | ||
4806 | @property | ||
4807 | to | ||
4808 | @parameters | ||
4809 | [another part's name] | ||
4810 | @effect | ||
4811 | Causes a corner to be positioned relatively to another part's | ||
4812 | container. Setting to "" will un-set this value for inherited | ||
4813 | parts. | ||
4814 | @endproperty | ||
4815 | */ | ||
4816 | static void | ||
4817 | st_collections_group_parts_part_description_rel1_to(void) | ||
4818 | { | ||
4819 | Edje_Part_Collection *pc; | ||
4820 | |||
4821 | check_arg_count(1); | ||
4822 | |||
4823 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4824 | |||
4825 | { | ||
4826 | char *name; | ||
4827 | |||
4828 | name = parse_str(0); | ||
4829 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x)); | ||
4830 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y)); | ||
4831 | free(name); | ||
4832 | } | ||
4833 | } | ||
4834 | |||
4835 | /** | ||
4836 | @page edcref | ||
4837 | @property | ||
4838 | to_x | ||
4839 | @parameters | ||
4840 | [another part's name] | ||
4841 | @effect | ||
4842 | Causes a corner to be positioned relatively to the X axis of another | ||
4843 | part's container. Simply put affects the first parameter of "relative". | ||
4844 | Setting to "" will un-set this value for inherited parts. | ||
4845 | @endproperty | ||
4846 | */ | ||
4847 | static void | ||
4848 | st_collections_group_parts_part_description_rel1_to_x(void) | ||
4849 | { | ||
4850 | Edje_Part_Collection *pc; | ||
4851 | |||
4852 | check_arg_count(1); | ||
4853 | |||
4854 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4855 | |||
4856 | { | ||
4857 | char *name; | ||
4858 | |||
4859 | name = parse_str(0); | ||
4860 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x)); | ||
4861 | free(name); | ||
4862 | } | ||
4863 | } | ||
4864 | |||
4865 | /** | ||
4866 | @page edcref | ||
4867 | @property | ||
4868 | to_y | ||
4869 | @parameters | ||
4870 | [another part's name] | ||
4871 | @effect | ||
4872 | Causes a corner to be positioned relatively to the Y axis of another | ||
4873 | part's container. Simply put, affects the second parameter of | ||
4874 | "relative". Setting to "" will un-set this value for inherited parts. | ||
4875 | @endproperty | ||
4876 | */ | ||
4877 | static void | ||
4878 | st_collections_group_parts_part_description_rel1_to_y(void) | ||
4879 | { | ||
4880 | Edje_Part_Collection *pc; | ||
4881 | |||
4882 | check_arg_count(1); | ||
4883 | |||
4884 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4885 | |||
4886 | { | ||
4887 | char *name; | ||
4888 | |||
4889 | name = parse_str(0); | ||
4890 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y)); | ||
4891 | free(name); | ||
4892 | } | ||
4893 | } | ||
4894 | |||
4895 | static void | ||
4896 | st_collections_group_parts_part_description_rel2_relative(void) | ||
4897 | { | ||
4898 | check_arg_count(2); | ||
4899 | |||
4900 | current_desc->rel2.relative_x = FROM_DOUBLE(parse_float(0)); | ||
4901 | current_desc->rel2.relative_y = FROM_DOUBLE(parse_float(1)); | ||
4902 | } | ||
4903 | |||
4904 | static void | ||
4905 | st_collections_group_parts_part_description_rel2_offset(void) | ||
4906 | { | ||
4907 | check_arg_count(2); | ||
4908 | |||
4909 | current_desc->rel2.offset_x = parse_int(0); | ||
4910 | current_desc->rel2.offset_y = parse_int(1); | ||
4911 | } | ||
4912 | |||
4913 | static void | ||
4914 | st_collections_group_parts_part_description_rel2_to(void) | ||
4915 | { | ||
4916 | Edje_Part_Collection *pc; | ||
4917 | |||
4918 | check_arg_count(1); | ||
4919 | |||
4920 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4921 | |||
4922 | { | ||
4923 | char *name; | ||
4924 | |||
4925 | name = parse_str(0); | ||
4926 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x)); | ||
4927 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y)); | ||
4928 | free(name); | ||
4929 | } | ||
4930 | } | ||
4931 | |||
4932 | static void | ||
4933 | st_collections_group_parts_part_description_rel2_to_x(void) | ||
4934 | { | ||
4935 | Edje_Part_Collection *pc; | ||
4936 | |||
4937 | check_arg_count(1); | ||
4938 | |||
4939 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4940 | |||
4941 | { | ||
4942 | char *name; | ||
4943 | |||
4944 | name = parse_str(0); | ||
4945 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x)); | ||
4946 | free(name); | ||
4947 | } | ||
4948 | } | ||
4949 | |||
4950 | static void | ||
4951 | st_collections_group_parts_part_description_rel2_to_y(void) | ||
4952 | { | ||
4953 | Edje_Part_Collection *pc; | ||
4954 | |||
4955 | check_arg_count(1); | ||
4956 | |||
4957 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
4958 | |||
4959 | { | ||
4960 | char *name; | ||
4961 | |||
4962 | name = parse_str(0); | ||
4963 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y)); | ||
4964 | free(name); | ||
4965 | } | ||
4966 | } | ||
4967 | |||
4968 | /** | ||
4969 | @edcsection{description_image,Image state description sub blocks} | ||
4970 | */ | ||
4971 | |||
4972 | /** | ||
4973 | @page edcref | ||
4974 | @block | ||
4975 | image | ||
4976 | @context | ||
4977 | description { | ||
4978 | .. | ||
4979 | image { | ||
4980 | normal: "filename.ext"; | ||
4981 | tween: "filename2.ext"; | ||
4982 | .. | ||
4983 | tween: "filenameN.ext"; | ||
4984 | border: left right top bottom; | ||
4985 | middle: 0/1/NONE/DEFAULT/SOLID; | ||
4986 | } | ||
4987 | .. | ||
4988 | } | ||
4989 | @description | ||
4990 | @endblock | ||
4991 | |||
4992 | @property | ||
4993 | normal | ||
4994 | @parameters | ||
4995 | [image's filename] | ||
4996 | @effect | ||
4997 | Name of image to be used as previously declared in the images block. | ||
4998 | In an animation, this is the first and last image displayed. It's | ||
4999 | required in any image part | ||
5000 | @endproperty | ||
5001 | */ | ||
5002 | static void | ||
5003 | st_collections_group_parts_part_description_image_normal(void) | ||
5004 | { | ||
5005 | Edje_Part_Description_Image *ed; | ||
5006 | |||
5007 | check_arg_count(1); | ||
5008 | |||
5009 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5010 | { | ||
5011 | ERR("%s: Error. parse error %s:%i. " | ||
5012 | "image attributes in non-IMAGE part.", | ||
5013 | progname, file_in, line - 1); | ||
5014 | exit(-1); | ||
5015 | } | ||
5016 | |||
5017 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5018 | |||
5019 | { | ||
5020 | char *name; | ||
5021 | |||
5022 | name = parse_str(0); | ||
5023 | data_queue_image_lookup(name, &(ed->image.id), &(ed->image.set)); | ||
5024 | free(name); | ||
5025 | } | ||
5026 | } | ||
5027 | |||
5028 | /** | ||
5029 | @page edcref | ||
5030 | @property | ||
5031 | tween | ||
5032 | @parameters | ||
5033 | [image's filename] | ||
5034 | @effect | ||
5035 | Name of an image to be used in an animation loop, an image block can | ||
5036 | have none, one or multiple tween declarations. Images are displayed in | ||
5037 | the order they are listed. | ||
5038 | @endproperty | ||
5039 | */ | ||
5040 | static void | ||
5041 | st_collections_group_parts_part_description_image_tween(void) | ||
5042 | { | ||
5043 | Edje_Part_Description_Image *ed; | ||
5044 | |||
5045 | check_arg_count(1); | ||
5046 | |||
5047 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5048 | { | ||
5049 | ERR("%s: Error. parse error %s:%i. " | ||
5050 | "image attributes in non-IMAGE part.", | ||
5051 | progname, file_in, line - 1); | ||
5052 | exit(-1); | ||
5053 | } | ||
5054 | |||
5055 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5056 | |||
5057 | { | ||
5058 | char *name; | ||
5059 | Edje_Part_Image_Id *iid; | ||
5060 | |||
5061 | iid = mem_alloc(SZ(Edje_Part_Image_Id)); | ||
5062 | ed->image.tweens_count++; | ||
5063 | ed->image.tweens = realloc(ed->image.tweens, | ||
5064 | sizeof (Edje_Part_Image_Id*) * ed->image.tweens_count); | ||
5065 | ed->image.tweens[ed->image.tweens_count - 1] = iid; | ||
5066 | name = parse_str(0); | ||
5067 | data_queue_image_lookup(name, &(iid->id), &(iid->set)); | ||
5068 | free(name); | ||
5069 | } | ||
5070 | } | ||
5071 | |||
5072 | /** | ||
5073 | @page edcref | ||
5074 | @property | ||
5075 | border | ||
5076 | @parameters | ||
5077 | [left] [right] [top] [bottom] | ||
5078 | @effect | ||
5079 | If set, the area (in pixels) of each side of the image will be | ||
5080 | displayed as a fixed size border, from the side -> inwards, preventing | ||
5081 | the corners from being changed on a resize. | ||
5082 | @endproperty | ||
5083 | */ | ||
5084 | static void | ||
5085 | st_collections_group_parts_part_description_image_border(void) | ||
5086 | { | ||
5087 | Edje_Part_Description_Image *ed; | ||
5088 | |||
5089 | check_arg_count(4); | ||
5090 | |||
5091 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5092 | { | ||
5093 | ERR("%s: Error. parse error %s:%i. " | ||
5094 | "image attributes in non-IMAGE part.", | ||
5095 | progname, file_in, line - 1); | ||
5096 | exit(-1); | ||
5097 | } | ||
5098 | |||
5099 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5100 | |||
5101 | ed->image.border.l = parse_int_range(0, 0, 0x7fffffff); | ||
5102 | ed->image.border.r = parse_int_range(1, 0, 0x7fffffff); | ||
5103 | ed->image.border.t = parse_int_range(2, 0, 0x7fffffff); | ||
5104 | ed->image.border.b = parse_int_range(3, 0, 0x7fffffff); | ||
5105 | } | ||
5106 | |||
5107 | /** | ||
5108 | @page edcref | ||
5109 | @property | ||
5110 | middle | ||
5111 | @parameters | ||
5112 | 0, 1, NONE, DEFAULT, SOLID | ||
5113 | @effect | ||
5114 | If border is set, this value tells Edje if the rest of the | ||
5115 | image (not covered by the defined border) will be displayed or not | ||
5116 | or be assumed to be solid (without alpha). The default is 1/DEFAULT. | ||
5117 | @endproperty | ||
5118 | */ | ||
5119 | static void | ||
5120 | st_collections_group_parts_part_description_image_middle(void) | ||
5121 | { | ||
5122 | Edje_Part_Description_Image *ed; | ||
5123 | |||
5124 | check_arg_count(1); | ||
5125 | |||
5126 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5127 | { | ||
5128 | ERR("%s: Error. parse error %s:%i. " | ||
5129 | "image attributes in non-IMAGE part.", | ||
5130 | progname, file_in, line - 1); | ||
5131 | exit(-1); | ||
5132 | } | ||
5133 | |||
5134 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5135 | |||
5136 | ed->image.border.no_fill = parse_enum(0, | ||
5137 | "1", 0, | ||
5138 | "DEFAULT", 0, | ||
5139 | "0", 1, | ||
5140 | "NONE", 1, | ||
5141 | "SOLID", 2, | ||
5142 | NULL); | ||
5143 | } | ||
5144 | |||
5145 | /** | ||
5146 | @page edcref | ||
5147 | @property | ||
5148 | border_scale_by | ||
5149 | @parameters | ||
5150 | 0.0 or bigger (0.0 or 1.0 to turn it off) | ||
5151 | @effect | ||
5152 | If border scaling is enabled then normally the OUTPUT border sizes | ||
5153 | (e.g. if 3 pixels on the left edge are set as a border, then normally | ||
5154 | at scale 1.0, those 3 columns will always be the exact 3 columns of | ||
5155 | output, or at scale 2.0 they will be 6 columns, or 0.33 they will merge | ||
5156 | into a single column). This property multiplies the input scale | ||
5157 | factor by this multiplier, allowing the creation of "supersampled" | ||
5158 | borders to make much higher resolution outputs possible by always using | ||
5159 | the highest resolution artwork and then runtime scaling it down. | ||
5160 | @endproperty | ||
5161 | */ | ||
5162 | static void | ||
5163 | st_collections_group_parts_part_description_image_border_scale_by(void) | ||
5164 | { | ||
5165 | Edje_Part_Description_Image *ed; | ||
5166 | |||
5167 | check_arg_count(1); | ||
5168 | |||
5169 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5170 | { | ||
5171 | ERR("%s: Error. parse error %s:%i. " | ||
5172 | "image attributes in non-IMAGE part.", | ||
5173 | progname, file_in, line - 1); | ||
5174 | exit(-1); | ||
5175 | } | ||
5176 | |||
5177 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5178 | |||
5179 | ed->image.border.scale_by = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); | ||
5180 | } | ||
5181 | |||
5182 | /** | ||
5183 | @page edcref | ||
5184 | @property | ||
5185 | border_scale | ||
5186 | @parameters | ||
5187 | 0, 1 | ||
5188 | @effect | ||
5189 | If border is set, this value tells Edje if the border should be scaled | ||
5190 | by the object/global edje scale factors | ||
5191 | @endproperty | ||
5192 | */ | ||
5193 | static void | ||
5194 | st_collections_group_parts_part_description_image_border_scale(void) | ||
5195 | { | ||
5196 | Edje_Part_Description_Image *ed; | ||
5197 | |||
5198 | check_arg_count(1); | ||
5199 | |||
5200 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5201 | { | ||
5202 | ERR("%s: Error. parse error %s:%i. " | ||
5203 | "image attributes in non-IMAGE part.", | ||
5204 | progname, file_in, line - 1); | ||
5205 | exit(-1); | ||
5206 | } | ||
5207 | |||
5208 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5209 | |||
5210 | ed->image.border.scale = parse_enum(0, | ||
5211 | "0", 0, | ||
5212 | "1", 1, | ||
5213 | NULL); | ||
5214 | } | ||
5215 | |||
5216 | /** | ||
5217 | @page edcref | ||
5218 | @property | ||
5219 | scale_hint | ||
5220 | @parameters | ||
5221 | 0, NONE, DYNAMIC, STATIC | ||
5222 | @effect | ||
5223 | Sets the evas image scale hint letting the engine more effectively save | ||
5224 | cached copies of the scaled image if it makes sense | ||
5225 | @endproperty | ||
5226 | */ | ||
5227 | static void | ||
5228 | st_collections_group_parts_part_description_image_scale_hint(void) | ||
5229 | { | ||
5230 | Edje_Part_Description_Image *ed; | ||
5231 | |||
5232 | check_arg_count(1); | ||
5233 | |||
5234 | if (current_part->type != EDJE_PART_TYPE_IMAGE) | ||
5235 | { | ||
5236 | ERR("%s: Error. parse error %s:%i. " | ||
5237 | "image attributes in non-IMAGE part.", | ||
5238 | progname, file_in, line - 1); | ||
5239 | exit(-1); | ||
5240 | } | ||
5241 | |||
5242 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5243 | |||
5244 | ed->image.scale_hint = parse_enum(0, | ||
5245 | "NONE", EVAS_IMAGE_SCALE_HINT_NONE, | ||
5246 | "DYNAMIC", EVAS_IMAGE_SCALE_HINT_DYNAMIC, | ||
5247 | "STATIC", EVAS_IMAGE_SCALE_HINT_STATIC, | ||
5248 | "0", EVAS_IMAGE_SCALE_HINT_NONE, | ||
5249 | NULL); | ||
5250 | } | ||
5251 | |||
5252 | /** | ||
5253 | @page edcref | ||
5254 | @block | ||
5255 | fill | ||
5256 | @context | ||
5257 | description { | ||
5258 | .. | ||
5259 | fill { | ||
5260 | smooth: 0-1; | ||
5261 | origin { | ||
5262 | relative: X-axis Y-axis; | ||
5263 | offset: X-axis Y-axis; | ||
5264 | } | ||
5265 | size { | ||
5266 | relative: width height; | ||
5267 | offset: width height; | ||
5268 | } | ||
5269 | } | ||
5270 | .. | ||
5271 | } | ||
5272 | @description | ||
5273 | The fill method is an optional block that defines the way an IMAGE part | ||
5274 | is going to be displayed inside its container. | ||
5275 | @endblock | ||
5276 | |||
5277 | @property | ||
5278 | smooth | ||
5279 | @parameters | ||
5280 | [0 or 1] | ||
5281 | @effect | ||
5282 | The smooth property takes a boolean value to decide if the image will | ||
5283 | be smoothed on scaling (1) or not (0). The default value is 1. | ||
5284 | @endproperty | ||
5285 | */ | ||
5286 | static void | ||
5287 | st_collections_group_parts_part_description_fill_smooth(void) | ||
5288 | { | ||
5289 | Edje_Part_Description_Spec_Fill *fill; | ||
5290 | |||
5291 | check_arg_count(1); | ||
5292 | |||
5293 | switch (current_part->type) | ||
5294 | { | ||
5295 | case EDJE_PART_TYPE_IMAGE: | ||
5296 | { | ||
5297 | Edje_Part_Description_Image *ed; | ||
5298 | |||
5299 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5300 | |||
5301 | fill = &ed->image.fill; | ||
5302 | break; | ||
5303 | } | ||
5304 | case EDJE_PART_TYPE_PROXY: | ||
5305 | { | ||
5306 | Edje_Part_Description_Proxy *ed; | ||
5307 | |||
5308 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5309 | |||
5310 | fill = &ed->proxy.fill; | ||
5311 | break; | ||
5312 | } | ||
5313 | default: | ||
5314 | { | ||
5315 | ERR("%s: Error. parse error %s:%i. " | ||
5316 | "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).", | ||
5317 | progname, file_in, line - 1, current_part->name, current_part->type); | ||
5318 | exit(-1); | ||
5319 | } | ||
5320 | } | ||
5321 | |||
5322 | fill->smooth = parse_bool(0); | ||
5323 | } | ||
5324 | |||
5325 | /** | ||
5326 | @page edcref | ||
5327 | |||
5328 | @property | ||
5329 | spread | ||
5330 | @parameters | ||
5331 | TODO | ||
5332 | @effect | ||
5333 | TODO | ||
5334 | @endproperty | ||
5335 | */ | ||
5336 | static void | ||
5337 | st_collections_group_parts_part_description_fill_spread(void) | ||
5338 | { | ||
5339 | #if 0 | ||
5340 | Edje_Part_Collection *pc; | ||
5341 | Edje_Part *ep; | ||
5342 | Edje_Part_Description_Image *ed; | ||
5343 | #endif | ||
5344 | |||
5345 | check_arg_count(1); | ||
5346 | |||
5347 | /* XXX this will need to include IMAGES when spread support is added to evas images */ | ||
5348 | { | ||
5349 | ERR("%s: Error. parse error %s:%i. " | ||
5350 | "fill.spread not supported yet.", | ||
5351 | progname, file_in, line - 1); | ||
5352 | exit(-1); | ||
5353 | } | ||
5354 | |||
5355 | #if 0 | ||
5356 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
5357 | |||
5358 | ep = pc->parts[pc->parts_count - 1]; | ||
5359 | |||
5360 | if (ep->type != EDJE_PART_TYPE_IMAGE) | ||
5361 | { | ||
5362 | ERR("%s: Error. parse error %s:%i. " | ||
5363 | "image attributes in non-IMAGE part.", | ||
5364 | progname, file_in, line - 1); | ||
5365 | exit(-1); | ||
5366 | } | ||
5367 | |||
5368 | ed = (Edje_Part_Description_Image*) ep->default_desc; | ||
5369 | if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; | ||
5370 | |||
5371 | ed->image.fill.spread = parse_int_range(0, 0, 1); | ||
5372 | #endif | ||
5373 | } | ||
5374 | |||
5375 | /** | ||
5376 | @page edcref | ||
5377 | |||
5378 | @property | ||
5379 | type | ||
5380 | @parameters | ||
5381 | TODO | ||
5382 | @effect | ||
5383 | TODO | ||
5384 | @endproperty | ||
5385 | */ | ||
5386 | static void | ||
5387 | st_collections_group_parts_part_description_fill_type(void) | ||
5388 | { | ||
5389 | Edje_Part_Description_Spec_Fill *fill; | ||
5390 | |||
5391 | check_arg_count(1); | ||
5392 | |||
5393 | switch (current_part->type) | ||
5394 | { | ||
5395 | case EDJE_PART_TYPE_IMAGE: | ||
5396 | { | ||
5397 | Edje_Part_Description_Image *ed; | ||
5398 | |||
5399 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5400 | |||
5401 | fill = &ed->image.fill; | ||
5402 | break; | ||
5403 | } | ||
5404 | case EDJE_PART_TYPE_PROXY: | ||
5405 | { | ||
5406 | Edje_Part_Description_Proxy *ed; | ||
5407 | |||
5408 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5409 | |||
5410 | fill = &ed->proxy.fill; | ||
5411 | break; | ||
5412 | } | ||
5413 | default: | ||
5414 | { | ||
5415 | ERR("%s: Error. parse error %s:%i. " | ||
5416 | "image and proxy attributes in non-IMAGE, non-PROXY part.", | ||
5417 | progname, file_in, line - 1); | ||
5418 | exit(-1); | ||
5419 | } | ||
5420 | } | ||
5421 | |||
5422 | fill->type = parse_enum(0, | ||
5423 | "SCALE", EDJE_FILL_TYPE_SCALE, | ||
5424 | "TILE", EDJE_FILL_TYPE_TILE, | ||
5425 | NULL); | ||
5426 | } | ||
5427 | |||
5428 | /** | ||
5429 | @page edcref | ||
5430 | @block | ||
5431 | origin | ||
5432 | @context | ||
5433 | description { | ||
5434 | .. | ||
5435 | fill { | ||
5436 | .. | ||
5437 | origin { | ||
5438 | relative: 0.0 0.0; | ||
5439 | offset: 0 0; | ||
5440 | } | ||
5441 | .. | ||
5442 | } | ||
5443 | .. | ||
5444 | } | ||
5445 | @description | ||
5446 | The origin block is used to place the starting point, inside the | ||
5447 | displayed element, that will be used to render the tile. By default, | ||
5448 | the origin is set at the element's left-up corner. | ||
5449 | @endblock | ||
5450 | |||
5451 | @property | ||
5452 | relative | ||
5453 | @parameters | ||
5454 | [X axis] [Y axis] | ||
5455 | @effect | ||
5456 | Sets the starting point relatively to displayed element's content. | ||
5457 | @endproperty | ||
5458 | */ | ||
5459 | static void | ||
5460 | st_collections_group_parts_part_description_fill_origin_relative(void) | ||
5461 | { | ||
5462 | Edje_Part_Description_Spec_Fill *fill; | ||
5463 | |||
5464 | check_arg_count(2); | ||
5465 | |||
5466 | switch (current_part->type) | ||
5467 | { | ||
5468 | case EDJE_PART_TYPE_IMAGE: | ||
5469 | { | ||
5470 | Edje_Part_Description_Image *ed; | ||
5471 | |||
5472 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5473 | |||
5474 | fill = &ed->image.fill; | ||
5475 | break; | ||
5476 | } | ||
5477 | case EDJE_PART_TYPE_PROXY: | ||
5478 | { | ||
5479 | Edje_Part_Description_Proxy *ed; | ||
5480 | |||
5481 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5482 | |||
5483 | fill = &ed->proxy.fill; | ||
5484 | break; | ||
5485 | } | ||
5486 | default: | ||
5487 | { | ||
5488 | ERR("%s: Error. parse error %s:%i. " | ||
5489 | "image and proxy attributes in non-IMAGE, non-PROXY part.", | ||
5490 | progname, file_in, line - 1); | ||
5491 | exit(-1); | ||
5492 | } | ||
5493 | } | ||
5494 | |||
5495 | fill->pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0)); | ||
5496 | fill->pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0)); | ||
5497 | } | ||
5498 | |||
5499 | /** | ||
5500 | @page edcref | ||
5501 | @property | ||
5502 | offset | ||
5503 | @parameters | ||
5504 | [X axis] [Y axis] | ||
5505 | @effect | ||
5506 | Affects the starting point a fixed number of pixels along each axis. | ||
5507 | @endproperty | ||
5508 | */ | ||
5509 | static void | ||
5510 | st_collections_group_parts_part_description_fill_origin_offset(void) | ||
5511 | { | ||
5512 | Edje_Part_Description_Spec_Fill *fill; | ||
5513 | |||
5514 | check_arg_count(2); | ||
5515 | |||
5516 | switch (current_part->type) | ||
5517 | { | ||
5518 | case EDJE_PART_TYPE_IMAGE: | ||
5519 | { | ||
5520 | Edje_Part_Description_Image *ed; | ||
5521 | |||
5522 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5523 | |||
5524 | fill = &ed->image.fill; | ||
5525 | break; | ||
5526 | } | ||
5527 | case EDJE_PART_TYPE_PROXY: | ||
5528 | { | ||
5529 | Edje_Part_Description_Proxy *ed; | ||
5530 | |||
5531 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5532 | |||
5533 | fill = &ed->proxy.fill; | ||
5534 | break; | ||
5535 | } | ||
5536 | default: | ||
5537 | { | ||
5538 | ERR("%s: Error. parse error %s:%i. " | ||
5539 | "image and proxy attributes in non-IMAGE, non-PROXY part.", | ||
5540 | progname, file_in, line - 1); | ||
5541 | exit(-1); | ||
5542 | } | ||
5543 | } | ||
5544 | |||
5545 | fill->pos_abs_x = parse_int(0); | ||
5546 | fill->pos_abs_y = parse_int(1); | ||
5547 | } | ||
5548 | |||
5549 | /** | ||
5550 | @page edcref | ||
5551 | @block | ||
5552 | size | ||
5553 | @context | ||
5554 | description { | ||
5555 | .. | ||
5556 | fill { | ||
5557 | .. | ||
5558 | size { | ||
5559 | relative: 1.0 1.0; | ||
5560 | offset: -1 -1; | ||
5561 | } | ||
5562 | .. | ||
5563 | } | ||
5564 | .. | ||
5565 | } | ||
5566 | @description | ||
5567 | The size block defines the tile size of the content that will be | ||
5568 | displayed. | ||
5569 | @endblock | ||
5570 | |||
5571 | @property | ||
5572 | relative | ||
5573 | @parameters | ||
5574 | [width] [height] | ||
5575 | @effect | ||
5576 | Takes a pair of decimal values that represent the a percentual value | ||
5577 | of the original size of the element. For example, "0.5 0.5" represents | ||
5578 | half the size, while "2.0 2.0" represents the double. The default | ||
5579 | value is "1.0 1.0". | ||
5580 | @endproperty | ||
5581 | */ | ||
5582 | static void | ||
5583 | st_collections_group_parts_part_description_fill_size_relative(void) | ||
5584 | { | ||
5585 | Edje_Part_Description_Spec_Fill *fill; | ||
5586 | |||
5587 | check_arg_count(2); | ||
5588 | |||
5589 | switch (current_part->type) | ||
5590 | { | ||
5591 | case EDJE_PART_TYPE_IMAGE: | ||
5592 | { | ||
5593 | Edje_Part_Description_Image *ed; | ||
5594 | |||
5595 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5596 | |||
5597 | fill = &ed->image.fill; | ||
5598 | break; | ||
5599 | } | ||
5600 | case EDJE_PART_TYPE_PROXY: | ||
5601 | { | ||
5602 | Edje_Part_Description_Proxy *ed; | ||
5603 | |||
5604 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5605 | |||
5606 | fill = &ed->proxy.fill; | ||
5607 | break; | ||
5608 | } | ||
5609 | default: | ||
5610 | { | ||
5611 | ERR("%s: Error. parse error %s:%i. " | ||
5612 | "image and proxy attributes in non-IMAGE, non-PROXY part.", | ||
5613 | progname, file_in, line - 1); | ||
5614 | exit(-1); | ||
5615 | } | ||
5616 | } | ||
5617 | |||
5618 | fill->rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); | ||
5619 | fill->rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0)); | ||
5620 | } | ||
5621 | |||
5622 | /** | ||
5623 | @page edcref | ||
5624 | @property | ||
5625 | offset | ||
5626 | @parameters | ||
5627 | [X axis] [Y axis] | ||
5628 | @effect | ||
5629 | Affects the size of the tile a fixed number of pixels along each axis. | ||
5630 | @endproperty | ||
5631 | */ | ||
5632 | static void | ||
5633 | st_collections_group_parts_part_description_fill_size_offset(void) | ||
5634 | { | ||
5635 | Edje_Part_Description_Spec_Fill *fill; | ||
5636 | |||
5637 | check_arg_count(2); | ||
5638 | |||
5639 | switch (current_part->type) | ||
5640 | { | ||
5641 | case EDJE_PART_TYPE_IMAGE: | ||
5642 | { | ||
5643 | Edje_Part_Description_Image *ed; | ||
5644 | |||
5645 | ed = (Edje_Part_Description_Image*) current_desc; | ||
5646 | |||
5647 | fill = &ed->image.fill; | ||
5648 | break; | ||
5649 | } | ||
5650 | case EDJE_PART_TYPE_PROXY: | ||
5651 | { | ||
5652 | Edje_Part_Description_Proxy *ed; | ||
5653 | |||
5654 | ed = (Edje_Part_Description_Proxy*) current_desc; | ||
5655 | |||
5656 | fill = &ed->proxy.fill; | ||
5657 | break; | ||
5658 | } | ||
5659 | default: | ||
5660 | { | ||
5661 | ERR("%s: Error. parse error %s:%i. " | ||
5662 | "image and proxy attributes in non-IMAGE, non-PROXY part.", | ||
5663 | progname, file_in, line - 1); | ||
5664 | exit(-1); | ||
5665 | } | ||
5666 | } | ||
5667 | |||
5668 | fill->abs_x = parse_int(0); | ||
5669 | fill->abs_y = parse_int(1); | ||
5670 | } | ||
5671 | |||
5672 | |||
5673 | /** | ||
5674 | @edcsection{description_text,Text state description sub blocks} | ||
5675 | */ | ||
5676 | |||
5677 | /** | ||
5678 | @page edcref | ||
5679 | |||
5680 | @block | ||
5681 | text | ||
5682 | @context | ||
5683 | part { | ||
5684 | description { | ||
5685 | .. | ||
5686 | text { | ||
5687 | text: "some string of text to display"; | ||
5688 | font: "font_name"; | ||
5689 | size: SIZE; | ||
5690 | text_class: "class_name"; | ||
5691 | fit: horizontal vertical; | ||
5692 | min: horizontal vertical; | ||
5693 | max: horizontal vertical; | ||
5694 | align: X-axis Y-axis; | ||
5695 | source: "part_name"; | ||
5696 | text_source: "text_part_name"; | ||
5697 | ellipsis: 0.0-1.0; | ||
5698 | style: "stylename"; | ||
5699 | } | ||
5700 | .. | ||
5701 | } | ||
5702 | } | ||
5703 | @description | ||
5704 | @endblock | ||
5705 | |||
5706 | @property | ||
5707 | text | ||
5708 | @parameters | ||
5709 | [a string of text, or nothing] | ||
5710 | @effect | ||
5711 | Sets the default content of a text part, normally the application is | ||
5712 | the one changing its value. | ||
5713 | @endproperty | ||
5714 | */ | ||
5715 | static void | ||
5716 | st_collections_group_parts_part_description_text_text(void) | ||
5717 | { | ||
5718 | Edje_Part_Description_Text *ed; | ||
5719 | char *str = NULL; | ||
5720 | int i; | ||
5721 | |||
5722 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5723 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5724 | { | ||
5725 | ERR("%s: Error. parse error %s:%i. " | ||
5726 | "text attributes in non-TEXT part.", | ||
5727 | progname, file_in, line - 1); | ||
5728 | exit(-1); | ||
5729 | } | ||
5730 | |||
5731 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5732 | |||
5733 | for (i = 0; ;i++) | ||
5734 | { | ||
5735 | char *s; | ||
5736 | |||
5737 | if (!is_param(i)) break; | ||
5738 | s = parse_str(i); | ||
5739 | if (!str) str = s; | ||
5740 | else | ||
5741 | { | ||
5742 | str = realloc(str, strlen(str) + strlen(s) + 1); | ||
5743 | strcat(str, s); | ||
5744 | free(s); | ||
5745 | } | ||
5746 | } | ||
5747 | ed->text.text.str = str; | ||
5748 | } | ||
5749 | |||
5750 | /** | ||
5751 | @page edcref | ||
5752 | |||
5753 | @property | ||
5754 | text_class | ||
5755 | @parameters | ||
5756 | [text class name] | ||
5757 | @effect | ||
5758 | Similar to color_class, this is the name used by the application | ||
5759 | to alter the font family and size at runtime. | ||
5760 | @endproperty | ||
5761 | */ | ||
5762 | static void | ||
5763 | st_collections_group_parts_part_description_text_text_class(void) | ||
5764 | { | ||
5765 | Edje_Part_Description_Text *ed; | ||
5766 | |||
5767 | check_arg_count(1); | ||
5768 | |||
5769 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5770 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5771 | { | ||
5772 | ERR("%s: Error. parse error %s:%i. " | ||
5773 | "text attributes in non-TEXT part.", | ||
5774 | progname, file_in, line - 1); | ||
5775 | exit(-1); | ||
5776 | } | ||
5777 | |||
5778 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5779 | |||
5780 | ed->text.text_class = parse_str(0); | ||
5781 | } | ||
5782 | |||
5783 | /** | ||
5784 | @page edcref | ||
5785 | |||
5786 | @property | ||
5787 | font | ||
5788 | @parameters | ||
5789 | [font alias] | ||
5790 | @effect | ||
5791 | This sets the font family to one of the aliases set up in the "fonts" | ||
5792 | block. Can be overrided by the application. | ||
5793 | @endproperty | ||
5794 | */ | ||
5795 | static void | ||
5796 | st_collections_group_parts_part_description_text_font(void) | ||
5797 | { | ||
5798 | Edje_Part_Description_Text *ed; | ||
5799 | |||
5800 | check_arg_count(1); | ||
5801 | |||
5802 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5803 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5804 | { | ||
5805 | ERR("%s: Error. parse error %s:%i. " | ||
5806 | "text attributes in non-TEXT part.", | ||
5807 | progname, file_in, line - 1); | ||
5808 | exit(-1); | ||
5809 | } | ||
5810 | |||
5811 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5812 | |||
5813 | ed->text.font.str = parse_str(0); | ||
5814 | } | ||
5815 | |||
5816 | /** | ||
5817 | @page edcref | ||
5818 | |||
5819 | @property | ||
5820 | style | ||
5821 | @parameters | ||
5822 | [the style name] | ||
5823 | @effect | ||
5824 | Causes the part to use the default style and tags defined in the | ||
5825 | "style" block with the specified name. | ||
5826 | @endproperty | ||
5827 | */ | ||
5828 | static void | ||
5829 | st_collections_group_parts_part_description_text_style(void) | ||
5830 | { | ||
5831 | Edje_Part_Description_Text *ed; | ||
5832 | |||
5833 | check_arg_count(1); | ||
5834 | |||
5835 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5836 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5837 | { | ||
5838 | ERR("%s: Error. parse error %s:%i. " | ||
5839 | "text attributes in non-TEXT part.", | ||
5840 | progname, file_in, line - 1); | ||
5841 | exit(-1); | ||
5842 | } | ||
5843 | |||
5844 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5845 | |||
5846 | ed->text.style.str = parse_str(0); | ||
5847 | } | ||
5848 | |||
5849 | /** | ||
5850 | @page edcref | ||
5851 | |||
5852 | @property | ||
5853 | repch | ||
5854 | @parameters | ||
5855 | [the replacement character string] | ||
5856 | @effect | ||
5857 | If this is a textblock and is in PASSWORD mode this string is used | ||
5858 | to replace every character to hide the details of the entry. Normally | ||
5859 | you would use a "*", but you can use anything you like. | ||
5860 | @endproperty | ||
5861 | */ | ||
5862 | static void | ||
5863 | st_collections_group_parts_part_description_text_repch(void) | ||
5864 | { | ||
5865 | Edje_Part_Description_Text *ed; | ||
5866 | |||
5867 | check_arg_count(1); | ||
5868 | |||
5869 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5870 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5871 | { | ||
5872 | ERR("%s: Error. parse error %s:%i. " | ||
5873 | "text attributes in non-TEXT part.", | ||
5874 | progname, file_in, line - 1); | ||
5875 | exit(-1); | ||
5876 | } | ||
5877 | |||
5878 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5879 | |||
5880 | ed->text.repch.str = parse_str(0); | ||
5881 | } | ||
5882 | |||
5883 | /** | ||
5884 | @page edcref | ||
5885 | |||
5886 | @property | ||
5887 | size | ||
5888 | @parameters | ||
5889 | [font size in points (pt)] | ||
5890 | @effect | ||
5891 | Sets the default font size for the text part. Can be overrided by the | ||
5892 | application. | ||
5893 | @endproperty | ||
5894 | */ | ||
5895 | static void | ||
5896 | st_collections_group_parts_part_description_text_size(void) | ||
5897 | { | ||
5898 | Edje_Part_Description_Text *ed; | ||
5899 | |||
5900 | check_arg_count(1); | ||
5901 | |||
5902 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5903 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5904 | { | ||
5905 | ERR("%s: Error. parse error %s:%i. " | ||
5906 | "text attributes in non-TEXT part.", | ||
5907 | progname, file_in, line - 1); | ||
5908 | exit(-1); | ||
5909 | } | ||
5910 | |||
5911 | ed = (Edje_Part_Description_Text*)current_desc; | ||
5912 | |||
5913 | ed->text.size = parse_int_range(0, 0, 255); | ||
5914 | } | ||
5915 | |||
5916 | /** | ||
5917 | @page edcref | ||
5918 | |||
5919 | @property | ||
5920 | size_range | ||
5921 | @parameters | ||
5922 | [font min size in points (pt)] [font max size in points (pt)] | ||
5923 | @effect | ||
5924 | Sets the allowed font size for the text part. Setting min and max to 0 | ||
5925 | means we won't restrict the sizing (default). | ||
5926 | @endproperty | ||
5927 | @since 1.1.0 | ||
5928 | */ | ||
5929 | static void | ||
5930 | st_collections_group_parts_part_description_text_size_range(void) | ||
5931 | { | ||
5932 | Edje_Part_Description_Text *ed; | ||
5933 | |||
5934 | check_arg_count(2); | ||
5935 | |||
5936 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5937 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5938 | { | ||
5939 | ERR("%s: Error. parse error %s:%i. " | ||
5940 | "text attributes in non-TEXT part.", | ||
5941 | progname, file_in, line - 1); | ||
5942 | exit(-1); | ||
5943 | } | ||
5944 | |||
5945 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5946 | |||
5947 | ed->text.size_range_min = parse_int_range(0, 0, 255); | ||
5948 | ed->text.size_range_max = parse_int_range(1, 0, 255); | ||
5949 | if (ed->text.size_range_min > ed->text.size_range_max) | ||
5950 | { | ||
5951 | ERR("%s: Error. parse error %s:%i. " | ||
5952 | "min size is bigger than max size.", | ||
5953 | progname, file_in, line - 1); | ||
5954 | exit(-1); | ||
5955 | } | ||
5956 | } | ||
5957 | |||
5958 | /** | ||
5959 | @page edcref | ||
5960 | |||
5961 | @property | ||
5962 | fit | ||
5963 | @parameters | ||
5964 | [horizontal] [vertical] | ||
5965 | @effect | ||
5966 | When any of the parameters is set to 1 edje will resize the text for it | ||
5967 | to fit in it's container. Both are disabled by default. | ||
5968 | @endproperty | ||
5969 | */ | ||
5970 | static void | ||
5971 | st_collections_group_parts_part_description_text_fit(void) | ||
5972 | { | ||
5973 | Edje_Part_Description_Text *ed; | ||
5974 | |||
5975 | check_arg_count(2); | ||
5976 | |||
5977 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
5978 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
5979 | { | ||
5980 | ERR("%s: Error. parse error %s:%i. " | ||
5981 | "text attributes in non-TEXT part.", | ||
5982 | progname, file_in, line - 1); | ||
5983 | exit(-1); | ||
5984 | } | ||
5985 | |||
5986 | ed = (Edje_Part_Description_Text*) current_desc; | ||
5987 | |||
5988 | ed->text.fit_x = parse_bool(0); | ||
5989 | ed->text.fit_y = parse_bool(1); | ||
5990 | } | ||
5991 | |||
5992 | /** | ||
5993 | @page edcref | ||
5994 | |||
5995 | @property | ||
5996 | min | ||
5997 | @parameters | ||
5998 | [horizontal] [vertical] | ||
5999 | @effect | ||
6000 | When any of the parameters is enabled (1) it forces the minimum size of | ||
6001 | the container to be equal to the minimum size of the text. The default | ||
6002 | value is "0 0". | ||
6003 | @endproperty | ||
6004 | */ | ||
6005 | static void | ||
6006 | st_collections_group_parts_part_description_text_min(void) | ||
6007 | { | ||
6008 | Edje_Part_Description_Text *ed; | ||
6009 | |||
6010 | check_arg_count(2); | ||
6011 | |||
6012 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6013 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6014 | { | ||
6015 | ERR("%s: Error. parse error %s:%i. " | ||
6016 | "text attributes in non-TEXT part.", | ||
6017 | progname, file_in, line - 1); | ||
6018 | exit(-1); | ||
6019 | } | ||
6020 | |||
6021 | ed = (Edje_Part_Description_Text*)current_desc; | ||
6022 | |||
6023 | ed->text.min_x = parse_bool(0); | ||
6024 | ed->text.min_y = parse_bool(1); | ||
6025 | } | ||
6026 | |||
6027 | /** | ||
6028 | @page edcref | ||
6029 | |||
6030 | @property | ||
6031 | max | ||
6032 | @parameters | ||
6033 | [horizontal] [vertical] | ||
6034 | @effect | ||
6035 | When any of the parameters is enabled (1) it forces the maximum size of | ||
6036 | the container to be equal to the maximum size of the text. The default | ||
6037 | value is "0 0". | ||
6038 | @endproperty | ||
6039 | */ | ||
6040 | static void | ||
6041 | st_collections_group_parts_part_description_text_max(void) | ||
6042 | { | ||
6043 | Edje_Part_Description_Text *ed; | ||
6044 | |||
6045 | check_arg_count(2); | ||
6046 | |||
6047 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6048 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6049 | { | ||
6050 | ERR("%s: Error. parse error %s:%i. " | ||
6051 | "text attributes in non-TEXT part.", | ||
6052 | progname, file_in, line - 1); | ||
6053 | exit(-1); | ||
6054 | } | ||
6055 | |||
6056 | ed = (Edje_Part_Description_Text*) current_desc; | ||
6057 | |||
6058 | ed->text.max_x = parse_bool(0); | ||
6059 | ed->text.max_y = parse_bool(1); | ||
6060 | } | ||
6061 | |||
6062 | /** | ||
6063 | @page edcref | ||
6064 | |||
6065 | @property | ||
6066 | align | ||
6067 | @parameters | ||
6068 | [horizontal] [vertical] | ||
6069 | @effect | ||
6070 | Change the position of the point of balance inside the container. The | ||
6071 | default value is 0.5 0.5. | ||
6072 | @endproperty | ||
6073 | */ | ||
6074 | static void | ||
6075 | st_collections_group_parts_part_description_text_align(void) | ||
6076 | { | ||
6077 | Edje_Part_Description_Text *ed; | ||
6078 | |||
6079 | check_arg_count(2); | ||
6080 | |||
6081 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6082 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6083 | { | ||
6084 | ERR("%s: Error. parse error %s:%i. " | ||
6085 | "text attributes in non-TEXT part.", | ||
6086 | progname, file_in, line - 1); | ||
6087 | exit(-1); | ||
6088 | } | ||
6089 | |||
6090 | ed = (Edje_Part_Description_Text*) current_desc; | ||
6091 | |||
6092 | ed->text.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0)); | ||
6093 | ed->text.align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0)); | ||
6094 | } | ||
6095 | |||
6096 | /** | ||
6097 | @page edcref | ||
6098 | |||
6099 | @property | ||
6100 | source | ||
6101 | @parameters | ||
6102 | [another TEXT part's name] | ||
6103 | @effect | ||
6104 | Causes the part to use the text properties (like font and size) of | ||
6105 | another part and update them as they change. | ||
6106 | @endproperty | ||
6107 | */ | ||
6108 | static void | ||
6109 | st_collections_group_parts_part_description_text_source(void) | ||
6110 | { | ||
6111 | Edje_Part_Collection *pc; | ||
6112 | Edje_Part_Description_Text *ed; | ||
6113 | |||
6114 | check_arg_count(1); | ||
6115 | |||
6116 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
6117 | |||
6118 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6119 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6120 | { | ||
6121 | ERR("%s: Error. parse error %s:%i. " | ||
6122 | "text attributes in non-TEXT part.", | ||
6123 | progname, file_in, line - 1); | ||
6124 | exit(-1); | ||
6125 | } | ||
6126 | |||
6127 | ed = (Edje_Part_Description_Text*) current_desc; | ||
6128 | |||
6129 | { | ||
6130 | char *name; | ||
6131 | |||
6132 | name = parse_str(0); | ||
6133 | data_queue_part_lookup(pc, name, &(ed->text.id_source)); | ||
6134 | free(name); | ||
6135 | } | ||
6136 | } | ||
6137 | |||
6138 | /** | ||
6139 | @page edcref | ||
6140 | |||
6141 | @property | ||
6142 | text_source | ||
6143 | @parameters | ||
6144 | [another TEXT part's name] | ||
6145 | @effect | ||
6146 | Causes the part to display the text content of another part and update | ||
6147 | them as they change. | ||
6148 | @endproperty | ||
6149 | */ | ||
6150 | static void | ||
6151 | st_collections_group_parts_part_description_text_text_source(void) | ||
6152 | { | ||
6153 | Edje_Part_Collection *pc; | ||
6154 | Edje_Part_Description_Text *ed; | ||
6155 | |||
6156 | check_arg_count(1); | ||
6157 | |||
6158 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
6159 | |||
6160 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6161 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6162 | { | ||
6163 | ERR("%s: Error. parse error %s:%i. " | ||
6164 | "text attributes in non-TEXT part.", | ||
6165 | progname, file_in, line - 1); | ||
6166 | exit(-1); | ||
6167 | } | ||
6168 | |||
6169 | ed = (Edje_Part_Description_Text*) current_desc; | ||
6170 | |||
6171 | { | ||
6172 | char *name; | ||
6173 | |||
6174 | name = parse_str(0); | ||
6175 | data_queue_part_lookup(pc, name, &(ed->text.id_text_source)); | ||
6176 | free(name); | ||
6177 | } | ||
6178 | } | ||
6179 | |||
6180 | /** | ||
6181 | @page edcref | ||
6182 | |||
6183 | @property | ||
6184 | ellipsis | ||
6185 | @parameters | ||
6186 | [point of balance] | ||
6187 | @effect | ||
6188 | Used to balance the text in a relative point from 0.0 to 1.0, this | ||
6189 | point is the last section of the string to be cut out in case of a | ||
6190 | resize that is smaller than the text itself. The default value is 0.0. | ||
6191 | @endproperty | ||
6192 | */ | ||
6193 | static void | ||
6194 | st_collections_group_parts_part_description_text_elipsis(void) | ||
6195 | { | ||
6196 | Edje_Part_Description_Text *ed; | ||
6197 | |||
6198 | check_arg_count(1); | ||
6199 | |||
6200 | if ((current_part->type != EDJE_PART_TYPE_TEXT) && | ||
6201 | (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) | ||
6202 | { | ||
6203 | ERR("%s: Error. parse error %s:%i. " | ||
6204 | "text attributes in non-TEXT part.", | ||
6205 | progname, file_in, line - 1); | ||
6206 | exit(-1); | ||
6207 | } | ||
6208 | |||
6209 | ed = (Edje_Part_Description_Text*) current_desc; | ||
6210 | |||
6211 | ed->text.elipsis = parse_float_range(0, 0.0, 1.0); | ||
6212 | } | ||
6213 | |||
6214 | |||
6215 | /** | ||
6216 | @edcsection{description_box,Box state description sub blocks} | ||
6217 | */ | ||
6218 | |||
6219 | /** | ||
6220 | @page edcref | ||
6221 | |||
6222 | @block | ||
6223 | box | ||
6224 | @context | ||
6225 | part { | ||
6226 | description { | ||
6227 | .. | ||
6228 | box { | ||
6229 | layout: "vertical"; | ||
6230 | padding: 0 2; | ||
6231 | align: 0.5 0.5; | ||
6232 | min: 0 0; | ||
6233 | } | ||
6234 | .. | ||
6235 | } | ||
6236 | } | ||
6237 | @description | ||
6238 | A box block can contain other objects and display them in different | ||
6239 | layouts, any of the predefined set, or a custom one, set by the | ||
6240 | application. | ||
6241 | @endblock | ||
6242 | |||
6243 | @property | ||
6244 | layout | ||
6245 | @parameters | ||
6246 | [primary layout] [fallback layout] | ||
6247 | @effect | ||
6248 | Sets the layout for the box: | ||
6249 | @li horizontal (default) | ||
6250 | @li vertical | ||
6251 | @li horizontal_homogeneous | ||
6252 | @li vertical_homogeneous | ||
6253 | @li horizontal_max (homogeneous to the max sized child) | ||
6254 | @li vertical_max | ||
6255 | @li horizontal_flow | ||
6256 | @li vertical_flow | ||
6257 | @li stack | ||
6258 | @li some_other_custom_layout_set_by_the_application | ||
6259 | You could set a custom layout as fallback, it makes very | ||
6260 | very little sense though, and if that one fails, it will | ||
6261 | default to horizontal. | ||
6262 | @endproperty | ||
6263 | |||
6264 | @property | ||
6265 | align | ||
6266 | @parameters | ||
6267 | [horizontal] [vertical] | ||
6268 | @effect | ||
6269 | Change the position of the point of balance inside the container. The | ||
6270 | default value is 0.5 0.5. | ||
6271 | @endproperty | ||
6272 | |||
6273 | @property | ||
6274 | padding | ||
6275 | @parameters | ||
6276 | [horizontal] [vertical] | ||
6277 | @effect | ||
6278 | Sets the space between cells in pixels. Defaults to 0 0. | ||
6279 | @endproperty | ||
6280 | |||
6281 | @property | ||
6282 | min | ||
6283 | @parameters | ||
6284 | [horizontal] [vertical] | ||
6285 | @effect | ||
6286 | When any of the parameters is enabled (1) it forces the minimum size of | ||
6287 | the box to be equal to the minimum size of the items. The default | ||
6288 | value is "0 0". | ||
6289 | @endproperty | ||
6290 | */ | ||
6291 | static void st_collections_group_parts_part_description_box_layout(void) | ||
6292 | { | ||
6293 | Edje_Part_Description_Box *ed; | ||
6294 | |||
6295 | check_min_arg_count(1); | ||
6296 | |||
6297 | if (current_part->type != EDJE_PART_TYPE_BOX) | ||
6298 | { | ||
6299 | ERR("%s: Error. parse error %s:%i. " | ||
6300 | "box attributes in non-BOX part.", | ||
6301 | progname, file_in, line - 1); | ||
6302 | exit(-1); | ||
6303 | } | ||
6304 | |||
6305 | ed = (Edje_Part_Description_Box*) current_desc; | ||
6306 | |||
6307 | ed->box.layout = parse_str(0); | ||
6308 | if (is_param(1)) | ||
6309 | ed->box.alt_layout = parse_str(1); | ||
6310 | } | ||
6311 | |||
6312 | static void st_collections_group_parts_part_description_box_align(void) | ||
6313 | { | ||
6314 | Edje_Part_Description_Box *ed; | ||
6315 | |||
6316 | check_arg_count(2); | ||
6317 | |||
6318 | if (current_part->type != EDJE_PART_TYPE_BOX) | ||
6319 | { | ||
6320 | ERR("%s: Error. parse error %s:%i. " | ||
6321 | "box attributes in non-BOX part.", | ||
6322 | progname, file_in, line - 1); | ||
6323 | exit(-1); | ||
6324 | } | ||
6325 | |||
6326 | ed = (Edje_Part_Description_Box*) current_desc; | ||
6327 | |||
6328 | ed->box.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0)); | ||
6329 | ed->box.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0)); | ||
6330 | } | ||
6331 | |||
6332 | static void st_collections_group_parts_part_description_box_padding(void) | ||
6333 | { | ||
6334 | Edje_Part_Description_Box *ed; | ||
6335 | |||
6336 | check_arg_count(2); | ||
6337 | |||
6338 | if (current_part->type != EDJE_PART_TYPE_BOX) | ||
6339 | { | ||
6340 | ERR("%s: Error. parse error %s:%i. " | ||
6341 | "box attributes in non-BOX part.", | ||
6342 | progname, file_in, line - 1); | ||
6343 | exit(-1); | ||
6344 | } | ||
6345 | |||
6346 | ed = (Edje_Part_Description_Box*) current_desc; | ||
6347 | |||
6348 | ed->box.padding.x = parse_int_range(0, 0, 0x7fffffff); | ||
6349 | ed->box.padding.y = parse_int_range(1, 0, 0x7fffffff); | ||
6350 | } | ||
6351 | |||
6352 | static void | ||
6353 | st_collections_group_parts_part_description_box_min(void) | ||
6354 | { | ||
6355 | Edje_Part_Description_Box *ed; | ||
6356 | |||
6357 | check_arg_count(2); | ||
6358 | |||
6359 | if (current_part->type != EDJE_PART_TYPE_BOX) | ||
6360 | { | ||
6361 | ERR("%s: Error. parse error %s:%i. " | ||
6362 | "box attributes in non-BOX part.", | ||
6363 | progname, file_in, line - 1); | ||
6364 | exit(-1); | ||
6365 | } | ||
6366 | |||
6367 | ed = (Edje_Part_Description_Box*) current_desc; | ||
6368 | |||
6369 | ed->box.min.h = parse_bool(0); | ||
6370 | ed->box.min.v = parse_bool(1); | ||
6371 | } | ||
6372 | |||
6373 | |||
6374 | /** | ||
6375 | @edcsection{description_table,Table state description sub blocks} | ||
6376 | */ | ||
6377 | |||
6378 | /** | ||
6379 | @page edcref | ||
6380 | |||
6381 | @block | ||
6382 | table | ||
6383 | @context | ||
6384 | part { | ||
6385 | description { | ||
6386 | .. | ||
6387 | table { | ||
6388 | homogeneous: TABLE; | ||
6389 | padding: 0 2; | ||
6390 | align: 0.5 0.5; | ||
6391 | min: 0 0; | ||
6392 | } | ||
6393 | .. | ||
6394 | } | ||
6395 | } | ||
6396 | @description | ||
6397 | A table block can contain other objects packed in multiple columns | ||
6398 | and rows, and each item can span across more than one column and/or | ||
6399 | row. | ||
6400 | @endblock | ||
6401 | |||
6402 | @property | ||
6403 | homogeneous | ||
6404 | @parameters | ||
6405 | [homogeneous mode] | ||
6406 | @effect | ||
6407 | Sets the homogeneous mode for the table: | ||
6408 | @li NONE (default) | ||
6409 | @li TABLE | ||
6410 | @li ITEM | ||
6411 | @endproperty | ||
6412 | |||
6413 | @property | ||
6414 | align | ||
6415 | @parameters | ||
6416 | [horizontal] [vertical] | ||
6417 | @effect | ||
6418 | Change the position of the point of balance inside the container. The | ||
6419 | default value is 0.5 0.5. | ||
6420 | @endproperty | ||
6421 | |||
6422 | @property | ||
6423 | padding | ||
6424 | @parameters | ||
6425 | [horizontal] [vertical] | ||
6426 | @effect | ||
6427 | Sets the space between cells in pixels. Defaults to 0 0. | ||
6428 | @endproperty | ||
6429 | |||
6430 | @property | ||
6431 | min | ||
6432 | @parameters | ||
6433 | [horizontal] [vertical] | ||
6434 | @effect | ||
6435 | When any of the parameters is enabled (1) it forces the minimum size of | ||
6436 | the table to be equal to the minimum size of the items. The default | ||
6437 | value is "0 0". | ||
6438 | @endproperty | ||
6439 | */ | ||
6440 | static void st_collections_group_parts_part_description_table_homogeneous(void) | ||
6441 | { | ||
6442 | Edje_Part_Description_Table *ed; | ||
6443 | |||
6444 | check_min_arg_count(1); | ||
6445 | |||
6446 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
6447 | { | ||
6448 | ERR("%s: Error. parse error %s:%i. " | ||
6449 | "table attributes in non-TABLE part.", | ||
6450 | progname, file_in, line - 1); | ||
6451 | exit(-1); | ||
6452 | } | ||
6453 | |||
6454 | ed = (Edje_Part_Description_Table*) current_desc; | ||
6455 | |||
6456 | ed->table.homogeneous = parse_enum(0, | ||
6457 | "NONE", EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE, | ||
6458 | "TABLE", EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE, | ||
6459 | "ITEM", EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM, | ||
6460 | NULL); | ||
6461 | } | ||
6462 | |||
6463 | static void st_collections_group_parts_part_description_table_align(void) | ||
6464 | { | ||
6465 | Edje_Part_Description_Table *ed; | ||
6466 | |||
6467 | check_arg_count(2); | ||
6468 | |||
6469 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
6470 | { | ||
6471 | ERR("%s: Error. parse error %s:%i. " | ||
6472 | "table attributes in non-TABLE part.", | ||
6473 | progname, file_in, line - 1); | ||
6474 | exit(-1); | ||
6475 | } | ||
6476 | |||
6477 | ed = (Edje_Part_Description_Table*) current_desc; | ||
6478 | |||
6479 | ed->table.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0)); | ||
6480 | ed->table.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0)); | ||
6481 | } | ||
6482 | |||
6483 | static void st_collections_group_parts_part_description_table_padding(void) | ||
6484 | { | ||
6485 | Edje_Part_Description_Table *ed; | ||
6486 | |||
6487 | check_arg_count(2); | ||
6488 | |||
6489 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
6490 | { | ||
6491 | ERR("%s: Error. parse error %s:%i. " | ||
6492 | "table attributes in non-TABLE part.", | ||
6493 | progname, file_in, line - 1); | ||
6494 | exit(-1); | ||
6495 | } | ||
6496 | |||
6497 | ed = (Edje_Part_Description_Table*) current_desc; | ||
6498 | |||
6499 | ed->table.padding.x = parse_int_range(0, 0, 0x7fffffff); | ||
6500 | ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff); | ||
6501 | } | ||
6502 | |||
6503 | static void | ||
6504 | st_collections_group_parts_part_description_table_min(void) | ||
6505 | { | ||
6506 | Edje_Part_Description_Table *ed; | ||
6507 | |||
6508 | check_arg_count(2); | ||
6509 | |||
6510 | if (current_part->type != EDJE_PART_TYPE_TABLE) | ||
6511 | { | ||
6512 | ERR("%s: Error. parse error %s:%i. " | ||
6513 | "box attributes in non-TABLE part.", | ||
6514 | progname, file_in, line - 1); | ||
6515 | exit(-1); | ||
6516 | } | ||
6517 | |||
6518 | ed = (Edje_Part_Description_Table*) current_desc; | ||
6519 | |||
6520 | ed->table.min.h = parse_bool(0); | ||
6521 | ed->table.min.v = parse_bool(1); | ||
6522 | } | ||
6523 | |||
6524 | /** | ||
6525 | @edcsection{description_map,Map state description sub blocks} | ||
6526 | */ | ||
6527 | |||
6528 | /** | ||
6529 | @page edcref | ||
6530 | @block | ||
6531 | map | ||
6532 | @context | ||
6533 | description { | ||
6534 | .. | ||
6535 | map { | ||
6536 | perspective: "name"; | ||
6537 | light: "name"; | ||
6538 | on: 1; | ||
6539 | smooth: 1; | ||
6540 | perspective_on: 1; | ||
6541 | backface_cull: 1; | ||
6542 | alpha: 1; | ||
6543 | |||
6544 | rotation { | ||
6545 | .. | ||
6546 | } | ||
6547 | } | ||
6548 | .. | ||
6549 | } | ||
6550 | |||
6551 | @description | ||
6552 | @endblock | ||
6553 | |||
6554 | @property | ||
6555 | perspective | ||
6556 | @parameters | ||
6557 | [another part's name] | ||
6558 | @effect | ||
6559 | This sets the part that is used as the "perspective point" for giving | ||
6560 | a part a "3d look". The perspective point should have a perspective | ||
6561 | section that provides zplane and focal properties. The center of this | ||
6562 | part will be used as the focal point, so size, color and visibility | ||
6563 | etc. are not relevant just center point, zplane and focal are used. | ||
6564 | This also implicitly enables perspective transforms (see the on | ||
6565 | parameter for the map section). | ||
6566 | @endproperty | ||
6567 | */ | ||
6568 | static void | ||
6569 | st_collections_group_parts_part_description_map_perspective(void) | ||
6570 | { | ||
6571 | Edje_Part_Collection *pc; | ||
6572 | |||
6573 | check_arg_count(1); | ||
6574 | |||
6575 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
6576 | |||
6577 | { | ||
6578 | char *name; | ||
6579 | |||
6580 | name = parse_str(0); | ||
6581 | data_queue_part_lookup(pc, name, &(current_desc->map.id_persp)); | ||
6582 | free(name); | ||
6583 | } | ||
6584 | |||
6585 | current_desc->map.persp_on = 1; | ||
6586 | } | ||
6587 | |||
6588 | /** | ||
6589 | @page edcref | ||
6590 | @property | ||
6591 | light | ||
6592 | @parameters | ||
6593 | [another part's name] | ||
6594 | @effect | ||
6595 | This sets the part that is used as the "light" for calculating the | ||
6596 | brightness (based on how directly the part's surface is facing the | ||
6597 | light source point). Like the perspective point part, the center point | ||
6598 | is used and zplane is used for the z position (0 being the zero-plane | ||
6599 | where all 2D objects normally live) and positive values being further | ||
6600 | away into the distance. The light part color is used as the light | ||
6601 | color (alpha not used for light color). The color2 color is used for | ||
6602 | the ambient lighting when calculating brightness (alpha also not | ||
6603 | used). | ||
6604 | @endproperty | ||
6605 | */ | ||
6606 | static void | ||
6607 | st_collections_group_parts_part_description_map_light(void) | ||
6608 | { | ||
6609 | Edje_Part_Collection *pc; | ||
6610 | |||
6611 | check_arg_count(1); | ||
6612 | |||
6613 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
6614 | |||
6615 | { | ||
6616 | char *name; | ||
6617 | |||
6618 | name = parse_str(0); | ||
6619 | data_queue_part_lookup(pc, name, &(current_desc->map.id_light)); | ||
6620 | free(name); | ||
6621 | } | ||
6622 | } | ||
6623 | |||
6624 | /** | ||
6625 | @page edcref | ||
6626 | @property | ||
6627 | on | ||
6628 | @parameters | ||
6629 | [1 or 0] | ||
6630 | @effect | ||
6631 | This enables mapping for the part. Default is 0. | ||
6632 | @endproperty | ||
6633 | */ | ||
6634 | static void | ||
6635 | st_collections_group_parts_part_description_map_on(void) | ||
6636 | { | ||
6637 | check_arg_count(1); | ||
6638 | |||
6639 | current_desc->map.on = parse_bool(0); | ||
6640 | } | ||
6641 | |||
6642 | /** | ||
6643 | @page edcref | ||
6644 | @property | ||
6645 | smooth | ||
6646 | @parameters | ||
6647 | [1 or 0] | ||
6648 | @effect | ||
6649 | This enable smooth map rendering. This may be linear interpolation, | ||
6650 | anisotropic filtering or anything the engine decides is "smooth". | ||
6651 | This is a best-effort hint and may not produce precisely the same | ||
6652 | results in all engines and situations. Default is 1 | ||
6653 | @endproperty | ||
6654 | */ | ||
6655 | static void | ||
6656 | st_collections_group_parts_part_description_map_smooth(void) | ||
6657 | { | ||
6658 | check_arg_count(1); | ||
6659 | |||
6660 | current_desc->map.smooth = parse_bool(0); | ||
6661 | } | ||
6662 | |||
6663 | /** | ||
6664 | @page edcref | ||
6665 | @property | ||
6666 | alpha | ||
6667 | @parameters | ||
6668 | [1 or 0] | ||
6669 | @effect | ||
6670 | This enable alpha channel when map rendering. Default is 1. | ||
6671 | @endproperty | ||
6672 | */ | ||
6673 | static void | ||
6674 | st_collections_group_parts_part_description_map_alpha(void) | ||
6675 | { | ||
6676 | check_arg_count(1); | ||
6677 | |||
6678 | current_desc->map.alpha = parse_bool(0); | ||
6679 | } | ||
6680 | |||
6681 | /** | ||
6682 | @page edcref | ||
6683 | @property | ||
6684 | backface_cull | ||
6685 | @parameters | ||
6686 | [1 or 0] | ||
6687 | @effect | ||
6688 | This enables backface culling (when the rotated part that normally | ||
6689 | faces the camera is facing away after being rotated etc.). This means | ||
6690 | that the object will be hidden when "backface culled". | ||
6691 | @endproperty | ||
6692 | */ | ||
6693 | static void | ||
6694 | st_collections_group_parts_part_description_map_backface_cull(void) | ||
6695 | { | ||
6696 | check_arg_count(1); | ||
6697 | |||
6698 | current_desc->map.backcull = parse_bool(0); | ||
6699 | } | ||
6700 | |||
6701 | /** | ||
6702 | @page edcref | ||
6703 | @property | ||
6704 | perspective_on | ||
6705 | @parameters | ||
6706 | [1 or 0] | ||
6707 | @effect | ||
6708 | Enable perspective when rotating even without a perspective point object. | ||
6709 | This would use perspective set for the object itself or for the | ||
6710 | canvas as a whole as the global perspective with | ||
6711 | edje_perspective_set() and edje_perspective_global_set(). | ||
6712 | @endproperty | ||
6713 | */ | ||
6714 | static void | ||
6715 | st_collections_group_parts_part_description_map_perspective_on(void) | ||
6716 | { | ||
6717 | check_arg_count(1); | ||
6718 | |||
6719 | current_desc->map.persp_on = parse_bool(0); | ||
6720 | } | ||
6721 | /** | ||
6722 | @page edcref | ||
6723 | @block | ||
6724 | rotation | ||
6725 | @context | ||
6726 | map { | ||
6727 | .. | ||
6728 | rotation { | ||
6729 | center: "name"; | ||
6730 | x: 45.0; | ||
6731 | y: 45.0; | ||
6732 | z: 45.0; | ||
6733 | } | ||
6734 | .. | ||
6735 | } | ||
6736 | @description | ||
6737 | Rotates the part, optionally with the center on another part. | ||
6738 | @endblock | ||
6739 | |||
6740 | @property | ||
6741 | center | ||
6742 | @parameters | ||
6743 | [another part's name] | ||
6744 | @effect | ||
6745 | This sets the part that is used as the center of rotation when | ||
6746 | rotating the part with this description. The part's center point | ||
6747 | is used as the rotation center when applying rotation around the | ||
6748 | x, y and z axes. If no center is given, the parts original center | ||
6749 | itself is used for the rotation center. | ||
6750 | @endproperty | ||
6751 | */ | ||
6752 | static void | ||
6753 | st_collections_group_parts_part_description_map_rotation_center(void) | ||
6754 | { | ||
6755 | Edje_Part_Collection *pc; | ||
6756 | |||
6757 | check_arg_count(1); | ||
6758 | |||
6759 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
6760 | |||
6761 | { | ||
6762 | char *name; | ||
6763 | |||
6764 | name = parse_str(0); | ||
6765 | data_queue_part_lookup(pc, name, &(current_desc->map.rot.id_center)); | ||
6766 | free(name); | ||
6767 | } | ||
6768 | } | ||
6769 | |||
6770 | /** | ||
6771 | @page edcref | ||
6772 | @property | ||
6773 | x | ||
6774 | @parameters | ||
6775 | [X degrees] | ||
6776 | @effect | ||
6777 | This sets the rotation around the x axis of the part considering | ||
6778 | the center set. In degrees. | ||
6779 | @endproperty | ||
6780 | */ | ||
6781 | static void | ||
6782 | st_collections_group_parts_part_description_map_rotation_x(void) | ||
6783 | { | ||
6784 | check_arg_count(1); | ||
6785 | |||
6786 | current_desc->map.rot.x = FROM_DOUBLE(parse_float(0)); | ||
6787 | } | ||
6788 | |||
6789 | /** | ||
6790 | @page edcref | ||
6791 | @property | ||
6792 | y | ||
6793 | @parameters | ||
6794 | [Y degrees] | ||
6795 | @effect | ||
6796 | This sets the rotation around the u axis of the part considering | ||
6797 | the center set. In degrees. | ||
6798 | @endproperty | ||
6799 | */ | ||
6800 | static void | ||
6801 | st_collections_group_parts_part_description_map_rotation_y(void) | ||
6802 | { | ||
6803 | check_arg_count(1); | ||
6804 | |||
6805 | current_desc->map.rot.y = FROM_DOUBLE(parse_float(0)); | ||
6806 | } | ||
6807 | |||
6808 | /** | ||
6809 | @page edcref | ||
6810 | @property | ||
6811 | z | ||
6812 | @parameters | ||
6813 | [Z degrees] | ||
6814 | @effect | ||
6815 | This sets the rotation around the z axis of the part considering | ||
6816 | the center set. In degrees. | ||
6817 | @endproperty | ||
6818 | */ | ||
6819 | static void | ||
6820 | st_collections_group_parts_part_description_map_rotation_z(void) | ||
6821 | { | ||
6822 | check_arg_count(1); | ||
6823 | |||
6824 | current_desc->map.rot.z = FROM_DOUBLE(parse_float(0)); | ||
6825 | } | ||
6826 | |||
6827 | /** | ||
6828 | @page edcref | ||
6829 | @block | ||
6830 | perspective | ||
6831 | @context | ||
6832 | description { | ||
6833 | .. | ||
6834 | perspective { | ||
6835 | zplane: 0; | ||
6836 | focal: 1000; | ||
6837 | } | ||
6838 | .. | ||
6839 | } | ||
6840 | @description | ||
6841 | Adds focal and plane perspective to the part. Active if perspective_on is true. | ||
6842 | Must be provided if the part is being used by other part as it's perspective target. | ||
6843 | @endblock | ||
6844 | |||
6845 | @property | ||
6846 | zplane | ||
6847 | @parameters | ||
6848 | [unscaled Z value] | ||
6849 | @effect | ||
6850 | This sets the z value that will not be scaled. Normally this is 0 as | ||
6851 | that is the z distance that all objects are at normally. | ||
6852 | @endproperty | ||
6853 | */ | ||
6854 | static void | ||
6855 | st_collections_group_parts_part_description_perspective_zplane(void) | ||
6856 | { | ||
6857 | check_arg_count(1); | ||
6858 | |||
6859 | current_desc->persp.zplane = parse_int(0); | ||
6860 | } | ||
6861 | |||
6862 | |||
6863 | /** | ||
6864 | @page edcref | ||
6865 | @property | ||
6866 | focal | ||
6867 | @parameters | ||
6868 | [distance] | ||
6869 | @effect | ||
6870 | This sets the distance from the focal z plane (zplane) and the | ||
6871 | camera - i.e. very much equating to focal length of the camera | ||
6872 | @endproperty | ||
6873 | */ | ||
6874 | static void | ||
6875 | st_collections_group_parts_part_description_perspective_focal(void) | ||
6876 | { | ||
6877 | check_arg_count(1); | ||
6878 | |||
6879 | current_desc->persp.focal = parse_int_range(0, 1, 0x7fffffff); | ||
6880 | } | ||
6881 | |||
6882 | |||
6883 | /** | ||
6884 | @edcsection{description_params,Params state description sub blocks} | ||
6885 | */ | ||
6886 | |||
6887 | /** | ||
6888 | @page edcref | ||
6889 | @block | ||
6890 | params | ||
6891 | @context | ||
6892 | description { | ||
6893 | .. | ||
6894 | params { | ||
6895 | int: "name" 0; | ||
6896 | double: "other_name" 0.0; | ||
6897 | string: "another_name" "some text"; | ||
6898 | bool: "name" 1; | ||
6899 | choice: "some_name" "value"; | ||
6900 | } | ||
6901 | .. | ||
6902 | } | ||
6903 | @description | ||
6904 | Set parameters for EXTERNAL parts. The value overwrites previous | ||
6905 | definitions with the same name. | ||
6906 | @endblock | ||
6907 | */ | ||
6908 | static void | ||
6909 | _st_collections_group_parts_part_description_params(Edje_External_Param_Type type) | ||
6910 | { | ||
6911 | Edje_Part_Description_External *ed; | ||
6912 | Edje_External_Param *param; | ||
6913 | Eina_List *l; | ||
6914 | const char *name; | ||
6915 | int found = 0; | ||
6916 | |||
6917 | check_arg_count(2); | ||
6918 | |||
6919 | if (current_part->type != EDJE_PART_TYPE_EXTERNAL) | ||
6920 | { | ||
6921 | ERR("%s: Error. parse error %s:%i. " | ||
6922 | "params in non-EXTERNAL part.", | ||
6923 | progname, file_in, line - 1); | ||
6924 | exit(-1); | ||
6925 | } | ||
6926 | |||
6927 | ed = (Edje_Part_Description_External*) current_desc; | ||
6928 | |||
6929 | name = parse_str(0); | ||
6930 | |||
6931 | /* if a param with this name already exists, overwrite it */ | ||
6932 | EINA_LIST_FOREACH(ed->external_params, l, param) | ||
6933 | { | ||
6934 | if (!strcmp(param->name, name)) | ||
6935 | { | ||
6936 | found = 1; | ||
6937 | break; | ||
6938 | } | ||
6939 | } | ||
6940 | |||
6941 | if (!found) | ||
6942 | { | ||
6943 | param = mem_alloc(SZ(Edje_External_Param)); | ||
6944 | param->name = name; | ||
6945 | } | ||
6946 | |||
6947 | param->type = type; | ||
6948 | param->i = 0; | ||
6949 | param->d = 0; | ||
6950 | param->s = NULL; | ||
6951 | |||
6952 | switch (type) | ||
6953 | { | ||
6954 | case EDJE_EXTERNAL_PARAM_TYPE_BOOL: | ||
6955 | case EDJE_EXTERNAL_PARAM_TYPE_INT: | ||
6956 | param->i = parse_int(1); | ||
6957 | break; | ||
6958 | case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: | ||
6959 | param->d = parse_float(1); | ||
6960 | break; | ||
6961 | case EDJE_EXTERNAL_PARAM_TYPE_CHOICE: | ||
6962 | case EDJE_EXTERNAL_PARAM_TYPE_STRING: | ||
6963 | param->s = parse_str(1); | ||
6964 | break; | ||
6965 | default: | ||
6966 | ERR("%s: Error. parse error %s:%i. Invalid param type.\n", | ||
6967 | progname, file_in, line - 1); | ||
6968 | break; | ||
6969 | } | ||
6970 | |||
6971 | if (!found) | ||
6972 | ed->external_params = eina_list_append(ed->external_params, param); | ||
6973 | } | ||
6974 | |||
6975 | /** | ||
6976 | @page edcref | ||
6977 | @property | ||
6978 | int | ||
6979 | @parameters | ||
6980 | [param_name] [int_value] | ||
6981 | @effect | ||
6982 | Adds an integer parameter for an external object | ||
6983 | @endproperty | ||
6984 | */ | ||
6985 | static void | ||
6986 | st_collections_group_parts_part_description_params_int(void) | ||
6987 | { | ||
6988 | _st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_INT); | ||
6989 | } | ||
6990 | |||
6991 | /** | ||
6992 | @page edcref | ||
6993 | @property | ||
6994 | double | ||
6995 | @parameters | ||
6996 | [param_name] [double_value] | ||
6997 | @effect | ||
6998 | Adds a double parameter for an external object | ||
6999 | @endproperty | ||
7000 | */ | ||
7001 | static void | ||
7002 | st_collections_group_parts_part_description_params_double(void) | ||
7003 | { | ||
7004 | _st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_DOUBLE); | ||
7005 | } | ||
7006 | |||
7007 | /** | ||
7008 | @page edcref | ||
7009 | @property | ||
7010 | string | ||
7011 | @parameters | ||
7012 | [param_name] [string_value] | ||
7013 | @effect | ||
7014 | Adds a string parameter for an external object | ||
7015 | @endproperty | ||
7016 | */ | ||
7017 | static void | ||
7018 | st_collections_group_parts_part_description_params_string(void) | ||
7019 | { | ||
7020 | _st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_STRING); | ||
7021 | } | ||
7022 | |||
7023 | /** | ||
7024 | @page edcref | ||
7025 | @property | ||
7026 | bool | ||
7027 | @parameters | ||
7028 | [param_name] [bool_value] | ||
7029 | @effect | ||
7030 | Adds an boolean parameter for an external object. Value must be 0 or 1. | ||
7031 | @endproperty | ||
7032 | */ | ||
7033 | static void | ||
7034 | st_collections_group_parts_part_description_params_bool(void) | ||
7035 | { | ||
7036 | _st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_BOOL); | ||
7037 | } | ||
7038 | |||
7039 | /** | ||
7040 | @page edcref | ||
7041 | @property | ||
7042 | choice | ||
7043 | @parameters | ||
7044 | [param_name] [choice_string] | ||
7045 | @effect | ||
7046 | Adds a choice parameter for an external object. The possible | ||
7047 | choice values are defined by external type at their register time | ||
7048 | and will be validated at runtime. | ||
7049 | @endproperty | ||
7050 | */ | ||
7051 | static void | ||
7052 | st_collections_group_parts_part_description_params_choice(void) | ||
7053 | { | ||
7054 | _st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_CHOICE); | ||
7055 | } | ||
7056 | |||
7057 | |||
7058 | /** | ||
7059 | @edcsection{program, Program block} | ||
7060 | */ | ||
7061 | |||
7062 | /** | ||
7063 | @page edcref | ||
7064 | @block | ||
7065 | program | ||
7066 | @context | ||
7067 | group { | ||
7068 | programs { | ||
7069 | .. | ||
7070 | program { | ||
7071 | name: "programname"; | ||
7072 | signal: "signalname"; | ||
7073 | source: "partname"; | ||
7074 | filter: "partname" "statename"; | ||
7075 | in: 0.3 0.0; | ||
7076 | action: STATE_SET "statename" state_value; | ||
7077 | transition: LINEAR 0.5; | ||
7078 | target: "partname"; | ||
7079 | target: "anotherpart"; | ||
7080 | after: "programname"; | ||
7081 | after: "anotherprogram"; | ||
7082 | } | ||
7083 | .. | ||
7084 | } | ||
7085 | } | ||
7086 | @description | ||
7087 | Programs define how your interface reacts to events. | ||
7088 | Programs can change the state of parts, react to events or trigger | ||
7089 | other events. | ||
7090 | @endblock | ||
7091 | */ | ||
7092 | static void | ||
7093 | ob_collections_group_programs_program(void) | ||
7094 | { | ||
7095 | Edje_Part_Collection *pc; | ||
7096 | Edje_Program *ep; | ||
7097 | Edje_Program_Parser *epp; | ||
7098 | |||
7099 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7100 | |||
7101 | ep = mem_alloc(SZ(Edje_Program_Parser)); | ||
7102 | ep->id = -1; | ||
7103 | ep->tween.mode = EDJE_TWEEN_MODE_LINEAR; | ||
7104 | ep->after = NULL; | ||
7105 | epp = (Edje_Program_Parser *)ep; | ||
7106 | epp->can_override = EINA_FALSE; | ||
7107 | |||
7108 | _edje_program_insert(pc, ep); | ||
7109 | |||
7110 | current_program = ep; | ||
7111 | } | ||
7112 | |||
7113 | /** | ||
7114 | @page edcref | ||
7115 | @property | ||
7116 | name | ||
7117 | @parameters | ||
7118 | [program name] | ||
7119 | @effect | ||
7120 | Symbolic name of program as a unique identifier. | ||
7121 | @endproperty | ||
7122 | */ | ||
7123 | static void | ||
7124 | st_collections_group_programs_program_name(void) | ||
7125 | { | ||
7126 | Edje_Part_Collection *pc; | ||
7127 | |||
7128 | check_arg_count(1); | ||
7129 | |||
7130 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7131 | current_program->name = parse_str(0); | ||
7132 | |||
7133 | _edje_program_check(current_program->name, current_program, pc->programs.fnmatch, pc->programs.fnmatch_count); | ||
7134 | _edje_program_check(current_program->name, current_program, pc->programs.strcmp, pc->programs.strcmp_count); | ||
7135 | _edje_program_check(current_program->name, current_program, pc->programs.strncmp, pc->programs.strncmp_count); | ||
7136 | _edje_program_check(current_program->name, current_program, pc->programs.strrncmp, pc->programs.strrncmp_count); | ||
7137 | _edje_program_check(current_program->name, current_program, pc->programs.nocmp, pc->programs.nocmp_count); | ||
7138 | } | ||
7139 | |||
7140 | /** | ||
7141 | @page edcref | ||
7142 | @property | ||
7143 | signal | ||
7144 | @parameters | ||
7145 | [signal name] | ||
7146 | @effect | ||
7147 | Specifies signal(s) that should cause the program to run. The signal | ||
7148 | received must match the specified source to run. | ||
7149 | Signals may be globbed, but only one signal keyword per program | ||
7150 | may be used. ex: signal: "mouse,clicked,*"; (clicking any mouse button | ||
7151 | that matches source starts program). | ||
7152 | @endproperty | ||
7153 | */ | ||
7154 | static void | ||
7155 | st_collections_group_programs_program_signal(void) | ||
7156 | { | ||
7157 | Edje_Part_Collection *pc; | ||
7158 | |||
7159 | check_arg_count(1); | ||
7160 | |||
7161 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7162 | |||
7163 | _edje_program_remove(pc, current_program); | ||
7164 | current_program->signal = parse_str(0); | ||
7165 | _edje_program_insert(pc, current_program); | ||
7166 | } | ||
7167 | |||
7168 | /** | ||
7169 | @page edcref | ||
7170 | @property | ||
7171 | source | ||
7172 | @parameters | ||
7173 | [source name] | ||
7174 | @effect | ||
7175 | Source of accepted signal. Sources may be globbed, but only one source | ||
7176 | keyword per program may be used. ex:source: "button-*"; (Signals from | ||
7177 | any part or program named "button-*" are accepted). | ||
7178 | @endproperty | ||
7179 | */ | ||
7180 | static void | ||
7181 | st_collections_group_programs_program_source(void) | ||
7182 | { | ||
7183 | Edje_Part_Collection *pc; | ||
7184 | |||
7185 | check_arg_count(1); | ||
7186 | |||
7187 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7188 | |||
7189 | _edje_program_remove(pc, current_program); | ||
7190 | current_program->source = parse_str(0); | ||
7191 | _edje_program_insert(pc, current_program); | ||
7192 | } | ||
7193 | |||
7194 | /** | ||
7195 | @page edcref | ||
7196 | @property | ||
7197 | filter | ||
7198 | @parameters | ||
7199 | [part] [state] | ||
7200 | @effect | ||
7201 | Filter signals to be only accepted if the part [part] is in state named [state]. | ||
7202 | Only one filter per program can be used. If [state] is not given, the source of | ||
7203 | the event will be used instead. | ||
7204 | @endproperty | ||
7205 | */ | ||
7206 | static void | ||
7207 | st_collections_group_programs_program_filter(void) | ||
7208 | { | ||
7209 | check_min_arg_count(1); | ||
7210 | |||
7211 | if(is_param(1)) { | ||
7212 | current_program->filter.part = parse_str(0); | ||
7213 | current_program->filter.state = parse_str(1); | ||
7214 | } else { | ||
7215 | current_program->filter.state = parse_str(0); | ||
7216 | } | ||
7217 | } | ||
7218 | |||
7219 | /** | ||
7220 | @page edcref | ||
7221 | @property | ||
7222 | in | ||
7223 | @parameters | ||
7224 | [from] [range] | ||
7225 | @effect | ||
7226 | Wait 'from' seconds before executing the program. And add a random | ||
7227 | number of seconds (from 0 to 'range') to the total waiting time. | ||
7228 | @endproperty | ||
7229 | */ | ||
7230 | static void | ||
7231 | st_collections_group_programs_program_in(void) | ||
7232 | { | ||
7233 | check_arg_count(2); | ||
7234 | |||
7235 | current_program->in.from = parse_float_range(0, 0.0, 999999999.0); | ||
7236 | current_program->in.range = parse_float_range(1, 0.0, 999999999.0); | ||
7237 | } | ||
7238 | |||
7239 | #ifdef ENABLE_MULTISENSE | ||
7240 | /* add to docs below | ||
7241 | , PLAY_SAMPLE, PLAY_TONE | ||
7242 | |||
7243 | action: PLAY_SAMPLE "sample name";\n | ||
7244 | action: PLAY_TONE "tone name" duration in seconds ( Range 0.1 to 10.0 );\n | ||
7245 | */ | ||
7246 | #endif | ||
7247 | |||
7248 | /** | ||
7249 | @page edcref | ||
7250 | @property | ||
7251 | action | ||
7252 | @parameters | ||
7253 | [type] [param1] [param2] | ||
7254 | @effect | ||
7255 | Action to be performed by the program. Valid actions are: STATE_SET, | ||
7256 | ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE, | ||
7257 | FOCUS_SET, PARAM_COPY, PARAM_SET | ||
7258 | Only one action can be specified per program. Examples:\n | ||
7259 | action: STATE_SET "statename" 0.5;\n | ||
7260 | action: ACTION_STOP;\n | ||
7261 | action: SIGNAL_EMIT "signalname" "emitter";\n | ||
7262 | action: DRAG_VAL_SET 0.5 0.0;\n | ||
7263 | action: DRAG_VAL_STEP 1.0 0.0;\n | ||
7264 | action: DRAG_VAL_PAGE 0.0 0.0;\n | ||
7265 | action: FOCUS_SET;\n | ||
7266 | action: FOCUS_OBJECT;\n | ||
7267 | action: PARAM_COPY "src_part" "src_param" "dst_part" "dst_param";\n | ||
7268 | action: PARAM_SET "part" "param" "value";\n | ||
7269 | @endproperty | ||
7270 | */ | ||
7271 | static void | ||
7272 | st_collections_group_programs_program_action(void) | ||
7273 | { | ||
7274 | Edje_Part_Collection *pc; | ||
7275 | Edje_Program *ep; | ||
7276 | |||
7277 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7278 | ep = current_program; | ||
7279 | ep->action = parse_enum(0, | ||
7280 | "STATE_SET", EDJE_ACTION_TYPE_STATE_SET, | ||
7281 | "ACTION_STOP", EDJE_ACTION_TYPE_ACTION_STOP, | ||
7282 | "SIGNAL_EMIT", EDJE_ACTION_TYPE_SIGNAL_EMIT, | ||
7283 | "DRAG_VAL_SET", EDJE_ACTION_TYPE_DRAG_VAL_SET, | ||
7284 | "DRAG_VAL_STEP", EDJE_ACTION_TYPE_DRAG_VAL_STEP, | ||
7285 | "DRAG_VAL_PAGE", EDJE_ACTION_TYPE_DRAG_VAL_PAGE, | ||
7286 | "SCRIPT", EDJE_ACTION_TYPE_SCRIPT, | ||
7287 | "FOCUS_SET", EDJE_ACTION_TYPE_FOCUS_SET, | ||
7288 | "FOCUS_OBJECT", EDJE_ACTION_TYPE_FOCUS_OBJECT, | ||
7289 | "PARAM_COPY", EDJE_ACTION_TYPE_PARAM_COPY, | ||
7290 | "PARAM_SET", EDJE_ACTION_TYPE_PARAM_SET, | ||
7291 | #ifdef ENABLE_MULTISENSE | ||
7292 | "PLAY_SAMPLE", EDJE_ACTION_TYPE_SOUND_SAMPLE, | ||
7293 | "PLAY_TONE", EDJE_ACTION_TYPE_SOUND_TONE, | ||
7294 | #endif | ||
7295 | NULL); | ||
7296 | if (ep->action == EDJE_ACTION_TYPE_STATE_SET) | ||
7297 | { | ||
7298 | ep->state = parse_str(1); | ||
7299 | ep->value = parse_float_range(2, 0.0, 1.0); | ||
7300 | } | ||
7301 | else if (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT) | ||
7302 | { | ||
7303 | ep->state = parse_str(1); | ||
7304 | ep->state2 = parse_str(2); | ||
7305 | } | ||
7306 | #ifdef ENABLE_MULTISENSE | ||
7307 | else if (ep->action == EDJE_ACTION_TYPE_SOUND_SAMPLE) | ||
7308 | { | ||
7309 | int i; | ||
7310 | |||
7311 | ep->sample_name = parse_str(1); | ||
7312 | for (i = 0; i < (int)edje_file->sound_dir->samples_count; i++) | ||
7313 | { | ||
7314 | if (!strcmp(edje_file->sound_dir->samples[i].name, ep->sample_name)) | ||
7315 | break; | ||
7316 | if (i == (int)(edje_file->sound_dir->samples_count - 1)) | ||
7317 | { | ||
7318 | ERR("%s: Error. No Sample name %s exist.", progname, | ||
7319 | ep->sample_name); | ||
7320 | exit(-1); | ||
7321 | } | ||
7322 | } | ||
7323 | ep->speed = parse_float_range(2, 0.0, 10.0); | ||
7324 | } | ||
7325 | else if (ep->action == EDJE_ACTION_TYPE_SOUND_TONE) | ||
7326 | { | ||
7327 | int i; | ||
7328 | |||
7329 | ep->tone_name = parse_str(1); | ||
7330 | for (i = 0; i < (int)edje_file->sound_dir->tones_count; i++) | ||
7331 | { | ||
7332 | if (!strcmp(edje_file->sound_dir->tones[i].name, ep->tone_name)) | ||
7333 | break; | ||
7334 | if (i == (int)(edje_file->sound_dir->tones_count - 1)) | ||
7335 | { | ||
7336 | ERR("%s: Error. No Tone name %s exist.", progname, | ||
7337 | ep->tone_name); | ||
7338 | exit(-1); | ||
7339 | } | ||
7340 | } | ||
7341 | ep->duration = parse_float_range(2, 0.1, 10.0); | ||
7342 | } | ||
7343 | #endif | ||
7344 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET) | ||
7345 | { | ||
7346 | ep->value = parse_float(1); | ||
7347 | ep->value2 = parse_float(2); | ||
7348 | } | ||
7349 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP) | ||
7350 | { | ||
7351 | ep->value = parse_float(1); | ||
7352 | ep->value2 = parse_float(2); | ||
7353 | } | ||
7354 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE) | ||
7355 | { | ||
7356 | ep->value = parse_float(1); | ||
7357 | ep->value2 = parse_float(2); | ||
7358 | } | ||
7359 | else if (ep->action == EDJE_ACTION_TYPE_PARAM_COPY) | ||
7360 | { | ||
7361 | char *src_part, *dst_part; | ||
7362 | |||
7363 | src_part = parse_str(1); | ||
7364 | ep->state = parse_str(2); | ||
7365 | dst_part = parse_str(3); | ||
7366 | ep->state2 = parse_str(4); | ||
7367 | |||
7368 | data_queue_part_lookup(pc, src_part, &(ep->param.src)); | ||
7369 | data_queue_part_lookup(pc, dst_part, &(ep->param.dst)); | ||
7370 | |||
7371 | free(src_part); | ||
7372 | free(dst_part); | ||
7373 | } | ||
7374 | else if (ep->action == EDJE_ACTION_TYPE_PARAM_SET) | ||
7375 | { | ||
7376 | char *part; | ||
7377 | |||
7378 | part = parse_str(1); | ||
7379 | ep->state = parse_str(2); | ||
7380 | ep->state2 = parse_str(3); | ||
7381 | |||
7382 | data_queue_part_lookup(pc, part, &(ep->param.dst)); | ||
7383 | free(part); | ||
7384 | } | ||
7385 | |||
7386 | switch (ep->action) | ||
7387 | { | ||
7388 | case EDJE_ACTION_TYPE_ACTION_STOP: | ||
7389 | check_arg_count(1); | ||
7390 | break; | ||
7391 | case EDJE_ACTION_TYPE_SCRIPT: | ||
7392 | /* this is implicitly set by script {} so this is here just for | ||
7393 | * completeness */ | ||
7394 | break; | ||
7395 | case EDJE_ACTION_TYPE_FOCUS_OBJECT: | ||
7396 | case EDJE_ACTION_TYPE_FOCUS_SET: | ||
7397 | check_arg_count(1); | ||
7398 | break; | ||
7399 | case EDJE_ACTION_TYPE_PARAM_COPY: | ||
7400 | check_arg_count(5); | ||
7401 | break; | ||
7402 | case EDJE_ACTION_TYPE_PARAM_SET: | ||
7403 | check_arg_count(4); | ||
7404 | break; | ||
7405 | #ifdef ENABLE_MULTISENSE | ||
7406 | case EDJE_ACTION_TYPE_SOUND_SAMPLE: | ||
7407 | check_arg_count(3); | ||
7408 | break; | ||
7409 | case EDJE_ACTION_TYPE_SOUND_TONE: | ||
7410 | check_arg_count(3); | ||
7411 | break; | ||
7412 | #endif | ||
7413 | default: | ||
7414 | check_arg_count(3); | ||
7415 | } | ||
7416 | } | ||
7417 | |||
7418 | /** | ||
7419 | @page edcref | ||
7420 | @property | ||
7421 | transition | ||
7422 | @parameters | ||
7423 | [type] [length] [[interp val 1]] [[interp val 2]] [[option]] | ||
7424 | @effect | ||
7425 | Defines how transitions occur using STATE_SET action.\n | ||
7426 | Where 'type' is the style of the transition and 'length' is a double | ||
7427 | specifying the number of seconds in which to preform the transition.\n | ||
7428 | Valid types are: LIN or LINEAR, SIN or SINUSOIDAL, | ||
7429 | ACCEL or ACCELERATE, DECEL or DECELERATE, | ||
7430 | ACCEL_FAC or ACCELERATE_FACTOR, DECEL_FAC or DECELERATE_FACTOR, | ||
7431 | SIN_FAC or SINUSOIDAL_FACTOR, DIVIS or DIVISOR_INTERP, | ||
7432 | BOUNCE, SPRING. | ||
7433 | |||
7434 | ACCEL_FAC, DECEL_FAC and SIN_FAC need the extra optional | ||
7435 | "interp val 1" to determine the "factor" of curviness. 1.0 is the same | ||
7436 | as their non-factor counterparts, where 0.0 is equal to linear. | ||
7437 | numbers higher than one make the curve angles steeper with a more | ||
7438 | prnounced curve point. | ||
7439 | |||
7440 | DIVIS, BOUNCE and SPRING also require "interp val 2" in addition | ||
7441 | to "interp val 1". | ||
7442 | |||
7443 | DIVIS uses val 1 as the initial graident start | ||
7444 | (0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the | ||
7445 | gradient of linear etc.). val 2 is interpreted as an integer factor | ||
7446 | defining how much the value swings "outside" the gradient only to come | ||
7447 | back to the final resting spot at the end. 0.0 for val 2 is equivalent | ||
7448 | to linear interpolation. Note that DIVIS can exceed 1.0 | ||
7449 | |||
7450 | BOUNCE uses val 2 as the number of bounces (so its rounded down to | ||
7451 | the nearest integer value), with val 2 determining how much the | ||
7452 | bounce decays, with 0.0 giving linear decay per bounce, and higher | ||
7453 | values giving much more decay. | ||
7454 | |||
7455 | SPRING is similar to bounce, where val 2 specifies the number of | ||
7456 | spring "swings" and val 1 specifies the decay, but it can exceed 1.0 | ||
7457 | on the outer swings. | ||
7458 | |||
7459 | Valid option is CURRENT. | ||
7460 | |||
7461 | CURRENT is the option which causes the edje object to move from its current position. | ||
7462 | It can be used as the last parameter of any transition type. (@since 1.1.0) | ||
7463 | |||
7464 | @endproperty | ||
7465 | */ | ||
7466 | static void | ||
7467 | st_collections_group_programs_program_transition(void) | ||
7468 | { | ||
7469 | check_min_arg_count(2); | ||
7470 | |||
7471 | current_program->tween.mode = parse_enum(0, | ||
7472 | // short names | ||
7473 | "LIN", EDJE_TWEEN_MODE_LINEAR, | ||
7474 | "SIN", EDJE_TWEEN_MODE_SINUSOIDAL, | ||
7475 | "ACCEL", EDJE_TWEEN_MODE_ACCELERATE, | ||
7476 | "DECEL", EDJE_TWEEN_MODE_DECELERATE, | ||
7477 | "ACCEL_FAC", EDJE_TWEEN_MODE_ACCELERATE_FACTOR, | ||
7478 | "DECEL_FAC", EDJE_TWEEN_MODE_DECELERATE_FACTOR, | ||
7479 | "SIN_FAC", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR, | ||
7480 | "DIVIS", EDJE_TWEEN_MODE_DIVISOR_INTERP, | ||
7481 | |||
7482 | // long/full names | ||
7483 | "LINEAR", EDJE_TWEEN_MODE_LINEAR, | ||
7484 | "SINUSOIDAL", EDJE_TWEEN_MODE_SINUSOIDAL, | ||
7485 | "ACCELERATE", EDJE_TWEEN_MODE_ACCELERATE, | ||
7486 | "DECELERATE", EDJE_TWEEN_MODE_DECELERATE, | ||
7487 | "ACCELERATE_FACTOR", EDJE_TWEEN_MODE_ACCELERATE_FACTOR, | ||
7488 | "DECELERATE_FACTOR", EDJE_TWEEN_MODE_DECELERATE_FACTOR, | ||
7489 | "SINUSOIDAL_FACTOR", EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR, | ||
7490 | "DIVISOR_INTERP", EDJE_TWEEN_MODE_DIVISOR_INTERP, | ||
7491 | |||
7492 | // long/full is short enough | ||
7493 | "BOUNCE", EDJE_TWEEN_MODE_BOUNCE, | ||
7494 | "SPRING", EDJE_TWEEN_MODE_SPRING, | ||
7495 | NULL); | ||
7496 | current_program->tween.time = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0)); | ||
7497 | if ((current_program->tween.mode >= EDJE_TWEEN_MODE_LINEAR) && | ||
7498 | (current_program->tween.mode <= EDJE_TWEEN_MODE_DECELERATE)) | ||
7499 | { | ||
7500 | if ((get_arg_count() == 3) && (!strcmp(parse_str(2), "CURRENT"))) | ||
7501 | current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; | ||
7502 | else if (get_arg_count() != 2) | ||
7503 | { | ||
7504 | ERR("%s: Error. parse error %s:%i. " | ||
7505 | "Need 2rd parameter to set time", | ||
7506 | progname, file_in, line - 1); | ||
7507 | exit(-1); | ||
7508 | } | ||
7509 | } | ||
7510 | // the following need v1 | ||
7511 | // EDJE_TWEEN_MODE_ACCELERATE_FACTOR | ||
7512 | // EDJE_TWEEN_MODE_DECELERATE_FACTOR | ||
7513 | // EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR | ||
7514 | // current_program->tween.v1 | ||
7515 | else if ((current_program->tween.mode >= EDJE_TWEEN_MODE_ACCELERATE_FACTOR) && | ||
7516 | (current_program->tween.mode <= EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR)) | ||
7517 | { | ||
7518 | if ((get_arg_count() == 4) && (!strcmp(parse_str(3), "CURRENT"))) | ||
7519 | current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; | ||
7520 | else if (get_arg_count() != 3) | ||
7521 | { | ||
7522 | ERR("%s: Error. parse error %s:%i. " | ||
7523 | "Need 3rd parameter to set factor", | ||
7524 | progname, file_in, line - 1); | ||
7525 | exit(-1); | ||
7526 | } | ||
7527 | current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0)); | ||
7528 | } | ||
7529 | // the followjng also need v2 | ||
7530 | // EDJE_TWEEN_MODE_DIVISOR_INTERP | ||
7531 | // EDJE_TWEEN_MODE_BOUNCE | ||
7532 | // EDJE_TWEEN_MODE_SPRING | ||
7533 | // current_program->tween.v2 | ||
7534 | else if ((current_program->tween.mode >= EDJE_TWEEN_MODE_DIVISOR_INTERP) && | ||
7535 | (current_program->tween.mode <= EDJE_TWEEN_MODE_SPRING)) | ||
7536 | { | ||
7537 | if ((get_arg_count() == 5) && (!strcmp(parse_str(4), "CURRENT"))) | ||
7538 | current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; | ||
7539 | else if (get_arg_count() != 4) | ||
7540 | { | ||
7541 | ERR("%s: Error. parse error %s:%i. " | ||
7542 | "Need 3rd and 4th parameters to set factor and counts", | ||
7543 | progname, file_in, line - 1); | ||
7544 | exit(-1); | ||
7545 | } | ||
7546 | current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0)); | ||
7547 | current_program->tween.v2 = FROM_DOUBLE(parse_float_range(3, 0.0, 999999999.0)); | ||
7548 | } | ||
7549 | } | ||
7550 | |||
7551 | /** | ||
7552 | @page edcref | ||
7553 | @property | ||
7554 | target | ||
7555 | @parameters | ||
7556 | [target] | ||
7557 | @effect | ||
7558 | Program or part on which the specified action acts. Multiple target | ||
7559 | keywords may be specified, one per target. SIGNAL_EMITs do not have | ||
7560 | targets. | ||
7561 | @endproperty | ||
7562 | */ | ||
7563 | static void | ||
7564 | st_collections_group_programs_program_target(void) | ||
7565 | { | ||
7566 | Edje_Part_Collection *pc; | ||
7567 | Edje_Program *ep; | ||
7568 | |||
7569 | check_arg_count(1); | ||
7570 | |||
7571 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7572 | ep = current_program; | ||
7573 | { | ||
7574 | Edje_Program_Target *et; | ||
7575 | Edje_Program_Target *etw; | ||
7576 | Eina_List *l; | ||
7577 | char *name; | ||
7578 | char *copy; | ||
7579 | |||
7580 | name = parse_str(0); | ||
7581 | |||
7582 | EINA_LIST_FOREACH(ep->targets, l, etw) | ||
7583 | { | ||
7584 | if (!strcmp(name, (char*) (etw + 1))) | ||
7585 | { | ||
7586 | free(name); | ||
7587 | return; | ||
7588 | } | ||
7589 | } | ||
7590 | |||
7591 | et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1); | ||
7592 | ep->targets = eina_list_append(ep->targets, et); | ||
7593 | copy = (char*) (et + 1); | ||
7594 | |||
7595 | memcpy(copy, name, strlen(name) + 1); | ||
7596 | |||
7597 | if (ep->action == EDJE_ACTION_TYPE_STATE_SET) | ||
7598 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7599 | else if (ep->action == EDJE_ACTION_TYPE_ACTION_STOP) | ||
7600 | data_queue_program_lookup(pc, name, &(et->id)); | ||
7601 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET) | ||
7602 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7603 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP) | ||
7604 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7605 | else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE) | ||
7606 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7607 | else if (ep->action == EDJE_ACTION_TYPE_FOCUS_SET) | ||
7608 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7609 | else if (ep->action == EDJE_ACTION_TYPE_FOCUS_OBJECT) | ||
7610 | data_queue_part_lookup(pc, name, &(et->id)); | ||
7611 | else | ||
7612 | { | ||
7613 | ERR("%s: Error. parse error %s:%i. " | ||
7614 | "target may only be used after action", | ||
7615 | progname, file_in, line - 1); | ||
7616 | exit(-1); | ||
7617 | } | ||
7618 | free(name); | ||
7619 | } | ||
7620 | } | ||
7621 | |||
7622 | /** | ||
7623 | @page edcref | ||
7624 | @property | ||
7625 | after | ||
7626 | @parameters | ||
7627 | [after] | ||
7628 | @effect | ||
7629 | Specifies a program to run after the current program completes. The | ||
7630 | source and signal parameters of a program run as an "after" are ignored. | ||
7631 | Multiple "after" statements can be specified per program. | ||
7632 | @endproperty | ||
7633 | */ | ||
7634 | static void | ||
7635 | st_collections_group_programs_program_after(void) | ||
7636 | { | ||
7637 | Edje_Part_Collection *pc; | ||
7638 | Edje_Program *ep; | ||
7639 | |||
7640 | check_arg_count(1); | ||
7641 | |||
7642 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7643 | ep = current_program; | ||
7644 | { | ||
7645 | Edje_Program_After *pa; | ||
7646 | char *name; | ||
7647 | |||
7648 | name = parse_str(0); | ||
7649 | |||
7650 | pa = mem_alloc(SZ(Edje_Program_After)); | ||
7651 | pa->id = -1; | ||
7652 | ep->after = eina_list_append(ep->after, pa); | ||
7653 | |||
7654 | data_queue_program_lookup(pc, name, &(pa->id)); | ||
7655 | free(name); | ||
7656 | } | ||
7657 | } | ||
7658 | |||
7659 | /** | ||
7660 | @page edcref | ||
7661 | @property | ||
7662 | api | ||
7663 | @parameters | ||
7664 | [name] [description] | ||
7665 | @effect | ||
7666 | Specifies a hint to let applications (or IDE's) know how to bind | ||
7667 | things. The parameter name should contain the name of the function that | ||
7668 | the application should use, and description describes how it should | ||
7669 | be used. | ||
7670 | @endproperty | ||
7671 | */ | ||
7672 | static void | ||
7673 | st_collections_group_programs_program_api(void) | ||
7674 | { | ||
7675 | check_min_arg_count(1); | ||
7676 | |||
7677 | current_program->api.name = parse_str(0); | ||
7678 | |||
7679 | if (is_param(1)) | ||
7680 | { | ||
7681 | check_arg_count(2); | ||
7682 | current_program->api.description = parse_str(1); | ||
7683 | } | ||
7684 | } | ||
7685 | |||
7686 | static void | ||
7687 | st_collections_group_parts_part_api(void) | ||
7688 | { | ||
7689 | check_min_arg_count(1); | ||
7690 | |||
7691 | current_part->api.name = parse_str(0); | ||
7692 | if (is_param(1)) | ||
7693 | { | ||
7694 | check_arg_count(2); | ||
7695 | current_part->api.description = parse_str(1); | ||
7696 | } | ||
7697 | } | ||
7698 | |||
7699 | static void | ||
7700 | ob_collections_group_programs_program_script(void) | ||
7701 | { | ||
7702 | Edje_Part_Collection *pc; | ||
7703 | Code *cd; | ||
7704 | |||
7705 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7706 | cd = eina_list_data_get(eina_list_last(codes)); | ||
7707 | |||
7708 | if (!is_verbatim()) track_verbatim(1); | ||
7709 | else | ||
7710 | { | ||
7711 | Eina_Bool empty = EINA_TRUE; | ||
7712 | char *s; | ||
7713 | int i, len; | ||
7714 | |||
7715 | s = get_verbatim(); | ||
7716 | if (s) | ||
7717 | { | ||
7718 | Code_Program *cp; | ||
7719 | |||
7720 | /* FIXME: Need to store the script somewhere to be restored when using edje_edit API */ | ||
7721 | cp = mem_alloc(SZ(Code_Program)); | ||
7722 | cp->l1 = get_verbatim_line1(); | ||
7723 | cp->l2 = get_verbatim_line2(); | ||
7724 | cp->script = s; | ||
7725 | cp->original = strdup(s); | ||
7726 | if (cd->shared && cd->is_lua) | ||
7727 | { | ||
7728 | ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group", | ||
7729 | progname, file_in, line - 1); | ||
7730 | exit(-1); | ||
7731 | } | ||
7732 | cd->is_lua = 0; | ||
7733 | |||
7734 | len = strlen(cp->script); | ||
7735 | for (i = 0; i < len; i++) | ||
7736 | { | ||
7737 | if (((cp->script[i] > 'a') && (cp->script[i] < 'z')) || | ||
7738 | ((cp->script[i] > 'A') && (cp->script[i] < 'Z')) || | ||
7739 | ((cp->script[i] > '0') && (cp->script[i] < '9'))) | ||
7740 | empty = EINA_FALSE; | ||
7741 | } | ||
7742 | |||
7743 | if (!empty) | ||
7744 | { | ||
7745 | cd->programs = eina_list_append(cd->programs, cp); | ||
7746 | data_queue_anonymous_lookup(pc, current_program, &(cp->id)); | ||
7747 | current_program->action = EDJE_ACTION_TYPE_SCRIPT; | ||
7748 | } | ||
7749 | else | ||
7750 | { | ||
7751 | data_queue_anonymous_lookup(pc, current_program, NULL); | ||
7752 | free(cp); | ||
7753 | cp = NULL; | ||
7754 | } | ||
7755 | |||
7756 | set_verbatim(NULL, 0, 0); | ||
7757 | } | ||
7758 | } | ||
7759 | } | ||
7760 | /** | ||
7761 | @page edcref | ||
7762 | </table> | ||
7763 | */ | ||