1 /*
2 // pixmap.c
3 //
4 */
5
6 #include "xbook.h"
7
CreatePixmap(display,window,width,height,depth,fore,back,gc)8 Pixmap CreatePixmap( display, window, width, height, depth, fore, back, gc)
9 Display *display;
10 Window window;
11 int width, height, depth;
12 unsigned long fore, back;
13 GC *gc;
14 {
15 Pixmap pixmap;
16
17 pixmap = XCreatePixmap( display, window,
18 width, height, depth );
19 if( pixmap == (Pixmap) None )
20 {
21 QuitX( display,
22 "ERROR: Could not create pixmap",
23 " " );
24 }
25 *gc = MakeGC( display, pixmap, fore, back );
26 ClearPixmap( display, pixmap, *gc, fore, back, width, height );
27 return( pixmap );
28 }
29
ClearPixmap(display,pixmap,gc,fore,back,width,height)30 ClearPixmap( display, pixmap, gc, fore, back, width, height )
31 Display *display;
32 Pixmap pixmap;
33 GC gc;
34 unsigned long fore, back;
35 int width, height;
36 {
37 XSetForeground( display, gc, back );
38 XFillRectangle( display, pixmap, gc,
39 0, 0, width, height );
40 XSetForeground( display, gc, fore );
41 }
42
43