File: VExpBuffer.c

package info (click to toggle)
acm4 4.7-18
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,776 kB
  • ctags: 1,621
  • sloc: ansic: 16,777; makefile: 364; sh: 31
file content (61 lines) | stat: -rw-r--r-- 1,540 bytes parent folder | download | duplicates (6)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "Vlib.h"

void VExposeBuffer (v, gc)
Viewport *v;
GC	gc; {

    if (v->flags & VPFastAnimation) {
	v->ztop = 0;
	v->depth = MaxDepth;
	FrameComplete (v->w);
	XFlush (v->dpy);
	return;
    }

/*
 * this is one area where more-than-one window per display gets hairy
 * -- this call really exposes the drawings buffered in all windows
 * associated with a given display.  the calling sequence needs to be
 * changed to reflect this.
 */

    if (v->flags & VPMono) {
	XCopyArea (v->dpy, v->monoPixmap, v->win, gc,
		0, 0, v->width, v->height, 0, 0);
	XSetForeground (v->dpy, gc, WhitePixel(v->dpy, v->screen));
	XFillRectangle (v->dpy, v->monoPixmap, gc, 0, 0, v->width, v->height);
	XSetForeground (v->dpy, gc, BlackPixel(v->dpy, v->screen));
    }
    else if (v->flags & VPPixmap) {
	XCopyArea (v->dpy, v->monoPixmap, v->win, gc,
		0, 0, v->width, v->height, 0, 0);
    }
    else if (v->set == 0) {
	v->set = 1;
	XStoreColors (v->dpy, v->cmap, v->aColor, v->colors*v->colors);
	v->pixel = &(v->bPixel[0]);
	XSetPlaneMask (v->dpy, gc, v->bMask);
	v->mask = v->bMask;
	/*
	for ((p=VColorList, q = &(v->bPixel[1])); p != (VColor *) 0; ++q) {
	    p->xcolor.pixel = *q;
	    p = p->next;
	}
	*/
    }
    else {
	v->set = 0;
	XStoreColors (v->dpy, v->cmap, v->bColor, v->colors*v->colors);
	v->pixel = &(v->aPixel[0]);
	XSetPlaneMask (v->dpy, gc, v->aMask);
	v->mask = v->aMask;
	/*
	for ((p=VColorList, q = &(v->aPixel[1])); p != (VColor *) 0; ++q) {
	    p->xcolor.pixel = *q;
	    p = p->next;
	}
	*/
    }

    XFlush (v->dpy);
}