2003-06-11 06:20:48 -07:00
|
|
|
#include "edje_cc.h"
|
|
|
|
|
|
|
|
static void ob_images(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
static void ob_images_image(void);
|
|
|
|
static void st_images_image(void);
|
|
|
|
|
2003-06-11 07:14:23 -07:00
|
|
|
static void ob_collections(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_name(void);
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_parts(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_parts_part(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_parts_part_name(void);
|
|
|
|
static void st_collections_group_parts_part_type(void);
|
|
|
|
static void st_collections_group_parts_part_mouse_events(void);
|
|
|
|
static void st_collections_group_parts_part_color_class(void);
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_parts_part_description(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_parts_part_description_state(void);
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_programs(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_programs_program(void);
|
2003-06-11 07:14:23 -07:00
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
/*****/
|
|
|
|
|
|
|
|
New_Object_Handler object_handlers[] =
|
|
|
|
{
|
|
|
|
{"images", ob_images},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"images.image", ob_images_image},
|
|
|
|
{"collections", ob_collections},
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group", ob_collections_group},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"collections.group.name", NULL},
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group.parts", ob_collections_group_parts},
|
|
|
|
{"collections.group.parts.part", ob_collections_group_parts_part},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"collections.group.parts.part.name", NULL},
|
|
|
|
{"collections.group.parts.part.type", NULL},
|
|
|
|
{"collections.group.parts.part.mouse_events", NULL},
|
|
|
|
{"collections.group.parts.part.color_class", NULL},
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group.parts.part.description", ob_collections_group_parts_part_description},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"collections.group.parts.part.description.state", NULL},
|
|
|
|
{"collections.group.parts.part.description.visible", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.x", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.y", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.confine", NULL},
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group.programs", ob_collections_group_programs},
|
|
|
|
{"collections.group.programs.program", ob_collections_group_programs_program}
|
2003-06-11 06:20:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
New_Statement_Handler statement_handlers[] =
|
|
|
|
{
|
2003-06-11 07:14:23 -07:00
|
|
|
{"images.image", st_images_image},
|
2003-06-12 16:02:45 -07:00
|
|
|
{"collections.group.name", st_collections_group_name},
|
|
|
|
{"collections.group.parts.part.name", st_collections_group_parts_part_name},
|
|
|
|
{"collections.group.parts.part.type", st_collections_group_parts_part_type},
|
|
|
|
{"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
|
|
|
|
{"collections.group.parts.part.color_class", st_collections_group_parts_part_color_class},
|
|
|
|
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"collections.group.parts.part.description.visible", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.x", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.y", NULL},
|
|
|
|
{"collections.group.parts.part.description.dragable.confine", NULL}
|
2003-06-11 06:20:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****/
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****/
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_images(void)
|
|
|
|
{
|
2003-06-12 15:34:51 -07:00
|
|
|
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_images_image(void)
|
|
|
|
{
|
|
|
|
Edje_Image_Directory_Entry *img;
|
|
|
|
|
|
|
|
img = calloc(1, sizeof(Edje_Image_Directory_Entry));
|
|
|
|
edje_file->image_dir->entries = evas_list_append(edje_file->image_dir->entries, img);
|
|
|
|
img->id = evas_list_count(edje_file->image_dir->entries) - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_images_image(void)
|
|
|
|
{
|
|
|
|
Edje_Image_Directory_Entry *img;
|
2003-06-12 06:02:28 -07:00
|
|
|
int v;
|
2003-06-11 06:20:48 -07:00
|
|
|
|
|
|
|
img = evas_list_data(evas_list_last(edje_file->image_dir->entries));
|
2003-06-12 06:02:28 -07:00
|
|
|
img->entry = parse_str(0);
|
|
|
|
v = parse_enum(1,
|
|
|
|
"RAW", 0,
|
|
|
|
"COMP", 1,
|
|
|
|
"LOSSY", 2,
|
|
|
|
"USER", 3,
|
|
|
|
NULL);
|
|
|
|
if (v == 0)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 1)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
|
|
|
|
img->source_param = 1;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 2)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 3)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
|
|
|
if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY) return;
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_param = parse_int_range(2, 0, 100);
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-11 07:14:23 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections(void)
|
2003-06-12 15:34:51 -07:00
|
|
|
{
|
|
|
|
edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection_Directory_Entry *de;
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
|
2003-06-12 16:02:45 -07:00
|
|
|
edje_file->collection_dir->entries = evas_list_append(edje_file->collection_dir->entries, de);
|
|
|
|
de->id = evas_list_count(edje_file->collection_dir->entries) - 1;
|
|
|
|
|
|
|
|
pc = mem_alloc(SZ(Edje_Part_Collection));
|
|
|
|
edje_file->collection_loaded = evas_list_append(edje_file->collection_loaded, pc);
|
|
|
|
pc->id = evas_list_count(edje_file->collection_loaded) - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_name(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection_Directory_Entry *de;
|
|
|
|
|
|
|
|
de = evas_list_data(evas_list_last(edje_file->collection_dir->entries));
|
|
|
|
de->entry = parse_str(0);
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_parts(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_parts_part(void)
|
2003-06-12 16:02:45 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
ep = mem_alloc(SZ(Edje_Part));
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
pc->parts = evas_list_append(pc->parts, ep);
|
|
|
|
ep->id = evas_list_count(pc->parts) - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_name(void)
|
2003-06-12 15:34:51 -07:00
|
|
|
{
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ep->name = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_type(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ep->type = parse_enum(0,
|
|
|
|
"RECT", EDJE_PART_TYPE_RECTANGLE,
|
|
|
|
"TEXT", EDJE_PART_TYPE_TEXT,
|
|
|
|
"IMAGE", EDJE_PART_TYPE_IMAGE,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_mouse_events(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ep->mouse_events = parse_int_range(0, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_color_class(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ep->color_class = parse_str(0);
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_parts_part_description(void)
|
|
|
|
{
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ed = mem_alloc(SZ(Edje_Part_Description));
|
|
|
|
if (!ep->default_desc)
|
|
|
|
ep->default_desc = ed;
|
|
|
|
else
|
|
|
|
ep->other_desc = evas_list_append(ep->other_desc, ed);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_state(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
|
|
|
ep = evas_list_data(evas_list_last(pc->parts));
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
|
|
|
ed->state.name = parse_str(0);
|
|
|
|
ed->state.value = parse_float_range(1, 0.0, 1.0);
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_programs(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_programs_program(void)
|
2003-06-11 07:14:23 -07:00
|
|
|
{
|
|
|
|
}
|