- gcv.foreground = default_fg_pixel = get_pixel_resource("foreground", "Foreground", dpy, cmap);
- draw_gc = XCreateGC(dpy, window, GCForeground, &gcv);
- gcv.foreground = get_pixel_resource ("background", "Background",dpy, cmap);
- erase_gc = XCreateGC (dpy, window, GCForeground, &gcv);
- ncolors = NCOLORSMAX;
- make_uniform_colormap(dpy, xgwa.visual, cmap, colors, &ncolors, True, &writeable, False);
- if (ncolors <= 0) {
- ncolors = 2;
- colors[0].red = colors[0].green = colors[0].blue = 0;
- colors[1].red = colors[1].green = colors[1].blue = 0xFFFF;
- XAllocColor(dpy, cmap, &colors[0]);
- XAllocColor(dpy, cmap, &colors[1]);
+ gcv.foreground = st->default_fg_pixel = get_pixel_resource(st->dpy, cmap, "foreground", "Foreground");
+ st->draw_gc = XCreateGC(st->dpy, st->window, GCForeground, &gcv);
+ gcv.foreground = get_pixel_resource (st->dpy, cmap, "background", "Background");
+ st->erase_gc = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
+ st->ncolors = NCOLORSMAX;
+ make_uniform_colormap(xgwa.screen, xgwa.visual, cmap,
+ st->colors, &st->ncolors, True, &writeable, False);
+ if (st->ncolors <= 0) {
+ st->ncolors = 2;
+ st->colors[0].red = st->colors[0].green = st->colors[0].blue = 0;
+ st->colors[1].red = st->colors[1].green = st->colors[1].blue = 0xFFFF;
+ XAllocColor(st->dpy, cmap, &st->colors[0]);
+ XAllocColor(st->dpy, cmap, &st->colors[1]);