- Colormap cmap;
- XGetWindowAttributes (dpy, window, &xgwa);
- cmap = xgwa.colormap;
- npixels = 0;
- gcv.foreground= fg= get_pixel_resource("foreground","Foreground", dpy, cmap);
- gcv.background= bg= get_pixel_resource("background","Background", dpy, cmap);
- gcv.fill_style= FillOpaqueStippled;
- gc = XCreateGC (dpy, window, GCForeground|GCBackground|GCFillStyle, &gcv);
+ st->dpy = dpy;
+ st->window = window;
+
+ XGetWindowAttributes (st->dpy, st->window, &xgwa);
+ st->xlim = xgwa.width;
+ st->ylim = xgwa.height;
+ st->cmap = xgwa.colormap;
+ st->npixels = 0;
+ st->grey_p = get_boolean_resource(st->dpy, "grey", "Boolean");
+ gcv.foreground= st->fg= get_pixel_resource(st->dpy, st->cmap, "foreground","Foreground");
+ gcv.background= st->bg= get_pixel_resource(st->dpy, st->cmap, "background","Background");