Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas Modified Files: evas_callbacks.c evas_object_image.c evas_render.c Log Message: 1. fixed some inefficient edje loading - moved checks to the cache code where it sould be 2. fixed edje handling of delete of objects so we don't lose clip info if we move a swallowed object out 3. fix up norender stuff for evas a bit 4. pants. 5. coogee beach (sydney) in summer right now is beatiful - KICK ASS! =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_callbacks.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- evas_callbacks.c 14 Nov 2006 02:00:23 -0000 1.27 +++ evas_callbacks.c 22 Jan 2007 12:44:57 -0000 1.28 @@ -45,6 +45,7 @@ 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)); @@ -81,6 +82,13 @@ 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 @@ -88,6 +96,7 @@ { /* 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)); @@ -106,6 +115,10 @@ 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 @@ -121,6 +134,7 @@ if (obj->callbacks) { + /* switch (type) { case EVAS_CALLBACK_MOUSE_IN: @@ -196,13 +210,46 @@ 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); @@ -226,8 +273,7 @@ } 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); } @@ -417,6 +463,7 @@ if (!fn) return; fn->func = func; fn->data = (void *)data; + fn->type = type; if (!obj->callbacks) obj->callbacks = evas_mem_calloc(sizeof(Evas_Callbacks)); @@ -425,6 +472,7 @@ free(fn); return; } + /* switch (type) { case EVAS_CALLBACK_MOUSE_IN: @@ -481,6 +529,9 @@ break; } *l_mod = evas_object_list_append(*l_mod, fn); + */ + obj->callbacks->callbacks = + evas_object_list_append(obj->callbacks->callbacks, fn); } /** @@ -521,6 +572,7 @@ if (!obj->callbacks) return NULL; + /* switch (type) { case EVAS_CALLBACK_MOUSE_IN: @@ -581,6 +633,24 @@ fn = (Evas_Func_Node *)l; if ((fn->func == func) && (!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; + } + } + */ + 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; =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_image.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -3 -r1.47 -r1.48 --- evas_object_image.c 17 Dec 2006 15:48:50 -0000 1.47 +++ evas_object_image.c 22 Jan 2007 12:44:57 -0000 1.48 @@ -1707,6 +1707,11 @@ } 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) && =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_render.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- evas_render.c 16 Jan 2007 10:17:10 -0000 1.22 +++ evas_render.c 22 Jan 2007 12:44:57 -0000 1.23 @@ -278,99 +278,117 @@ 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) + while ((surface = + e->engine.func->output_redraws_next_update_get(e->engine.data.output, + &ux, &uy, &uw, &uh, + &cx, &cy, &cw, &ch))) { - 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) - { - 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 */ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs