Remove Evas_List from Evas.

SVN revision: 36942
This commit is contained in:
Cedric BAIL 2008-10-21 16:31:05 +00:00
parent 0780128787
commit 465b76a017
59 changed files with 715 additions and 868 deletions

View File

@ -404,8 +404,8 @@ extern "C" {
EAPI void evas_free (Evas *e);
EAPI int evas_render_method_lookup (const char *name);
EAPI Evas_List *evas_render_method_list (void);
EAPI void evas_render_method_list_free (Evas_List *list);
EAPI Eina_List *evas_render_method_list (void);
EAPI void evas_render_method_list_free (Eina_List *list);
EAPI void evas_output_method_set (Evas *e, int render_method);
EAPI int evas_output_method_get (const Evas *e);
@ -434,8 +434,8 @@ extern "C" {
EAPI void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h);
EAPI void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h);
EAPI void evas_obscured_clear (Evas *e);
EAPI Evas_List *evas_render_updates (Evas *e);
EAPI void evas_render_updates_free (Evas_List *updates);
EAPI Eina_List *evas_render_updates (Evas *e);
EAPI void evas_render_updates_free (Eina_List *updates);
EAPI void evas_render (Evas *e);
EAPI void evas_norender (Evas *e);
EAPI void evas_render_idle_flush (Evas *e);
@ -593,7 +593,7 @@ extern "C" {
EAPI void evas_font_path_clear (Evas *e);
EAPI void evas_font_path_append (Evas *e, const char *path);
EAPI void evas_font_path_prepend (Evas *e, const char *path);
EAPI const Evas_List *evas_font_path_list (const Evas *e);
EAPI const Eina_List *evas_font_path_list (const Evas *e);
EAPI void evas_font_hinting_set (Evas *e, Evas_Font_Hinting_Flags hinting);
EAPI Evas_Font_Hinting_Flags evas_font_hinting_get (const Evas *e);
@ -603,8 +603,8 @@ extern "C" {
EAPI void evas_font_cache_set (Evas *e, int size);
EAPI int evas_font_cache_get (const Evas *e);
EAPI Evas_List *evas_font_available_list (const Evas *e);
EAPI void evas_font_available_list_free (Evas *e, Evas_List *available);
EAPI Eina_List *evas_font_available_list (const Evas *e);
EAPI void evas_font_available_list_free (Evas *e, Eina_List *available);
/* textblock objects */
typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
@ -677,7 +677,7 @@ extern "C" {
EAPI int evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
EAPI Evas_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y);
EAPI int evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y);
EAPI Evas_List *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2);
EAPI Eina_List *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2);
EAPI Evas_Bool evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
EAPI void evas_object_textblock_clear(Evas_Object *obj);
@ -744,7 +744,7 @@ extern "C" {
EAPI void evas_object_clip_set (Evas_Object *obj, Evas_Object *clip);
EAPI Evas_Object *evas_object_clip_get (const Evas_Object *obj);
EAPI void evas_object_clip_unset (Evas_Object *obj);
EAPI const Evas_List *evas_object_clipees_get (const Evas_Object *obj);
EAPI const Eina_List *evas_object_clipees_get (const Evas_Object *obj);
EAPI void evas_object_data_set (Evas_Object *obj, const char *key, const void *data);
EAPI void *evas_object_data_get (const Evas_Object *obj, const char *key);
@ -760,8 +760,8 @@ extern "C" {
EAPI Evas_Object *evas_object_top_at_pointer_get (const Evas *e);
EAPI Evas_Object *evas_object_top_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects);
EAPI Evas_List *evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects);
EAPI Evas_List *evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects);
EAPI Eina_List *evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects);
EAPI Eina_List *evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects);
/* smart objects */
EAPI Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*func_resize) (Evas_Object *obj, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data);
@ -775,7 +775,7 @@ extern "C" {
EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj);
EAPI void evas_object_smart_member_del (Evas_Object *obj);
EAPI Evas_Object *evas_object_smart_parent_get (const Evas_Object *obj);
EAPI Evas_List *evas_object_smart_members_get (const Evas_Object *obj);
EAPI Eina_List *evas_object_smart_members_get (const Evas_Object *obj);
EAPI Evas_Smart *evas_object_smart_smart_get (const Evas_Object *obj);
EAPI void *evas_object_smart_data_get (const Evas_Object *obj);
EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data);

View File

@ -11,7 +11,7 @@
#ifdef BUILD_ASYNC_PRELOAD
#include <pthread.h>
static Evas_List *preload = NULL;
static Eina_List *preload = NULL;
static Image_Entry *current = NULL;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
@ -275,7 +275,7 @@ _evas_cache_image_entry_preload_add(Evas_Cache_Image *cache,
if (!ie->flags.preload)
{
preload = evas_list_append(preload, ie);
preload = eina_list_append(preload, ie);
ie->flags.preload = 1;
ie->target = target;
@ -312,7 +312,7 @@ _evas_cache_image_entry_preload_remove(Evas_Cache_Image *cache,
}
else
{
preload = evas_list_remove(preload, ie);
preload = eina_list_remove(preload, ie);
ie->flags.preload = 0;
ret = 1;
}
@ -1029,8 +1029,8 @@ _evas_cache_background_load(void *data)
{
pthread_mutex_lock(&mutex);
current = evas_list_data(preload);
preload = evas_list_remove(preload, current);
current = eina_list_data_get(preload);
preload = eina_list_remove(preload, current);
pthread_mutex_unlock(&mutex);

View File

@ -4,23 +4,25 @@
void
evas_object_clip_dirty(Evas_Object *obj)
{
Evas_List *l;
Eina_List *l;
Evas_Object *data;
obj->cur.cache.clip.dirty = 1;
for (l = obj->clip.clipees; l; l = l->next)
evas_object_clip_dirty(l->data);
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
evas_object_clip_dirty(data);
}
void
evas_object_recalc_clippees(Evas_Object *obj)
{
Evas_List *l;
Eina_List *l;
Evas_Object *data;
if (obj->cur.cache.clip.dirty)
{
evas_object_clip_recalc(obj);
for (l = obj->clip.clipees; l; l = l->next)
evas_object_recalc_clippees(l->data);
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
evas_object_recalc_clippees(data);
}
}
@ -117,7 +119,7 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
if (obj->cur.clipper)
{
/* unclip */
obj->cur.clipper->clip.clipees = evas_list_remove(obj->cur.clipper->clip.clipees, obj);
obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
if (!obj->cur.clipper->clip.clipees) obj->cur.clipper->cur.have_clipees = 0;
evas_object_change(obj->cur.clipper);
evas_object_change(obj);
@ -134,7 +136,7 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
clip->cur.geometry.w, clip->cur.geometry.h);
}
obj->cur.clipper = clip;
clip->clip.clipees = evas_list_append(clip->clip.clipees, obj);
clip->clip.clipees = eina_list_append(clip->clip.clipees, obj);
if (clip->clip.clipees) clip->cur.have_clipees = 1;
evas_object_change(clip);
evas_object_change(obj);
@ -226,7 +228,7 @@ evas_object_clip_unset(Evas_Object *obj)
}
if (obj->cur.clipper)
{
obj->cur.clipper->clip.clipees = evas_list_remove(obj->cur.clipper->clip.clipees, obj);
obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
if (!obj->cur.clipper->clip.clipees)
obj->cur.clipper->cur.have_clipees = 0;
evas_object_change(obj->cur.clipper);
@ -275,22 +277,18 @@ evas_object_clip_unset(Evas_Object *obj)
* clipper = evas_object_clip_get(obj);
* if (clipper)
* {
* Evas_List *clippees, *l;
* Eina_List *clippees, *l;
* Evas_Object *obj_tmp;
*
* clippees = evas_object_clipees_get(clipper);
* printf("Clipper clips %i objects\n", evas_list_count(clippees));
* for (l = clippees; l; l = l->next)
* {
* Evas_Object *obj_tmp;
*
* obj_tmp = l->data;
* printf("Clipper clips %i objects\n", eina_list_count(clippees));
* EINA_LIST_FOREACH(clippees, l, obj_tmp)
* evas_object_show(obj_tmp);
* }
* }
* @endcode
* @ingroup Evas_Clip_Group
*/
EAPI const Evas_List *
EAPI const Eina_List *
evas_object_clipees_get(const Evas_Object *obj)
{
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);

View File

@ -56,7 +56,7 @@ evas_object_data_set(Evas_Object *obj, const char *key, const void *data)
node->key = (char *)node + sizeof(Evas_Data_Node);
strcpy(node->key, key);
node->data = (void *)data;
obj->data.elements = evas_list_prepend(obj->data.elements, node);
obj->data.elements = eina_list_prepend(obj->data.elements, node);
}
/**
@ -89,23 +89,21 @@ evas_object_data_set(Evas_Object *obj, const char *key, const void *data)
EAPI void *
evas_object_data_get(const Evas_Object *obj, const char *key)
{
Evas_List *l;
Eina_List *l;
Evas_Data_Node *node;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
if (!key) return NULL;
for (l = obj->data.elements; l; l = l->next)
EINA_LIST_FOREACH(obj->data.elements, l, node)
{
Evas_Data_Node *node;
node = l->data;
if (!strcmp(node->key, key))
{
Evas_List *lst;
Eina_List *lst;
lst = obj->data.elements;
lst = evas_list_promote_list(lst, l);
lst = eina_list_promote_list(lst, l);
((Evas_Object *)obj)->data.elements = lst;
return node->data;
}
@ -136,23 +134,21 @@ evas_object_data_get(const Evas_Object *obj, const char *key)
EAPI void *
evas_object_data_del(Evas_Object *obj, const char *key)
{
Evas_List *l;
Eina_List *l;
Evas_Data_Node *node;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
if (!key) return NULL;
for (l = obj->data.elements; l; l = l->next)
EINA_LIST_FOREACH(obj->data.elements, l, node)
{
Evas_Data_Node *node;
node = l->data;
if (!strcmp(node->key, key))
{
void *data;
data = node->data;
obj->data.elements = evas_list_remove_list(obj->data.elements, l);
obj->data.elements = eina_list_remove_list(obj->data.elements, l);
free(node);
return data;
}

View File

@ -1,8 +1,8 @@
#include "evas_common.h"
#include "evas_private.h"
static Evas_List *
_evas_event_object_list_in_get(Evas *e, Evas_List *in, const Eina_Inlist *list, Evas_Object *stop, int x, int y, int *no_rep)
static Eina_List *
_evas_event_object_list_in_get(Evas *e, Eina_List *in, const Eina_Inlist *list, Evas_Object *stop, int x, int y, int *no_rep)
{
Evas_Object *obj;
@ -40,7 +40,7 @@ _evas_event_object_list_in_get(Evas *e, Evas_List *in, const Eina_Inlist *list,
((!obj->precise_is_inside) ||
(evas_object_is_inside(obj, x, y))))
{
in = evas_list_append(in, obj);
in = eina_list_append(in, obj);
if (!obj->repeat_events)
{
*no_rep = 1;
@ -55,11 +55,11 @@ _evas_event_object_list_in_get(Evas *e, Evas_List *in, const Eina_Inlist *list,
return in;
}
Evas_List *
Eina_List *
evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
{
Evas_Layer *lay;
Evas_List *in = NULL;
Eina_List *in = NULL;
if (!e->layers) return NULL;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
@ -74,14 +74,15 @@ evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
return in;
}
static Evas_List *evas_event_list_copy(Evas_List *list);
static Evas_List *
evas_event_list_copy(Evas_List *list)
static Eina_List *evas_event_list_copy(Eina_List *list);
static Eina_List *
evas_event_list_copy(Eina_List *list)
{
Evas_List *l, *new_l = NULL;
Eina_List *l, *new_l = NULL;
const void *data;
for (l = list; l; l = l->next)
new_l = evas_list_append(new_l, l->data);
EINA_LIST_FOREACH(list, l, data)
new_l = eina_list_append(new_l, data);
return new_l;
}
/* public functions */
@ -196,8 +197,9 @@ evas_event_freeze_get(const Evas *e)
EAPI void
evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
{
Evas_List *l, *copy;
Eina_List *l, *copy;
Evas_Event_Mouse_Down ev;
Evas_Object *obj;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -224,11 +226,8 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int
_evas_walk(e);
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
{
obj->mouse_grabbed++;
@ -239,7 +238,7 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev);
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
e->last_mouse_down_counter++;
_evas_unwalk(e);
}
@ -253,7 +252,7 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int
EAPI void
evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
{
Evas_List *l, *copy;
Eina_List *l, *copy;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -268,6 +267,7 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
{
Evas_Event_Mouse_Up ev;
Evas_Object *obj;
ev.button = b;
ev.output.x = e->pointer.x;
@ -283,11 +283,8 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
_evas_walk(e);
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
(obj->mouse_in) && (obj->mouse_grabbed > 0))
{
@ -298,17 +295,17 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev);
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
e->last_mouse_up_counter++;
}
if (!e->pointer.button)
{
Evas_List *ins;
Evas_List *l;
Eina_List *ins;
Eina_List *l;
{
Evas_Event_Mouse_Out ev;
Evas_Object *obj;
ev.buttons = e->pointer.button;
ev.output.x = e->pointer.x;
@ -325,12 +322,9 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
/* go thru old list of in objects */
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
if ((!evas_list_find(ins, obj)) ||
if ((!eina_list_data_find(ins, obj)) ||
(!e->pointer.inside))
{
@ -341,10 +335,11 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
if (e->delete_me) break;
}
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
if (e->pointer.inside)
{
Evas_Event_Mouse_In ev;
Evas_Object *obj;
ev.buttons = e->pointer.button;
ev.output.x = e->pointer.x;
@ -357,13 +352,9 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
ev.timestamp = timestamp;
ev.event_flags = EVAS_EVENT_FLAG_NONE;
for (l = ins; l; l = l->next)
EINA_LIST_FOREACH(ins, l, obj)
{
Evas_Object *obj;
obj = l->data;
if (!evas_list_find(e->pointer.object.in, obj))
if (!eina_list_data_find(e->pointer.object.in, obj))
{
obj->mouse_in = 1;
@ -375,10 +366,10 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
}
else
{
ins = evas_list_free(ins);
ins = eina_list_free(ins);
}
/* free our old list of ins */
e->pointer.object.in = evas_list_free(e->pointer.object.in);
e->pointer.object.in = eina_list_free(e->pointer.object.in);
/* and set up the new one */
e->pointer.object.in = ins;
if (e->pointer.inside)
@ -431,8 +422,9 @@ evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data)
EAPI void
evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestamp, const void *data)
{
Evas_List *l, *copy;
Eina_List *l, *copy;
Evas_Event_Mouse_Wheel ev;
Evas_Object *obj;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -456,15 +448,13 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam
_evas_walk(e);
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj = l->data;
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev);
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
_evas_unwalk(e);
}
@ -505,11 +495,12 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
if (e->pointer.mouse_grabbed > 0)
{
/* go thru old list of in objects */
Evas_List *outs = NULL;
Evas_List *l, *copy;
Eina_List *outs = NULL;
Eina_List *l, *copy;
{
Evas_Event_Mouse_Move ev;
Evas_Object *obj;
ev.buttons = e->pointer.button;
ev.cur.output.x = e->pointer.x;
@ -526,11 +517,8 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
ev.timestamp = timestamp;
ev.event_flags = EVAS_EVENT_FLAG_NONE;
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
if ((obj->cur.visible) &&
(evas_object_clippers_is_visible(obj)) &&
(!evas_event_passes_through(obj)) &&
@ -543,7 +531,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
}
}
else
outs = evas_list_append(outs, obj);
outs = eina_list_append(outs, obj);
if (e->delete_me) break;
}
}
@ -561,16 +549,16 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
ev.timestamp = timestamp;
ev.event_flags = EVAS_EVENT_FLAG_NONE;
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
while (outs)
{
Evas_Object *obj;
obj = outs->data;
outs = evas_list_remove(outs, obj);
outs = eina_list_remove(outs, obj);
if ((!obj->mouse_grabbed) && (!e->delete_me))
{
e->pointer.object.in = evas_list_remove(e->pointer.object.in, obj);
e->pointer.object.in = eina_list_remove(e->pointer.object.in, obj);
{
obj->mouse_in = 0;
if (e->events_frozen <= 0)
@ -582,11 +570,12 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
}
else
{
Evas_List *ins;
Evas_List *l, *copy;
Eina_List *ins;
Eina_List *l, *copy;
Evas_Event_Mouse_Move ev;
Evas_Event_Mouse_Out ev2;
Evas_Event_Mouse_In ev3;
Evas_Object *obj;
ev.buttons = e->pointer.button;
ev.cur.output.x = e->pointer.x;
@ -629,11 +618,8 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
ins = evas_event_objects_event_list(e, NULL, x, y);
/* go thru old list of in objects */
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
/* if its under the pointer and its visible and its in the new */
/* in list */
// FIXME: i don't think we need this
@ -641,7 +627,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
(obj->cur.visible) &&
(evas_object_clippers_is_visible(obj)) &&
(evas_list_find(ins, obj)) &&
(eina_list_data_find(ins, obj)) &&
(!evas_event_passes_through(obj)) &&
(!obj->clip.clipees) &&
((!obj->precise_is_inside) ||
@ -662,15 +648,12 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
}
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
/* go thru our current list of ins */
for (l = ins; l; l = l->next)
EINA_LIST_FOREACH(ins, l, obj)
{
Evas_Object *obj;
obj = l->data;
/* if its not in the old list of ins send an enter event */
if (!evas_list_find(e->pointer.object.in, obj))
if (!eina_list_data_find(e->pointer.object.in, obj))
{
obj->mouse_in = 1;
@ -680,7 +663,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
if (e->delete_me) break;
}
/* free our old list of ins */
evas_list_free(e->pointer.object.in);
eina_list_free(e->pointer.object.in);
/* and set up the new one */
e->pointer.object.in = ins;
}
@ -696,9 +679,10 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
EAPI void
evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data)
{
Evas_List *ins;
Evas_List *l;
Eina_List *ins;
Eina_List *l;
Evas_Event_Mouse_In ev;
Evas_Object *obj;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -724,13 +708,9 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data)
_evas_walk(e);
/* get new list of ins */
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
for (l = ins; l; l = l->next)
EINA_LIST_FOREACH(ins, l, obj)
{
Evas_Object *obj;
obj = l->data;
if (!evas_list_find(e->pointer.object.in, obj))
if (!eina_list_data_find(e->pointer.object.in, obj))
{
obj->mouse_in = 1;
@ -740,7 +720,7 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data)
if (e->delete_me) break;
}
/* free our old list of ins */
e->pointer.object.in = evas_list_free(e->pointer.object.in);
e->pointer.object.in = eina_list_free(e->pointer.object.in);
/* and set up the new one */
e->pointer.object.in = ins;
evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
@ -782,25 +762,21 @@ evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data)
if (e->pointer.mouse_grabbed == 0)
{
/* go thru old list of in objects */
Evas_List *l, *copy;
Eina_List *l, *copy;
Evas_Object *obj;
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj->mouse_in = 0;
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
obj = l->data;
{
obj->mouse_in = 0;
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
if (e->delete_me) break;
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
/* free our old list of ins */
e->pointer.object.in = evas_list_free(e->pointer.object.in);
e->pointer.object.in = eina_list_free(e->pointer.object.in);
}
_evas_unwalk(e);
}
@ -837,14 +813,12 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch
ev.event_flags = EVAS_EVENT_FLAG_NONE;
if (e->grabs)
{
Evas_List *l;
Eina_List *l;
Evas_Key_Grab *g;
e->walking_grabs++;
for (l = e->grabs; l; l= l->next)
EINA_LIST_FOREACH(e->grabs, l, g)
{
Evas_Key_Grab *g;
g = l->data;
if (g->just_added)
{
g->just_added = 0;
@ -869,15 +843,11 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch
{
while (e->delete_grabs > 0)
{
Evas_List *l;
e->delete_grabs--;
for (l = e->grabs; l;)
{
Evas_Key_Grab *g;
g = l->data;
l = l->next;
g = eina_list_data_get(l);
l = eina_list_next(l);
if (g->delete_me)
evas_key_grab_free(g->object, g->keyname, g->modifiers, g->not_modifiers);
}
@ -925,14 +895,12 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char
ev.event_flags = EVAS_EVENT_FLAG_NONE;
if (e->grabs)
{
Evas_List *l;
Eina_List *l;
Evas_Key_Grab *g;
e->walking_grabs++;
for (l = e->grabs; l; l= l->next)
EINA_LIST_FOREACH(e->grabs, l, g)
{
Evas_Key_Grab *g;
g = l->data;
if (g->just_added)
{
g->just_added = 0;
@ -963,8 +931,8 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char
{
Evas_Key_Grab *g;
g = l->data;
l = l->next;
g = eina_list_data_get(data);
l = eina_list_next(next);
if (g->delete_me)
evas_key_grab_free(g->object, g->keyname, g->modifiers, g->not_modifiers);
}
@ -989,8 +957,9 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char
EAPI void
evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data)
{
Evas_List *l, *copy;
Eina_List *l, *copy;
Evas_Event_Hold ev;
Evas_Object *obj;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -1006,16 +975,13 @@ evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data
_evas_walk(e);
copy = evas_event_list_copy(e->pointer.object.in);
for (l = copy; l; l = l->next)
EINA_LIST_FOREACH(copy, l, obj)
{
Evas_Object *obj;
obj = l->data;
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_HOLD, &ev);
if (e->delete_me) break;
}
if (copy) copy = evas_list_free(copy);
if (copy) copy = eina_list_free(copy);
_evas_unwalk(e);
}

View File

@ -9,8 +9,8 @@
/* font dir cache */
static Evas_Hash *font_dirs = NULL;
static Evas_List *fonts_cache = NULL;
static Evas_List *fonts_zero = NULL;
static Eina_List *fonts_cache = NULL;
static Eina_List *fonts_zero = NULL;
typedef struct _Fndat Fndat;
@ -64,16 +64,16 @@ evas_font_dir_cache_find(char *dir, char *font)
return NULL;
}
static Evas_List *
static Eina_List *
evas_font_set_get(const char *name)
{
Evas_List *fonts = NULL;
Eina_List *fonts = NULL;
char *p;
p = strchr(name, ',');
if (!p)
{
fonts = evas_list_append(fonts, eina_stringshare_add(name));
fonts = eina_list_append(fonts, eina_stringshare_add(name));
}
else
{
@ -86,10 +86,10 @@ evas_font_set_get(const char *name)
nm = alloca(p - pp + 1);
strncpy(nm, pp, p - pp);
nm[p - pp] = 0;
fonts = evas_list_append(fonts, eina_stringshare_add(nm));
fonts = eina_list_append(fonts, eina_stringshare_add(nm));
pp = p + 1;
p = strchr(pp, ',');
if (!p) fonts = evas_list_append(fonts, eina_stringshare_add(pp));
if (!p) fonts = eina_list_append(fonts, eina_stringshare_add(pp));
}
}
return fonts;
@ -98,32 +98,30 @@ evas_font_set_get(const char *name)
void
evas_font_free(Evas *evas, void *font)
{
Evas_List *l;
Eina_List *l;
Fndat *fd;
for (l = fonts_cache; l; l = l->next)
EINA_LIST_FOREACH(fonts_cache, l, fd)
{
Fndat *fd;
fd = l->data;
if (fd->font == font)
{
fd->ref--;
if (fd->ref == 0)
{
fonts_cache = evas_list_remove_list(fonts_cache, l);
fonts_zero = evas_list_append(fonts_zero, fd);
fonts_cache = eina_list_remove_list(fonts_cache, l);
fonts_zero = eina_list_append(fonts_zero, fd);
}
break;
}
}
while ((fonts_zero) &&
(evas_list_count(fonts_zero) > 4)) /* 4 is arbitrary */
(eina_list_count(fonts_zero) > 4)) /* 4 is arbitrary */
{
Fndat *fd;
fd = evas_list_data(fonts_zero);
fd = eina_list_data_get(fonts_zero);
if (fd->ref != 0) break;
fonts_zero = evas_list_remove_list(fonts_zero, fonts_zero);
fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero);
if (fd->name) eina_stringshare_del(fd->name);
if (fd->source) eina_stringshare_del(fd->source);
evas->engine.func->font_free(evas->engine.data.output, fd->font);
@ -135,15 +133,15 @@ void *
evas_font_load(Evas *evas, const char *name, const char *source, int size)
{
void *font = NULL;
Evas_List *fonts, *l;
Eina_List *fonts, *l;
Fndat *fd;
char *nm;
if (!name) return NULL;
if (name[0] == 0) return NULL;
for (l = fonts_cache; l; l = l->next)
EINA_LIST_FOREACH(fonts_cache, l, fd)
{
fd = l->data;
if (!strcmp(name, fd->name))
{
if (((!source) && (!fd->source)) ||
@ -151,7 +149,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
{
if (size == fd->size)
{
fonts_cache = evas_list_promote_list(fonts_cache, l);
fonts_cache = eina_list_promote_list(fonts_cache, l);
fd->ref++;
return fd->font;
}
@ -159,9 +157,8 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
}
}
for (l = fonts_zero; l; l = l->next)
EINA_LIST_FOREACH(fonts_zero, l, fd)
{
fd = l->data;
if (!strcmp(name, fd->name))
{
if (((!source) && (!fd->source)) ||
@ -169,8 +166,8 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
{
if (size == fd->size)
{
fonts_zero = evas_list_remove_list(fonts_zero, l);
fonts_cache = evas_list_prepend(fonts_cache, fd);
fonts_zero = eina_list_remove_list(fonts_zero, l);
fonts_cache = eina_list_prepend(fonts_cache, fd);
fd->ref++;
return fd->font;
}
@ -178,11 +175,8 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
}
}
fonts = evas_font_set_get(name);
for (l = fonts; l; l = l->next) /* Load each font in append */
EINA_LIST_FOREACH(fonts, l, nm) /* Load each font in append */
{
char *nm;
nm = l->data;
if ((l == fonts) || (!font)) /* First iteration OR no font */
{
#ifdef BUILD_FONT_LOADER_EET
@ -223,13 +217,14 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
font = evas->engine.func->font_load(evas->engine.data.output, (char *)nm, size);
else /* search font path */
{
Evas_List *l;
Eina_List *l;
char *dir;
for (l = evas->font_path; l; l = l->next)
EINA_LIST_FOREACH(evas->font_path, l, dir)
{
const char *f_file;
f_file = evas_font_dir_cache_find(l->data, (char *)nm);
f_file = evas_font_dir_cache_find(dir, (char *)nm);
if (f_file)
{
font = evas->engine.func->font_load(evas->engine.data.output, f_file, size);
@ -285,13 +280,14 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
evas->engine.func->font_add(evas->engine.data.output, font, (char *)nm, size);
else
{
Evas_List *l;
Eina_List *l;
char *dir;
for (l = evas->font_path; l; l = l->next)
EINA_LIST_FOREACH(evas->font_path, l, dir)
{
const char *f_file;
f_file = evas_font_dir_cache_find(l->data, (char *)nm);
f_file = evas_font_dir_cache_find(dir, (char *)nm);
if (f_file)
{
if (evas->engine.func->font_add(evas->engine.data.output, font, f_file, size))
@ -305,7 +301,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
}
eina_stringshare_del(nm);
}
evas_list_free(fonts);
eina_list_free(fonts);
#ifdef HAVE_FONTCONFIG
@ -355,7 +351,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
fd->size = size;
fd->font = font;
fd->ref = 1;
fonts_cache = evas_list_prepend(fonts_cache, fd);
fonts_cache = eina_list_prepend(fonts_cache, fd);
}
if (font)
@ -371,12 +367,12 @@ evas_font_load_hinting_set(Evas *evas, void *font, int hinting)
hinting);
}
Evas_List *
Eina_List *
evas_font_dir_available_list(const Evas *evas)
{
Evas_List *l;
Evas_List *ll;
Evas_List *available = NULL;
Eina_List *l;
Eina_List *ll;
Eina_List *available = NULL;
#ifdef HAVE_FONTCONFIG
/* Add font config fonts */
@ -384,6 +380,7 @@ evas_font_dir_available_list(const Evas *evas)
FcFontSet *set = NULL;
FcObjectSet *os;
int i;
char *dir;
p = FcPatternCreate();
os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
@ -400,7 +397,7 @@ evas_font_dir_available_list(const Evas *evas)
char *font;
font = (char *)FcNameUnparse(set->fonts[i]);
available = evas_list_append(available, eina_stringshare_add(font));
available = eina_list_append(available, eina_stringshare_add(font));
free(font);
}
@ -412,21 +409,18 @@ evas_font_dir_available_list(const Evas *evas)
if (!evas->font_path)
return available;
for (l = evas->font_path; l; l = l->next)
EINA_LIST_FOREACH(evas->font_path, l, dir)
{
Evas_Font_Dir *fd;
fd = evas_hash_find(font_dirs, (char *)l->data);
fd = object_text_font_cache_dir_update((char *)l->data, fd);
fd = evas_hash_find(font_dirs, dir);
fd = object_text_font_cache_dir_update(dir, fd);
if (fd && fd->aliases)
{
for (ll = fd->aliases; ll; ll = ll->next)
{
Evas_Font_Alias *fa;
Evas_Font_Alias *fa;
fa = ll->data;
available = evas_list_append(available, eina_stringshare_add((char *)fa->alias));
}
EINA_LIST_FOREACH(fd->aliases, ll, fa)
available = eina_list_append(available, eina_stringshare_add((char *)fa->alias));
}
}
@ -434,12 +428,12 @@ evas_font_dir_available_list(const Evas *evas)
}
void
evas_font_dir_available_list_free(Evas_List *available)
evas_font_dir_available_list_free(Eina_List *available)
{
while (available)
{
eina_stringshare_del(available->data);
available = evas_list_remove(available, available->data);
available = eina_list_remove(available, available->data);
}
}
@ -502,17 +496,15 @@ object_text_font_cache_dir_update(char *dir, Evas_Font_Dir *fd)
static Evas_Font *
object_text_font_cache_font_find_x(Evas_Font_Dir *fd, char *font)
{
Evas_List *l;
Eina_List *l;
char font_prop[14][256];
int num;
Evas_Font *fn;
num = evas_object_text_font_string_parse(font, font_prop);
if (num != 14) return NULL;
for (l = fd->fonts; l; l = l->next)
EINA_LIST_FOREACH(fd->fonts, l, fn)
{
Evas_Font *fn;
fn = l->data;
if (fn->type == 1)
{
int i;
@ -537,13 +529,11 @@ object_text_font_cache_font_find_x(Evas_Font_Dir *fd, char *font)
static Evas_Font *
object_text_font_cache_font_find_file(Evas_Font_Dir *fd, char *font)
{
Evas_List *l;
Eina_List *l;
Evas_Font *fn;
for (l = fd->fonts; l; l = l->next)
EINA_LIST_FOREACH(fd->fonts, l, fn)
{
Evas_Font *fn;
fn = l->data;
if (fn->type == 0)
{
if (!strcasecmp(font, fn->simple.name)) return fn;
@ -555,15 +545,11 @@ object_text_font_cache_font_find_file(Evas_Font_Dir *fd, char *font)
static Evas_Font *
object_text_font_cache_font_find_alias(Evas_Font_Dir *fd, char *font)
{
Evas_List *l;
Eina_List *l;
Evas_Font_Alias *fa;
for (l = fd->aliases; l; l = l->next)
{
Evas_Font_Alias *fa;
fa = l->data;
if (!strcasecmp(fa->alias, font)) return fa->fn;
}
EINA_LIST_FOREACH(fd->aliases, l, fa)
if (!strcasecmp(fa->alias, font)) return fa->fn;
return NULL;
}
@ -587,7 +573,7 @@ object_text_font_cache_dir_add(char *dir)
{
Evas_Font_Dir *fd;
char *tmp, *tmp2;
Evas_List *fdir;
Eina_List *fdir;
fd = calloc(1, sizeof(Evas_Font_Dir));
if (!fd) return NULL;
@ -634,7 +620,7 @@ object_text_font_cache_dir_add(char *dir)
fn->path = eina_stringshare_add(tmp2);
free(tmp2);
}
fd->fonts = evas_list_append(fd->fonts, fn);
fd->fonts = eina_list_append(fd->fonts, fn);
}
}
}
@ -670,12 +656,12 @@ object_text_font_cache_dir_add(char *dir)
fn->path = eina_stringshare_add(tmp2);
free(tmp2);
}
fd->fonts = evas_list_append(fd->fonts, fn);
fd->fonts = eina_list_append(fd->fonts, fn);
}
free(tmp);
}
free(fdir->data);
fdir = evas_list_remove(fdir, fdir->data);
fdir = eina_list_remove(fdir, fdir->data);
}
/* fonts.alias */
@ -707,7 +693,7 @@ object_text_font_cache_dir_add(char *dir)
free(fa);
}
else
fd->aliases = evas_list_append(fd->aliases, fa);
fd->aliases = eina_list_append(fd->aliases, fa);
}
}
fclose(f);
@ -742,7 +728,7 @@ object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd)
int i;
fn = fd->fonts->data;
fd->fonts = evas_list_remove(fd->fonts, fn);
fd->fonts = eina_list_remove(fd->fonts, fn);
for (i = 0; i < 14; i++)
{
if (fn->x.prop[i]) eina_stringshare_del(fn->x.prop[i]);
@ -756,7 +742,7 @@ object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd)
Evas_Font_Alias *fa;
fa = fd->aliases->data;
fd->aliases = evas_list_remove(fd->aliases, fa);
fd->aliases = eina_list_remove(fd->aliases, fa);
if (fa->alias) eina_stringshare_del(fa->alias);
free(fa);
}

View File

@ -39,13 +39,13 @@ evas_key_grab_new(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modi
return NULL;
}
}
g->object->grabs = evas_list_append(g->object->grabs, g);
if (evas_list_alloc_error())
g->object->grabs = eina_list_append(g->object->grabs, g);
if (eina_error_get())
{
MERR_BAD();
evas_mem_free(sizeof(Evas_List));
g->object->grabs = evas_list_append(g->object->grabs, g);
if (evas_list_alloc_error())
evas_mem_free(sizeof(Eina_List));
g->object->grabs = eina_list_append(g->object->grabs, g);
if (eina_error_get())
{
MERR_FATAL();
free(g);
@ -53,16 +53,16 @@ evas_key_grab_new(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modi
return NULL;
}