_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret)
{
Edje_File *edf;
- Evas_List *l;
+ Evas_List *l, *hist;
Edje_Part_Collection *edc;
edf = evas_hash_find(_edje_file_hash, file);
{
*error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION;
}
+ else
+ {
+ for (l = edc->parts; l; l = l->next)
+ {
+ Edje_Part *ep, *ep2;
+
+ /* Register any color classes in this parts descriptions. */
+ ep = l->data;
+ hist = NULL;
+ hist = evas_list_append(hist, ep);
+ ep2 = ep;
+ while (ep2->dragable.confine_id >= 0)
+ {
+ ep2 = evas_list_nth(edc->parts, ep2->dragable.confine_id);
+ if (evas_list_find(hist, ep2))
+ {
+ printf("EDJE ERROR: confine_to loops. invalidating loop.\n");
+ ep2->dragable.confine_id = -1;
+ break;
+ }
+ hist = evas_list_append(hist, ep2);
+ }
+ evas_list_free(hist);
+ hist = NULL;
+ hist = evas_list_append(hist, ep);
+ ep2 = ep;
+ while (ep2->dragable.events_id >= 0)
+ {
+ Edje_Part* prev;
+
+ prev = ep2;
+
+ ep2 = evas_list_nth(edc->parts, ep2->dragable.events_id);
+ if (!ep2->dragable.x && !ep2->dragable.y)
+ {
+ prev->dragable.events_id = -1;
+ break;
+ }
+
+ if (evas_list_find(hist, ep2))
+ {
+ printf("EDJE ERROR: events_to loops. invalidating loop.\n");
+ ep2->dragable.events_id = -1;
+ break;
+ }
+ hist = evas_list_append(hist, ep2);
+ }
+ evas_list_free(hist);
+ hist = NULL;
+ hist = evas_list_append(hist, ep);
+ ep2 = ep;
+ while (ep2->clip_to_id >= 0)
+ {
+ ep2 = evas_list_nth(edc->parts, ep2->clip_to_id);
+ if (evas_list_find(hist, ep2))
+ {
+ printf("EDJE ERROR: clip_to loops. invalidating loop.\n");
+ ep2->clip_to_id = -1;
+ break;
+ }
+ hist = evas_list_append(hist, ep2);
+ }
+ evas_list_free(hist);
+ hist = NULL;
+ }
+ }
}
if (edc_ret) *edc_ret = edc;
Evas_List *l;
int errors = 0;
- /* check for invalid loops */
+ /* colorclass stuff */
for (l = ed->collection->parts; (l && ! errors); l = l->next)
{
Edje_Part *ep;
Evas_List *hist = NULL;
-
+
/* Register any color classes in this parts descriptions. */
ep = l->data;
if ((ep->default_desc) && (ep->default_desc->color_class))
desc = hist->data;
if (desc->color_class) _edje_color_class_member_add(ed, desc->color_class);
}
- hist = NULL;
- hist = evas_list_append(hist, ep);
- while (ep->dragable.confine_id >= 0)
- {
- ep = evas_list_nth(ed->collection->parts,
- ep->dragable.confine_id);
- if (evas_list_find(hist, ep))
- {
- printf("EDJE ERROR: confine_to loops. invalidating loop.\n");
- ep->dragable.confine_id = -1;
- break;
- }
- hist = evas_list_append(hist, ep);
- }
- evas_list_free(hist);
- hist = NULL;
- hist = evas_list_append(hist, ep);
- while (ep->dragable.events_id >= 0)
- {
- Edje_Part* prev;
-
- prev = ep;
-
- ep = evas_list_nth(ed->collection->parts,
- ep->dragable.events_id);
-
- if (!ep->dragable.x && !ep->dragable.y)
- {
- prev->dragable.events_id = -1;
- break;
- }
-
- if (evas_list_find(hist, ep))
- {
- printf("EDJE ERROR: events_to loops. invalidating loop.\n");
- ep->dragable.events_id = -1;
- break;
- }
- hist = evas_list_append(hist, ep);
- }
- evas_list_free(hist);
- hist = NULL;
- hist = evas_list_append(hist, ep);
- while (ep->clip_to_id >= 0)
- {
- ep = evas_list_nth(ed->collection->parts,
- ep->clip_to_id);
- if (evas_list_find(hist, ep))
- {
- printf("EDJE ERROR: clip_to loops. invalidating loop.\n");
- ep->clip_to_id = -1;
- break;
- }
- hist = evas_list_append(hist, ep);
- }
- evas_list_free(hist);
- hist = NULL;
}
/* build real parts */
for (n = 0, l = ed->collection->parts; l; l = l->next, n++)
}
if (n > 0)
{
+ /* FIXME: keeping a table AND a list is just bad - nuke list */
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
ed->table_parts_size = n;
/* FIXME: check malloc return */
n = evas_list_count(ed->collection->programs);
if (n > 0)
{
+ /* FIXME: keeping a table AND a list is just bad - nuke list */
ed->table_programs = malloc(sizeof(Edje_Program *) * n);
ed->table_programs_size = n;
/* FIXME: check malloc return */
evas_object_smart_data_set(obj, ed);
ed->obj = obj;
_edje_edjes = evas_list_append(_edje_edjes, obj);
+/*
+ {
+ Evas_List *l;
+
+ printf("--- EDJE DUMP [%i]\n", evas_list_count(_edje_edjes));
+ for (l = _edje_edjes; l; l = l->next)
+ {
+ ed = _edje_fetch(l->data);
+ printf("EDJE: %80s | %80s\n", ed->path, ed->part);
+ }
+ printf("--- EDJE DUMP [%i]\n", evas_list_count(_edje_edjes));
+ }
+ */
}
static void
_edje_edjes = evas_list_remove(_edje_edjes, obj);
evas_object_smart_data_set(obj, NULL);
_edje_unref(ed);
+ _edje_file_del(ed);
}
static void
if (!obj->callbacks) return;
if (!obj->callbacks->deletions_waiting) return;
obj->callbacks->deletions_waiting = 0;
+/*
evas_object_event_callback_list_post_free(&(obj->callbacks->in));
evas_object_event_callback_list_post_free(&(obj->callbacks->out));
evas_object_event_callback_list_post_free(&(obj->callbacks->down));
free(obj->callbacks);
obj->callbacks = NULL;
}
+ */
+ evas_object_event_callback_list_post_free(&obj->callbacks->callbacks);
+ if (!obj->callbacks->callbacks)
+ {
+ free(obj->callbacks);
+ obj->callbacks = NULL;
+ }
}
void
{
/* MEM OK */
if (!obj->callbacks) return;
+ /*
evas_object_event_callback_list_free(&(obj->callbacks->in));
evas_object_event_callback_list_free(&(obj->callbacks->out));
evas_object_event_callback_list_free(&(obj->callbacks->down));
evas_object_event_callback_list_free(&(obj->callbacks->obj_restack));
free(obj->callbacks);
obj->callbacks = NULL;
+ */
+ evas_object_event_callback_list_post_free(&obj->callbacks->callbacks);
+ free(obj->callbacks);
+ obj->callbacks = NULL;
}
void
if (obj->callbacks)
{
+ /*
switch (type)
{
case EVAS_CALLBACK_MOUSE_IN:
return;
break;
}
+ */
+ l_mod = &obj->callbacks->callbacks;
+ switch (type)
+ {
+ case EVAS_CALLBACK_MOUSE_DOWN:
+ {
+ Evas_Event_Mouse_Down *ev = event_info;
+
+ flags = ev->flags;
+ if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK))
+ {
+ if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1))
+ ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK);
+ }
+ obj->last_mouse_down_counter = e->last_mouse_down_counter;
+ break;
+ }
+ case EVAS_CALLBACK_MOUSE_UP:
+ {
+ Evas_Event_Mouse_Up *ev = event_info;
+
+ flags = ev->flags;
+ if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK))
+ {
+ if (obj->last_mouse_up_counter < (e->last_mouse_up_counter - 1))
+ ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK);
+ }
+ obj->last_mouse_up_counter = e->last_mouse_up_counter;
+ break;
+ }
+ default:
+ break;
+ }
obj->callbacks->walking_list++;
for (l = *l_mod; l; l = l->next)
{
Evas_Func_Node *fn;
fn = (Evas_Func_Node *)l;
- if (!fn->delete_me)
+ if ((fn->type == type) && (!fn->delete_me))
{
if (fn->func)
fn->func(fn->data, obj->layer->evas, obj, event_info);
}
if ((obj->no_propagate) && (l_mod) && (*l_mod)) return;
- if ((obj->smart.parent) &&
- (type != EVAS_CALLBACK_FREE) &&
+ if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
(type <= EVAS_CALLBACK_KEY_UP))
evas_object_event_callback_call(obj->smart.parent, type, event_info);
}
if (!fn) return;
fn->func = func;
fn->data = (void *)data;
+ fn->type = type;
if (!obj->callbacks)
obj->callbacks = evas_mem_calloc(sizeof(Evas_Callbacks));
free(fn);
return;
}
+ /*
switch (type)
{
case EVAS_CALLBACK_MOUSE_IN:
break;
}
*l_mod = evas_object_list_append(*l_mod, fn);
+ */
+ obj->callbacks->callbacks =
+ evas_object_list_append(obj->callbacks->callbacks, fn);
}
/**
if (!obj->callbacks) return NULL;
+ /*
switch (type)
{
case EVAS_CALLBACK_MOUSE_IN:
return data;
}
}
+ */
+ for (l = obj->callbacks->callbacks; l; l = l->next)
+ {
+ Evas_Func_Node *fn;
+
+ fn = (Evas_Func_Node *)l;
+ if ((fn->func == func) && (fn->type == type) && (!fn->delete_me))
+ {
+ void *data;
+
+ data = fn->data;
+ fn->delete_me = 1;
+ obj->callbacks->deletions_waiting = 1;
+ if (!obj->callbacks->walking_list)
+ evas_object_event_callback_clear(obj);
+ return data;
+ }
+ }
return NULL;
}
}
else
ih = ((int)(idy + idh)) - iy;
+/// printf(" IMG: %ix%i -> %i %i | %ix%i\n",
+/// o->cur.image.w, o->cur.image.h,
+/// obj->cur.geometry.x + idx,
+/// obj->cur.geometry.y + idy,
+/// iw, ih);
if ((o->cur.border.l == 0) &&
(o->cur.border.r == 0) &&
(o->cur.border.t == 0) &&
obscuring_objects_orig = obscuring_objects;
obscuring_objects = NULL;
/* phase 6. go thru each update rect and render objects in it*/
- while ((surface =
- e->engine.func->output_redraws_next_update_get(e->engine.data.output,
- &ux, &uy, &uw, &uh,
- &cx, &cy, &cw, &ch)))
+ if (do_draw)
{
- int off_x, off_y;
-
- if (make_updates)
- {
- Evas_Rectangle *rect;
-
- rect = malloc(sizeof(Evas_Rectangle));
- if (rect)
- {
- rect->x = ux; rect->y = uy; rect->w = uw; rect->h = uh;
- updates = evas_list_append(updates, rect);
- }
- }
- off_x = cx - ux;
- off_y = cy - uy;
- /* build obscuring objects list (in order from bottom to top) */
- for (ll = obscuring_objects_orig; ll; ll = ll->next)
- {
- Evas_Object *obj;
-
- obj = (Evas_Object *)(ll->data);
- if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
- obscuring_objects = evas_list_append(obscuring_objects, obj);
- }
- /* render all object that intersect with rect */
- for (ll = active_objects; ll; ll = ll->next)
+ while ((surface =
+ e->engine.func->output_redraws_next_update_get(e->engine.data.output,
+ &ux, &uy, &uw, &uh,
+ &cx, &cy, &cw, &ch)))
{
- Evas_Object *obj;
- Evas_List *l3;
- obj = (Evas_Object *)(ll->data);
-
- /* if it's in our outpout rect and it doesn't clip anything */
- if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh) &&
- (!obj->clip.clipees) &&
- (obj->cur.visible) &&
- (!obj->delete_me) &&
- (obj->cur.cache.clip.visible) &&
- (!obj->smart.smart) &&
- (obj->cur.color.a > 0))
+ int off_x, off_y;
+
+ if (make_updates)
{
- int x, y, w, h;
-
- if ((obscuring_objects) && (obscuring_objects->data == obj))
- obscuring_objects = evas_list_remove(obscuring_objects, obj);
- x = cx; y = cy; w = cw; h = ch;
- RECTS_CLIP_TO_RECT(x, y, w, h,
- obj->cur.cache.clip.x + off_x,
- obj->cur.cache.clip.y + off_y,
- obj->cur.cache.clip.w,
- obj->cur.cache.clip.h);
- if ((w > 0) && (h > 0) && (do_draw))
+ Evas_Rectangle *rect;
+
+ rect = malloc(sizeof(Evas_Rectangle));
+ if (rect)
{
- e->engine.func->context_clip_set(e->engine.data.output,
- e->engine.data.context,
- x, y, w, h);
-#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
- for (l3 = obscuring_objects; l3; l3 = l3->next)
+ rect->x = ux; rect->y = uy; rect->w = uw; rect->h = uh;
+ updates = evas_list_append(updates, rect);
+ }
+ }
+ off_x = cx - ux;
+ off_y = cy - uy;
+ /* build obscuring objects list (in order from bottom to top) */
+ for (ll = obscuring_objects_orig; ll; ll = ll->next)
+ {
+ Evas_Object *obj;
+
+ obj = (Evas_Object *)(ll->data);
+ if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
+ obscuring_objects = evas_list_append(obscuring_objects, obj);
+ }
+ /* render all object that intersect with rect */
+ for (ll = active_objects; ll; ll = ll->next)
+ {
+ Evas_Object *obj;
+ Evas_List *l3;
+ obj = (Evas_Object *)(ll->data);
+
+ /* if it's in our outpout rect and it doesn't clip anything */
+ if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh) &&
+ (!obj->clip.clipees) &&
+ (obj->cur.visible) &&
+ (!obj->delete_me) &&
+ (obj->cur.cache.clip.visible) &&
+ (!obj->smart.smart) &&
+ (obj->cur.color.a > 0))
+ {
+ int x, y, w, h;
+
+ if ((obscuring_objects) && (obscuring_objects->data == obj))
+ obscuring_objects = evas_list_remove(obscuring_objects, obj);
+ x = cx; y = cy; w = cw; h = ch;
+ RECTS_CLIP_TO_RECT(x, y, w, h,
+ obj->cur.cache.clip.x + off_x,
+ obj->cur.cache.clip.y + off_y,
+ obj->cur.cache.clip.w,
+ obj->cur.cache.clip.h);
+ if ((w > 0) && (h > 0))
{
- Evas_Object *obj2;
-
- obj2 = (Evas_Object *)l3->data;
- e->engine.func->context_cutout_add(e->engine.data.output,
- e->engine.data.context,
- obj2->cur.cache.clip.x + off_x,
- obj2->cur.cache.clip.y + off_y,
- obj2->cur.cache.clip.w,
- obj2->cur.cache.clip.h);
- }
+/// printf("CLIP: %p | %i %i, %ix%i | %p %i %i %ix%i\n",
+/// obj,
+/// x, y, w, h,
+/// obj->cur.clipper,
+/// obj->cur.cache.clip.x + off_x,
+/// obj->cur.cache.clip.y + off_y,
+/// obj->cur.cache.clip.w,
+/// obj->cur.cache.clip.h
+/// );
+/// if (((obj->cur.cache.clip.x + off_x) == 0) &&
+/// ((obj->cur.cache.clip.w) == 960))
+/// {
+/// abort();
+/// }
+
+ e->engine.func->context_clip_set(e->engine.data.output,
+ e->engine.data.context,
+ x, y, w, h);
+#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
+ for (l3 = obscuring_objects; l3; l3 = l3->next)
+ {
+ Evas_Object *obj2;
+
+ obj2 = (Evas_Object *)l3->data;
+ e->engine.func->context_cutout_add(e->engine.data.output,
+ e->engine.data.context,
+ obj2->cur.cache.clip.x + off_x,
+ obj2->cur.cache.clip.y + off_y,
+ obj2->cur.cache.clip.w,
+ obj2->cur.cache.clip.h);
+ }
#endif
- obj->func->render(obj,
- e->engine.data.output,
- e->engine.data.context,
- surface,
- off_x, off_y);
- e->engine.func->context_cutout_clear(e->engine.data.output,
- e->engine.data.context);
+ obj->func->render(obj,
+ e->engine.data.output,
+ e->engine.data.context,
+ surface,
+ off_x, off_y);
+ e->engine.func->context_cutout_clear(e->engine.data.output,
+ e->engine.data.context);
+ }
}
}
+ /* punch rect out */
+ e->engine.func->output_redraws_next_update_push(e->engine.data.output,
+ surface,
+ ux, uy, uw, uh);
+ /* free obscuring objects list */
+ obscuring_objects = evas_list_free(obscuring_objects);
}
- /* punch rect out */
- e->engine.func->output_redraws_next_update_push(e->engine.data.output,
- surface,
- ux, uy, uw, uh);
- /* free obscuring objects list */
- obscuring_objects = evas_list_free(obscuring_objects);
+ /* flush redraws */
+ e->engine.func->output_flush(e->engine.data.output);
}
- /* flush redraws */
- e->engine.func->output_flush(e->engine.data.output);
/* clear redraws */
e->engine.func->output_redraws_clear(e->engine.data.output);
/* and do a post render pass */
{
unsigned char deletions_waiting : 1;
int walking_list;
+ Evas_Object_List *callbacks;
+/*
Evas_Object_List *down;
Evas_Object_List *up;
Evas_Object_List *move;
Evas_Object_List *obj_move;
Evas_Object_List *obj_resize;
Evas_Object_List *obj_restack;
+ */
};
struct _Evas
struct _Evas_Func_Node
{
Evas_Object_List _list_data;
- char delete_me : 1;
void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info);
void *data;
+ Evas_Callback_Type type;
+ char delete_me : 1;
};
struct _Evas_Data_Node