You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

9386 lines
287 KiB

/*
Concerning the EDC reference:
The formatting for blocks and properties has been implemented as a table
which is filled using ALIASES.
For maximum flexibility I implemented them in the \@code/\@encode style,
this means that missing one or changing the order most certainly cause
formatting errors.
\@block
block name
\@context
code sample of the block
\@description
the block's description
\@endblock
\@property
property name
\@parameters
property's parameter list
\@effect
the property description (lol)
\@endproperty
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include "edje_cc.h"
/**
* @page edcref Edje Data Collection reference
* An Edje Data Collection, it's a plain text file (normally identified with the
* .edc extension), consisting of instructions for the Edje Compiler.
*
* The syntax for the edje data collection files follows a simple structure of
* "blocks { .. }" that can contain "properties: ..", more blocks, or both.
*
* @anchor sec_quickaccess Quick access to block descriptions:
* <ul>
* <li>@ref sec_toplevel "Top-Level"</li>
* <ul>
* <li>@ref sec_toplevel_externals "Externals"</li>
* <li>@ref sec_toplevel_images "Images"</li>
* <ul>
* <li>@ref sec_toplevel_images_set "Set"</li>
* <ul>
* <li>@ref sec_toplevel_images_image "Image"</li>
* </ul>
* </ul>
* <li>@ref sec_toplevel_fonts "Fonts"</li>
* <li>@ref sec_toplevel_data "Data"</li>
* <li>@ref sec_toplevel_color_classes "Color Classes"</li>
* <li>@ref sec_toplevel_styles "Styles"</li>
* </ul>
* <li>@ref sec_collections "Collections"</li>
* <ul>
* <li>@ref sec_collections_sounds "Sounds"</li>
* <ul>
* <li>@ref sec_collections_sounds_sample "Sample"</li>
* </ul>
* <li>@ref sec_collections_group "Group"</li>
* <ul>
* <li>@ref sec_collections_group_script "Script"</li>
* <li>@ref sec_collections_group_limits "Limits"</li>
* <li>@ref sec_toplevel_data "Data"</li>
* <li>@ref sec_collections_group_parts "Parts"</li>
* <ul>
* <li>@ref sec_collections_group_parts_part "Part"</li>
* <ul>
* <li>@ref sec_collections_group_parts_dragable "Dragable"</li>
* <li>@ref sec_collections_group_parts_items "Items"</li>
* <li>@ref sec_collections_group_parts_description "Description"</li>
* <ul>
* <li>@ref sec_collections_group_parts_description_relatives "Relatives (rel1/rel2)"</li>
* <li>@ref sec_collections_group_parts_description_image "Image"</li>
* <ul>
* <li>@ref sec_collections_group_parts_description_image_fill "Fill"</li>
* <ul>
* <li>@ref sec_collections_group_parts_description_image_fill_origin "Origin"</li>
* <li>@ref sec_collections_group_parts_description_image_fill_size "Size"</li>
* </ul>
* </ul>
* <li>@ref sec_collections_group_parts_description_text "Text"</li>
* <li>@ref sec_collections_group_parts_description_box "Box"</li>
* <ul>
* <li>@ref sec_collections_group_parts_items "Items"</li>
* </ul>
* <li>@ref sec_collections_group_parts_description_table "Table"</li>
* <li>@ref sec_collections_group_parts_description_physics "Physics"</li>
* <ul>
* <li>@ref sec_collections_group_parts_description_physics_movement_freedom "Movement Freedom"</li>
* <li>@ref sec_collections_group_parts_description_physics_faces "Faces"</li>
* </ul>
* <li>@ref sec_collections_group_parts_description_map "Map (3d/transformations)"</li>
* <ul>
* <li>@ref sec_collections_group_parts_description_map_rotation "Rotation"</li>
* </ul>
* <li>@ref sec_collections_group_parts_description_perspective "Perspective"</li>
* <li>@ref sec_collections_group_parts_descriptions_params "Params"</li>
* </ul>
* </ul>
* </ul>
* <li>@ref sec_collections_group_programs "Programs"</li>
* <ul>
* <li>@ref sec_collections_group_script "Script"</li>
* </ul>
* <li>@ref sec_collections_group_physics "Physics"</li>
* <ul>
* <li>@ref sec_collections_group_physics_world "World"</li>
* </ul>
* </ul>
* </ul>
* </ul>
*
* @author Andres Blanc (dresb) andresblanc@gmail.com
*
* <table class="edcref" border="0">
*/
static Edje_Part_Collection_Directory_Entry *current_de = NULL;
static Edje_Part *current_part = NULL;
static Edje_Pack_Element *current_item = NULL;
static Edje_Part_Description_Common *current_desc = NULL;
static Edje_Part_Description_Common *parent_desc = NULL;
static Edje_Program *current_program = NULL;
struct _Edje_Cc_Handlers_Hierarchy_Info
{ /* Struct that keeps globals value to impl hierarchy */
Edje_Part_Collection_Directory_Entry *current_de;
Edje_Part *current_part;
Edje_Pack_Element *current_item;
Edje_Part_Description_Common *current_desc;
Edje_Part_Description_Common *parent_desc;
Edje_Program *current_program;
Edje_Part *ep;
};
typedef struct _Edje_Cc_Handlers_Hierarchy_Info Edje_Cc_Handlers_Hierarchy_Info;
static Eina_Array *part_hierarchy = NULL; /* stack parts,support nested parts */
static void edje_cc_handlers_hierarchy_set(Edje_Part *src);
static Edje_Part *edje_cc_handlers_hierarchy_parent_get(void);
static void edje_cc_handlers_hierarchy_push(Edje_Part *ep, Edje_Part *cp);
static void edje_cc_handlers_hierarchy_rename(Edje_Part *old, Edje_Part *new);
static void edje_cc_handlers_hierarchy_pop(void);
static void st_externals_external(void);
static void st_images_image(void);
static void ob_images_set(void);
static void st_images_set_name(void);
static void ob_images_set_image(void);
static void st_images_set_image_image(void);
static void st_images_set_image_size(void);
static void st_fonts_font(void);
static void st_data_item(void);
static void st_data_file(void);
static void ob_styles_style(void);
static void st_styles_style_name(void);
static void st_styles_style_base(void);
static void st_styles_style_tag(void);
static void ob_color_class(void);
static void st_color_class_name(void);
static void st_color_class_color(void);
static void st_color_class_color2(void);
static void st_color_class_color3(void);
static void ob_collections(void);
static void ob_collections_group(void);
static void st_collections_group_name(void);
static void st_collections_group_inherit(void);
static void st_collections_group_script_only(void);
static void st_collections_group_alias(void);
static void st_collections_group_min(void);
static void st_collections_group_max(void);
static void st_collections_group_broadcast_signal(void);
static void st_collections_group_data_item(void);
static void st_collections_group_orientation(void);
static void st_collections_group_limits_vertical(void);
static void st_collections_group_limits_horizontal(void);
static void ob_collections_group_script(void);
static void ob_collections_group_lua_script(void);
static void st_collections_group_parts_alias(void);
static Edje_Part *edje_cc_handlers_part_make(void);
static void ob_collections_group_parts_part(void);
static void st_collections_group_parts_part_name(void);
static void st_collections_group_parts_part_type(void);
#ifdef HAVE_EPHYSICS
static void st_collections_group_parts_part_physics_body(void);
#endif
static void st_collections_group_parts_part_insert_before(void);
static void st_collections_group_parts_part_insert_after(void);
static void st_collections_group_parts_part_effect(void);
static void st_collections_group_parts_part_mouse_events(void);
static void st_collections_group_parts_part_repeat_events(void);
static void st_collections_group_parts_part_ignore_flags(void);
static void st_collections_group_parts_part_scale(void);
static void st_collections_group_parts_part_pointer_mode(void);
static void st_collections_group_parts_part_precise_is_inside(void);
static void st_collections_group_parts_part_use_alternate_font_metrics(void);
static void st_collections_group_parts_part_clip_to_id(void);
static void st_collections_group_parts_part_source(void);
static void st_collections_group_parts_part_source2(void);
static void st_collections_group_parts_part_source3(void);
static void st_collections_group_parts_part_source4(void);
static void st_collections_group_parts_part_source5(void);
static void st_collections_group_parts_part_source6(void);
static void st_collections_group_parts_part_entry_mode(void);
static void st_collections_group_parts_part_select_mode(void);
static void st_collections_group_parts_part_cursor_mode(void);
static void st_collections_group_parts_part_multiline(void);
static void st_collections_group_parts_part_access(void);
static void st_collections_group_parts_part_dragable_x(void);
static void st_collections_group_parts_part_dragable_y(void);
static void st_collections_group_parts_part_dragable_confine(void);
static void st_collections_group_parts_part_dragable_events(void);
/* box and table items share these */
static void ob_collections_group_parts_part_box_items_item(void);
static void st_collections_group_parts_part_box_items_item_type(void);
static void st_collections_group_parts_part_box_items_item_name(void);
static void st_collections_group_parts_part_box_items_item_source(void);
static void st_collections_group_parts_part_box_items_item_min(void);
static void st_collections_group_parts_part_box_items_item_prefer(void);
static void st_collections_group_parts_part_box_items_item_max(void);
static void st_collections_group_parts_part_box_items_item_padding(void);
static void st_collections_group_parts_part_box_items_item_align(void);
static void st_collections_group_parts_part_box_items_item_weight(void);
static void st_collections_group_parts_part_box_items_item_aspect(void);
static void st_collections_group_parts_part_box_items_item_aspect_mode(void);
static void st_collections_group_parts_part_box_items_item_options(void);
/* but these are only for table */
static void st_collections_group_parts_part_table_items_item_position(void);
static void st_collections_group_parts_part_table_items_item_span(void);
static void ob_collections_group_parts_part_description(void);
static void st_collections_group_parts_part_description_inherit(void);
static void st_collections_group_parts_part_description_source(void);
static void st_collections_group_parts_part_description_state(void);
static void st_collections_group_parts_part_description_visible(void);
static void st_collections_group_parts_part_description_limit(void);
static void st_collections_group_parts_part_description_align(void);
static void st_collections_group_parts_part_description_fixed(void);
static void st_collections_group_parts_part_description_min(void);
static void st_collections_group_parts_part_description_minmul(void);
static void st_collections_group_parts_part_description_max(void);
static void st_collections_group_parts_part_description_step(void);
static void st_collections_group_parts_part_description_aspect(void);
static void st_collections_group_parts_part_description_aspect_preference(void);
static void st_collections_group_parts_part_description_rel1_relative(void);
static void st_collections_group_parts_part_description_rel1_offset(void);
static void st_collections_group_parts_part_description_rel1_to_set(const char *name);
static void st_collections_group_parts_part_description_rel1_to(void);
static void st_collections_group_parts_part_description_rel1_to_x(void);
static void st_collections_group_parts_part_description_rel1_to_y(void);
static void st_collections_group_parts_part_description_rel2_relative(void);
static void st_collections_group_parts_part_description_rel2_offset(void);
static void st_collections_group_parts_part_description_rel2_to_set(const char *name);
static void st_collections_group_parts_part_description_rel2_to(void);
static void st_collections_group_parts_part_description_rel2_to_x(void);
static void st_collections_group_parts_part_description_rel2_to_y(void);
static void st_collections_group_parts_part_description_image_normal(void);
static void st_collections_group_parts_part_description_image_tween(void);
static void st_collections_group_parts_part_description_image_border(void);
static void st_collections_group_parts_part_description_image_middle(void);
static void st_collections_group_parts_part_description_image_border_scale(void);
static void st_collections_group_parts_part_description_image_border_scale_by(void);
static void st_collections_group_parts_part_description_image_scale_hint(void);
static void st_collections_group_parts_part_description_fill_smooth(void);
static void st_collections_group_parts_part_description_fill_origin_relative(void);
static void st_collections_group_parts_part_description_fill_origin_offset(void);
static void st_collections_group_parts_part_description_fill_size_relative(void);
static void st_collections_group_parts_part_description_fill_size_offset(void);
static void st_collections_group_parts_part_description_fill_spread(void);
static void st_collections_group_parts_part_description_fill_type(void);
static void st_collections_group_parts_part_description_color_class(void);
static void st_collections_group_parts_part_description_color(void);
static void st_collections_group_parts_part_description_color2(void);
static void st_collections_group_parts_part_description_color3(void);
static void st_collections_group_parts_part_description_text_text(void);
static void st_collections_group_parts_part_description_text_text_class(void);
static void st_collections_group_parts_part_description_text_font(void);
static void st_collections_group_parts_part_description_text_style(void);
static void st_collections_group_parts_part_description_text_repch(void);
static void st_collections_group_parts_part_description_text_size(void);
static void st_collections_group_parts_part_description_text_size_range(void);
static void st_collections_group_parts_part_description_text_fit(void);
static void st_collections_group_parts_part_description_text_min(void);
static void st_collections_group_parts_part_description_text_max(void);
static void st_collections_group_parts_part_description_text_align(void);
static void st_collections_group_parts_part_description_text_source(void);
static void st_collections_group_parts_part_description_text_text_source(void);
static void st_collections_group_parts_part_description_text_elipsis(void);
static void st_collections_group_parts_part_description_box_layout(void);
static void st_collections_group_parts_part_description_box_align(void);
static void st_collections_group_parts_part_description_box_padding(void);
static void st_collections_group_parts_part_description_box_min(void);
static void st_collections_group_parts_part_description_table_homogeneous(void);
static void st_collections_group_parts_part_description_table_align(void);
static void st_collections_group_parts_part_description_table_padding(void);
static void st_collections_group_parts_part_description_table_min(void);
#ifdef HAVE_EPHYSICS
static void st_collections_group_parts_part_description_physics_mass(void);
static void st_collections_group_parts_part_description_physics_restitution(void);
static void st_collections_group_parts_part_description_physics_friction(void);
static void st_collections_group_parts_part_description_physics_damping(void);
static void st_collections_group_parts_part_description_physics_sleep(void);
static void st_collections_group_parts_part_description_physics_material(void);
static void st_collections_group_parts_part_description_physics_density(void);
static void st_collections_group_parts_part_description_physics_hardness(void);
static void st_collections_group_parts_part_description_physics_ignore_part_pos(void);
static void st_collections_group_parts_part_description_physics_light_on(void);
static void st_collections_group_parts_part_description_physics_z(void);
static void st_collections_group_parts_part_description_physics_depth(void);
static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void);
static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void);
static void st_collections_group_parts_part_description_physics_backface_cull(void);
static void st_collections_group_parts_part_description_physics_face(void);
static void st_collections_group_parts_part_description_physics_face_type(void);
static void st_collections_group_parts_part_description_physics_face_source(void);
#endif
static void st_collections_group_parts_part_description_map_perspective(void);
static void st_collections_group_parts_part_description_map_light(void);
static void st_collections_group_parts_part_description_map_rotation_center(void);
static void st_collections_group_parts_part_description_map_rotation_x(void);
static void st_collections_group_parts_part_description_map_rotation_y(void);
static void st_collections_group_parts_part_description_map_rotation_z(void);
static void st_collections_group_parts_part_description_map_on(void);
static void st_collections_group_parts_part_description_map_smooth(void);
static void st_collections_group_parts_part_description_map_alpha(void);
static void st_collections_group_parts_part_description_map_backface_cull(void);
static void st_collections_group_parts_part_description_map_perspective_on(void);
static void st_collections_group_parts_part_description_perspective_zplane(void);
static void st_collections_group_parts_part_description_perspective_focal(void);
static void st_collections_group_parts_part_api(void);
/* external part parameters */
static void st_collections_group_parts_part_description_params_int(void);
static void ob_collections_group_programs_program(void);
static void st_collections_group_parts_part_description_params_double(void);
static void st_collections_group_programs_program_name(void);
static void st_collections_group_parts_part_description_params_string(void);
static void st_collections_group_parts_part_description_params_bool(void);
static void st_collections_group_parts_part_description_params_choice(void);
static void st_collections_group_programs_program_signal(void);
static void st_collections_group_programs_program_source(void);
static void st_collections_group_programs_program_filter(void);
static void st_collections_group_programs_program_in(void);
static void st_collections_group_programs_program_action(void);
static void st_collections_group_programs_program_transition(void);
static void st_collections_group_programs_program_target(void);
static void st_collections_group_programs_program_after(void);
static void st_collections_group_programs_program_api(void);
static void ob_collections_group_programs_program_script(void);
static void st_collections_group_sound_sample_name(void);
static void st_collections_group_sound_sample_source(void);
static void st_collections_group_sound_tone(void);
#ifdef HAVE_EPHYSICS
static void st_collections_group_physics_world_gravity(void);
static void st_collections_group_physics_world_rate(void);
static void st_collections_group_physics_world_z(void);
static void st_collections_group_physics_world_depth(void);
#endif
/*****/
New_Statement_Handler statement_handlers[] =
{
{"externals.external", st_externals_external},
{"images.image", st_images_image},
{"images.set.name", st_images_set_name},
{"images.set.image.image", st_images_set_image_image},
{"images.set.image.size", st_images_set_image_size},
{"fonts.font", st_fonts_font},
{"data.item", st_data_item},
{"data.file", st_data_file},
{"styles.style.name", st_styles_style_name},
{"styles.style.base", st_styles_style_base},
{"styles.style.tag", st_styles_style_tag},
{"color_classes.color_class.name", st_color_class_name},
{"color_classes.color_class.color", st_color_class_color},
{"color_classes.color_class.color2", st_color_class_color2},
{"color_classes.color_class.color3", st_color_class_color3},
{"collections.externals.external", st_externals_external}, /* dup */
{"collections.image", st_images_image}, /* dup */
{"collections.set.name", st_images_set_name}, /* dup */
{"collections.set.image.image", st_images_set_image_image}, /* dup */
{"collections.set.image.size", st_images_set_image_size}, /* dup */
{"collections.images.image", st_images_image}, /* dup */
{"collections.images.set.name", st_images_set_name}, /* dup */
{"collections.images.set.image.image", st_images_set_image_image}, /* dup */
{"collections.images.set.image.size", st_images_set_image_size}, /* dup */
{"collections.font", st_fonts_font}, /* dup */
{"collections.fonts.font", st_fonts_font}, /* dup */
{"collections.styles.style.name", st_styles_style_name}, /* dup */
{"collections.styles.style.base", st_styles_style_base}, /* dup */
{"collections.styles.style.tag", st_styles_style_tag}, /* dup */
{"collections.color_classes.color_class.name", st_color_class_name}, /* dup */
{"collections.color_classes.color_class.color", st_color_class_color}, /* dup */
{"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.sounds.sample.name", st_collections_group_sound_sample_name},
{"collections.sounds.sample.source", st_collections_group_sound_sample_source},
{"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */
{"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */
{"collections.sounds.tone", st_collections_group_sound_tone},
{"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */
{"collections.group.name", st_collections_group_name},
{"collections.group.inherit", st_collections_group_inherit},
{"collections.group.script_only", st_collections_group_script_only},
{"collections.group.lua_script_only", st_collections_group_script_only},
{"collections.group.alias", st_collections_group_alias},
{"collections.group.min", st_collections_group_min},
{"collections.group.max", st_collections_group_max},
{"collections.group.broadcast_signal", st_collections_group_broadcast_signal},
{"collections.group.orientation", st_collections_group_orientation},
{"collections.group.data.item", st_collections_group_data_item},
{"collections.group.limits.horizontal", st_collections_group_limits_horizontal},
{"collections.group.limits.vertical", st_collections_group_limits_vertical},
{"collections.group.externals.external", st_externals_external}, /* dup */
{"collections.group.image", st_images_image}, /* dup */
{"collections.group.set.name", st_images_set_name},
{"collections.group.set.image.image", st_images_set_image_image},
{"collections.group.set.image.size", st_images_set_image_size},
{"collections.group.images.image", st_images_image}, /* dup */
{"collections.group.images.set.name", st_images_set_name},
{"collections.group.images.set.image.image", st_images_set_image_image},
{"collections.group.images.set.image.size", st_images_set_image_size},
{"collections.group.font", st_fonts_font}, /* dup */
{"collections.group.fonts.font", st_fonts_font}, /* dup */
{"collections.group.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.styles.style.base", st_styles_style_base}, /* dup */
{"collections.group.styles.style.tag", st_styles_style_tag}, /* dup */
{"collections.group.color_classes.color_class.name", st_color_class_name}, /* dup */
{"collections.group.color_classes.color_class.color", st_color_class_color}, /* dup */
{"collections.group.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.alias", st_collections_group_parts_alias },
{"collections.group.parts.image", st_images_image}, /* dup */
{"collections.group.parts.set.name", st_images_set_name},
{"collections.group.parts.set.image.image", st_images_set_image_image},
{"collections.group.parts.set.image.size", st_images_set_image_size},
{"collections.group.parts.images.image", st_images_image}, /* dup */
{"collections.group.parts.images.set.name", st_images_set_name},
{"collections.group.parts.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.font", st_fonts_font}, /* dup */
{"collections.group.parts.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.styles.style.base", st_styles_style_base}, /* dup */
{"collections.group.parts.styles.style.tag", st_styles_style_tag}, /* dup */
{"collections.group.parts.color_classes.color_class.name", st_color_class_name}, /* dup */
{"collections.group.parts.color_classes.color_class.color", st_color_class_color}, /* dup */
{"collections.group.parts.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.parts.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.part.name", st_collections_group_parts_part_name},
{"collections.group.parts.part.api", st_collections_group_parts_part_api},
{"collections.group.parts.part.type", st_collections_group_parts_part_type},
#ifdef HAVE_EPHYSICS
{"collections.group.parts.part.physics_body", st_collections_group_parts_part_physics_body},
#endif
{"collections.group.parts.part.insert_before", st_collections_group_parts_part_insert_before},
{"collections.group.parts.part.insert_after", st_collections_group_parts_part_insert_after},
{"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
{"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
{"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
{"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
{"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
{"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
{"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
{"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
{"collections.group.parts.part.source", st_collections_group_parts_part_source},
{"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
{"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
{"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
{"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
{"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
{"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
{"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
{"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
{"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
{"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
{"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
{"collections.group.parts.part.access", st_collections_group_parts_part_access},
{"collections.group.parts.part.image", st_images_image}, /* dup */
{"collections.group.parts.part.set.name", st_images_set_name},
{"collections.group.parts.part.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.images.image", st_images_image}, /* dup */
{"collections.group.parts.part.images.set.name", st_images_set_name},
{"collections.group.parts.part.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.part.styles.style.base", st_styles_style_base}, /* dup */
{"collections.group.parts.part.styles.style.tag", st_styles_style_tag}, /* dup */
{"collections.group.parts.part.color_classes.color_class.name", st_color_class_name}, /* dup */
{"collections.group.parts.part.color_classes.color_class.color", st_color_class_color}, /* dup */
{"collections.group.parts.part.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.parts.part.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type},
{"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
{"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
{"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
{"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
{"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
{"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
{"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align},
{"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight},
{"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect},
{"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode},
{"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options},
{"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */
{"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
{"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
{"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
{"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
{"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
{"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
{"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */
{"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */
{"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */
{"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */
{"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */
{"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
{"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
{"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
{"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
{"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
{"collections.group.parts.part.description.limit", st_collections_group_parts_part_description_limit},
{"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
{"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
{"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
{"collections.group.parts.part.description.minmul", st_collections_group_parts_part_description_minmul},
{"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
{"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step},
{"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect},
{"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference},
{"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative},
{"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset},
{"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to},
{"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x},
{"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y},
{"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative},
{"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset},
{"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to},
{"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x},
{"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y},
{"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
{"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
{"collections.group.parts.part.description.image.image", st_images_image}, /* dup */
{"collections.group.parts.part.description.image.set.name", st_images_set_name},
{"collections.group.parts.part.description.image.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.description.image.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */
{"collections.group.parts.part.description.image.images.set.name", st_images_set_name},
{"collections.group.parts.part.description.image.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.description.image.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border},
{"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
{"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale},
{"collections.group.parts.part.description.image.border_scale_by", st_collections_group_parts_part_description_image_border_scale_by},
{"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint},
{"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth},
{"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative},
{"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
{"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
{"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
{"collections.group.parts.part.description.fill.spread", st_collections_group_parts_part_description_fill_spread},
{"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type},
{"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
{"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
{"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
{"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
{"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
{"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
{"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
{"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
{"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
{"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
{"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range},
{"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
{"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
{"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
{"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
{"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source},
{"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
{"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
{"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_elipsis},
{"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
{"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
{"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
{"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min},
{"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
{"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
{"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
{"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
#ifdef HAVE_EPHYSICS
{"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
{"collections.group.parts.part.description.physics.restitution", st_collections_group_parts_part_description_physics_restitution},
{"collections.group.parts.part.description.physics.friction", st_collections_group_parts_part_description_physics_friction},
{"collections.group.parts.part.description.physics.damping", st_collections_group_parts_part_description_physics_damping},
{"collections.group.parts.part.description.physics.sleep", st_collections_group_parts_part_description_physics_sleep},
{"collections.group.parts.part.description.physics.material", st_collections_group_parts_part_description_physics_material},
{"collections.group.parts.part.description.physics.density", st_collections_group_parts_part_description_physics_density},
{"collections.group.parts.part.description.physics.hardness", st_collections_group_parts_part_description_physics_hardness},
{"collections.group.parts.part.description.physics.movement_freedom.linear", st_collections_group_parts_part_description_physics_movement_freedom_linear},
{"collections.group.parts.part.description.physics.movement_freedom.angular", st_collections_group_parts_part_description_physics_movement_freedom_angular},
{"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos},
{"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on},
{"collections.group.parts.part.description.physics.z", st_collections_group_parts_part_description_physics_z},
{"collections.group.parts.part.description.physics.depth", st_collections_group_parts_part_description_physics_depth},
{"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull},
{"collections.group.parts.part.description.physics.faces.face.type", st_collections_group_parts_part_description_physics_face_type},
{"collections.group.parts.part.description.physics.faces.face.source", st_collections_group_parts_part_description_physics_face_source},
#endif
{"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
{"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
{"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
{"collections.group.parts.part.description.map.rotation.x", st_collections_group_parts_part_description_map_rotation_x},
{"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y},
{"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z},
{"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on},
{"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth},
{"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha},
{"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull},
{"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on},
{"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
{"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
{"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
{"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double},
{"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string},
{"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool},
{"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice},
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
{"collections.group.parts.part.description.images.set.name", st_images_set_name},
{"collections.group.parts.part.description.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.description.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.part.description.styles.style.base", st_styles_style_base}, /* dup */
{"collections.group.parts.part.description.styles.style.tag", st_styles_style_tag}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.name", st_color_class_name}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.color", st_color_class_color}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.part.description.programs.image", st_images_image}, /* dup */
{"collections.group.parts.part.description.programs.set.name", st_images_set_name},
{"collections.group.parts.part.description.programs.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.description.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.programs.images.image", st_images_image}, /* dup */
{"collections.group.parts.part.description.programs.images.set.name", st_images_set_name},
{"collections.group.parts.part.description.programs.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.description.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.description.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.part.description.programs.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.part.description.programs.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.part.description.programs.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.part.description.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.part.description.programs.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.part.description.programs.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.description.programs.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.part.description.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.description.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.part.description.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.part.description.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.part.description.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.part.description.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.part.description.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.part.description.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.description.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.part.programs.image", st_images_image}, /* dup */
{"collections.group.parts.part.programs.set.name", st_images_set_name},
{"collections.group.parts.part.programs.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.programs.images.image", st_images_image}, /* dup */
{"collections.group.parts.part.programs.images.set.name", st_images_set_name},
{"collections.group.parts.part.programs.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.part.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.part.programs.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.part.programs.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.part.programs.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.part.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.part.programs.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.part.programs.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.programs.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.part.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.part.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.part.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.part.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.part.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.part.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.part.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.programs.image", st_images_image}, /* dup */
{"collections.group.parts.programs.set.name", st_images_set_name},
{"collections.group.parts.programs.set.image.image", st_images_set_image_image},
{"collections.group.parts.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.programs.images.image", st_images_image}, /* dup */
{"collections.group.parts.programs.images.set.name", st_images_set_name},
{"collections.group.parts.programs.images.set.image.image", st_images_set_image_image},
{"collections.group.parts.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.programs.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.parts.programs.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.programs.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.programs.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.programs.program.after", st_collections_group_programs_program_after},
{"collections.group.parts.programs.program.api", st_collections_group_programs_program_api},
{"collections.group.parts.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.parts.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.parts.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.parts.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.parts.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.program.api", st_collections_group_programs_program_api}, /* dup */
#ifdef HAVE_EPHYSICS
{"collections.group.physics.world.gravity", st_collections_group_physics_world_gravity},
{"collections.group.physics.world.rate", st_collections_group_physics_world_rate},
{"collections.group.physics.world.z", st_collections_group_physics_world_z},
{"collections.group.physics.world.depth", st_collections_group_physics_world_depth},
#endif
{"collections.group.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.program.source", st_collections_group_programs_program_source}, /* dup */
{"collections.group.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.program.target", st_collections_group_programs_program_target}, /* dup */
{"collections.group.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.programs.program.name", st_collections_group_programs_program_name},
{"collections.group.programs.program.signal", st_collections_group_programs_program_signal},
{"collections.group.programs.program.source", st_collections_group_programs_program_source},
{"collections.group.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.programs.program.in", st_collections_group_programs_program_in},
{"collections.group.programs.program.action", st_collections_group_programs_program_action},
{"collections.group.programs.program.transition", st_collections_group_programs_program_transition},
{"collections.group.programs.program.target", st_collections_group_programs_program_target},
{"collections.group.programs.program.after", st_collections_group_programs_program_after},
{"collections.group.programs.program.api", st_collections_group_programs_program_api},
{"collections.group.programs.image", st_images_image}, /* dup */
{"collections.group.programs.set.name", st_images_set_name},
{"collections.group.programs.set.image.image", st_images_set_image_image},
{"collections.group.programs.set.image.size", st_images_set_image_size},
{"collections.group.programs.images.image", st_images_image}, /* dup */
{"collections.group.programs.images.set.name", st_images_set_name},
{"collections.group.programs.images.set.image.image", st_images_set_image_image},
{"collections.group.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.programs.font", st_fonts_font}, /* dup */
{"collections.group.programs.fonts.font", st_fonts_font} /* dup */
};
New_Object_Handler object_handlers[] =
{
{"externals", NULL},
{"images", NULL},
{"images.set", ob_images_set},
{"images.set.image", ob_images_set_image},
{"fonts", NULL},
{"data", NULL},
{"styles", NULL},
{"styles.style", ob_styles_style},
{"color_classes", NULL},
{"color_classes.color_class", ob_color_class},
{"spectra", NULL},
{"collections", ob_collections},
{"collections.externals", NULL}, /* dup */
{"collections.set", ob_images_set}, /* dup */
{"collections.set.image", ob_images_set_image}, /* dup */
{"collections.images", NULL}, /* dup */
{"collections.images.set", ob_images_set}, /* dup */
{"collections.images.set.image", ob_images_set_image}, /* dup */
{"collections.fonts", NULL}, /* dup */
{"collections.styles", NULL}, /* dup */
{"collections.styles.style", ob_styles_style}, /* dup */
{"collections.color_classes", NULL}, /* dup */
{"collections.color_classes.color_class", ob_color_class}, /* dup */
{"collections.sounds", NULL},
{"collections.group.sounds", NULL}, /* dup */
{"collections.sounds.sample", NULL},
{"collections.group.sounds.sample", NULL}, /* dup */
{"collections.group", ob_collections_group},
{"collections.group.data", NULL},
{"collections.group.limits", NULL},
{"collections.group.script", ob_collections_group_script},
{"collections.group.lua_script", ob_collections_group_lua_script},
{"collections.group.externals", NULL}, /* dup */
{"collections.group.set", ob_images_set}, /* dup */
{"collections.group.set.image", ob_images_set_image}, /* dup */
{"collections.group.images", NULL}, /* dup */
{"collections.group.images.set", ob_images_set}, /* dup */
{"collections.group.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.fonts", NULL}, /* dup */
{"collections.group.styles", NULL}, /* dup */
{"collections.group.styles.style", ob_styles_style}, /* dup */
{"collections.group.color_classes", NULL}, /* dup */
{"collections.group.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts", NULL},
{"collections.group.parts.set", ob_images_set}, /* dup */
{"collections.group.parts.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.images", NULL}, /* dup */
{"collections.group.parts.images.set", ob_images_set}, /* dup */
{"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.fonts", NULL}, /* dup */
{"collections.group.parts.styles", NULL}, /* dup */
{"collections.group.parts.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.color_classes", NULL}, /* dup */
{"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts.part", ob_collections_group_parts_part},
{"collections.group.parts.part.dragable", NULL},
{"collections.group.parts.part.set", ob_images_set}, /* dup */
{"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.images", NULL}, /* dup */
{"collections.group.parts.part.images.set", ob_images_set}, /* dup */
{"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.fonts", NULL}, /* dup */
{"collections.group.parts.part.styles", NULL}, /* dup */
{"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.part.color_classes", NULL}, /* dup */
{"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts.part.box", NULL},
{"collections.group.parts.part.box.items", NULL},
{"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item},
{"collections.group.parts.part.table", NULL},
{"collections.group.parts.part.table.items", NULL},
{"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */
{"collections.group.parts.part.description", ob_collections_group_parts_part_description},
{"collections.group.parts.part.description.rel1", NULL},
{"collections.group.parts.part.description.rel2", NULL},
{"collections.group.parts.part.description.image", NULL}, /* dup */
{"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */
{"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.image.images", NULL}, /* dup */
{"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */
{"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.fill", NULL},
{"collections.group.parts.part.description.fill.origin", NULL},
{"collections.group.parts.part.description.fill.size", NULL},
{"collections.group.parts.part.description.text", NULL},
{"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.images", NULL}, /* dup */
{"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */
{"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.styles", NULL}, /* dup */
{"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.part.description.box", NULL},
{"collections.group.parts.part.description.table", NULL},
#ifdef HAVE_EPHYSICS
{"collections.group.parts.part.description.physics", NULL},
{"collections.group.parts.part.description.physics.movement_freedom", NULL},
{"collections.group.parts.part.description.physics.faces", NULL},
{"collections.group.parts.part.description.physics.faces.face", st_collections_group_parts_part_description_physics_face},
#endif
{"collections.group.parts.part.description.map", NULL},
{"collections.group.parts.part.description.map.rotation", NULL},
{"collections.group.parts.part.description.perspective", NULL},
{"collections.group.parts.part.description.params", NULL},
{"collections.group.parts.part.description.color_classes", NULL}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.description.programs", NULL}, /* dup */
{"collections.group.parts.part.description.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.part.description.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.programs.images", NULL}, /* dup */
{"collections.group.parts.part.description.programs.images.set", ob_images_set},
{"collections.group.parts.part.description.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.description.script", ob_collections_group_script}, /* dup */
{"collections.group.parts.part.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.programs", NULL}, /* dup */
{"collections.group.parts.part.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.part.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.programs.images", NULL}, /* dup */
{"collections.group.parts.part.programs.images.set", ob_images_set}, /* dup */
{"collections.group.parts.part.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.script", ob_collections_group_script}, /* dup */
{"collections.group.parts.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.programs", NULL}, /* dup */
{"collections.group.parts.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.programs.images", NULL}, /* dup */
{"collections.group.parts.programs.images.set", ob_images_set}, /* dup */
{"collections.group.parts.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.programs.fonts", NULL}, /* dup */
{"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.script", ob_collections_group_script}, /* dup */
#ifdef HAVE_EPHYSICS
{"collections.group.physics", NULL},
{"collections.group.physics.world", NULL},
#endif
{"collections.group.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.programs", NULL},
{"collections.group.programs.set", ob_images_set}, /* dup */
{"collections.group.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.programs.images", NULL}, /* dup */
{"collections.group.programs.images.set", ob_images_set}, /* dup */
{"collections.group.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.programs.fonts", NULL}, /* dup */
{"collections.group.programs.program", ob_collections_group_programs_program},
{"collections.group.programs.program.script", ob_collections_group_programs_program_script},
{"collections.group.programs.script", ob_collections_group_script} /* dup */
};
New_Nested_Handler nested_handlers[] = {
{"collections.group.parts", "part", NULL, edje_cc_handlers_hierarchy_pop }
};
/*****/
int
object_handler_num(void)
{
return sizeof(object_handlers) / sizeof (New_Object_Handler);
}
int
statement_handler_num(void)
{
return sizeof(statement_handlers) / sizeof (New_Object_Handler);
}
int
nested_handler_num(void)
{
return sizeof(nested_handlers) / sizeof (New_Nested_Handler);
}
static void
_edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill)
{
fill->smooth = 1;
fill->pos_rel_x = FROM_DOUBLE(0.0);
fill->pos_abs_x = 0;
fill->rel_x = FROM_DOUBLE(1.0);
fill->abs_x = 0;
fill->pos_rel_y = FROM_DOUBLE(0.0);
fill->pos_abs_y = 0;
fill->rel_y = FROM_DOUBLE(1.0);
fill->abs_y = 0;
fill->angle = 0;
fill->spread = 0;
fill->type = EDJE_FILL_TYPE_SCALE;
}
static void
_edje_part_description_image_remove(Edje_Part_Description_Image *ed)
{
unsigned int j;
if (!ed) return;
data_queue_image_remove(&(ed->image.id), &(ed->image.set));
for (j = 0; j < ed->image.tweens_count; ++j)
data_queue_image_remove(&(ed->image.tweens[j]->id),
&(ed->image.tweens[j]->set));
}
void
part_description_image_cleanup(Edje_Part *ep)
{
Edje_Part_Description_Image *ed;
unsigned int j;
if (ep->type != EDJE_PART_TYPE_IMAGE)
return ;
ed = (Edje_Part_Description_Image*) ep->default_desc;
_edje_part_description_image_remove(ed);
for (j = 0; j < ep->other.desc_count; j++)
{
ed = (Edje_Part_Description_Image*) ep->other.desc[j];
_edje_part_description_image_remove(ed);
}
}
static Edje_Part_Description_Common *
_edje_part_description_alloc(unsigned char type, const char *collection, const char *part)
{
Edje_Part_Description_Common *result = NULL;
switch (type)
{
case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
result = mem_alloc(SZ(Edje_Part_Description_Common));
break;
case EDJE_PART_TYPE_TEXT:
case EDJE_PART_TYPE_TEXTBLOCK:
{
Edje_Part_Description_Text *ed;
ed = mem_alloc(SZ(Edje_Part_Description_Text));
ed->text.color3.r = 0;
ed->text.color3.g = 0;
ed->text.color3.b = 0;
ed->text.color3.a = 128;
ed->text.align.x = FROM_DOUBLE(0.5);
ed->text.align.y = FROM_DOUBLE(0.5);
ed->text.id_source = -1;
ed->text.id_text_source = -1;
result = &ed->common;
break;
}
case EDJE_PART_TYPE_IMAGE:
{
Edje_Part_Description_Image *ed;
ed = mem_alloc(SZ(Edje_Part_Description_Image));
ed->image.id = -1;
_edje_part_description_fill(&ed->image.fill);
result = &ed->common;
break;
}
case EDJE_PART_TYPE_PROXY:
{
Edje_Part_Description_Proxy *ed;
ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
ed->proxy.id = -1;
_edje_part_description_fill(&ed->proxy.fill);
result = &ed->common;
break;
}
case EDJE_PART_TYPE_BOX:
{
Edje_Part_Description_Box *ed;
ed = mem_alloc(SZ(Edje_Part_Description_Box));
ed->box.layout = NULL;
ed->box.alt_layout = NULL;
ed->box.align.x = FROM_DOUBLE(0.5);
ed->box.align.y = FROM_DOUBLE(0.5);
ed->box.padding.x = 0;
ed->box.padding.y = 0;
result = &ed->common;
break;
}
case EDJE_PART_TYPE_TABLE:
{
Edje_Part_Description_Table *ed;
ed = mem_alloc(SZ(Edje_Part_Description_Table));
ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE;
ed->table.align.x = FROM_DOUBLE(0.5);
ed->table.align.y = FROM_DOUBLE(0.5);
ed->table.padding.x = 0;
ed->table.padding.y = 0;
result = &ed->common;
break;
}
case EDJE_PART_TYPE_EXTERNAL:
{
Edje_Part_Description_External *ed;
ed = mem_alloc(SZ(Edje_Part_Description_External));
ed->external_params = NULL;
result = &ed->common;
break;
}
}
if (!result)
{
ERR("Unknown type %i of part %s in collection %s.",
type, part, collection);
exit(-1);
}
#ifdef HAVE_EPHYSICS
result->physics.mass = FROM_DOUBLE(1.0);
result->physics.friction = FROM_DOUBLE(0.5);
result->physics.sleep.linear = FROM_DOUBLE(24);
result->physics.sleep.angular = FROM_DOUBLE(57.29);
result->physics.hardness = FROM_DOUBLE(1.0);
result->physics.ignore_part_pos = 1;
result->physics.mov_freedom.lin.x = 1;
result->physics.mov_freedom.lin.y = 1;
result->physics.mov_freedom.ang.z = 1;
result->physics.z = -15;
result->physics.depth = 30;
#endif
return result;
}
static void
_edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, unsigned int count)
{
Edje_Part_Collection *pc;
unsigned int i;
Edje_Program_Parser *epp;
pc = eina_list_data_get(eina_list_last(edje_collections));
for (i = 0; i < count; ++i)
if (pgrms[i]->name)
if (pgrms[i] != me && (!strcmp(name, pgrms[i]->name)))
{
epp = (Edje_Program_Parser *)pgrms[i];
if (!epp->can_override)
{
ERR("parse error %s:%i. There is already a program of the name %s",
file_in, line - 1, name);
exit(-1);
}
else
{
_edje_program_remove(pc, me);
current_program = pgrms[i];
epp->can_override = EINA_FALSE;
return;
}
}
}
static void
_edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
{
Edje_Part_Collection *pc;
Edje_Program_Target *et, *et2;
Edje_Program_After *pa, *pa2;
Edje_Program_Parser *epp;
Eina_List *l;
char *name;
char *copy;
pc = eina_list_data_get(eina_list_last(edje_collections));
#define STRDUP(x) x ? strdup(x) : NULL
ep->name = STRDUP(ep2->name);
_edje_program_remove(pc, current_program);
ep->signal = STRDUP(ep2->signal);
ep->source = STRDUP(ep2->source);
_edje_program_insert(pc, current_program);
ep->filter.part = STRDUP(ep2->filter.part);
ep->filter.state = STRDUP(ep2->filter.state);
ep->in.from = ep2->in.from;
ep->in.range = ep2->in.range;
ep->action = ep2->action;
ep->state = STRDUP(ep2->state);
ep->state2 = STRDUP(ep2->state2);
ep->value = ep2->value;
ep->value2 = ep2->value2;
ep->tween.mode = ep2->tween.mode;
ep->tween.time = ep2->tween.time;
ep->tween.v1 = ep2->tween.v1;
ep->tween.v2 = ep2->tween.v2;
ep->sample_name = STRDUP(ep2->sample_name);
ep->tone_name = STRDUP(ep2->tone_name);
ep->duration = ep2->duration;
ep->speed = ep2->speed;
EINA_LIST_FOREACH(ep2->targets, l, et2)
{
name = (char*) (et2 + 1);
et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1);
ep->targets = eina_list_append(ep->targets, et);
copy = (char*) (et + 1);
memcpy(copy, name, strlen(name) + 1);
if (ep2->action == EDJE_ACTION_TYPE_STATE_SET)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_ACTION_STOP)
data_queue_copied_program_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_SCRIPT)
data_queue_copied_program_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_SET)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_OBJECT)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else
{
ERR("parse error %s:%i. target may only be used after action",
file_in, line - 1);
exit(-1);
}
}
EINA_LIST_FOREACH(ep2->after, l, pa2)
{
name = (char*) (pa2 + 1);
pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
ep->after = eina_list_append(ep->after, pa);
copy = (char*) (pa + 1);
memcpy(copy, name, strlen(name) + 1);
data_queue_copied_program_lookup(pc, &(pa2->id), &(pa->id));
}
ep->api.name = STRDUP(ep2->api.name);
ep->api.description = STRDUP(ep2->api.description);
data_queue_copied_part_lookup(pc, &(ep2->param.src), &(ep->param.src));
data_queue_copied_part_lookup(pc, &(ep2->param.dst), &(ep->param.dst));
epp = (Edje_Program_Parser *)ep;
epp->can_override = EINA_TRUE;
#undef STRDUP
}
/*****/
/**
@edcsection{toplevel,Top-Level blocks}
*/
/**
@edcsubsection{toplevel_externals,Externals}
*/
/**
@page edcref
@block
externals
@context
externals {
external: "name";
}
@description
The "externals" block is used to list each external module file that will be used in others
programs.
@endblock
@property
external
@parameters
[external filename]
@effect
Used to add a file to the externals list.
@endproperty
*/
static void
st_externals_external(void)
{
External *ex;
check_arg_count(1);
if (!edje_file->external_dir)
edje_file->external_dir = mem_alloc(SZ(Edje_External_Directory));
ex = mem_alloc(SZ(External));
ex->name = parse_str(0);
{
Eina_List *l;
External *lex;
EINA_LIST_FOREACH(externals, l, lex)
{
if (!strcmp(lex->name, ex->name))
{
free(ex->name);
free(ex);
return;
}
}
}
externals = eina_list_append(externals, ex);
if (edje_file->external_dir)
{
edje_file->external_dir->entries_count++;
edje_file->external_dir->entries = realloc(edje_file->external_dir->entries,
sizeof (Edje_External_Directory) * edje_file->external_dir->entries_count);
memset(edje_file->external_dir->entries + edje_file->external_dir->entries_count - 1,
0, sizeof (Edje_External_Directory));
if (!edje_file->external_dir->entries)
{
ERR("not enough memory");
exit(-1);
}
edje_file->external_dir->entries[edje_file->external_dir->entries_count - 1].entry = mem_strdup(ex->name);
}
}
/**
@edcsubsection{toplevel_images,Images}
*/
/**
@page edcref
@block
images
@context
images {
image: "filename1.ext" COMP;
image: "filename2.ext" LOSSY 99;
set {
name: "image_name_used";
image {
image: "filename3.ext" LOSSY 90;
size: 201 201 500 500;
}
image {
image: "filename4.ext" COMP;
size: 51 51 200 200;
}
image {
image: "filename5.ext" COMP;
size: 11 11 50 50;
}
image {
image: "filename6.ext" RAW;
size: 0 0 10 10;
}
}
..
}
@description
The "images" block is used to list each image file that will be used in
the theme along with its compression method (if any).
Besides the document's root, additional "images" blocks can be
included inside other blocks, normally "collections", "group" and
"part", easing maintenance of the file list when the theme is split
among multiple files.
@endblock
@property
image
@parameters
[image file] [compression method] (compression level)
@effect
Used to include each image file. The full path to the directory holding
the images can be defined later with edje_cc's "-id" option.
Compression methods:
@li RAW: Uncompressed.
@li COMP: Lossless compression.
@li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
@li USER: Do not embed the file, refer to the external file instead.
@endproperty
*/
static void
st_images_image(void)
{
Edje_Image_Directory_Entry *img;
const char *tmp;
unsigned int i;
int v;
check_min_arg_count(2);
if (!edje_file->image_dir)
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
tmp = parse_str(0);
for (i = 0; i < edje_file->image_dir->entries_count; ++i)
if (!strcmp(edje_file->image_dir->entries[i].entry, tmp))
{
free((char*) tmp);
return;
}
edje_file->image_dir->entries_count++;
edje_file->image_dir->entries = realloc(edje_file->image_dir->entries,
sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count);
memset(edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1,
0, sizeof (Edje_Image_Directory_Entry));
if (!edje_file->image_dir->entries)
{
ERR("No enough memory.");
exit(-1);
}
img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
img->entry = tmp;
img->id = edje_file->image_dir->entries_count - 1;
v = parse_enum(1,
"RAW", 0,
"COMP", 1,
"LOSSY", 2,
"USER", 3,
NULL);
if (v == 0)
{
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
img->source_param = 0;
}
else if (v == 1)
{
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
img->source_param = 1;
}
else if (v == 2)
{
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY;
img->source_param = 0;
}
else if (v == 3)
{
img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
img->source_param = 0;
}
if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY)
check_arg_count(2);
else
{
img->source_param = parse_int_range(2, 0, 100);
check_arg_count(3);
}
}
/**
@edcsubsection{toplevel_images_set,Set}
*/
/**
@page edcref
@block
set
@context
set {
name: "image_name_used";
image {
image: "filename3.ext" LOSSY 90;
size: 201 201 500 500;
}
image {
image: "filename4.ext" COMP;
size: 51 51 200 200;
}
image {
image: "filename5.ext" COMP;
size: 11 11 50 50;
}
image {
image: "filename6.ext" RAW;
size: 0 0 10 10;
}
}
@description
The "set" block is used to define an image with different content depending on their size.
Besides the document's root, additional "set" blocks can be
included inside other blocks, normally "collections", "group" and
"part", easing maintenance of the file list when the theme is split
among multiple files.
@endblock
*/
static void
ob_images_set(void)
{
if (!edje_file->image_dir)
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
edje_file->image_dir->sets_count++;
edje_file->image_dir->sets = realloc(edje_file->image_dir->sets,
sizeof (Edje_Image_Directory_Set) * edje_file->image_dir->sets_count);
memset(edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1,
0, sizeof (Edje_Image_Directory_Set));
if (!edje_file->image_dir->sets)
{
ERR("Not enough memory.");
exit(-1);
}
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
}
/**
@page edcref
@property
name
@parameters
[image name]
@effect
Define the name that refer to this image description.
@endproperty
*/
static void
st_images_set_name(void)
{
check_arg_count(1);
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].name = parse_str(0);
}
/**
@edcsubsection{toplevel_images_image,Image}
*/
/**
@page edcref
@block
image
@description
The "image" block inside a "set" block define the characteristic of an image.
Every block will describe one image and the size rule to use it.
@endblock
**/
static void
ob_images_set_image(void)
{
Edje_Image_Directory_Set_Entry *entry;
Edje_Image_Directory_Set *set;
set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
entry = mem_alloc(SZ(Edje_Image_Directory_Set_Entry));
set->entries = eina_list_append(set->entries, entry);
}
/**
@page edcref
@property
image
@parameters
[image file] [compression method] (compression level)
@effect
Used to include each image file. The full path to the directory holding
the images can be defined later with edje_cc's "-id" option.
Compression methods:
@li RAW: Uncompressed.
@li COMP: Lossless compression.
@li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
@li USER: Do not embed the file, refer to the external file instead.
@endproperty
**/
static void
st_images_set_image_image(void)
{
Edje_Image_Directory_Set_Entry *entry;
Edje_Image_Directory_Set *set;
unsigned int i;
set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
entry = eina_list_data_get(eina_list_last(set->entries));
/* Add the image to the global pool with the same syntax. */
st_images_image();
entry->name = parse_str(0);
for (i = 0; i < edje_file->image_dir->entries_count; ++i)
if (!strcmp(edje_file->image_dir->entries[i].entry, entry->name))
{
entry->id = i;
return;
}
}
/**
@page edcref
@property
size
@parameters
[minw minh maxw mawh]
@effect
Define the minimal and maximal size that will select the specified image.
@endproperty
*/
static void
st_images_set_image_size(void)
{
Edje_Image_Directory_Set_Entry *entry;
Edje_Image_Directory_Set *set;
set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
entry = eina_list_data_get(eina_list_last(set->entries));
entry->size.min.w = parse_int(0);
entry->size.min.h = parse_int(1);
entry->size.max.w = parse_int(2);
entry->size.max.h = parse_int(3);
if (entry->size.min.w > entry->size.max.w
|| entry->size.min.h > entry->size.max.h)
{
ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
file_in, line - 1,
entry->size.min.w, entry->size.min.h,
entry->size.max.w, entry->size.max.h);
exit(-1);
}
}
/**
@edcsubsection{toplevel_fonts,Fonts}
*/
/**
@page edcref
@block
fonts
@context
fonts {
font: "filename1.ext" "fontname";
font: "filename2.ext" "otherfontname";
..
}
@description
The "fonts" block is used to list each font file with an alias used later
in the theme. As with the "images" block, additional "fonts" blocks can
be included inside other blocks.
@endblock
@property
font
@parameters
[font filename] [font alias]
@effect
Defines each font "file" and "alias", the full path to the directory
holding the font files can be defined with edje_cc's "-fd" option.
@endproperty
*/
static void
st_fonts_font(void)
{
Edje_Font *fn;
check_arg_count(2);
if (!edje_file->fonts)
edje_file->fonts = eina_hash_string_small_new(free);
fn = mem_alloc(SZ(Edje_Font));
fn->file = parse_str(0);
fn->name = parse_str(1);
if (eina_hash_find(edje_file->fonts, fn->name))
{
free(fn->file);
free(fn->name);
free(fn);
return;
}
eina_hash_direct_add(edje_file->fonts, fn->name, fn);
}
/**
@edcsubsection{toplevel_data,Data}
*/
/**
@page edcref
@block
data
@context
data {
item: "key" "value";
file: "otherkey" "filename.ext";
..
}
@description
The "data" block is used to pass arbitrary parameters from the theme to
the application. Unlike the "images" and "fonts" blocks, additional
"data" blocks can only be included inside the "group" block.
@endblock
@property
item
@parameters
[parameter name] [parameter value]
@effect
Defines a new parameter, the value will be the string specified next to
it.
@endproperty
*/
static void
st_data_item(void)
{
Edje_String *es;
char *key;
check_arg_count(2);
key = parse_str(0);
es = mem_alloc(SZ(Edje_String));
es->str = parse_str(1);
if (!edje_file->data)
edje_file->data = eina_hash_string_small_new(free);
/* FIXME: check if data already exist */
eina_hash_direct_add(edje_file->data, key, es);
}
/**
@page edcref
@property
file
@parameters
[parameter name] [parameter filename]
@effect
Defines a new parameter, the value will be the contents of the
specified file formated as a single string of text. This property only
works with plain text files.
@endproperty
*/
static void
st_data_file(void)
{
const char *data;
const char *over;
Edje_String *es;
char *filename;
char *value;
char *key;
int fd;
int i;
struct stat buf;
check_arg_count(2);
key = parse_str(0);
es = mem_alloc(SZ(Edje_String));
filename = parse_str(1);
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
ERR("%s:%i when opening file \"%s\": \"%s\"",
file_in, line, filename, strerror(errno));
exit(-1);
}
if (fstat(fd, &buf))
{
ERR("%s:%i when stating file \"%s\": \"%s\"",
file_in, line, filename, strerror(errno));
exit(-1);
}
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED)
{
ERR("%s:%i when mapping file \"%s\": \"%s\"",
file_in, line, filename, strerror(errno));
exit(-1);
}
over = data;
for (i = 0; i < buf.st_size; ++i, ++over)
if (*over == '\0')
{
ERR("%s:%i file \"%s\" is a binary file.", file_in, line, filename);
exit(-1);
}
value = malloc(sizeof (char) * buf.st_size + 1);
snprintf(value, buf.st_size + 1, "%s", data);
munmap((void*)data, buf.st_size);
close(fd);
es->str = value;
eina_hash_direct_add(edje_file->data, key, es);
free(filename);
}
/**
@edcsubsection{toplevel_color_classes,Color Classes}
*/
/**
@page edcref
@block
color_classes
@context
color_classes {
color_class {
name: "colorclassname";
color: [0-255] [0-255] [0-255] [0-255];
color2: [0-255] [0-255] [0-255] [0-255];
color3: [0-255] [0-255] [0-255] [0-255]
}
..
}
@description
The "color_classes" block contains a list of one or more "color_class"
blocks. Each "color_class" allows the designer to name an arbitrary
group of colors to be used in the theme, the application can use that
name to alter the color values at runtime.
@endblock
*/
static void
ob_color_class(void)
{
Edje_Color_Class *cc;
cc = mem_alloc(SZ(Edje_Color_Class));
edje_file->color_classes = eina_list_append(edje_file->color_classes, cc);
cc->r = 0;
cc->g = 0;
cc->b = 0;
cc->a = 0;
cc->r2 = 0;
cc->g2 = 0;
cc->b2 = 0;
cc->a2 = 0;
cc->r3 = 0;
cc->g3 = 0;
cc->b3 = 0;
cc->a3 = 0;
}
/**
@page edcref
@property
name
@parameters
[color class name]
@effect
Sets the name for the color class, used as reference by both the theme
and the application.
@endproperty
*/
static void
st_color_class_name(void)
{
Edje_Color_Class *cc, *tcc;
Eina_List *l;
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
cc->name = parse_str(0);
EINA_LIST_FOREACH(edje_file->color_classes, l, tcc)
{
if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
{
ERR("parse error %s:%i. There is already a color class named \"%s\"",
file_in, line - 1, cc->name);
exit(-1);
}
}
}
/**
@page edcref
@property
color
@parameters
[red] [green] [blue] [alpha]
@effect
The main color.
@endproperty
*/
static void
st_color_class_color(void)
{
Edje_Color_Class *cc;
check_arg_count(4);
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
cc->r = parse_int_range(0, 0, 255);
cc->g = parse_int_range(1, 0, 255);
cc->b = parse_int_range(2, 0, 255);
cc->a = parse_int_range(3, 0, 255);
}
/**
@page edcref
@property
color2
@parameters
[red] [green] [blue] [alpha]
@effect
Used as outline in text and textblock parts.
@endproperty
*/
static void
st_color_class_color2(void)
{
Edje_Color_Class *cc;
check_arg_count(4);
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
cc->r2 = parse_int_range(0, 0, 255);
cc->g2 = parse_int_range(1, 0, 255);
cc->b2 = parse_int_range(2, 0, 255);
cc->a2 = parse_int_range(3, 0, 255);
}
/**
@page edcref
@property
color3
@parameters
[red] [green] [blue] [alpha]
@effect
Used as shadow in text and textblock parts.
@endproperty
*/
static void
st_color_class_color3(void)
{
Edje_Color_Class *cc;
check_arg_count(4);
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
cc->r3 = parse_int_range(0, 0, 255);
cc->g3 = parse_int_range(1, 0, 255);
cc->b3 = parse_int_range(2, 0, 255);
cc->a3 = parse_int_range(3, 0, 255);
}
/**
@edcsubsection{toplevel_styles,Styles}
*/
/**
@page edcref
@block
styles
@context
styles {
style {
name: "stylename";
base: "..default style properties..";
tag: "tagname" "..style properties..";
..
}
..
}
@description
The "styles" block contains a list of one or more "style" blocks. A
"style" block is used to create style \<tags\> for advanced TEXTBLOCK
formatting.
@endblock
*/
static void
ob_styles_style(void)
{
Edje_Style *stl;
stl = mem_alloc(SZ(Edje_Style));
edje_file->styles = eina_list_append(edje_file->styles, stl);
}
/**
@page edcref
@property
name
@parameters
[style name]
@effect
The name of the style to be used as reference later in the theme.
@endproperty
*/
static void
st_styles_style_name(void)
{
Edje_Style *stl, *tstl;
Eina_List *l;
stl = eina_list_data_get(eina_list_last(edje_file->styles));
stl->name = parse_str(0);
EINA_LIST_FOREACH(edje_file->styles, l, tstl)
{
if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name)))
{
ERR("parse error %s:%i. There is already a style named \"%s\"",
file_in, line - 1, stl->name);
exit(-1);
}
}
}
/**
@page edcref
@property
base
@parameters
[style properties string]
@effect
The default style properties that will be applied to the complete
text.
@endproperty
*/
static void
st_styles_style_base(void)
{
Edje_Style *stl;
Edje_Style_Tag *tag;
stl = eina_list_data_get(eina_list_last(edje_file->styles));
if (stl->tags)
{
ERR("parse error %s:%i. There is already a basic format for the style",
file_in, line - 1);
exit(-1);
}
tag = mem_alloc(SZ(Edje_Style_Tag));
tag->key = mem_strdup("DEFAULT");
tag->value = parse_str(0);
stl->tags = eina_list_append(stl->tags, tag);
}
/**
@page edcref
@property
tag
@parameters
[tag name] [style properties string]
@effect
Style to be applied only to text between style \<tags\>..\</tags\>.
When creating "paired" tags, like \<bold\>\</bold\>, A '+' should be added at the start of the style properties of the first part (\<bold\>).
If the second part (\</bold\>) is also defined, a '-' should be prepended to it's style properties.
This only applies to paired tags; Single tags, like \<tab\>, must not include a starting '+'.
@endproperty
*/
static void
st_styles_style_tag(void)
{
Edje_Style *stl;
Edje_Style_Tag *tag;
stl = eina_list_data_get(eina_list_last(edje_file->styles));
tag = mem_alloc(SZ(Edje_Style