clouseau: small 15min cleanup.

SVN revision: 74430
This commit is contained in:
Cedric BAIL 2012-07-26 09:53:44 +00:00
parent 2d0358d52b
commit 5924cf3548
6 changed files with 49 additions and 43 deletions

View File

@ -1187,7 +1187,7 @@ static void
_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
void *event_info)
{
clouseau_obj_information_list_clear();
clouseau_object_information_list_clear();
gui_elements *g = data;
Clouseau_Tree_Item *treeit = elm_object_item_data_get(event_info);
const Elm_Object_Item *parent;

View File

@ -139,10 +139,12 @@ struct _Clouseau_Tree_Item
Eina_Bool is_visible;
};
Clouseau_Object *_obj_information_get(Clouseau_Tree_Item *treeit);
Eet_Data_Descriptor *clouseau_object_desc_make(void);
void clouseau_object_desc_shutdown(void);
Evas_Object *clouseau_obj_information_list_add(Evas_Object *parent);
void clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb);
void clouseau_obj_information_list_clear();
/* Public */
void clouseau_object_information_list_clear(void);
#endif

View File

@ -29,7 +29,7 @@ libclouseau_item_add(Evas_Object *o, Clouseau_Tree_Item *parent)
treeit->name = eina_stringshare_add(evas_object_type_get(o));
treeit->is_clipper = !!evas_object_clipees_get(o);
treeit->is_visible = evas_object_visible_get(o);
treeit->info = obj_information_get(treeit);
treeit->info = clouseau_object_information_get(treeit);
parent->children = eina_list_append(parent->children, treeit);

View File

@ -51,7 +51,7 @@ _clouseau_tree_item_free(Clouseau_Tree_Item *parent)
EINA_LIST_FREE(parent->children, treeit)
_clouseau_tree_item_free(treeit);
obj_information_free(parent->info);
clouseau_object_information_free(parent->info);
eina_stringshare_del(parent->name);
free(parent);
}

View File

@ -95,13 +95,13 @@ clouseau_obj_information_list_add(Evas_Object *parent)
}
static void
_item_tree_item_free(Inf_Clouseau_Tree_Item *parent)
_clouseau_item_tree_item_free(Inf_Clouseau_Tree_Item *parent)
{
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(parent->children, treeit)
{
_item_tree_item_free(treeit);
_clouseau_item_tree_item_free(treeit);
}
eina_stringshare_del(parent->string);
@ -109,18 +109,18 @@ _item_tree_item_free(Inf_Clouseau_Tree_Item *parent)
}
static void
_item_tree_free(void)
_clouseau_item_tree_free(void)
{
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(information_tree, treeit)
{
_item_tree_item_free(treeit);
_clouseau_item_tree_item_free(treeit);
}
}
void
obj_information_free(Clouseau_Object *oinfo)
clouseau_object_information_free(Clouseau_Object *oinfo)
{
if (!oinfo)
return;
@ -128,47 +128,49 @@ obj_information_free(Clouseau_Object *oinfo)
eina_stringshare_del(oinfo->evas_props.name);
eina_stringshare_del(oinfo->evas_props.bt);
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
switch (oinfo->extra_props.type)
{
eina_stringshare_del(oinfo->extra_props.u.elm.type);
eina_stringshare_del(oinfo->extra_props.u.elm.style);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
{
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);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
{
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);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
{
eina_stringshare_del(oinfo->extra_props.u.edje.file);
eina_stringshare_del(oinfo->extra_props.u.edje.group);
case CLOUSEAU_OBJ_TYPE_ELM:
eina_stringshare_del(oinfo->extra_props.u.elm.type);
eina_stringshare_del(oinfo->extra_props.u.elm.style);
break;
case CLOUSEAU_OBJ_TYPE_TEXT:
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);
break;
case CLOUSEAU_OBJ_TYPE_IMAGE:
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);
break;
case CLOUSEAU_OBJ_TYPE_EDJE:
eina_stringshare_del(oinfo->extra_props.u.edje.file);
eina_stringshare_del(oinfo->extra_props.u.edje.group);
eina_stringshare_del(oinfo->extra_props.u.edje.load_err);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
{
eina_stringshare_del(oinfo->extra_props.u.textblock.style);
eina_stringshare_del(oinfo->extra_props.u.textblock.text);
eina_stringshare_del(oinfo->extra_props.u.edje.load_err);
break;
case CLOUSEAU_OBJ_TYPE_TEXTBLOCK:
eina_stringshare_del(oinfo->extra_props.u.textblock.style);
eina_stringshare_del(oinfo->extra_props.u.textblock.text);
break;
case CLOUSEAU_OBJ_TYPE_UNKNOWN:
case CLOUSEAU_OBJ_TYPE_OTHER:
break;
}
free(oinfo);
}
Clouseau_Object *
obj_information_get(Clouseau_Tree_Item *treeit)
clouseau_object_information_get(Clouseau_Tree_Item *treeit)
{
Clouseau_Object *oinfo;
Evas_Object *obj = (void*) (uintptr_t) treeit->ptr;
if (!treeit->is_obj)
return NULL;
Clouseau_Object *oinfo;
Evas_Object *obj = (void*) (uintptr_t) treeit->ptr;
oinfo = calloc(1, sizeof(Clouseau_Object));
oinfo->evas_props.pass_events = evas_object_pass_events_get(obj);
@ -417,7 +419,7 @@ clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *
char buf[1024];
unsigned int i;
clouseau_obj_information_list_clear();
clouseau_object_information_list_clear();
if (!treeit->is_obj)
return;
@ -586,8 +588,8 @@ clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *
}
void
clouseau_obj_information_list_clear()
clouseau_object_information_list_clear(void)
{
_item_tree_free();
_clouseau_item_tree_free();
elm_genlist_clear(prop_list);
}

View File

@ -149,7 +149,6 @@ typedef struct _data_desc data_desc;
/* Function Declarations */
Clouseau_Object *obj_information_get(Clouseau_Tree_Item *treeit);
void obj_information_free(Clouseau_Object *oinfo);
void item_tree_item_free(Clouseau_Tree_Item *parent);
void _item_tree_item_string(Clouseau_Tree_Item *parent);
data_desc *data_descriptors_init(void);
@ -172,6 +171,9 @@ void libclouseau_lines_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
void clouseau_data_descriptors_init(void);
void clouseau_data_descriptors_shutdown(void);
Clouseau_Object *clouseau_object_information_get(Clouseau_Tree_Item *treeit);
void clouseau_object_information_free(Clouseau_Object *oinfo);
/* Exported function */
int clouseau_init(void);
int clouseau_shutdown(void);