add x_draw_clipped_string and use it in the text_list gui

This commit is contained in:
Cedric Roux
2016-04-28 15:50:04 +02:00
parent ca945b53de
commit c9f51868e2
3 changed files with 20 additions and 2 deletions
+12
View File
@@ -279,6 +279,18 @@ void x_draw_string(x_connection *_c, x_window *_w, int color,
XDrawString(c->d, w->p, c->colors[color], x, y, t, tlen);
}
void x_draw_clipped_string(x_connection *_c, x_window *_w, int color,
int x, int y, const char *t,
int clipx, int clipy, int clipwidth, int clipheight)
{
struct x_connection *c = _c;
XRectangle clip = { clipx, clipy, clipwidth, clipheight };
XSetClipRectangles(c->d, c->colors[color], 0, 0, &clip, 1, Unsorted);
x_draw_string(_c, _w, color, x, y, t);
XSetClipMask(c->d, c->colors[color], None);
}
void x_draw(x_connection *_c, x_window *_w)
{
struct x_connection *c = _c;