summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-26 16:21:44 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-27 13:11:36 -0500
commit291ffc69d08b03602956726d071ecca4d7b70ff3 (patch)
treecd2b770ca23f9a4e336b807a759489c2ed8773d1
parent3e376bdc5f1663dc62d4980832a43048c692cbf3 (diff)
edje_cc: add "id" toplevel property
this can be used by edje files to identify themselves
-rw-r--r--src/bin/edje/edje_cc_handlers.c26
-rw-r--r--src/lib/edje/edje_data.c1
-rw-r--r--src/lib/edje/edje_load.c1
-rw-r--r--src/lib/edje/edje_private.h1
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);
202 202
203static void check_has_anchors(void); 203static void check_has_anchors(void);
204 204
205static void st_id(void);
205static void st_efl_version(void); 206static void st_efl_version(void);
206static void st_externals_external(void); 207static void st_externals_external(void);
207 208
@@ -701,6 +702,7 @@ static void _handle_vector_image(void);
701 702
702New_Statement_Handler statement_handlers[] = 703New_Statement_Handler statement_handlers[] =
703{ 704{
705 {"id", st_id},
704 {"efl_version", st_efl_version}, 706 {"efl_version", st_efl_version},
705 {"externals.external", st_externals_external}, 707 {"externals.external", st_externals_external},
706 IMAGE_STATEMENTS("") 708 IMAGE_STATEMENTS("")
@@ -2223,6 +2225,30 @@ st_efl_version(void)
2223 edje_file->efl_version.minor = parse_int(1); 2225 edje_file->efl_version.minor = parse_int(1);
2224} 2226}
2225 2227
2228/** @edcsubsection{toplevel_id,
2229 * id} */
2230
2231/**
2232 @page edcref
2233
2234 @property
2235 id
2236 @parameters
2237 [name]
2238 @effect
2239 A string which is used to identify the edje file.
2240 @since 1.21
2241 @endproperty
2242 */
2243static void
2244st_id(void)
2245{
2246 check_arg_count(1);
2247
2248 free(edje_file->id);
2249 edje_file->id = parse_str(0);
2250}
2251
2226/** @edcsubsection{toplevel_externals, 2252/** @edcsubsection{toplevel_externals,
2227 * Externals} */ 2253 * Externals} */
2228 2254
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)
613 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.major", efl_version.major, EET_T_INT); 613 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.major", efl_version.major, EET_T_INT);
614 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.minor", efl_version.minor, EET_T_INT); 614 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "efl_version.minor", efl_version.minor, EET_T_INT);
615 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "base_scale", base_scale, EDJE_T_FLOAT); 615 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "base_scale", base_scale, EDJE_T_FLOAT);
616 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "id", id, EET_T_STRING);
616 EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory); 617 EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory);
617 EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory); 618 EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
618 EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "model_dir", model_dir, _edje_edd_edje_model_directory); 619 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)
2229 if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns); 2229 if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns);
2230 if (edf->path) eina_stringshare_del(edf->path); 2230 if (edf->path) eina_stringshare_del(edf->path);
2231 if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler); 2231 if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
2232 if (edf->free_strings) eina_stringshare_del(edf->id);
2232 _edje_textblock_style_cleanup(edf); 2233 _edje_textblock_style_cleanup(edf);
2233 if (edf->ef) eet_close(edf->ef); 2234 if (edf->ef) eet_close(edf->ef);
2234 if (edf->f) eina_file_close(edf->f); 2235 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
600 int major; 600 int major;
601 int minor; 601 int minor;
602 } efl_version; 602 } efl_version;
603 Eina_Stringshare *id;
603 604
604 FLOAT_T base_scale; 605 FLOAT_T base_scale;
605 606