- XGetWindowAttributes (display, window, &xgwa);
-
- screen = xgwa.screen;
- visual = xgwa.visual;
- cmap = xgwa.colormap;
- windowWidth = xgwa.width;
- windowHeight = xgwa.height;
-
- gcv.background = get_pixel_resource ("background", "Background",
- display, xgwa.colormap);
- gcv.foreground = get_pixel_resource ("foreground", "Foreground",
- display, xgwa.colormap);
- fg_pixel = gcv.foreground;
- theGC = XCreateGC (display, window, GCForeground|GCBackground, &gcv);
-
- theBitmap = makeBitmap(BARCODE_WIDTH * MAX_MAG, BARCODE_HEIGHT * MAX_MAG);
- theImage = XCreateImage(display, visual, 1, XYBitmap, 0, theBitmap->buf,
- theBitmap->width, theBitmap->height, 8,
- theBitmap->widthBytes);
+ XGetWindowAttributes (st->dpy, st->window, &xgwa);
+
+ st->visual = xgwa.visual;
+ st->cmap = xgwa.colormap;
+ st->windowWidth = xgwa.width;
+ st->windowHeight = xgwa.height;
+
+ gcv.background = get_pixel_resource (st->dpy, xgwa.colormap,
+ "background", "Background");
+ gcv.foreground = get_pixel_resource (st->dpy, xgwa.colormap,
+ "foreground", "Foreground");
+ st->fg_pixel = gcv.foreground;
+ st->theGC = XCreateGC (st->dpy, st->window, GCForeground|GCBackground, &gcv);
+
+ st->theBitmap = makeBitmap(BARCODE_WIDTH * MAX_MAG, BARCODE_HEIGHT * MAX_MAG);
+ st->theImage = XCreateImage(st->dpy, st->visual, 1, XYBitmap, 0, st->theBitmap->buf,
+ st->theBitmap->width, st->theBitmap->height, 8,
+ st->theBitmap->widthBytes);
+ st->theImage->bitmap_bit_order = LSBFirst;
+ st->theImage->byte_order = LSBFirst;