moved draw.c to libdraw.a
[dmenu.git] / draw / setupdraw.c
1 /* See LICENSE file for copyright and license details. */
2 #include <X11/Xlib.h>
3 #include "draw.h"
4
5 void
6 setupdraw(DC *dc, Window w) {
7         XWindowAttributes wa;
8
9         XGetWindowAttributes(dc->dpy, w, &wa);
10         dc->drawable = XCreatePixmap(dc->dpy, w, wa.width, wa.height,
11                 DefaultDepth(dc->dpy, DefaultScreen(dc->dpy)));
12         dc->gc = XCreateGC(dc->dpy, w, 0, NULL);
13         XSetLineAttributes(dc->dpy, dc->gc, 1, LineSolid, CapButt, JoinMiter);
14         if(!dc->font.set)
15                 XSetFont(dc->dpy, dc->gc, dc->font.xfont->fid);
16 }