2012-06-04 Cedric Bail
- * Add VIRTUAL part to reduce the load on the canvas (lighter and faster theme).
+ * Add SPACER part to reduce the load on the canvas (lighter and faster theme).
* Add edje_watch to monitore change on edje source.
* Emit ['edje,change,file', 'edje'] when the file change on disk.
* edje_player will automatically reload the file when it change on disk.
- * Add VIRTUAL part. This part are not putting anything into the canvas. So lighter and faster to
+ * Add SPACER part. This part are not putting anything into the canvas. So lighter and faster to
process (Use it to replace RECT part that are never visible and never catch any event).
Improvements:
switch (type)
{
- case EDJE_PART_TYPE_VIRTUAL:
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
@li TABLE
@li EXTERNAL
@li PROXY
- @li VIRTUAL
+ @li SPACER
@endproperty
*/
static void
"TABLE", EDJE_PART_TYPE_TABLE,
"EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
"PROXY", EDJE_PART_TYPE_PROXY,
- "VIRTUAL", EDJE_PART_TYPE_VIRTUAL,
+ "SPACER", EDJE_PART_TYPE_SPACER,
NULL);
/* handle type change of inherited part */
ed->color_class = STRDUP(ed->color_class);
switch (ep->type)
{
- case EDJE_PART_TYPE_VIRTUAL:
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
{
check_arg_count(1);
- if (current_part->type == EDJE_PART_TYPE_VIRTUAL)
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
{
ERR("%s: Error. parse error %s:%i. "
- "VIRTUAL part can't have a visibility defined",
+ "SPACER part can't have a visibility defined",
progname, file_in, line - 1);
exit(-1);
}
{
check_arg_count(1);
- if (current_part->type == EDJE_PART_TYPE_VIRTUAL)
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
{
ERR("%s: Error. parse error %s:%i. "
- "VIRTUAL part can't have a color defined",
+ "SPACER part can't have a color defined",
progname, file_in, line - 1);
exit(-1);
}
{
check_arg_count(4);
- if (current_part->type == EDJE_PART_TYPE_VIRTUAL)
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
{
ERR("%s: Error. parse error %s:%i. "
- "VIRTUAL part can't have a color defined",
+ "SPACER part can't have a color defined",
progname, file_in, line - 1);
exit(-1);
}
{
check_arg_count(4);
- if (current_part->type == EDJE_PART_TYPE_VIRTUAL)
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
{
ERR("%s: Error. parse error %s:%i. "
- "VIRTUAL part can't have a color defined",
+ "SPACER part can't have a color defined",
progname, file_in, line - 1);
exit(-1);
}
return "TABLE";
case EDJE_PART_TYPE_EXTERNAL:
return "EXTERNAL";
+ case EDJE_PART_TYPE_SPACER:
+ return "SPACER";
case EDJE_PART_TYPE_NONE:
case EDJE_PART_TYPE_LAST:
EDJE_PART_TYPE_TABLE = 9,
EDJE_PART_TYPE_EXTERNAL = 10,
EDJE_PART_TYPE_PROXY = 11,
- EDJE_PART_TYPE_VIRTUAL = 12, /**< @since 1.3 */
+ EDJE_PART_TYPE_SPACER = 12, /**< @since 1.3 */
EDJE_PART_TYPE_LAST = 13
} Edje_Part_Type;
INIT_EMP_BOTH(BOX, Edje_Part_Description_Box, ce);
INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce);
INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce);
- INIT_EMP_BOTH(VIRTUAL, Edje_Part_Description_Common, ce);
+ INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce);
INIT_EMP(part, Edje_Part, ce);
snprintf(buf, sizeof(buf), "edje/collections/%i", id);
ce->count.GROUP++;
memsize = sizeof(Edje_Part_Description_Common);
break;
- case EDJE_PART_TYPE_VIRTUAL:
- desc_rtl = eina_mempool_malloc(ce->mp_rtl.VIRTUAL,
+ case EDJE_PART_TYPE_SPACER:
+ desc_rtl = eina_mempool_malloc(ce->mp_rtl.SPACER,
sizeof (Edje_Part_Description_Common));
- ce->count.VIRTUAL++;
+ ce->count.SPACER++;
memsize = sizeof(Edje_Part_Description_Common);
break;
EDIT_ALLOC_POOL_RTL(TEXT, Text, text);
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params);
- if (ep->part->type != EDJE_PART_TYPE_VIRTUAL)
+ if (ep->part->type != EDJE_PART_TYPE_SPACER)
{
/* colors */
if ((desc->color_class) && (*desc->color_class))
break;
}
- case EDJE_PART_TYPE_VIRTUAL:
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TABLE:
case EDJE_PART_TYPE_EXTERNAL:
evas_object_image_source_set(ep->object, pp->swallowed_object);
break;
- case EDJE_PART_TYPE_VIRTUAL:
+ case EDJE_PART_TYPE_SPACER:
/* FIXME: detect that at compile time and prevent it */
break;
}
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
- case EDJE_PART_TYPE_VIRTUAL:
- /* We really should do nothing on VIRTUAL part */
+ case EDJE_PART_TYPE_SPACER:
+ /* We really should do nothing on SPACER part */
break;
}
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
- case EDJE_PART_TYPE_VIRTUAL:
- /* We really should do nothing on VIRTUAL part */
+ case EDJE_PART_TYPE_SPACER:
+ /* We really should do nothing on SPACER part */
break;
}
mo = ep->swallowed_object;
}
else mo = ep->object;
- if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_VIRTUAL)
+ if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
{
static Evas_Map *map = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_variant = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle = NULL;
-Eet_Data_Descriptor *_edje_edd_edje_part_description_virtual = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_external = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL;
-Eet_Data_Descriptor *_edje_edd_edje_part_description_virtual_pointer = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image_pointer = NULL;
EMP(BOX, box);
EMP(TABLE, table);
EMP(EXTERNAL, external);
-EMP(VIRTUAL, virtual);
+EMP(SPACER, spacer);
EMP(part, part);
#define FREED(eed) \
{ EDJE_PART_TYPE_TABLE, "table" },
{ EDJE_PART_TYPE_EXTERNAL, "external" },
{ EDJE_PART_TYPE_PROXY, "proxy" },
- { EDJE_PART_TYPE_VIRTUAL, "virtual" }
+ { EDJE_PART_TYPE_SPACER, "spacer" }
};
static const char *
FREED(_edje_edd_edje_part_pointer);
FREED(_edje_edd_edje_part_description_variant);
FREED(_edje_edd_edje_part_description_rectangle);
- FREED(_edje_edd_edje_part_description_virtual);
+ FREED(_edje_edd_edje_part_description_spacer);
FREED(_edje_edd_edje_part_description_swallow);
FREED(_edje_edd_edje_part_description_group);
FREED(_edje_edd_edje_part_description_image);
FREED(_edje_edd_edje_part_description_external);
FREED(_edje_edd_edje_part_description_variant_list);
FREED(_edje_edd_edje_part_description_rectangle_pointer);
- FREED(_edje_edd_edje_part_description_virtual_pointer);
+ FREED(_edje_edd_edje_part_description_spacer_pointer);
FREED(_edje_edd_edje_part_description_swallow_pointer);
FREED(_edje_edd_edje_part_description_group_pointer);
FREED(_edje_edd_edje_part_description_image_pointer);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.BOX", count.BOX, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TABLE", count.TABLE, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.EXTERNAL", count.EXTERNAL, EET_T_INT);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.VIRTUAL", count.VIRTUAL, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SPACER", count.SPACER, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.part", count.part, EET_T_INT);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Style_Tag);
EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_rectangle, Edje_Part_Description_Common);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
- eddc.func.mem_free = mem_free_virtual;
- eddc.func.mem_alloc = mem_alloc_virtual;
- _edje_edd_edje_part_description_virtual =
+ eddc.func.mem_free = mem_free_spacer;
+ eddc.func.mem_alloc = mem_alloc_spacer;
+ _edje_edd_edje_part_description_spacer =
eet_data_descriptor_file_new(&eddc);
- EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_virtual, Edje_Part_Description_Common);
+ EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_spacer, Edje_Part_Description_Common);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
eddc.func.mem_free = mem_free_swallow;
eddc.func.type_set = _edje_description_variant_type_set;
_edje_edd_edje_part_description_variant = eet_data_descriptor_file_new(&eddc);
- EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "virtual", _edje_edd_edje_part_description_virtual);
+ EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "spacer", _edje_edd_edje_part_description_spacer);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "rectangle", _edje_edd_edje_part_description_rectangle);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group);
_edje_edd_edje_part_description_variant_list = eet_data_descriptor_file_new(&eddc);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "rectangle", rectangle);
- EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "virtual", virtual);
+ EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "spacer", spacer);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "image", image);
EDIT_EMN(BOX, Edje_Part_Description_Box, de);
EDIT_EMN(TABLE, Edje_Part_Description_Table, de);
EDIT_EMN(EXTERNAL, Edje_Part_Description_External, de);
+ EDIT_EMN(SPACER, Edje_Part_Description_Common, de);
EDIT_EMN(part, Edje_Part, de);
ed->file->collection_cache = eina_list_prepend(ed->file->collection_cache, pc);
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
rp->object = evas_object_textblock_add(ed->base.evas);
- else
+ else if (ep->type != EDJE_PART_TYPE_SPACER)
ERR("wrong part type %i!", ep->type);
if (rp->object)
{
pd = eina_mempool_malloc(ce->mp.RECTANGLE, sizeof (Edje_Part_Description_Common));
ce->count.RECTANGLE++;
break;
+ case EDJE_PART_TYPE_SPACER:
+ pd = eina_mempool_malloc(ce->mp.SPACER, sizeof (Edje_Part_Description_Common));
+ ce->count.SPACER++;
+ break;
case EDJE_PART_TYPE_SWALLOW:
pd = eina_mempool_malloc(ce->mp.SWALLOW, sizeof (Edje_Part_Description_Common));
ce->count.SWALLOW++;
#define BUF_APPENDF(FMT, ...) \
ret &= eina_strbuf_append_printf(buf, FMT, ##__VA_ARGS__)
-static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL"};
+static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL", "SPACER"};
static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", "SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW ", "FAR_SHADOW ", "FAR_SOFT_SHADOW", "GLOW"};
static const char *prefers[] = {"NONE", "VERTICAL", "HORIZONTAL", "BOTH"};
ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
ep->name, group, file);
break;
- case EDJE_PART_TYPE_VIRTUAL:
+ case EDJE_PART_TYPE_SPACER:
rp->object = NULL;
break;
default:
eina_mempool_del(ce->mp.BOX);
eina_mempool_del(ce->mp.TABLE);
eina_mempool_del(ce->mp.EXTERNAL);
- eina_mempool_del(ce->mp.VIRTUAL);
+ eina_mempool_del(ce->mp.SPACER);
eina_mempool_del(ce->mp.part);
memset(&ce->mp, 0, sizeof (ce->mp));
eina_mempool_del(ce->mp_rtl.BOX);
eina_mempool_del(ce->mp_rtl.TABLE);
eina_mempool_del(ce->mp_rtl.EXTERNAL);
- eina_mempool_del(ce->mp_rtl.VIRTUAL);
+ eina_mempool_del(ce->mp_rtl.SPACER);
memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl));
free(ec);
ce->ref = NULL;
TYPE GROUP; \
TYPE BOX; \
TYPE TABLE; \
- TYPE VIRTUAL; \
+ TYPE SPACER; \
TYPE EXTERNAL;
struct _Edje_Part_Collection_Directory_Entry
extern Eina_Mempool *_emp_BOX;
extern Eina_Mempool *_emp_TABLE;
extern Eina_Mempool *_emp_EXTERNAL;
-extern Eina_Mempool *_emp_VIRTUAL;
+extern Eina_Mempool *_emp_SPACER;
extern Eina_Mempool *_emp_part;
void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2);