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