draw: remove shadow support

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-12-03 11:30:29 +01:00
parent 486e13eba0
commit b5fb612ea3
4 changed files with 1 additions and 40 deletions

View File

@ -49,10 +49,6 @@ List of *awesome* markup elements and their attributes:
- image: path to a background image - image: path to a background image
- align: background image alignment - align: background image alignment
- resize: resize background image to text size - resize: resize background image to text size
* text
- shadow: shadow color
- shadow_offset: shadow color offset in pixel
A Pango markup example: <span weight="bold" foreground="#336699">...</span>. A Pango markup example: <span weight="bold" foreground="#336699">...</span>.

View File

@ -72,8 +72,6 @@ right
role role
screen screen
selected selected
shadow
shadow_offset
Shift Shift
size_hints size_hints
skip_taskbar skip_taskbar

30
draw.c
View File

@ -201,22 +201,6 @@ draw_markup_on_element(markup_parser_data_t *p, const char *elem,
break; break;
} }
break; break;
case 't': /* text */
for(; *names; names++, values++)
switch(a_tokenize(*names, -1))
{
case A_TK_SHADOW:
reqs[++reqs_nbr] = xcolor_init_unchecked(&data->shadow.color,
*values,
a_strlen(*values));
break;
case A_TK_SHADOW_OFFSET:
data->shadow.offset = atoi(*values);
break;
default:
break;
}
break;
} }
for(i = 0; i <= reqs_nbr; i++) for(i = 0; i <= reqs_nbr; i++)
@ -230,7 +214,7 @@ static bool
draw_text_markup_expand(draw_parser_data_t *data, draw_text_markup_expand(draw_parser_data_t *data,
const char *str, ssize_t slen) const char *str, ssize_t slen)
{ {
static char const * const elements[] = { "bg", "bg_margin", "text", NULL }; static char const * const elements[] = { "bg", "bg_margin", NULL };
markup_parser_data_t p = markup_parser_data_t p =
{ {
.elements = elements, .elements = elements,
@ -383,18 +367,6 @@ draw_text(draw_context_t *ctx, font_t *font, PangoEllipsizeMode ellip, PangoWrap
break; break;
} }
if(pdata->shadow.offset)
{
cairo_set_source_rgba(ctx->cr,
pdata->shadow.color.red / 65535.0,
pdata->shadow.color.green / 65535.0,
pdata->shadow.color.blue / 65535.0,
pdata->shadow.color.alpha / 65535.0);
cairo_move_to(ctx->cr, x + pdata->shadow.offset, y + pdata->shadow.offset);
pango_cairo_layout_path(ctx->cr, ctx->layout);
cairo_stroke(ctx->cr);
}
cairo_move_to(ctx->cr, x, y); cairo_move_to(ctx->cr, x, y);
cairo_set_source_rgba(ctx->cr, cairo_set_source_rgba(ctx->cr,

5
draw.h
View File

@ -170,11 +170,6 @@ typedef struct
image_t *bg_image; image_t *bg_image;
alignment_t bg_align; alignment_t bg_align;
bool bg_resize; bool bg_resize;
struct
{
int offset;
xcolor_t color;
} shadow;
} draw_parser_data_t; } draw_parser_data_t;
void draw_text(draw_context_t *, font_t *, PangoEllipsizeMode, PangoWrapMode, alignment_t, padding_t *, area_t, const char *, ssize_t len, draw_parser_data_t *, area_t *); void draw_text(draw_context_t *, font_t *, PangoEllipsizeMode, PangoWrapMode, alignment_t, padding_t *, area_t, const char *, ssize_t len, draw_parser_data_t *, area_t *);