forked from enlightenment/efl
edje: add a SNAPSHOT part in EDC.
This commit is contained in:
parent
08e888156e
commit
a7fd98f8f6
|
@ -1270,6 +1270,7 @@ New_Object_Handler object_handlers[] =
|
|||
external{}
|
||||
proxy{}
|
||||
spacer{}
|
||||
snapshot{}
|
||||
part {
|
||||
desc {
|
||||
}
|
||||
|
@ -1422,6 +1423,7 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
|
|||
case EDJE_PART_TYPE_RECTANGLE:
|
||||
case EDJE_PART_TYPE_SWALLOW:
|
||||
case EDJE_PART_TYPE_GROUP:
|
||||
case EDJE_PART_TYPE_SNAPSHOT:
|
||||
result = mem_alloc(SZ(Edje_Part_Description_Common));
|
||||
break;
|
||||
case EDJE_PART_TYPE_TEXT:
|
||||
|
@ -4882,6 +4884,7 @@ ob_collections_group_parts_part_short(void)
|
|||
"external", EDJE_PART_TYPE_EXTERNAL,
|
||||
"proxy", EDJE_PART_TYPE_PROXY,
|
||||
"spacer", EDJE_PART_TYPE_SPACER,
|
||||
"snapshot", EDJE_PART_TYPE_SNAPSHOT,
|
||||
NULL);
|
||||
|
||||
stack_pop_quick(EINA_TRUE, EINA_TRUE);
|
||||
|
@ -4918,6 +4921,7 @@ _part_desc_free(Edje_Part_Collection *pc,
|
|||
case EDJE_PART_TYPE_RECTANGLE:
|
||||
case EDJE_PART_TYPE_SWALLOW:
|
||||
case EDJE_PART_TYPE_GROUP:
|
||||
case EDJE_PART_TYPE_SNAPSHOT:
|
||||
/* Nothing todo, this part only have a common description. */
|
||||
break;
|
||||
case EDJE_PART_TYPE_BOX:
|
||||
|
@ -5289,6 +5293,7 @@ st_collections_group_parts_part_name(void)
|
|||
@li EXTERNAL
|
||||
@li PROXY
|
||||
@li SPACER
|
||||
@li SNAPSHOT
|
||||
@endproperty
|
||||
*/
|
||||
static void
|
||||
|
@ -5310,7 +5315,8 @@ st_collections_group_parts_part_type(void)
|
|||
"TABLE", EDJE_PART_TYPE_TABLE,
|
||||
"EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
|
||||
"PROXY", EDJE_PART_TYPE_PROXY,
|
||||
"SPACER", EDJE_PART_TYPE_SPACER,
|
||||
"SPACER", EDJE_PART_TYPE_SPACER,
|
||||
"SNAPSHOT", EDJE_PART_TYPE_SNAPSHOT,
|
||||
NULL);
|
||||
|
||||
_part_type_set(type);
|
||||
|
@ -7025,6 +7031,7 @@ st_collections_group_parts_part_description_inherit(void)
|
|||
case EDJE_PART_TYPE_RECTANGLE:
|
||||
case EDJE_PART_TYPE_SWALLOW:
|
||||
case EDJE_PART_TYPE_GROUP:
|
||||
case EDJE_PART_TYPE_SNAPSHOT:
|
||||
/* Nothing todo, this part only have a common description. */
|
||||
break;
|
||||
case EDJE_PART_TYPE_TEXT:
|
||||
|
|
|
@ -1235,7 +1235,8 @@ typedef enum _Edje_Part_Type
|
|||
EDJE_PART_TYPE_MESH_NODE = 13,
|
||||
EDJE_PART_TYPE_LIGHT = 14,
|
||||
EDJE_PART_TYPE_CAMERA = 15,
|
||||
EDJE_PART_TYPE_LAST = 16 /**< Last type value */
|
||||
EDJE_PART_TYPE_SNAPSHOT = 16,
|
||||
EDJE_PART_TYPE_LAST = 17 /**< Last type value */
|
||||
} Edje_Part_Type;
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -33,6 +33,7 @@ edje_cache_emp_alloc(Edje_Part_Collection_Directory_Entry *ce)
|
|||
INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce);
|
||||
INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce);
|
||||
INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce);
|
||||
INIT_EMP_BOTH(SNAPSHOT, Edje_Part_Description_Common, ce);
|
||||
INIT_EMP(part, Edje_Part, ce);
|
||||
}
|
||||
|
||||
|
@ -51,6 +52,7 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce)
|
|||
eina_mempool_del(ce->mp.TABLE);
|
||||
eina_mempool_del(ce->mp.EXTERNAL);
|
||||
eina_mempool_del(ce->mp.SPACER);
|
||||
eina_mempool_del(ce->mp.SNAPSHOT);
|
||||
eina_mempool_del(ce->mp.part);
|
||||
memset(&ce->mp, 0, sizeof (ce->mp));
|
||||
|
||||
|
@ -65,6 +67,7 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce)
|
|||
eina_mempool_del(ce->mp_rtl.TABLE);
|
||||
eina_mempool_del(ce->mp_rtl.EXTERNAL);
|
||||
eina_mempool_del(ce->mp_rtl.SPACER);
|
||||
eina_mempool_del(ce->mp_rtl.SNAPSHOT);
|
||||
memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl));
|
||||
ce->ref = NULL;
|
||||
}
|
||||
|
|
|
@ -326,6 +326,13 @@ case EDJE_PART_TYPE_##Short: \
|
|||
memsize = sizeof(Edje_Part_Description_Common);
|
||||
break;
|
||||
|
||||
case EDJE_PART_TYPE_SNAPSHOT:
|
||||
desc_rtl = eina_mempool_malloc(ce->mp_rtl.SNAPSHOT,
|
||||
sizeof (Edje_Part_Description_Common));
|
||||
ce->count.SNAPSHOT++;
|
||||
memsize = sizeof(Edje_Part_Description_Common);
|
||||
break;
|
||||
|
||||
case EDJE_PART_TYPE_SWALLOW:
|
||||
desc_rtl = eina_mempool_malloc(ce->mp_rtl.SWALLOW,
|
||||
sizeof (Edje_Part_Description_Common));
|
||||
|
|
|
@ -36,6 +36,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part = 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_snapshot = 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;
|
||||
|
@ -54,6 +55,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_light = NULL;
|
|||
Eet_Data_Descriptor *_edje_edd_edje_part_description_camera = 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_snapshot_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;
|
||||
|
@ -116,6 +118,7 @@ EMP(SPACER, spacer)
|
|||
EMP(MESH_NODE, mesh_node)
|
||||
EMP(LIGHT, light)
|
||||
EMP(CAMERA, camera)
|
||||
EMP(SNAPSHOT, snapshot)
|
||||
#undef EMP
|
||||
|
||||
EAPI Eina_Mempool *_emp_part = NULL;
|
||||
|
@ -164,7 +167,8 @@ struct
|
|||
{ EDJE_PART_TYPE_SPACER, "spacer" },
|
||||
{ EDJE_PART_TYPE_MESH_NODE, "mesh_node" },
|
||||
{ EDJE_PART_TYPE_LIGHT, "light" },
|
||||
{ EDJE_PART_TYPE_CAMERA, "camera" }
|
||||
{ EDJE_PART_TYPE_CAMERA, "camera" },
|
||||
{ EDJE_PART_TYPE_SNAPSHOT, "snapshot" }
|
||||
};
|
||||
|
||||
static const char *
|
||||
|
@ -254,6 +258,7 @@ _edje_edd_shutdown(void)
|
|||
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_snapshot);
|
||||
FREED(_edje_edd_edje_part_description_spacer);
|
||||
FREED(_edje_edd_edje_part_description_swallow);
|
||||
FREED(_edje_edd_edje_part_description_group);
|
||||
|
@ -272,6 +277,7 @@ _edje_edd_shutdown(void)
|
|||
FREED(_edje_edd_edje_part_description_3d_vec);
|
||||
FREED(_edje_edd_edje_part_description_variant_list);
|
||||
FREED(_edje_edd_edje_part_description_rectangle_pointer);
|
||||
FREED(_edje_edd_edje_part_description_snapshot_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);
|
||||
|
@ -491,6 +497,7 @@ _edje_edd_init(void)
|
|||
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.SPACER", count.SPACER, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SNAPSHOT", count.SNAPSHOT, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.MESH_NODE", count.MESH_NODE, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.LIGHT", count.LIGHT, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.CAMERA", count.CAMERA, EET_T_INT);
|
||||
|
@ -864,6 +871,14 @@ _edje_edd_init(void)
|
|||
eet_data_descriptor_file_new(&eddc);
|
||||
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_snapshot;
|
||||
eddc.func.mem_alloc = mem_alloc_snapshot;
|
||||
_edje_edd_edje_part_description_snapshot =
|
||||
eet_data_descriptor_file_new(&eddc);
|
||||
EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_snapshot, 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.mem_alloc = mem_alloc_swallow;
|
||||
|
@ -1117,6 +1132,7 @@ _edje_edd_init(void)
|
|||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_rectangle);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_snapshot);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Proxy, part_description_proxy);
|
||||
EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text);
|
||||
|
@ -1135,6 +1151,7 @@ _edje_edd_init(void)
|
|||
|
||||
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, "snapshot", _edje_edd_edje_part_description_snapshot);
|
||||
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);
|
||||
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image);
|
||||
|
@ -1162,6 +1179,7 @@ _edje_edd_init(void)
|
|||
_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, "snapshot", snapshot);
|
||||
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);
|
||||
|
|
|
@ -710,7 +710,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
|
|||
|
||||
case EDJE_PART_TYPE_PROXY:
|
||||
case EDJE_PART_TYPE_IMAGE:
|
||||
case EDJE_PART_TYPE_SNAPSHOT:
|
||||
rp->object = evas_object_image_add(ed->base->evas);
|
||||
if (ep->type == EDJE_PART_TYPE_SNAPSHOT)
|
||||
evas_object_image_snapshot_set(rp->object, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case EDJE_PART_TYPE_TEXT:
|
||||
|
@ -1958,6 +1961,8 @@ case EDJE_PART_TYPE_##Type: eina_mempool_free(Ce->mp.Type, Desc); \
|
|||
FREE_POOL(BOX, ce, desc);
|
||||
FREE_POOL(TABLE, ce, desc);
|
||||
FREE_POOL(EXTERNAL, ce, desc);
|
||||
FREE_POOL(SNAPSHOT, ce, desc);
|
||||
FREE_POOL(SPACER, ce, desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -837,7 +837,8 @@ struct _Edje_Limit
|
|||
TYPE EXTERNAL; \
|
||||
TYPE MESH_NODE; \
|
||||
TYPE LIGHT; \
|
||||
TYPE CAMERA;
|
||||
TYPE CAMERA; \
|
||||
TYPE SNAPSHOT;
|
||||
|
||||
struct _Edje_Part_Collection_Directory_Entry
|
||||
{
|
||||
|
@ -2239,6 +2240,7 @@ EAPI extern Eina_Mempool *_emp_SPACER;
|
|||
EAPI extern Eina_Mempool *_emp_MESH_NODE;
|
||||
EAPI extern Eina_Mempool *_emp_LIGHT;
|
||||
EAPI extern Eina_Mempool *_emp_CAMERA;
|
||||
EAPI extern Eina_Mempool *_emp_SNAPSHOT;
|
||||
EAPI 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, FLOAT_T v3, FLOAT_T v4);
|
||||
|
|
Loading…
Reference in New Issue