add group aliases.

use as follows:

group {
  name: "primary_name";
  alias: "another_name";
  alias: "one_more_name";
}

then you can refer to the group by any of these names.


SVN revision: 26546
This commit is contained in:
rephorm 2006-10-12 05:35:14 +00:00 committed by rephorm
parent 83bb15914f
commit 980a64d58a
3 changed files with 29 additions and 0 deletions

View File

@ -128,6 +128,7 @@ extern Evas_List *edje_collections;
extern Evas_List *fonts; extern Evas_List *fonts;
extern Evas_List *codes; extern Evas_List *codes;
extern Evas_List *defines; extern Evas_List *defines;
extern Evas_List *aliases;
extern New_Object_Handler object_handlers[]; extern New_Object_Handler object_handlers[];
extern New_Statement_Handler statement_handlers[]; extern New_Statement_Handler statement_handlers[];

View File

@ -30,6 +30,7 @@ static void ob_collections(void);
static void ob_collections_group(void); static void ob_collections_group(void);
static void st_collections_group_name(void); static void st_collections_group_name(void);
static void st_collections_group_alias(void);
static void st_collections_group_min(void); static void st_collections_group_min(void);
static void st_collections_group_max(void); static void st_collections_group_max(void);
static void st_collections_group_data_item(void); static void st_collections_group_data_item(void);
@ -144,6 +145,7 @@ New_Statement_Handler statement_handlers[] =
{"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */ {"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */ {"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.name", st_collections_group_name}, {"collections.group.name", st_collections_group_name},
{"collections.group.alias", st_collections_group_alias},
{"collections.group.min", st_collections_group_min}, {"collections.group.min", st_collections_group_min},
{"collections.group.max", st_collections_group_max}, {"collections.group.max", st_collections_group_max},
{"collections.group.data.item", st_collections_group_data_item}, {"collections.group.data.item", st_collections_group_data_item},
@ -793,6 +795,21 @@ st_collections_group_name(void)
de->entry = parse_str(0); de->entry = parse_str(0);
} }
static void
st_collections_group_alias(void)
{
Edje_Part_Collection_Directory_Entry *de, *alias;
check_arg_count(1);
de = evas_list_data(evas_list_last(edje_file->collection_dir->entries));
alias = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
alias->id = de->id;
alias->entry = parse_str(0);
aliases = evas_list_append(aliases, alias);
}
static void static void
st_collections_group_min(void) st_collections_group_min(void)
{ {

View File

@ -52,6 +52,7 @@ Evas_List *edje_collections = NULL;
Evas_List *fonts = NULL; Evas_List *fonts = NULL;
Evas_List *codes = NULL; Evas_List *codes = NULL;
Evas_List *code_lookups = NULL; Evas_List *code_lookups = NULL;
Evas_List *aliases = NULL;
static Eet_Data_Descriptor *edd_edje_file = 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 = NULL;
@ -221,6 +222,16 @@ data_write(void)
} }
if (edje_file) if (edje_file)
{ {
if (edje_file->collection_dir)
{
/* copy aliases into collection directory */
while (aliases)
{
edje_file->collection_dir->entries = evas_list_append(edje_file->collection_dir->entries, aliases->data);
aliases = evas_list_remove_list(aliases, aliases);
}
}
bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1); bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1);
if (bytes <= 0) if (bytes <= 0)
{ {