diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-02-26 16:21:44 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-02-28 16:02:37 -0500 |
commit | 3a86768f3bf4f38ff41adad8054060ed57eae384 (patch) | |
tree | f2f5e1fadd8b92da0bd1c28cfc5c6bc4ccd5e798 /src | |
parent | 30378f26fad84362ab64b6ec6e1ca237802bebeb (diff) | |
download | efl-3a86768f3bf4f38ff41adad8054060ed57eae384.tar.gz |
edje_cc: add "id" toplevel property
this can be used by edje files to identify themselves
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/edje/edje_cc_handlers.c | 26 | ||||
-rw-r--r-- | src/lib/edje/edje_data.c | 1 | ||||
-rw-r--r-- | src/lib/edje/edje_load.c | 1 | ||||
-rw-r--r-- | src/lib/edje/edje_private.h | 1 |
4 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 6786104269..e5109d1c8d 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -202,6 +202,7 @@ static void *_part_free(Edje_Part_Collection *pc, Edje_Part *ep); static void check_has_anchors(void); +static void st_id(void); static void st_efl_version(void); static void st_externals_external(void); @@ -701,6 +702,7 @@ static void _handle_vector_image(void); New_Statement_Handler statement_handlers[] = { + {"id", st_id}, {"efl_version", st_efl_version}, {"externals.external", st_externals_external}, IMAGE_STATEMENTS("") @@ -2223,6 +2225,30 @@ st_efl_version(void) edje_file->efl_version.minor = parse_int(1); } +/** @edcsubsection{toplevel_id, + * id} */ + +/** + @page edcref + + @property + id + @parameters + [name] + @effect + A string which is used to identify the edje file. + @since 1.21 + @endproperty + */ +static void +st_id(void) +{ + check_arg_count(1); + + free(edje_file->id); + edje_file->id = parse_str(0); +} + /** @edcsubsection{toplevel_externals, * Externals} */ diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 13f94fc51d..b6df4b6fab 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -613,6 +613,7 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.major", efl_version.major, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.minor", efl_version.minor, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "base_scale", base_scale, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "id", id, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory); EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory); EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "model_dir", model_dir, _edje_edd_edje_model_directory); diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 76964dd0d0..f809d5a987 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -2229,6 +2229,7 @@ _edje_file_free(Edje_File *edf) if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns); if (edf->path) eina_stringshare_del(edf->path); if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler); + if (edf->free_strings) eina_stringshare_del(edf->id); _edje_textblock_style_cleanup(edf); if (edf->ef) eet_close(edf->ef); if (edf->f) eina_file_close(edf->f); diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 8200d43aa7..87975753eb 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -600,6 +600,7 @@ struct _Edje_File int major; int minor; } efl_version; + Eina_Stringshare *id; FLOAT_T base_scale; |