File: tile.c

package info (click to toggle)
xgalaga 2.1.1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,700 kB
  • sloc: ansic: 16,119; sh: 1,548; perl: 816; makefile: 179
file content (45 lines) | stat: -rw-r--r-- 994 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "allincludes.h"

void
W_TileWindow(window, image)
    W_Window window;
    W_Image  *image;
{
    Window  win;

    check_loaded(image);
#ifdef DEBUG
    printf("Tiling window %d\n", window);
#endif
    win = W_Void2Window(window)->window;

    if (image->xpm == 0) {
	Pixmap orig;
	orig = image->pixmap;
	image->pixmap = XCreatePixmap(W_Display, W_Root,
	      image->width, image->height, 
	      (unsigned)DefaultDepth(W_Display, W_Screen));
	XCopyPlane(W_Display, orig, image->pixmap,
	   colortable[W_White].contexts[0], 0, 0, image->width, image->height,
		   0, 0, 1);
	image->xpm = 1;
    }
    XSetWindowBackgroundPixmap(W_Display, win, image->pixmap);
    XClearWindow(W_Display, win);
}

void
W_UnTileWindow(window)
    W_Window window;
{
    Window  win;

#ifdef DEBUG
    printf("Untiling window %d\n", window);
#endif
    win = W_Void2Window(window)->window;

    XSetWindowBackground(W_Display, win, colortable[W_Black].pixelValue);
    XClearWindow(W_Display, win);
}