forked from enlightenment/efl
edje: add efl_version property
Summary: efl_version will be used to figure out which version of EFL lib is used to develop a edje file. If there is no property of efl_version, it will be 1.19 as default. This feature is needed to fix T5548. Example: efl_version: 1 20 @feature Test Plan: N/A Reviewers: cedric, jpeg, herdsman, zmike, raster Reviewed By: cedric Maniphest Tasks: T5548 Differential Revision: https://phab.enlightenment.org/D4961 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
8c11685b5e
commit
638ee888d9
|
@ -398,6 +398,15 @@ main(int argc, char **argv)
|
||||||
* does not load nicely as a NULL or 0 value
|
* does not load nicely as a NULL or 0 value
|
||||||
* and needs a special fallback initialization
|
* and needs a special fallback initialization
|
||||||
*/
|
*/
|
||||||
|
/* efl_version is used for specify efl's version
|
||||||
|
* which was used for developing a edje file.
|
||||||
|
* It is useful if Edje(or other EFL libs) need to keep
|
||||||
|
* backward compatibility.
|
||||||
|
* efl_version was added just after EFL 1.19.
|
||||||
|
* Thus, 1.19 will be default.
|
||||||
|
*/
|
||||||
|
edje_file->efl_version.major = 1;
|
||||||
|
edje_file->efl_version.minor = 19;
|
||||||
edje_file->base_scale = FROM_INT(1);
|
edje_file->base_scale = FROM_INT(1);
|
||||||
|
|
||||||
source_edd();
|
source_edd();
|
||||||
|
|
|
@ -199,6 +199,7 @@ static void _program_free(Edje_Program *pr);
|
||||||
|
|
||||||
static void check_has_anchors(void);
|
static void check_has_anchors(void);
|
||||||
|
|
||||||
|
static void st_efl_version(void);
|
||||||
static void st_externals_external(void);
|
static void st_externals_external(void);
|
||||||
|
|
||||||
static void st_images_image(void);
|
static void st_images_image(void);
|
||||||
|
@ -695,6 +696,7 @@ static void _handle_vector_image(void);
|
||||||
|
|
||||||
New_Statement_Handler statement_handlers[] =
|
New_Statement_Handler statement_handlers[] =
|
||||||
{
|
{
|
||||||
|
{"efl_version", st_efl_version},
|
||||||
{"externals.external", st_externals_external},
|
{"externals.external", st_externals_external},
|
||||||
IMAGE_STATEMENTS("")
|
IMAGE_STATEMENTS("")
|
||||||
FONT_STYLE_CC_STATEMENTS("")
|
FONT_STYLE_CC_STATEMENTS("")
|
||||||
|
@ -2141,6 +2143,29 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
|
||||||
|
|
||||||
/** @edcsection{toplevel,Top-Level blocks} */
|
/** @edcsection{toplevel,Top-Level blocks} */
|
||||||
|
|
||||||
|
/** @edcsubsection{toplevel_efl_version,
|
||||||
|
* Efl_version} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
@page edcref
|
||||||
|
|
||||||
|
@property
|
||||||
|
efl_version
|
||||||
|
@parameters
|
||||||
|
[major] [minor]
|
||||||
|
@effect
|
||||||
|
Used to show which version of EFL is used for developing a edje file.
|
||||||
|
@endproperty
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
st_efl_version(void)
|
||||||
|
{
|
||||||
|
check_arg_count(2);
|
||||||
|
|
||||||
|
edje_file->efl_version.major = parse_int(0);
|
||||||
|
edje_file->efl_version.minor = parse_int(1);
|
||||||
|
}
|
||||||
|
|
||||||
/** @edcsubsection{toplevel_externals,
|
/** @edcsubsection{toplevel_externals,
|
||||||
* Externals} */
|
* Externals} */
|
||||||
|
|
||||||
|
|
|
@ -354,6 +354,13 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool coll
|
||||||
WRN("The base_scale can not be a 0.0. It is changed the default value(1.0)");
|
WRN("The base_scale can not be a 0.0. It is changed the default value(1.0)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set default efl_version if there is no version information */
|
||||||
|
if ((edf->efl_version.major == 0) && (edf->efl_version.minor == 0))
|
||||||
|
{
|
||||||
|
edf->efl_version.major = 1;
|
||||||
|
edf->efl_version.minor = 19;
|
||||||
|
}
|
||||||
|
|
||||||
edf->path = eina_stringshare_add(eina_file_filename_get(f));
|
edf->path = eina_stringshare_add(eina_file_filename_get(f));
|
||||||
edf->references = 1;
|
edf->references = 1;
|
||||||
|
|
||||||
|
|
|
@ -216,6 +216,8 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
edf->size_classes = oedf->size_classes;
|
edf->size_classes = oedf->size_classes;
|
||||||
edf->version = oedf->version;
|
edf->version = oedf->version;
|
||||||
edf->feature_ver = oedf->feature_ver;
|
edf->feature_ver = oedf->feature_ver;
|
||||||
|
edf->efl_version.major = oedf->efl_version.major;
|
||||||
|
edf->efl_version.minor = oedf->efl_version.minor;
|
||||||
edf->compiler = oedf->compiler;
|
edf->compiler = oedf->compiler;
|
||||||
|
|
||||||
edf->dangling = EINA_FALSE;
|
edf->dangling = EINA_FALSE;
|
||||||
|
|
|
@ -1034,6 +1034,8 @@ _edje_edd_init(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "version", version, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "version", version, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "minor", minor, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "minor", minor, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "feature_ver", feature_ver, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "feature_ver", feature_ver, EET_T_INT);
|
||||||
|
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, "base_scale", base_scale, EDJE_T_FLOAT);
|
||||||
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, "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, "image_dir", image_dir, _edje_edd_edje_image_directory);
|
||||||
|
|
|
@ -592,6 +592,11 @@ struct _Edje_File
|
||||||
int version;
|
int version;
|
||||||
int minor;
|
int minor;
|
||||||
int feature_ver;
|
int feature_ver;
|
||||||
|
struct {
|
||||||
|
int major;
|
||||||
|
int minor;
|
||||||
|
} efl_version;
|
||||||
|
|
||||||
FLOAT_T base_scale;
|
FLOAT_T base_scale;
|
||||||
|
|
||||||
char fid[8+8+8+2];
|
char fid[8+8+8+2];
|
||||||
|
|
Loading…
Reference in New Issue