clouseau: Added Evas Map x,y,z, values to props

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 74561
This commit is contained in:
Aharon Hillel 2012-07-30 08:25:15 +00:00 committed by Tom Hacohen
parent 7f76aa623f
commit 3c06e4da01
3 changed files with 69 additions and 0 deletions

View File

@ -15,6 +15,7 @@ typedef struct _Clouseau_Evas_Text_Props Clouseau_Evas_Text_Props;
typedef struct _Clouseau_Evas_Image_Props Clouseau_Evas_Image_Props;
typedef struct _Clouseau_Elm_Props Clouseau_Elm_Props;
typedef struct _Clouseau_Edje_Props Clouseau_Edje_Props;
typedef struct _Clouseau_Evas_Map_Point_Props Clouseau_Evas_Map_Point_Props;
typedef struct _Clouseau_Extra_Props Clouseau_Extra_Props;
typedef struct _Clouseau_Object Clouseau_Object;
@ -45,6 +46,11 @@ typedef enum
CLOUSEAU_OBJ_TYPE_TEXTBLOCK
} Clouseau_Object_Type;
struct _Clouseau_Evas_Map_Point_Props
{
Evas_Coord x, y, z;
};
struct _Clouseau_Evas_Props
{
const char *name;
@ -61,6 +67,8 @@ struct _Clouseau_Evas_Props
Eina_Bool is_clipper;
Eina_Bool is_visible;
Evas_Object_Pointer_Mode mode;
Clouseau_Evas_Map_Point_Props *points;
int points_count;
};
struct _Clouseau_Evas_Text_Props

View File

@ -21,6 +21,7 @@ static Eet_Data_Descriptor *clouseau_highlight_edd = NULL;
static Eet_Data_Descriptor *clouseau_bmp_req_edd = NULL;
static Eet_Data_Descriptor *clouseau_variant_edd = NULL;
static Eet_Data_Descriptor *clouseau_protocol_edd = NULL;
static Eet_Data_Descriptor *clouseau_map_point_props_edd = NULL;
void
clouseau_lines_free(bmp_info_st *st)
@ -466,6 +467,24 @@ _clouseau_textblock_desc_make(void)
"text", text, EET_T_STRING);
}
static void
_clouseau_map_point_props_desc_make(void)
{
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc,
Clouseau_Evas_Map_Point_Props);
clouseau_map_point_props_edd = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(clouseau_map_point_props_edd,
Clouseau_Evas_Map_Point_Props, "x", x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(clouseau_map_point_props_edd,
Clouseau_Evas_Map_Point_Props, "y", y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(clouseau_map_point_props_edd,
Clouseau_Evas_Map_Point_Props, "z", z, EET_T_INT);
}
static void
_clouseau_object_desc_make(void)
{
@ -540,6 +559,11 @@ _clouseau_object_desc_make(void)
_clouseau_edje_desc_make();
_clouseau_textblock_desc_make();
_clouseau_map_point_props_desc_make();
EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(clouseau_object_edd, Clouseau_Object,
"evas_props.points", evas_props.points,
clouseau_map_point_props_edd);
/* for union */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Clouseau_Extra_Props);
eddc.func.type_get = _clouseau_props_union_type_get;
@ -635,6 +659,7 @@ clouseau_data_descriptors_shutdown(void)
eet_data_descriptor_free(clouseau_edje_edd);
eet_data_descriptor_free(clouseau_textblock_edd);
eet_data_descriptor_free(clouseau_union_edd);
eet_data_descriptor_free(clouseau_map_point_props_edd);
}
static void *

View File

@ -128,6 +128,9 @@ clouseau_object_information_free(Clouseau_Object *oinfo)
eina_stringshare_del(oinfo->evas_props.name);
eina_stringshare_del(oinfo->evas_props.bt);
if (oinfo->evas_props.points)
free(oinfo->evas_props.points);
switch (oinfo->extra_props.type)
{
case CLOUSEAU_OBJ_TYPE_ELM:
@ -167,6 +170,7 @@ clouseau_object_information_get(Clouseau_Tree_Item *treeit)
{
Clouseau_Object *oinfo;
Evas_Object *obj = (void*) (uintptr_t) treeit->ptr;
const Evas_Map *map = NULL;
if (!treeit->is_obj)
return NULL;
@ -202,6 +206,25 @@ clouseau_object_information_get(Clouseau_Tree_Item *treeit)
oinfo->evas_props.is_clipper = !!evas_object_clipees_get(obj);
oinfo->evas_props.bt = eina_stringshare_ref(evas_object_data_get(obj, ".clouseau.bt"));
map = evas_object_map_get(obj);
if (map)
{ /* Save map coords count info if object has map */
oinfo->evas_props.points_count = evas_map_count_get(map);
if (oinfo->evas_props.points_count)
{
int i;
Clouseau_Evas_Map_Point_Props *p;
oinfo->evas_props.points = calloc(oinfo->evas_props.points_count,
sizeof(Clouseau_Evas_Map_Point_Props));
for(i = 0 ; i < oinfo->evas_props.points_count; i++)
{
p = &oinfo->evas_props.points[i];
evas_map_point_coord_get(map, i, &p->x, &p->y, &p->z);
}
}
}
if (elm_widget_is(obj))
{
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_ELM;
@ -495,6 +518,19 @@ clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *
_clouseau_information_bool_to_tree(main_tit, "Has clipees",
oinfo->evas_props.is_clipper);
if (oinfo->evas_props.points_count)
{
main_tit = _clouseau_type_to_parent(&information_tree, "Evas Map");
Clouseau_Evas_Map_Point_Props *p;
for(i = 0 ; (int) i < oinfo->evas_props.points_count; i++)
{
p = &oinfo->evas_props.points[i];
snprintf(buf, sizeof(buf), "Coords: %d %d %d", p->x, p->y, p->z);
_clouseau_information_buffer_to_tree(main_tit, buf);
}
}
main_tit = _clouseau_type_to_parent(&information_tree,
_clouseau_type_to_string(oinfo->extra_props.type));
if (main_tit)