2012-05-14 07:40:57 -07:00
|
|
|
#include "libclouseau.h"
|
2011-08-25 04:12:13 -07:00
|
|
|
typedef struct _Inf_Tree_Item Inf_Tree_Item;
|
|
|
|
struct _Inf_Tree_Item
|
|
|
|
{
|
|
|
|
Eina_List *children;
|
|
|
|
Evas_Object *icon;
|
|
|
|
const char *string;
|
|
|
|
};
|
|
|
|
|
2012-05-14 07:39:10 -07:00
|
|
|
/* START EET stuff */
|
|
|
|
struct _extra_props_descs
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *elm;
|
|
|
|
Eet_Data_Descriptor *text;
|
|
|
|
Eet_Data_Descriptor *image;
|
|
|
|
Eet_Data_Descriptor *edje;
|
|
|
|
Eet_Data_Descriptor *textblock;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *_union_unified_descriptor;
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
};
|
|
|
|
typedef struct _extra_props_descs extra_props_descs;
|
|
|
|
|
|
|
|
static extra_props_descs *props_descs = NULL; /* to be used later for union */
|
|
|
|
|
2012-05-14 07:39:46 -07:00
|
|
|
static eet_extra_props_mapping eet_props_mapping[] =
|
|
|
|
{ /* As eet_mapping */
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_OTHER, CLOUSEAU_OBJ_TYPE_OTHER_STR },
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_ELM, CLOUSEAU_OBJ_TYPE_ELM_STR },
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_TEXT, CLOUSEAU_OBJ_TYPE_TEXT_STR },
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_IMAGE, CLOUSEAU_OBJ_TYPE_IMAGE_STR },
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_EDJE, CLOUSEAU_OBJ_TYPE_EDJE_STR },
|
2012-05-14 07:40:07 -07:00
|
|
|
{ CLOUSEAU_OBJ_TYPE_TEXTBLOCK, CLOUSEAU_OBJ_TYPE_TEXTBLOCK_STR },
|
|
|
|
{ CLOUSEAU_OBJ_TYPE_UNKNOWN, NULL }
|
2012-05-14 07:39:46 -07:00
|
|
|
};
|
|
|
|
|
2012-05-14 07:39:10 -07:00
|
|
|
static const char *
|
|
|
|
_props_union_type_get(const void *data, Eina_Bool *unknow)
|
|
|
|
{ /* _union_type_get */
|
|
|
|
const en_obj_type *u = data;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (unknow)
|
|
|
|
*unknow = EINA_FALSE;
|
|
|
|
|
|
|
|
for (i = 0; eet_props_mapping[i].name != NULL; ++i)
|
|
|
|
if (*u == eet_props_mapping[i].u)
|
|
|
|
return eet_props_mapping[i].name;
|
|
|
|
|
|
|
|
if (unknow)
|
|
|
|
*unknow = EINA_TRUE;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_props_union_type_set(const char *type, void *data, Eina_Bool unknow)
|
|
|
|
{ /* same as _union_type_set */
|
|
|
|
en_obj_type *u = data;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (unknow)
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
for (i = 0; eet_props_mapping[i].name != NULL; ++i)
|
|
|
|
if (strcmp(eet_props_mapping[i].name, type) == 0)
|
|
|
|
{
|
|
|
|
*u = eet_props_mapping[i].u;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
elm_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_elm);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "type", type, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "style", style, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "scale", scale, EET_T_DOUBLE);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "has_focus",
|
|
|
|
has_focus, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_disabled",
|
|
|
|
is_disabled, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_mirrored",
|
|
|
|
is_mirrored, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_mirrored_automatic",
|
|
|
|
is_mirrored_automatic, EET_T_UCHAR);
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
text_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_text);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "font", font, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "size", size, EET_T_INT);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "source", source, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "text", text, EET_T_STRING);
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
image_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_image);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "file", file, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "key", key, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "source", source, EET_T_UINT);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "load_err",
|
|
|
|
load_err, EET_T_STRING);
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
edje_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_edje);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "file", file, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "group", group, EET_T_STRING);
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "load_err",
|
|
|
|
load_err, EET_T_STRING);
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
textblock_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_textblock);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_textblock, "style",
|
|
|
|
style, EET_T_STRING);
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eet_Data_Descriptor *
|
|
|
|
Obj_Information_desc_make(void)
|
|
|
|
{
|
|
|
|
Eet_Data_Descriptor *d;
|
|
|
|
|
|
|
|
Eet_Data_Descriptor_Class eddc;
|
|
|
|
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Obj_Information);
|
|
|
|
d = eet_data_descriptor_stream_new(&eddc);
|
|
|
|
|
|
|
|
/* START - evas_props Struct desc */
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.name",
|
|
|
|
evas_props.name, EET_T_STRING);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.bt",
|
|
|
|
evas_props.bt, EET_T_STRING);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.layer",
|
|
|
|
evas_props.layer, EET_T_SHORT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.x",
|
|
|
|
evas_props.x, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.y",
|
|
|
|
evas_props.y, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.w",
|
|
|
|
evas_props.w, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.h",
|
|
|
|
evas_props.h, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.scale",
|
|
|
|
evas_props.scale, EET_T_DOUBLE);
|
|
|
|
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.min_w",
|
|
|
|
evas_props.min_w, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.min_h",
|
|
|
|
evas_props.min_h, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.max_w",
|
|
|
|
evas_props.max_w, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.max_h",
|
|
|
|
evas_props.max_h, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.req_w",
|
|
|
|
evas_props.req_w, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.req_h",
|
|
|
|
evas_props.req_h, EET_T_INT);
|
|
|
|
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.align_x", evas_props.align_x, EET_T_DOUBLE);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.align_y", evas_props.align_y, EET_T_DOUBLE);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.weight_x", evas_props.weight_x, EET_T_DOUBLE);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.weight_y", evas_props.weight_y, EET_T_DOUBLE);
|
|
|
|
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.r",
|
|
|
|
evas_props.r, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.g",
|
|
|
|
evas_props.g, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.b",
|
|
|
|
evas_props.b, EET_T_INT);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.a",
|
|
|
|
evas_props.a, EET_T_INT);
|
|
|
|
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.pass_events", evas_props.pass_events, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.has_focus", evas_props.has_focus, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.is_clipper", evas_props.is_clipper, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.is_visible", evas_props.is_visible, EET_T_UCHAR);
|
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
|
|
|
|
"evas_props.mode", evas_props.mode, EET_T_INT);
|
|
|
|
/* END - evas_props Struct desc */
|
|
|
|
|
|
|
|
|
2012-05-14 07:41:13 -07:00
|
|
|
if (!props_descs)
|
|
|
|
{ /* Free later in desc shutdown */
|
2012-05-14 07:39:10 -07:00
|
|
|
props_descs = calloc(1, sizeof(extra_props_descs));
|
|
|
|
props_descs->elm = elm_desc_make();
|
|
|
|
props_descs->text = text_desc_make();
|
|
|
|
props_descs->image = image_desc_make();
|
|
|
|
props_descs->edje = edje_desc_make();
|
|
|
|
props_descs->textblock = textblock_desc_make();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* for union */
|
|
|
|
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&(props_descs->eddc),
|
|
|
|
st_extra_props);
|
|
|
|
|
|
|
|
props_descs->eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
|
|
|
|
props_descs->eddc.func.type_get = _props_union_type_get;
|
|
|
|
props_descs->eddc.func.type_set = _props_union_type_set;
|
|
|
|
props_descs->_union_unified_descriptor =
|
|
|
|
eet_data_descriptor_file_new(&(props_descs->eddc));
|
|
|
|
|
|
|
|
/* START handle UNION desc */
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
|
2012-05-14 07:40:19 -07:00
|
|
|
CLOUSEAU_OBJ_TYPE_ELM_STR, props_descs->elm);
|
2012-05-14 07:39:10 -07:00
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
|
2012-05-14 07:40:19 -07:00
|
|
|
CLOUSEAU_OBJ_TYPE_TEXT_STR, props_descs->text);
|
2012-05-14 07:39:10 -07:00
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
|
2012-05-14 07:40:19 -07:00
|
|
|
CLOUSEAU_OBJ_TYPE_IMAGE_STR, props_descs->image);
|
2012-05-14 07:39:10 -07:00
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
|
2012-05-14 07:40:19 -07:00
|
|
|
CLOUSEAU_OBJ_TYPE_EDJE_STR, props_descs->edje);
|
2012-05-14 07:39:10 -07:00
|
|
|
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
|
2012-05-14 07:40:19 -07:00
|
|
|
CLOUSEAU_OBJ_TYPE_TEXTBLOCK_STR, props_descs->textblock);
|
2012-05-14 07:39:10 -07:00
|
|
|
|
2012-05-14 07:40:07 -07:00
|
|
|
EET_DATA_DESCRIPTOR_ADD_UNION(d, Obj_Information, "u", extra_props.u,
|
|
|
|
extra_props.type, props_descs->_union_unified_descriptor);
|
2012-05-14 07:39:10 -07:00
|
|
|
/* END handle UNION desc */
|
|
|
|
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Obj_Information_desc_shutdown(void)
|
|
|
|
{
|
2012-05-14 07:39:29 -07:00
|
|
|
if (props_descs)
|
|
|
|
{
|
|
|
|
eet_data_descriptor_free(props_descs->elm);
|
|
|
|
eet_data_descriptor_free(props_descs->text);
|
|
|
|
eet_data_descriptor_free(props_descs->image);
|
|
|
|
eet_data_descriptor_free(props_descs->edje);
|
|
|
|
eet_data_descriptor_free(props_descs->textblock);
|
|
|
|
eet_data_descriptor_free(props_descs->_union_unified_descriptor);
|
|
|
|
|
|
|
|
free(props_descs);
|
|
|
|
props_descs = NULL;
|
|
|
|
}
|
2012-05-14 07:39:10 -07:00
|
|
|
}
|
|
|
|
/* END EET stuff */
|
|
|
|
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
static Eina_List *information_tree = NULL;
|
2011-08-25 04:12:09 -07:00
|
|
|
static Evas_Object *prop_list = NULL;
|
2011-08-25 04:12:13 -07:00
|
|
|
static Elm_Genlist_Item_Class itc;
|
|
|
|
|
|
|
|
static void
|
2012-05-14 07:39:46 -07:00
|
|
|
_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2011-08-25 04:12:17 -07:00
|
|
|
/* Currently do nothing */
|
|
|
|
return;
|
2011-08-25 04:12:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 07:39:46 -07:00
|
|
|
gl_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2012-01-20 00:41:47 -08:00
|
|
|
Elm_Object_Item *glit = event_info;
|
2012-03-06 07:04:55 -08:00
|
|
|
Inf_Tree_Item *parent = elm_object_item_data_get(glit);
|
2011-08-25 04:12:17 -07:00
|
|
|
Inf_Tree_Item *tit;
|
2011-08-25 04:12:13 -07:00
|
|
|
Eina_List *itr;
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
EINA_LIST_FOREACH(parent->children, itr, tit)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2012-03-12 07:38:59 -07:00
|
|
|
Elm_Genlist_Item_Type iflag = (tit->children) ?
|
|
|
|
ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE;
|
2012-01-20 00:41:47 -08:00
|
|
|
elm_genlist_item_append(prop_list, &itc, tit, glit,
|
2011-08-25 04:12:17 -07:00
|
|
|
iflag, _gl_selected, NULL);
|
2011-08-25 04:12:13 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 07:39:46 -07:00
|
|
|
gl_con(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2012-01-20 00:41:47 -08:00
|
|
|
Elm_Object_Item *glit = event_info;
|
|
|
|
elm_genlist_item_subitems_clear(glit);
|
2011-08-25 04:12:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 07:39:46 -07:00
|
|
|
gl_exp_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2012-01-20 00:41:47 -08:00
|
|
|
Elm_Object_Item *glit = event_info;
|
|
|
|
elm_genlist_item_expanded_set(glit, EINA_TRUE);
|
2011-08-25 04:12:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-14 07:39:46 -07:00
|
|
|
gl_con_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
2012-01-20 00:41:47 -08:00
|
|
|
Elm_Object_Item *glit = event_info;
|
|
|
|
elm_genlist_item_expanded_set(glit, EINA_FALSE);
|
2011-08-25 04:12:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-05-14 07:39:46 -07:00
|
|
|
item_icon_get(void *data EINA_UNUSED, Evas_Object *parent EINA_UNUSED,
|
|
|
|
const char *part EINA_UNUSED)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2012-05-14 07:39:46 -07:00
|
|
|
item_text_get(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *part EINA_UNUSED)
|
2011-08-25 04:12:13 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit = data;
|
|
|
|
return strdup(tit->string);
|
|
|
|
}
|
2011-08-25 04:12:09 -07:00
|
|
|
|
|
|
|
Evas_Object *
|
|
|
|
clouseau_obj_information_list_add(Evas_Object *parent)
|
|
|
|
{
|
2011-08-25 04:12:13 -07:00
|
|
|
prop_list = elm_genlist_add(parent);
|
|
|
|
itc.item_style = "default";
|
2011-12-01 00:32:43 -08:00
|
|
|
itc.func.text_get = item_text_get;
|
2011-11-13 22:19:04 -08:00
|
|
|
itc.func.content_get = item_icon_get;
|
2011-08-25 04:12:13 -07:00
|
|
|
itc.func.state_get = NULL;
|
|
|
|
itc.func.del = NULL;
|
|
|
|
|
|
|
|
evas_object_smart_callback_add(prop_list, "expand,request", gl_exp_req,
|
|
|
|
prop_list);
|
|
|
|
evas_object_smart_callback_add(prop_list, "contract,request", gl_con_req,
|
|
|
|
prop_list);
|
|
|
|
evas_object_smart_callback_add(prop_list, "expanded", gl_exp, prop_list);
|
|
|
|
evas_object_smart_callback_add(prop_list, "contracted", gl_con, prop_list);
|
|
|
|
evas_object_smart_callback_add(prop_list, "selected", _gl_selected, NULL);
|
|
|
|
|
|
|
|
return prop_list;
|
2011-08-25 04:12:09 -07:00
|
|
|
}
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
static void
|
|
|
|
_item_tree_item_free(Inf_Tree_Item *parent)
|
|
|
|
{
|
|
|
|
Inf_Tree_Item *treeit;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(parent->children, treeit)
|
|
|
|
{
|
|
|
|
_item_tree_item_free(treeit);
|
|
|
|
}
|
|
|
|
|
2011-08-25 04:25:28 -07:00
|
|
|
eina_stringshare_del(parent->string);
|
2011-08-25 04:12:17 -07:00
|
|
|
free(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_tree_free(void)
|
|
|
|
{
|
|
|
|
Inf_Tree_Item *treeit;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(information_tree, treeit)
|
|
|
|
{
|
|
|
|
_item_tree_item_free(treeit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-14 07:39:23 -07:00
|
|
|
void
|
|
|
|
obj_information_free(Obj_Information *oinfo)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:23 -07:00
|
|
|
if (!oinfo)
|
|
|
|
return;
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
eina_stringshare_del(oinfo->evas_props.name);
|
2012-03-12 09:36:15 -07:00
|
|
|
eina_stringshare_del(oinfo->evas_props.bt);
|
2011-08-25 07:54:27 -07:00
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.elm.type);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.elm.style);
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.text.font);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.text.source);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.text.text);
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.image.file);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.image.key);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.image.load_err);
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.edje.file);
|
|
|
|
eina_stringshare_del(oinfo->extra_props.u.edje.group);
|
2011-08-25 07:54:27 -07:00
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.edje.load_err);
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
|
2011-10-03 02:10:37 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
eina_stringshare_del(oinfo->extra_props.u.textblock.style);
|
2011-10-03 02:10:37 -07:00
|
|
|
}
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
free(oinfo);
|
|
|
|
}
|
|
|
|
|
2012-05-14 07:39:10 -07:00
|
|
|
Obj_Information *
|
2012-05-14 07:39:23 -07:00
|
|
|
obj_information_get(Tree_Item *treeit)
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:10 -07:00
|
|
|
if (!treeit->is_obj)
|
2012-05-14 07:40:07 -07:00
|
|
|
return NULL;
|
2012-05-14 07:39:10 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
Obj_Information *oinfo;
|
|
|
|
Evas_Object *obj = treeit->ptr;
|
|
|
|
oinfo = calloc(1, sizeof(*oinfo));
|
|
|
|
|
2011-08-28 02:46:40 -07:00
|
|
|
oinfo->evas_props.pass_events = evas_object_pass_events_get(obj);
|
2011-08-28 02:28:21 -07:00
|
|
|
oinfo->evas_props.has_focus = evas_object_focus_get(obj);
|
2011-08-25 07:54:27 -07:00
|
|
|
oinfo->evas_props.is_visible = evas_object_visible_get(obj);
|
|
|
|
oinfo->evas_props.name = eina_stringshare_add(evas_object_name_get(obj));
|
|
|
|
oinfo->evas_props.layer = evas_object_layer_get(obj);
|
2011-08-30 01:40:02 -07:00
|
|
|
evas_object_geometry_get(obj, &oinfo->evas_props.x, &oinfo->evas_props.y,
|
2011-08-25 07:54:27 -07:00
|
|
|
&oinfo->evas_props.w, &oinfo->evas_props.h);
|
|
|
|
oinfo->evas_props.scale = evas_object_scale_get(obj);
|
|
|
|
|
|
|
|
evas_object_size_hint_min_get(obj, &oinfo->evas_props.min_w,
|
|
|
|
&oinfo->evas_props.min_h);
|
|
|
|
evas_object_size_hint_max_get(obj, &oinfo->evas_props.max_w,
|
|
|
|
&oinfo->evas_props.max_h);
|
|
|
|
evas_object_size_hint_request_get(obj, &oinfo->evas_props.req_w,
|
|
|
|
&oinfo->evas_props.req_h);
|
|
|
|
|
|
|
|
evas_object_size_hint_align_get(obj, &oinfo->evas_props.align_x,
|
|
|
|
&oinfo->evas_props.align_y);
|
|
|
|
evas_object_size_hint_weight_get(obj, &oinfo->evas_props.weight_x,
|
|
|
|
&oinfo->evas_props.weight_y);
|
|
|
|
|
|
|
|
evas_object_color_get(obj, &oinfo->evas_props.r, &oinfo->evas_props.g,
|
|
|
|
&oinfo->evas_props.b, &oinfo->evas_props.a);
|
|
|
|
|
2012-03-12 07:59:11 -07:00
|
|
|
oinfo->evas_props.mode = evas_object_pointer_mode_get(obj);
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
oinfo->evas_props.is_clipper = !!evas_object_clipees_get(obj);
|
2012-03-12 09:36:15 -07:00
|
|
|
oinfo->evas_props.bt = eina_stringshare_ref(evas_object_data_get(obj, ".clouseau.bt"));
|
2011-08-25 07:54:27 -07:00
|
|
|
|
2012-05-06 07:41:25 -07:00
|
|
|
if (elm_widget_is(obj))
|
2011-08-25 07:54:27 -07:00
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_ELM;
|
2011-08-25 07:54:27 -07:00
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.type =
|
2011-08-25 07:54:27 -07:00
|
|
|
eina_stringshare_add(elm_widget_type_get(obj));
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.style =
|
2011-08-25 07:54:27 -07:00
|
|
|
eina_stringshare_add(elm_widget_style_get(obj));
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.scale = elm_widget_scale_get(obj);
|
|
|
|
oinfo->extra_props.u.elm.has_focus = elm_object_focus_get(obj);
|
|
|
|
oinfo->extra_props.u.elm.is_disabled = elm_widget_disabled_get(obj);
|
|
|
|
oinfo->extra_props.u.elm.is_mirrored = elm_widget_mirrored_get(obj);
|
|
|
|
oinfo->extra_props.u.elm.is_mirrored_automatic =
|
2011-08-25 07:54:27 -07:00
|
|
|
elm_widget_mirrored_automatic_get(obj);
|
|
|
|
}
|
|
|
|
else if (!strcmp("text", evas_object_type_get(obj)))
|
|
|
|
{
|
|
|
|
const char *font;
|
|
|
|
int size;
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_TEXT;
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
evas_object_text_font_get(obj, &font, &size);
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.text.font = eina_stringshare_add(font);
|
|
|
|
oinfo->extra_props.u.text.size = size;
|
|
|
|
oinfo->extra_props.u.text.source =
|
2011-08-25 07:54:27 -07:00
|
|
|
eina_stringshare_add(evas_object_text_font_source_get(obj));
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.text.text = eina_stringshare_add(evas_object_text_text_get(obj));
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
|
|
|
else if (!strcmp("image", evas_object_type_get(obj)))
|
|
|
|
{
|
|
|
|
const char *file, *key;
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_IMAGE;
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
evas_object_image_file_get(obj, &file, &key);
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.file = eina_stringshare_add(file);
|
|
|
|
oinfo->extra_props.u.image.key = eina_stringshare_add(key);
|
|
|
|
oinfo->extra_props.u.image.source = evas_object_image_source_get(obj);
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
if (evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE)
|
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.load_err = eina_stringshare_add(
|
2011-08-25 07:54:27 -07:00
|
|
|
evas_load_error_str(evas_object_image_load_error_get(obj)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp("edje", evas_object_type_get(obj)))
|
|
|
|
{
|
|
|
|
const char *file, *group;
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_EDJE;
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
edje_object_file_get(obj, &file, &group);
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.edje.file = eina_stringshare_add(file);
|
|
|
|
oinfo->extra_props.u.edje.group = eina_stringshare_add(group);
|
2011-08-25 07:54:27 -07:00
|
|
|
|
|
|
|
if (edje_object_load_error_get(obj) != EDJE_LOAD_ERROR_NONE)
|
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.edje.load_err = eina_stringshare_add(
|
2011-08-25 07:54:27 -07:00
|
|
|
edje_load_error_str(edje_object_load_error_get(obj)));
|
|
|
|
}
|
|
|
|
}
|
2011-10-03 02:10:37 -07:00
|
|
|
else if (!strcmp("textblock", evas_object_type_get(obj)))
|
|
|
|
{
|
|
|
|
const char *style;
|
|
|
|
const Evas_Textblock_Style *ts;
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_TEXTBLOCK;
|
2011-10-03 02:10:37 -07:00
|
|
|
|
|
|
|
ts = evas_object_textblock_style_get(obj);
|
|
|
|
style = evas_textblock_style_get(ts);
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.textblock.style = eina_stringshare_add(style);
|
2011-10-03 02:10:37 -07:00
|
|
|
}
|
2011-08-25 07:54:27 -07:00
|
|
|
else
|
|
|
|
{
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.type = CLOUSEAU_OBJ_TYPE_OTHER;
|
2011-08-25 07:54:27 -07:00
|
|
|
}
|
|
|
|
return oinfo;
|
|
|
|
}
|
2011-08-25 04:12:17 -07:00
|
|
|
|
2012-03-12 07:59:11 -07:00
|
|
|
static const struct {
|
|
|
|
const char *text;
|
|
|
|
Evas_Object_Pointer_Mode mode;
|
|
|
|
} pointer_mode[3] = {
|
|
|
|
# define POINTER_MODE(Value) { "Pointer mode : "#Value, Value }
|
|
|
|
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_AUTOGRAB),
|
|
|
|
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB),
|
|
|
|
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
# undef POINTER_MODE
|
|
|
|
};
|
|
|
|
|
2011-08-25 04:12:09 -07:00
|
|
|
void
|
2012-05-14 07:41:29 -07:00
|
|
|
clouseau_obj_information_list_populate(Tree_Item *treeit, Evas_Object *lb)
|
2011-08-25 04:12:09 -07:00
|
|
|
{
|
2012-03-12 07:59:11 -07:00
|
|
|
unsigned int i;
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
clouseau_obj_information_list_clear();
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:30 -07:00
|
|
|
if (!treeit->is_obj)
|
2011-08-25 04:12:09 -07:00
|
|
|
return;
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
Inf_Tree_Item *main_tit;
|
2012-05-14 07:39:23 -07:00
|
|
|
Obj_Information *oinfo = treeit->info;
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 04:25:28 -07:00
|
|
|
/* Populate evas properties list */
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Evas");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
2011-08-25 04:12:09 -07:00
|
|
|
{
|
2011-08-25 04:12:13 -07:00
|
|
|
Inf_Tree_Item *tit;
|
2011-08-25 04:12:09 -07:00
|
|
|
char buf[1024];
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Visibility: %d",
|
|
|
|
(int) oinfo->evas_props.is_visible);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
if (oinfo->evas_props.name)
|
2011-08-25 04:12:09 -07:00
|
|
|
{
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Name: %s", oinfo->evas_props.name);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
}
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Layer: %hd", oinfo->evas_props.layer);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Position: %d %d", oinfo->evas_props.x,
|
|
|
|
oinfo->evas_props.y);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Size: %d %d", oinfo->evas_props.w,
|
|
|
|
oinfo->evas_props.h);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Scale: %.6lg", oinfo->evas_props.scale);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
|
|
|
|
2011-08-25 04:12:09 -07:00
|
|
|
#if 0
|
|
|
|
if (evas_object_clip_get(obj))
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(
|
|
|
|
evas_object_clip_get(obj), &x, &y, &w, &h);
|
|
|
|
snprintf(buf, sizeof(buf), "Clipper position: %d %d", x, y);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Clipper size: %d %d", w, h);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Min size: %d %d", oinfo->evas_props.min_w,
|
|
|
|
oinfo->evas_props.min_h);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Max size: %d %d", oinfo->evas_props.max_w,
|
|
|
|
oinfo->evas_props.max_h);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Request size: %d %d",
|
|
|
|
oinfo->evas_props.req_w, oinfo->evas_props.req_h);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Align: %.6lg %.6lg",
|
|
|
|
oinfo->evas_props.align_x, oinfo->evas_props.align_y);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Weight: %.6lg %.6lg",
|
|
|
|
oinfo->evas_props.weight_x, oinfo->evas_props.weight_y);
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
#if 0
|
|
|
|
evas_object_size_hint_aspect_get(obj, &w, &h);
|
2011-08-25 05:13:16 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Aspect: %d %d", w, h);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 07:54:27 -07:00
|
|
|
#endif
|
2011-08-25 05:13:16 -07:00
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Color: %d %d %d %d",
|
|
|
|
oinfo->evas_props.r, oinfo->evas_props.g, oinfo->evas_props.b,
|
|
|
|
oinfo->evas_props.a);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 04:12:09 -07:00
|
|
|
|
2011-08-28 02:28:21 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Has focus: %d",
|
|
|
|
(int) oinfo->evas_props.has_focus);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-03-12 07:59:11 -07:00
|
|
|
for (i = 0; i < sizeof (pointer_mode) / sizeof (pointer_mode[0]); ++i)
|
|
|
|
if (pointer_mode[i].mode == oinfo->evas_props.mode)
|
|
|
|
{
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(pointer_mode[i].text);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-08-28 02:46:40 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Pass events: %d",
|
|
|
|
(int) oinfo->evas_props.pass_events);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
if (oinfo->evas_props.is_clipper)
|
2011-08-25 04:12:09 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Has clipees");
|
2011-08-25 04:12:13 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
2011-08-25 04:12:17 -07:00
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit;
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Elementary");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Wid-Type: %s", oinfo->extra_props.u.elm.type);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* Extract actual data from theme? */
|
|
|
|
snprintf(buf, sizeof(buf), "Theme: %s", elm_widget_theme_get(obj));
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
#endif
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Style: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.style);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Scale: %.6lg",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.scale);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Disabled: %d",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.is_disabled);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-28 02:28:21 -07:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Has focus: %d",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.has_focus);
|
2011-08-28 02:28:21 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
2011-08-25 05:03:17 -07:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Mirrored: %d",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.is_mirrored);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Automatic mirroring: %d",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.elm.is_mirrored_automatic);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit;
|
|
|
|
char buf[1024];
|
|
|
|
const char *font;
|
2012-03-12 07:59:11 -07:00
|
|
|
const char *text;
|
2011-08-25 05:03:17 -07:00
|
|
|
|
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Text");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Font: %s", oinfo->extra_props.u.text.font);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Size: %d", oinfo->extra_props.u.text.size);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
font = oinfo->extra_props.u.text.source;
|
2011-08-25 05:03:17 -07:00
|
|
|
if (font)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Source: %s", font);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
2012-03-12 07:59:11 -07:00
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
text = oinfo->extra_props.u.text.text;
|
2012-03-12 07:59:11 -07:00
|
|
|
if (text)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Text: %s", text);
|
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
2011-08-25 05:03:17 -07:00
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit;
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Image");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "File name: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.file);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.u.image.key)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
2011-08-25 07:54:27 -07:00
|
|
|
snprintf(buf, sizeof(buf), "File key: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.key);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.u.image.source)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Source: %p",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.source);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.u.image.load_err)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Load error: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.image.load_err);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit;
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Edje");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
snprintf(buf, sizeof(buf), "File: %s", oinfo->extra_props.u.edje.file);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Group: %s", oinfo->extra_props.u.edje.group);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
|
2012-05-14 07:39:03 -07:00
|
|
|
if (oinfo->extra_props.u.edje.load_err)
|
2011-08-25 05:03:17 -07:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Load error: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.edje.load_err);
|
2011-08-25 05:03:17 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
|
|
|
}
|
2012-05-14 07:39:03 -07:00
|
|
|
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
|
2011-10-03 02:10:37 -07:00
|
|
|
{
|
|
|
|
Inf_Tree_Item *tit;
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
main_tit = calloc(1, sizeof(*main_tit));
|
|
|
|
main_tit->string = eina_stringshare_add("Textblock");
|
|
|
|
information_tree = eina_list_append(information_tree, main_tit);
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "Style: %s",
|
2012-05-14 07:39:03 -07:00
|
|
|
oinfo->extra_props.u.textblock.style);
|
2011-10-03 02:10:37 -07:00
|
|
|
tit = calloc(1, sizeof(*tit));
|
|
|
|
tit->string = eina_stringshare_add(buf);
|
|
|
|
main_tit->children = eina_list_append(main_tit->children, tit);
|
|
|
|
}
|
2011-08-25 05:03:17 -07:00
|
|
|
|
2012-05-14 07:41:29 -07:00
|
|
|
/* Update backtrace text */
|
|
|
|
if (oinfo->evas_props.bt)
|
|
|
|
{ /* Build backtrace label */
|
|
|
|
char *k = malloc(strlen("Creation backtrace:\n\n") +
|
|
|
|
strlen(oinfo->evas_props.bt) + 1);
|
|
|
|
|
|
|
|
sprintf(k, "Creation backtrace:\n\n%s", oinfo->evas_props.bt);
|
|
|
|
char *p = elm_entry_utf8_to_markup(k);
|
|
|
|
elm_object_text_set(lb, p);
|
|
|
|
free(p);
|
|
|
|
free(k);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
elm_object_text_set(lb, NULL);
|
|
|
|
|
|
|
|
|
2011-08-25 04:12:17 -07:00
|
|
|
/* Actually populate the genlist */
|
|
|
|
{
|
|
|
|
Eina_List *itr;
|
|
|
|
Inf_Tree_Item *tit;
|
2011-08-28 02:46:44 -07:00
|
|
|
Eina_Bool first_it = EINA_TRUE;
|
2011-08-25 04:12:17 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(information_tree, itr, tit)
|
|
|
|
{
|
2012-01-20 00:41:47 -08:00
|
|
|
Elm_Object_Item *git;
|
2011-08-25 04:12:17 -07:00
|
|
|
git = elm_genlist_item_append(prop_list, &itc, tit, NULL,
|
2012-03-12 07:38:59 -07:00
|
|
|
ELM_GENLIST_ITEM_TREE, _gl_selected, NULL);
|
2011-08-28 02:46:44 -07:00
|
|
|
if (first_it)
|
|
|
|
{
|
|
|
|
/* Start with all the base item expanded */
|
|
|
|
elm_genlist_item_expanded_set(git, EINA_TRUE);
|
|
|
|
first_it = EINA_FALSE;
|
|
|
|
}
|
2011-08-25 04:12:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
clouseau_obj_information_list_clear()
|
|
|
|
{
|
2011-08-25 04:12:17 -07:00
|
|
|
_item_tree_free();
|
2011-08-25 04:12:13 -07:00
|
|
|
elm_genlist_clear(prop_list);
|
2011-08-25 04:12:09 -07:00
|
|
|
}
|