* edje: add file minor version field.

It will show a warning when loading file that may use feature from
	newer edje (show up with EINA_LOG_LEVEL=2 in the env).

	Please don't forget to increase it when you add feature to edje
	file format without breaking backward compatibility.


SVN revision: 51636
This commit is contained in:
Cedric BAIL 2010-08-25 09:56:20 +00:00
parent 86eb3374d4
commit 800b1af09e
4 changed files with 12 additions and 0 deletions

View File

@ -198,6 +198,7 @@ main(int argc, char **argv)
edje_file = mem_alloc(SZ(Edje_File));
edje_file->compiler = strdup("edje_cc");
edje_file->version = EDJE_FILE_VERSION;
edje_file->minor = EDJE_FILE_MINOR;
edje_file->feature_ver = 1; /* increment this every time we add a field
* or feature to the edje file format that
* does not load nicely as a NULL or 0 value

View File

@ -162,6 +162,11 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co
return NULL;
}
if (edf->minor > EDJE_FILE_MINOR)
{
WRN("`%s` may use feature from a newer edje and could not show up as expected.", file);
}
edf->path = eina_stringshare_add(file);
edf->references = 1;

View File

@ -325,6 +325,7 @@ _edje_edd_init(void)
_edje_edd_edje_file = eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "compiler", compiler, EET_T_STRING);
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, "feature_ver", feature_ver, EET_T_INT);
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);

View File

@ -150,6 +150,10 @@ struct _Edje_Smart_Api
* EETs cannot be loaded/used correctly anymore.
*/
#define EDJE_FILE_VERSION 3
/* increment this when you add new feature to edje file format without
* breaking backward compatibility.
*/
#define EDJE_FILE_MINOR 0
/* FIXME:
*
@ -354,6 +358,7 @@ struct _Edje_File
int references;
const char *compiler;
int version;
int minor;
int feature_ver;
Eina_Hash *data;