From: <enl...@li...> - 2002-02-15 04:50:52
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/estyle Dir : e17/libs/estyle/src Modified Files: Estyle_private.h estyle.c estyle_style.c Log Message: Some compensation for layer offsets when determining geometry and performing layout. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/Estyle_private.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Estyle_private.h 29 Jan 2002 21:26:45 -0000 1.2 +++ Estyle_private.h 15 Feb 2002 04:50:50 -0000 1.3 @@ -19,6 +19,8 @@ char *name; E_DB_File *style_db; Ewd_Sheap *layers; + int left_push, right_push, top_push, bottom_push; + int references; }; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- estyle.c 4 Feb 2002 22:24:06 -0000 1.5 +++ estyle.c 15 Feb 2002 04:50:50 -0000 1.6 @@ -123,7 +123,8 @@ es->x = x; es->y = y; - evas_move(es->evas, es->bit, (double)(x), (double)(y)); + evas_move(es->evas, es->bit, (double)(x + es->style->info->left_push), + (double)(y + es->style->info->left_push)); estyle_style_move(es); } @@ -322,8 +323,10 @@ if (!(es->flags & ESTYLE_BIT_FIXED)) { evas_get_geometry(es->evas, es->bit, &x, &y, &w, &h); - es->w = D2I_ROUND(w); - es->h = D2I_ROUND(h); + es->w = D2I_ROUND(w) + es->style->info->left_push + + es->style->info->right_push; + es->h = D2I_ROUND(h) + es->style->info->top_push + + es->style->info->bottom_push; } /* @@ -331,7 +334,9 @@ */ evas_set_color(es->evas, es->bit, es->color->r, es->color->g, es->color->b, es->color->a); - evas_move(es->evas, es->bit, (double)(es->x), (double)(es->y)); + evas_move(es->evas, es->bit, + (double)(es->x + es->style->info->left_push), + (double)(es->y + es->style->info->top_push)); /* * Draw style altering bits below the text. @@ -606,8 +611,10 @@ *char_x = D2I_ROUND(xx) + es->x; *char_y = D2I_ROUND(yy) + es->y; - *char_w = D2I_ROUND(ww); - *char_h = D2I_ROUND(hh); + *char_w = D2I_ROUND(ww) + es->style->info->left_push + + es->style->info->right_push; + *char_h = D2I_ROUND(hh) + es->style->info->top_push + + es->style->info->bottom_push; return ret; } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle_style.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- estyle_style.c 29 Jan 2002 21:26:45 -0000 1.2 +++ estyle_style.c 15 Feb 2002 04:50:50 -0000 1.3 @@ -335,8 +335,10 @@ */ while ((layer = ewd_sheap_item(info->layers, i++)) && (ob = ewd_list_next(es->style->bits))) - evas_move(es->evas, ob, (double)(es->x + layer->x_offset), - (double)(es->y + layer->y_offset)); + evas_move(es->evas, ob, (double)(es->x + layer->x_offset + + info->left_push), + (double)(es->y + layer->y_offset + + info->right_push)); } /* @@ -515,8 +517,10 @@ ret = evas_add_text(es->evas, es->font, es->font_size + layer->size_change, text); - evas_move(es->evas, ret, (double)(es->x + layer->x_offset), - (double)(es->y + layer->y_offset)); + evas_move(es->evas, ret, (double)(es->x + layer->x_offset + + es->style->info->left_push), + (double)(es->y + layer->y_offset + + es->style->info->top_push)); /* * Now determine if it has relative or absolute color and change it's @@ -650,6 +654,22 @@ sprintf(key, "/layers/%d/color/b", i); e_db_int_get(info->style_db, key, &layer->b); + + /* + * Adjust the push of the left and right edges of the estyle. + */ + if (layer->x_offset > info->right_push) + info->right_push = layer->x_offset; + else if (-layer->x_offset > info->left_push) + info->left_push = -layer->x_offset; + + /* + * Adjust the push of the top and bottom edges of the estyle. + */ + if (layer->y_offset > info->bottom_push) + info->bottom_push = layer->y_offset; + else if (-layer->y_offset > info->top_push) + info->top_push = -layer->y_offset; ewd_sheap_insert(info->layers, layer); } |