Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/enterminus/src/bin Modified Files: smart.c term.c term.h ui.c Log Message: fixed smart object show / hide / layer evas rectangles as bgs are VERY slow, or I'm totally treating them incorrectly. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/smart.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- smart.c 11 Feb 2005 23:27:30 -0000 1.3 +++ smart.c 18 Feb 2005 21:59:04 -0000 1.4 @@ -127,7 +127,14 @@ } /* TODO: - * We need to show evas objects and set their layers after a resize + * We need to show evas objects and set their layers after a resize + * + * When we resize, if we dont clear the text (which is what we should + * do, not clear the text) and we just call a normal redraw, then all + * of out text will get shifted and we get a distorted looking term. + * We need to copy the old are, resize, and render it onto the canvas + * as it were without any distortions. We dont get that now because we + * set all the area to '\0' in our current method, hence, clearing it. */ void term_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) { int x, y, old_size; @@ -168,6 +175,7 @@ } /* review this, do we need to subtract: + * We know that we need to subtract, but its segging when we do, fix. * (term->tcanvas->cols * term->tcanvas->rows * term->tcanvas->scroll_size) */ y = (term->tcanvas->cols * term->tcanvas->rows * term->tcanvas->scroll_size) @@ -204,6 +212,12 @@ for(x = y ; x <= term->tcanvas->cols * term->tcanvas->rows; x++) { gl = &term->grid[x]; gl->text = evas_object_text_add(term->evas); + evas_object_layer_set(gl->text, 2); + evas_object_show(gl->text); + gl->bg = evas_object_rectangle_add(term->evas); + evas_object_resize(gl->bg, term->font.width, term->font.height); + evas_object_color_set(gl->bg, 100, 50, 50, 150); + evas_object_layer_set(gl->bg, 1); } if(ioctl(term->cmd_fd.sys, TIOCSWINSZ, get_font_dim(term)) < 0) { @@ -223,7 +237,8 @@ for(i = 0; i < t->tcanvas->cols * t->tcanvas->rows; i++) { gl = &t->grid[i]; evas_object_show(gl->text); - evas_object_show(gl->bg); + /* Enabling this isnt really wise at this point, uber slowness */ + //evas_object_show(gl->bg); } } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/term.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- term.c 11 Feb 2005 13:14:55 -0000 1.9 +++ term.c 18 Feb 2005 21:59:04 -0000 1.10 @@ -194,9 +194,9 @@ i < term->tcanvas->cols * term->tcanvas->rows; i++) { gl = &term->grid[i]; gl->text = evas_object_text_add(term->evas); - gl->bg = evas_object_text_add(term->evas); + gl->bg = evas_object_rectangle_add(term->evas); evas_object_layer_set(gl->text,2); - evas_object_layer_set(gl->text,1); + evas_object_layer_set(gl->bg,1); } term->bg = NULL; =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/term.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- term.h 11 Feb 2005 13:07:56 -0000 1.4 +++ term.h 18 Feb 2005 21:59:04 -0000 1.5 @@ -19,6 +19,8 @@ #include <Ecore_X.h> #include "config.h" +#define DEBUG 1 + #define NPAR 16 #define DATADIR PACKAGE_DATA_DIR"/" =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/ui.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ui.c 11 Feb 2005 23:27:40 -0000 1.12 +++ ui.c 18 Feb 2005 21:59:04 -0000 1.13 @@ -85,7 +85,7 @@ c[0] = tgl->c; c[1] = '\0'; evas_object_text_text_set(gl->text, c); - + /* this is just temp, move it into its own function later */ switch(tgl->fg) { case 0: @@ -118,9 +118,12 @@ } /* The Layer setting and showing functions need to go away */ - evas_object_layer_set(gl->text,1); + //evas_object_layer_set(gl->text,2); evas_object_move(gl->text, j*term->font.width, i*term->font.height); - evas_object_show(gl->text); + //evas_object_show(gl->text); + //evas_object_layer_set(gl->bg,1); + evas_object_move(gl->bg, j*term->font.width, i*term->font.height); + //evas_object_show(gl->bg); tgl->changed = 0; } if(i + term->tcanvas->scroll_region_start > (term->tcanvas->rows - 1)*term->tcanvas->scroll_size) { @@ -230,7 +233,7 @@ if(y1 < 0) y1 = 0; if(y1 > term->tcanvas->rows) y1 = term->tcanvas->rows; if(x2 < 0) x2 = 0; if(x2 > term->tcanvas->cols) x2 = term->tcanvas->cols; if(y2 < 0) y2 = 0; if(y2 > term->tcanvas->rows) y2 = term->tcanvas->rows; - printf("Clearing: %d %d, %d %d\n",x1,y1+term->tcanvas->scroll_region_start,x2,y2+term->tcanvas->scroll_region_start); + DPRINT(("Clearing: %d %d, %d %d\n",x1,y1+term->tcanvas->scroll_region_start,x2,y2+term->tcanvas->scroll_region_start)); for(i = y1; i <= y2; i++) { for(j = x1; j <= x2; j++) { tgl = &term->tcanvas->grid[j + (term->tcanvas->cols * (i + term->tcanvas->scroll_region_start))]; ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs