forked from enlightenment/efl
edje_cc can now fully parse my test edje input "test.edc" file and build a
properly formed test.eet output file including inlined images, data structs and all. it can display verbose output infomration if you use the -v flag. the only problem now is that no sample .edc files are shipped. I'll make one or 2 better ones and include them. SVN revision: 7033
This commit is contained in:
parent
eccfb5727a
commit
0d2194a7b5
|
@ -6,6 +6,7 @@ Evas_List *img_dirs = NULL;
|
|||
char *file_in = NULL;
|
||||
char *file_out = NULL;
|
||||
char *progname = NULL;
|
||||
int verbose = 0;
|
||||
|
||||
static void
|
||||
main_help(void)
|
||||
|
@ -17,6 +18,7 @@ main_help(void)
|
|||
"Where OPTIONS is one or more of:\n"
|
||||
"\n"
|
||||
"-id image/directory Add a directory to look in for relative path images\n"
|
||||
"-v Verbose output\n"
|
||||
,progname);
|
||||
}
|
||||
|
||||
|
@ -25,6 +27,8 @@ main(int argc, char **argv)
|
|||
{
|
||||
int i;
|
||||
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
progname = argv[0];
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
|
@ -33,6 +37,10 @@ main(int argc, char **argv)
|
|||
main_help();
|
||||
exit(0);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-v"))
|
||||
{
|
||||
verbose = 1;
|
||||
}
|
||||
else if ((!strcmp(argv[i], "-id")) && (i < (argc - 1)))
|
||||
{
|
||||
i++;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
#include <locale.h>
|
||||
|
||||
/* types */
|
||||
typedef struct _New_Object_Handler New_Object_Handler;
|
||||
|
@ -37,6 +38,7 @@ struct _New_Statement_Handler
|
|||
void data_setup(void);
|
||||
void data_write(void);
|
||||
void data_queue_part_lookup(Edje_Part_Collection *pc, char *name, int *dest);
|
||||
void data_queue_program_lookup(Edje_Part_Collection *pc, char *name, int *dest);
|
||||
void data_queue_image_lookup(char *name, int *dest);
|
||||
void data_process_lookups(void);
|
||||
|
||||
|
@ -61,10 +63,12 @@ extern Evas_List *img_dirs;
|
|||
extern char *file_in;
|
||||
extern char *file_out;
|
||||
extern char *progname;
|
||||
extern int verbose;
|
||||
extern int line;
|
||||
extern Evas_List *stack;
|
||||
extern Evas_List *params;
|
||||
extern Edje_File *edje_file;
|
||||
extern Evas_List *edje_collections;
|
||||
extern New_Object_Handler object_handlers[];
|
||||
extern New_Statement_Handler statement_handlers[];
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@ static void st_collections_group_parts_part_description_text_align(void);
|
|||
static void ob_collections_group_programs(void);
|
||||
|
||||
static void ob_collections_group_programs_program(void);
|
||||
static void st_collections_group_programs_program_name(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_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);
|
||||
|
||||
/*****/
|
||||
|
||||
|
@ -99,7 +106,14 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.description.text.effect", st_collections_group_parts_part_description_text_effect},
|
||||
{"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.align", st_collections_group_parts_part_description_text_align}
|
||||
{"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
|
||||
{"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.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}
|
||||
};
|
||||
|
||||
New_Object_Handler object_handlers[] =
|
||||
|
@ -158,7 +172,14 @@ New_Object_Handler object_handlers[] =
|
|||
{"collections.group.parts.part.description.text.min", NULL},
|
||||
{"collections.group.parts.part.description.text.align", NULL},
|
||||
{"collections.group.programs", ob_collections_group_programs},
|
||||
{"collections.group.programs.program", ob_collections_group_programs_program}
|
||||
{"collections.group.programs.program", ob_collections_group_programs_program},
|
||||
{"collections.group.programs.program.name", NULL},
|
||||
{"collections.group.programs.program.signal", NULL},
|
||||
{"collections.group.programs.program.source", NULL},
|
||||
{"collections.group.programs.program.action", NULL},
|
||||
{"collections.group.programs.program.transition", NULL},
|
||||
{"collections.group.programs.program.target", NULL},
|
||||
{"collections.group.programs.program.after", NULL}
|
||||
};
|
||||
|
||||
/*****/
|
||||
|
@ -248,8 +269,8 @@ ob_collections_group(void)
|
|||
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;
|
||||
edje_collections = evas_list_append(edje_collections, pc);
|
||||
pc->id = evas_list_count(edje_collections) - 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -273,7 +294,7 @@ ob_collections_group_parts_part(void)
|
|||
Edje_Part *ep;
|
||||
|
||||
ep = mem_alloc(SZ(Edje_Part));
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
pc->parts = evas_list_append(pc->parts, ep);
|
||||
ep->id = evas_list_count(pc->parts) - 1;
|
||||
}
|
||||
|
@ -284,7 +305,7 @@ st_collections_group_parts_part_name(void)
|
|||
Edje_Part_Collection *pc;
|
||||
Edje_Part *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->name = parse_str(0);
|
||||
}
|
||||
|
@ -295,7 +316,7 @@ 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));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->type = parse_enum(0,
|
||||
"NONE", EDJE_PART_TYPE_NONE,
|
||||
|
@ -311,7 +332,7 @@ 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));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->mouse_events = parse_int_range(0, 0, 1);
|
||||
}
|
||||
|
@ -322,7 +343,7 @@ 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));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ep->color_class = parse_str(0);
|
||||
}
|
||||
|
@ -334,7 +355,7 @@ ob_collections_group_parts_part_description(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->parts));
|
||||
ed = mem_alloc(SZ(Edje_Part_Description));
|
||||
if (!ep->default_desc)
|
||||
|
@ -350,7 +371,7 @@ st_collections_group_parts_part_description_state(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -365,7 +386,7 @@ st_collections_group_parts_part_description_visible(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -379,7 +400,7 @@ st_collections_group_parts_part_description_dragable_x(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -395,7 +416,7 @@ st_collections_group_parts_part_description_dragable_y(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -411,7 +432,7 @@ st_collections_group_parts_part_description_dragable_confine(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -431,7 +452,7 @@ st_collections_group_parts_part_description_align(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -446,7 +467,7 @@ st_collections_group_parts_part_description_min(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -461,7 +482,7 @@ st_collections_group_parts_part_description_max(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -476,7 +497,7 @@ st_collections_group_parts_part_description_step(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -491,7 +512,7 @@ st_collections_group_parts_part_description_aspect(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -506,7 +527,7 @@ st_collections_group_parts_part_description_rel1_relative(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -521,7 +542,7 @@ st_collections_group_parts_part_description_rel1_offset(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -536,7 +557,7 @@ st_collections_group_parts_part_description_rel1_to(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -556,7 +577,7 @@ st_collections_group_parts_part_description_rel2_relative(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -571,7 +592,7 @@ st_collections_group_parts_part_description_rel2_offset(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -586,7 +607,7 @@ st_collections_group_parts_part_description_rel2_to(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -606,7 +627,7 @@ st_collections_group_parts_part_description_image_normal(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -626,7 +647,7 @@ st_collections_group_parts_part_description_image_tween(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -649,7 +670,7 @@ st_collections_group_parts_part_description_border(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -666,7 +687,7 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -681,7 +702,7 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -696,7 +717,7 @@ st_collections_group_parts_part_description_fill_size_relative(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -711,7 +732,7 @@ st_collections_group_parts_part_description_fill_size_offset(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -726,7 +747,7 @@ st_collections_group_parts_part_description_color(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -743,7 +764,7 @@ st_collections_group_parts_part_description_color2(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -760,7 +781,7 @@ st_collections_group_parts_part_description_color3(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -777,7 +798,7 @@ st_collections_group_parts_part_description_text_text(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -791,7 +812,7 @@ st_collections_group_parts_part_description_text_font(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -805,7 +826,7 @@ st_collections_group_parts_part_description_text_size(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -819,7 +840,7 @@ st_collections_group_parts_part_description_text_effect(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -839,7 +860,7 @@ st_collections_group_parts_part_description_text_fit(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -854,7 +875,7 @@ st_collections_group_parts_part_description_text_min(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -869,7 +890,7 @@ st_collections_group_parts_part_description_text_align(void)
|
|||
Edje_Part *ep;
|
||||
Edje_Part_Description *ed;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_file->collection_loaded));
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
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));
|
||||
|
@ -886,4 +907,124 @@ ob_collections_group_programs(void)
|
|||
static void
|
||||
ob_collections_group_programs_program(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = mem_alloc(SZ(Edje_Program));
|
||||
pc->programs = evas_list_append(pc->programs, ep);
|
||||
ep->id = evas_list_count(pc->programs) - 1;
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_name(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
ep->name = parse_str(0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_signal(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
ep->signal = parse_str(0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_source(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
ep->source = parse_str(0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_action(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
ep->action = parse_enum(0,
|
||||
"STATE_SET", EDJE_ACTION_TYPE_STATE_SET,
|
||||
"ACTION_STOP", EDJE_ACTION_TYPE_ACTION_STOP,
|
||||
NULL);
|
||||
ep->state = parse_str(1);
|
||||
ep->value = parse_float_range(2, 0.0, 1.0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_transition(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
ep->tween.mode = parse_enum(0,
|
||||
"LINEAR", EDJE_TWEEN_MODE_LINEAR,
|
||||
"SINUSOIDAL", EDJE_TWEEN_MODE_SINUSOIDAL,
|
||||
"ACCELERATE", EDJE_TWEEN_MODE_ACCELERATE,
|
||||
"DECELERATE", EDJE_TWEEN_MODE_DECELERATE,
|
||||
NULL);
|
||||
ep->tween.time = parse_float_range(1, 0.0, 999999999.0);
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_target(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
{
|
||||
Edje_Program_Target *et;
|
||||
char *name;
|
||||
|
||||
et = mem_alloc(SZ(Edje_Program_Target));
|
||||
ep->targets = evas_list_append(ep->targets, et);
|
||||
|
||||
name = parse_str(0);
|
||||
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
|
||||
data_queue_part_lookup(pc, name, &(et->id));
|
||||
else if (ep->action == EDJE_ACTION_TYPE_ACTION_STOP)
|
||||
data_queue_program_lookup(pc, name, &(et->id));
|
||||
else
|
||||
{
|
||||
/* FIXME: not type specified. guess */
|
||||
data_queue_part_lookup(pc, name, &(et->id));
|
||||
data_queue_program_lookup(pc, name, &(et->id));
|
||||
}
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_collections_group_programs_program_after(void)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
Edje_Program *ep;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
ep = evas_list_data(evas_list_last(pc->programs));
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = parse_str(0);
|
||||
data_queue_program_lookup(pc, name, &(ep->after));
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "edje_cc.h"
|
||||
|
||||
typedef struct _Part_Lookup Part_Lookup;
|
||||
typedef struct _Program_Lookup Program_Lookup;
|
||||
typedef struct _Image_Lookup Image_Lookup;
|
||||
|
||||
struct _Part_Lookup
|
||||
|
@ -10,6 +11,13 @@ struct _Part_Lookup
|
|||
int *dest;
|
||||
};
|
||||
|
||||
struct _Program_Lookup
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
char *name;
|
||||
int *dest;
|
||||
};
|
||||
|
||||
struct _Image_Lookup
|
||||
{
|
||||
char *name;
|
||||
|
@ -17,28 +25,40 @@ struct _Image_Lookup
|
|||
};
|
||||
|
||||
Edje_File *edje_file = NULL;
|
||||
Evas_List *edje_collections = NULL;
|
||||
|
||||
static Eet_Data_Descriptor *edd_edje_file = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_image_directory = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_image_directory_entry = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_program = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_program_target = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part_collection_directory = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part_collection_directory_entry = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part_collection = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part_description = NULL;
|
||||
static Eet_Data_Descriptor *edd_edje_part_image_id = NULL;
|
||||
|
||||
static Evas_List *part_lookups = NULL;
|
||||
static Evas_List *program_lookups = NULL;
|
||||
static Evas_List *image_lookups = NULL;
|
||||
|
||||
void
|
||||
data_setup(void)
|
||||
{
|
||||
/* image directory */
|
||||
edd_edje_image_directory_entry = eet_data_descriptor_new("Edje_Image_Directory_Entry",
|
||||
sizeof(Edje_Image_Directory_Entry),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
sizeof(Edje_Image_Directory_Entry),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "entry", entry, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_type", source_type, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_param", source_param, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "id", id, EET_T_INT);
|
||||
|
||||
edd_edje_image_directory = eet_data_descriptor_new("Edje_Image_Directory",
|
||||
sizeof(Edje_Image_Directory),
|
||||
evas_list_next,
|
||||
|
@ -47,6 +67,28 @@ data_setup(void)
|
|||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_image_directory, Edje_Image_Directory, "entries", entries, edd_edje_image_directory_entry);
|
||||
|
||||
/* collection directory */
|
||||
edd_edje_part_collection_directory_entry = eet_data_descriptor_new("Edje_Part_Collection_Directory_Entry",
|
||||
sizeof(Edje_Part_Collection_Directory_Entry),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "entry", entry, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "id", id, EET_T_INT);
|
||||
|
||||
edd_edje_part_collection_directory = eet_data_descriptor_new("Edje_Part_Collection_Directory",
|
||||
sizeof(Edje_Part_Collection_Directory),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_part_collection_directory, Edje_Part_Collection_Directory, "entries", entries, edd_edje_part_collection_directory_entry);
|
||||
|
||||
/* the main file directory */
|
||||
edd_edje_file = eet_data_descriptor_new("Edje_File",
|
||||
sizeof(Edje_File),
|
||||
evas_list_next,
|
||||
|
@ -55,6 +97,148 @@ data_setup(void)
|
|||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_SUB(edd_edje_file, Edje_File, "image_dir", image_dir, edd_edje_image_directory);
|
||||
EET_DATA_DESCRIPTOR_ADD_SUB(edd_edje_file, Edje_File, "collection_dir", collection_dir, edd_edje_part_collection_directory);
|
||||
|
||||
/* parts & programs - loaded induvidually */
|
||||
edd_edje_program_target = eet_data_descriptor_new("Edje_Program_Target",
|
||||
sizeof(Edje_Program_Target),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program_target, Edje_Program_Target, "id", id, EET_T_INT);
|
||||
|
||||
edd_edje_program = eet_data_descriptor_new("Edje_Program",
|
||||
sizeof(Edje_Program),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "id", id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "name", name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "signal", signal, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "source", source, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "action", action, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "state", state, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "value", value, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "tween.mode", tween.mode, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "tween.time", tween.time, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_program, Edje_Program, "targets", targets, edd_edje_program_target);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_program, Edje_Program, "after", after, EET_T_INT);
|
||||
|
||||
edd_edje_part_image_id = eet_data_descriptor_new("Edje_Part_Image_Id",
|
||||
sizeof(Edje_Part_Image_Id),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_image_id, Edje_Part_Image_Id, "id", id, EET_T_INT);
|
||||
|
||||
edd_edje_part_description = eet_data_descriptor_new("Edje_Part_Description",
|
||||
sizeof(Edje_Part_Description),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "state.name", state.name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "state.value", state.value, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "visible", visible, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.x", dragable.x, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.step_x", dragable.step_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.count_x", dragable.count_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.y", dragable.y, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.step_y", dragable.step_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.count_y", dragable.count_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "dragable.counfine_id", dragable.confine_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "clip_to_id", clip_to_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "align.x", align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "align.y", align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "min.w", min.w, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "min.h", min.h, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "max.w", max.w, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "max.h", max.h, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "step.x", step.x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "step.y", step.y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "aspect.min", aspect.min, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "aspect.max", aspect.max, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel1.relative_x", rel1.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel1.relative_y", rel1.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel1.offset_x", rel1.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel1.offset_y", rel1.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel1.id", rel1.id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel2.relative_x", rel2.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel2.relative_y", rel2.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel2.offset_x", rel2.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel2.offset_y", rel2.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "rel2.id", rel2.id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "image.id", image.id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_part_description, Edje_Part_Description, "image.tween_list", image.tween_list, edd_edje_part_image_id);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "border.l", border.l, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "border.r", border.r, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "border.t", border.t, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "border.b", border.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_x", fill.pos_rel_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_x", fill.pos_abs_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.rel_x", fill.rel_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.abs_x", fill.abs_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_y", fill.pos_rel_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_y", fill.pos_abs_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.rel_y", fill.rel_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "fill.abs_y", fill.abs_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color.r", color.r, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color.g", color.g, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color.b", color.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color.a", color.a, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color2.r", color2.r, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color2.g", color2.g, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color2.b", color2.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color2.a", color2.a, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color3.r", color3.r, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color3.g", color3.g, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color3.b", color3.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "color3.a", color3.a, EET_T_INT);
|
||||
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.text", text.text, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.font", text.font, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.size", text.size, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.effect", text.effect, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.fit_x", text.fit_x, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.fit_y", text.fit_y, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.min_x", text.min_x, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.min_y", text.min_y, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.align.x", text.align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_description, Edje_Part_Description, "text.align.y", text.align.y, EET_T_DOUBLE);
|
||||
|
||||
edd_edje_part = eet_data_descriptor_new("Edje_Part",
|
||||
sizeof(Edje_Part),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "name", name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "id", id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "type", type, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "mouse_events", mouse_events, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "color_class", color_class, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part, Edje_Part, "text_class", text_class, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_SUB(edd_edje_part, Edje_Part, "default_desc", default_desc, edd_edje_part_description);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_part, Edje_Part, "other_desc", other_desc, edd_edje_part_description);
|
||||
|
||||
edd_edje_part_collection = eet_data_descriptor_new("Edje_Part_Collection",
|
||||
sizeof(Edje_Part_Collection),
|
||||
evas_list_next,
|
||||
evas_list_append,
|
||||
evas_list_data,
|
||||
evas_hash_foreach,
|
||||
evas_hash_add);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_part_collection, Edje_Part_Collection, "programs", programs, edd_edje_program);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd_edje_part_collection, Edje_Part_Collection, "parts", parts, edd_edje_part);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_edje_part_collection, Edje_Part_Collection, "id", id, EET_T_INT);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -62,15 +246,27 @@ data_write(void)
|
|||
{
|
||||
Eet_File *ef;
|
||||
Evas_List *l;
|
||||
int bytes;
|
||||
|
||||
ef = eet_open(file_out, EET_FILE_MODE_WRITE);
|
||||
if (!ef)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to open %s for writing output\n",
|
||||
fprintf(stderr, "%s: Error. unable to open \"%s\" for writing output\n",
|
||||
progname, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
eet_data_write(ef, edd_edje_file, "data", edje_file, 1);
|
||||
bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1);
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write \"edje_file\" entry to \"%s\" \n",
|
||||
progname, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
|
||||
progname, bytes, (bytes + 512) / 1024);
|
||||
}
|
||||
for (l = edje_file->image_dir->entries; l; l = l->next)
|
||||
{
|
||||
Edje_Image_Directory_Entry *img;
|
||||
|
@ -95,8 +291,8 @@ data_write(void)
|
|||
if (im)
|
||||
{
|
||||
DATA32 *im_data;
|
||||
int im_w, im_h;
|
||||
int im_alpha;
|
||||
int im_w, im_h;
|
||||
int im_alpha;
|
||||
char buf[256];
|
||||
|
||||
imlib_context_set_image(im);
|
||||
|
@ -104,25 +300,59 @@ data_write(void)
|
|||
im_h = imlib_image_get_height();
|
||||
im_alpha = imlib_image_has_alpha();
|
||||
im_data = imlib_image_get_data_for_reading_only();
|
||||
snprintf(buf, sizeof(buf), "/images/%i", img->id);
|
||||
snprintf(buf, sizeof(buf), "images/%i", img->id);
|
||||
if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT)
|
||||
eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h, im_alpha,
|
||||
img->source_param, 0, 0);
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
img->source_param, 0, 0);
|
||||
else
|
||||
eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h, im_alpha,
|
||||
0, img->source_param, 1);
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
im_alpha,
|
||||
0, img->source_param, 1);
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s \n",
|
||||
progname, img->entry, buf, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\"\n",
|
||||
progname, bytes, (bytes + 512) / 1024, buf, img->entry);
|
||||
}
|
||||
imlib_image_put_back_data(im_data);
|
||||
imlib_free_image();
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Warning. unable to open image %s for inclusion in output\n",
|
||||
fprintf(stderr, "%s: Warning. unable to open image \"%s\" for inclusion in output\n",
|
||||
progname, img->entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (l = edje_collections; l; l = l->next)
|
||||
{
|
||||
Edje_Part_Collection *pc;
|
||||
char buf[456];
|
||||
|
||||
pc = l->data;
|
||||
|
||||
snprintf(buf, sizeof(buf), "collections/%i", pc->id);
|
||||
bytes = eet_data_write(ef, edd_edje_part_collection, buf, pc, 1);
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable to write \"%s\" part entry to %s \n",
|
||||
progname, buf, file_out);
|
||||
exit(-1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" collection entry\n",
|
||||
progname, bytes, (bytes + 512) / 1024, buf);
|
||||
}
|
||||
}
|
||||
eet_close(ef);
|
||||
}
|
||||
|
||||
|
@ -138,6 +368,18 @@ data_queue_part_lookup(Edje_Part_Collection *pc, char *name, int *dest)
|
|||
pl->dest = dest;
|
||||
}
|
||||
|
||||
void
|
||||
data_queue_program_lookup(Edje_Part_Collection *pc, char *name, int *dest)
|
||||
{
|
||||
Program_Lookup *pl;
|
||||
|
||||
pl = mem_alloc(SZ(Program_Lookup));
|
||||
program_lookups = evas_list_append(program_lookups, pl);
|
||||
pl->pc = pc;
|
||||
pl->name = mem_strdup(name);
|
||||
pl->dest = dest;
|
||||
}
|
||||
|
||||
void
|
||||
data_queue_image_lookup(char *name, int *dest)
|
||||
{
|
||||
|
@ -182,6 +424,34 @@ data_process_lookups(void)
|
|||
free(pl);
|
||||
}
|
||||
|
||||
while (program_lookups)
|
||||
{
|
||||
Program_Lookup *pl;
|
||||
|
||||
pl = program_lookups->data;
|
||||
|
||||
for (l = pl->pc->programs; l; l = l->next)
|
||||
{
|
||||
Edje_Program *ep;
|
||||
|
||||
ep = l->data;
|
||||
if ((ep->name) && (!strcmp(ep->name, pl->name)))
|
||||
{
|
||||
*(pl->dest) = ep->id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. unable find program name %s\n",
|
||||
progname, pl->name);
|
||||
exit(-1);
|
||||
}
|
||||
program_lookups = evas_list_remove(program_lookups, pl);
|
||||
free(pl->name);
|
||||
free(pl);
|
||||
}
|
||||
|
||||
while (image_lookups)
|
||||
{
|
||||
Image_Lookup *il;
|
||||
|
|
|
@ -245,7 +245,12 @@ parse(char *data, off_t size)
|
|||
char *p, *end, *token;
|
||||
int delim = 0;
|
||||
int do_params = 0;
|
||||
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Parsing input file\n",
|
||||
progname);
|
||||
}
|
||||
p = data;
|
||||
end = data + size;
|
||||
line = 1;
|
||||
|
@ -303,6 +308,11 @@ parse(char *data, off_t size)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Parsing done\n",
|
||||
progname);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -315,10 +325,15 @@ compile(void)
|
|||
fd = open(file_in, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Error. cannot open file %s for input. %s\n",
|
||||
fprintf(stderr, "%s: Error. cannot open file \"%s\" for input. %s\n",
|
||||
progname, file_in, strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
printf("%s: Opening \"%s\" for input\n",
|
||||
progname, file_in);
|
||||
}
|
||||
|
||||
size = lseek(fd, 0, SEEK_END);
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
@ -330,7 +345,7 @@ compile(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Error. cannot mmap file %s for input. %s\n",
|
||||
fprintf(stderr, "%s: Error. cannot mmap file \"%s\" for input. %s\n",
|
||||
progname, file_in, strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
|
|
@ -42,13 +42,12 @@
|
|||
* "drag"
|
||||
* "drag.stop"
|
||||
*/
|
||||
|
||||
typedef struct _Edje_File Edje_File;
|
||||
typedef struct _Edje_Image_Directory Edje_Image_Directory;
|
||||
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
|
||||
typedef struct _Edje_Program Edje_Program;
|
||||
typedef struct _Edje_Action_Directory Edje_Action_Directory;
|
||||
typedef struct _Edje_Action Edje_Action;
|
||||
typedef struct _Edje_Action_Target Edje_Action_Target;
|
||||
typedef struct _Edje_Program_Target Edje_Program_Target;
|
||||
typedef struct _Edje_Part_Collection_Directory Edje_Part_Collection_Directory;
|
||||
typedef struct _Edje_Part_Collection_Directory_Entry Edje_Part_Collection_Directory_Entry;
|
||||
typedef struct _Edje_Part_Collection Edje_Part_Collection;
|
||||
|
@ -56,24 +55,18 @@ typedef struct _Edje_Part Edje_Part;
|
|||
typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
|
||||
typedef struct _Edje_Part_Description Edje_Part_Description;
|
||||
|
||||
#define EDJE_PART_TYPE_NONE 0
|
||||
#define EDJE_PART_TYPE_RECTANGLE 1
|
||||
#define EDJE_PART_TYPE_TEXT 2
|
||||
#define EDJE_PART_TYPE_IMAGE 3
|
||||
#define EDJE_PART_TYPE_LAST 4
|
||||
|
||||
#define EDJE_ACTION_TYPE_NONE 0
|
||||
#define EDJE_ACTION_TYPE_STATE_SET 1
|
||||
#define EDJE_ACTION_TYPE_ACTION_STOP 2
|
||||
#define EDJE_ACTION_TYPE_DRAG_SET 3
|
||||
#define EDJE_ACTION_TYPE_LAST 4
|
||||
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_NONE 0
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT 1
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY 2
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_EXTERNAL 3
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_LAST 4
|
||||
|
||||
#define EDJE_PART_TYPE_NONE 0
|
||||
#define EDJE_PART_TYPE_RECTANGLE 1
|
||||
#define EDJE_PART_TYPE_TEXT 2
|
||||
#define EDJE_PART_TYPE_IMAGE 3
|
||||
#define EDJE_PART_TYPE_LAST 4
|
||||
|
||||
#define EDJE_TEXT_EFFECT_NONE 0
|
||||
#define EDJE_TEXT_EFFECT_PLAIN 1
|
||||
#define EDJE_TEXT_EFFECT_OUTLINE 2
|
||||
|
@ -81,6 +74,11 @@ typedef struct _Edje_Part_Description Edje_Part_Description;
|
|||
#define EDJE_TEXT_EFFECT_OUTLINE_SHADOW 4
|
||||
#define EDJE_TEXT_EFFECT_LAST 5
|
||||
|
||||
#define EDJE_ACTION_TYPE_NONE 0
|
||||
#define EDJE_ACTION_TYPE_STATE_SET 1
|
||||
#define EDJE_ACTION_TYPE_ACTION_STOP 2
|
||||
#define EDJE_ACTION_TYPE_LAST 4
|
||||
|
||||
#define EDJE_TWEEN_MODE_NONE 0
|
||||
#define EDJE_TWEEN_MODE_LINEAR 1
|
||||
#define EDJE_TWEEN_MODE_SINUSOIDAL 2
|
||||
|
@ -122,33 +120,27 @@ struct _Edje_Image_Directory_Entry
|
|||
|
||||
struct _Edje_Program /* a conditional program to be run */
|
||||
{
|
||||
char *emission; /* if signal emission name matches the glob here... */
|
||||
char *part; /* & if part that emitted the signal (name) matches this glob */
|
||||
int action_id; /* perform action number here */
|
||||
};
|
||||
|
||||
/*----------*/
|
||||
|
||||
struct _Edje_Action_Directory /* a list of possible actions to perform */
|
||||
{
|
||||
Evas_List *actions; /* a list of Edje_Action */
|
||||
};
|
||||
|
||||
struct _Edje_Action /* action to perfrom on parts within a part collection */
|
||||
{
|
||||
int id; /* id of program */
|
||||
char *name; /* name of the action */
|
||||
|
||||
char *signal; /* if signal emission name matches the glob here... */
|
||||
char *source; /* if part that emitted this (name) matches this glob */
|
||||
|
||||
int action; /* type - set state, stop action, set drag pos etc. */
|
||||
double tween_time; /* time to graduate between current and new state */
|
||||
int tween_mode; /* how to tween - linear, sinusoidal etc. */
|
||||
char *state; /* what state of alternates to apply */
|
||||
double drag_set_rel_x; /* x drag pos to set targets to, relative to container */
|
||||
double drag_set_rel_y; /* y drag pos to set targets to, relative to container */
|
||||
int drag_set_abs_offset_x;
|
||||
int drag_set_abs_offset_y;
|
||||
char *state; /* what state of alternates to apply, NULL = default */
|
||||
double value; /* value of state to apply (if multiple names match) */
|
||||
|
||||
struct {
|
||||
int mode; /* how to tween - linear, sinusoidal etc. */
|
||||
double time; /* time to graduate between current and new state */
|
||||
} tween;
|
||||
|
||||
Evas_List *targets; /* list of target parts to apply the state to */
|
||||
int end_action_id; /* id of action to run when this one finished */
|
||||
|
||||
int after; /* an action id to run at the end of this, for looping */
|
||||
};
|
||||
|
||||
struct _Edje_Action_Target /* the target of an action */
|
||||
struct _Edje_Program_Target /* the target of an action */
|
||||
{
|
||||
int id; /* just the part id no, or action id no */
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue