Fix evas_hash_foreach functions for recent evas changes.

Fix some formatting issues.


SVN revision: 33809
This commit is contained in:
Christopher Michael 2008-02-22 10:42:50 +00:00
parent 435dfe2a2a
commit a77a6eb18c
1 changed files with 27 additions and 34 deletions

View File

@ -6,7 +6,7 @@
#include "edje_private.h" #include "edje_private.h"
static void _edje_collection_free_part_description_free(Edje_Part_Description *desc); static void _edje_collection_free_part_description_free(Edje_Part_Description *desc);
static Evas_Bool _edje_file_collection_hash_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata); static Evas_Bool _edje_file_collection_hash_foreach(const Evas_Hash *hash, const char *key, void *data, void *fdata);
#ifdef EDJE_PROGRAM_CACHE #ifdef EDJE_PROGRAM_CACHE
static int _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata); static int _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata);
#endif #endif
@ -158,11 +158,11 @@ edje_file_group_exists(const char *file, const char *glob)
{ {
if (edf->collection_dir) if (edf->collection_dir)
{ {
Edje_Patterns *patterns; Edje_Patterns *patterns;
patterns = edje_match_collection_dir_init(edf->collection_dir->entries); patterns =
if (edje_match_collection_dir_exec(patterns, edje_match_collection_dir_init(edf->collection_dir->entries);
glob)) if (edje_match_collection_dir_exec(patterns, glob))
{ {
edje_match_patterns_free(patterns); edje_match_patterns_free(patterns);
return 1; return 1;
@ -263,7 +263,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *p
Edje_Part_Description *desc; Edje_Part_Description *desc;
desc = hist->data; desc = hist->data;
if (desc->color_class) _edje_color_class_member_add(ed, desc->color_class); if (desc->color_class)
_edje_color_class_member_add(ed, desc->color_class);
} }
} }
/* build real parts */ /* build real parts */
@ -286,9 +287,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *p
rp->param1.description = ep->default_desc; rp->param1.description = ep->default_desc;
rp->chosen_description = rp->param1.description; rp->chosen_description = rp->param1.description;
if (!rp->param1.description) if (!rp->param1.description)
{ printf("EDJE ERROR: no default part description!\n");
printf("EDJE ERROR: no default part description!\n");
}
if (ep->type == EDJE_PART_TYPE_RECTANGLE) if (ep->type == EDJE_PART_TYPE_RECTANGLE)
rp->object = evas_object_rectangle_add(ed->evas); rp->object = evas_object_rectangle_add(ed->evas);
else if (ep->type == EDJE_PART_TYPE_IMAGE) else if (ep->type == EDJE_PART_TYPE_IMAGE)
@ -311,9 +310,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *p
else if (ep->type == EDJE_PART_TYPE_GRADIENT) else if (ep->type == EDJE_PART_TYPE_GRADIENT)
rp->object = evas_object_gradient_add(ed->evas); rp->object = evas_object_gradient_add(ed->evas);
else else
{ printf("EDJE ERROR: wrong part type %i!\n", ep->type);
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
}
if (rp->object) if (rp->object)
{ {
evas_object_smart_member_add(rp->object, ed->obj); evas_object_smart_member_add(rp->object, ed->obj);
@ -490,7 +487,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *p
evas_stringshare_del(group_path->data); evas_stringshare_del(group_path->data);
evas_list_free(group_path); evas_list_free(group_path);
} }
ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE; ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
return 0; return 0;
} }
@ -564,9 +560,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *p
return 1; return 1;
} }
else else
{ return 0;
return 0;
}
ed->load_error = EDJE_LOAD_ERROR_NONE; ed->load_error = EDJE_LOAD_ERROR_NONE;
return 1; return 1;
} }
@ -594,8 +588,8 @@ _edje_swallows_collect(Edje *ed)
{ {
Evas_List *swallows = NULL; Evas_List *swallows = NULL;
int i; int i;
if (!ed->file || !ed->table_parts) return NULL;
if (!ed->file || !ed->table_parts) return NULL;
for (i = 0; i < ed->table_parts_size; i++) for (i = 0; i < ed->table_parts_size; i++)
{ {
Edje_Real_Part *rp; Edje_Real_Part *rp;
@ -661,7 +655,8 @@ _edje_file_del(Edje *ed)
if (rp->part->mouse_events) if (rp->part->mouse_events)
_edje_callbacks_del(rp->swallowed_object); _edje_callbacks_del(rp->swallowed_object);
/* Objects swallowed by the app do not get deleted, but those internally swallowed (GROUP type) do. */ /* Objects swallowed by the app do not get deleted,
but those internally swallowed (GROUP type) do. */
if (rp->part->type == EDJE_PART_TYPE_GROUP) if (rp->part->type == EDJE_PART_TYPE_GROUP)
evas_object_del(rp->swallowed_object); evas_object_del(rp->swallowed_object);
@ -673,9 +668,7 @@ _edje_file_del(Edje *ed)
if (rp->text.cache.out_str) evas_stringshare_del(rp->text.cache.out_str); if (rp->text.cache.out_str) evas_stringshare_del(rp->text.cache.out_str);
if (rp->custom.description) if (rp->custom.description)
{ _edje_collection_free_part_description_free(rp->custom.description);
_edje_collection_free_part_description_free(rp->custom.description);
}
_edje_unref(rp->edje); _edje_unref(rp->edje);
free(rp); free(rp);
@ -717,16 +710,13 @@ _edje_file_del(Edje *ed)
* Used to free the cached data values that are stored in the data_cache * Used to free the cached data values that are stored in the data_cache
* hash table. * hash table.
*/ */
static Evas_Bool data_cache_free(Evas_Hash *hash, const char *key, static Evas_Bool
void *data, void *fdata) data_cache_free(const Evas_Hash *hash, const char *key, void *data, void *fdata)
{ {
evas_stringshare_del(data); evas_stringshare_del(data);
return 1;
return 1;
} }
void void
_edje_file_free(Edje_File *edf) _edje_file_free(Edje_File *edf)
{ {
@ -785,7 +775,8 @@ _edje_file_free(Edje_File *edf)
while (se->color_list) while (se->color_list)
{ {
free(se->color_list->data); free(se->color_list->data);
se->color_list = evas_list_remove_list(se->color_list, se->color_list); se->color_list =
evas_list_remove_list(se->color_list, se->color_list);
} }
if (se->entry) evas_stringshare_del(se->entry); if (se->entry) evas_stringshare_del(se->entry);
if (se->filename) evas_stringshare_del(se->filename); if (se->filename) evas_stringshare_del(se->filename);
@ -815,7 +806,8 @@ _edje_file_free(Edje_File *edf)
Edje_Color_Class *ecc; Edje_Color_Class *ecc;
ecc = edf->color_classes->data; ecc = edf->color_classes->data;
edf->color_classes = evas_list_remove_list(edf->color_classes, edf->color_classes); edf->color_classes =
evas_list_remove_list(edf->color_classes, edf->color_classes);
if (ecc->name) evas_stringshare_del(ecc->name); if (ecc->name) evas_stringshare_del(ecc->name);
free(ecc); free(ecc);
} }
@ -833,7 +825,8 @@ _edje_file_free(Edje_File *edf)
"before calling edje_shutdown().\n" "before calling edje_shutdown().\n"
"The following errors are the edje object files and parts that are still\n" "The following errors are the edje object files and parts that are still\n"
"hanging around, with their reference counts\n"); "hanging around, with their reference counts\n");
evas_hash_foreach(edf->collection_hash, _edje_file_collection_hash_foreach, edf); evas_hash_foreach(edf->collection_hash,
_edje_file_collection_hash_foreach, edf);
evas_hash_free(edf->collection_hash); evas_hash_free(edf->collection_hash);
} }
if (edf->path) evas_stringshare_del(edf->path); if (edf->path) evas_stringshare_del(edf->path);
@ -948,7 +941,7 @@ _edje_collection_free_part_description_free(Edje_Part_Description *desc)
} }
static Evas_Bool static Evas_Bool
_edje_file_collection_hash_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata) _edje_file_collection_hash_foreach(const Evas_Hash *hash, const char *key, void *data, void *fdata)
{ {
Edje_File *edf; Edje_File *edf;
Edje_Part_Collection *coll; Edje_Part_Collection *coll;
@ -984,7 +977,7 @@ _cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *
parent = data; parent = data;
ed = _edje_fetch(obj); ed = _edje_fetch(obj);
if (!ed) return; if (!ed) return;
snprintf(new_src, sizeof(new_src), "%s%c%s", ed->parent, EDJE_PART_PATH_SEPARATOR, source); snprintf(new_src, sizeof(new_src), "%s%c%s", ed->parent,
EDJE_PART_PATH_SEPARATOR, source);
edje_object_signal_emit(parent, signal, new_src); edje_object_signal_emit(parent, signal, new_src);
} }