-
Notifications
You must be signed in to change notification settings - Fork 0
/
PixMap.cc
65 lines (46 loc) · 1.46 KB
/
PixMap.cc
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
62
63
64
65
/*
-------------------------------------------------------------------------
OBJECT NAME: PixMap.cc
FULL NAME: Generic X Pixmap manipulations
DESCRIPTION:
COPYRIGHT: University Corporation for Atmospheric Research, 1997
-------------------------------------------------------------------------
*/
#include "PixMap.h"
/* -------------------------------------------------------------------- */
PixMap::PixMap(const Widget w, int wd, int ht)
{
Cardinal n;
Arg args[4];
int depth;
dpy = XtDisplay(w);
win = XtWindow(w);
defaultGC = XDefaultGC(dpy, 0);
height = ht;
width = wd;
n = 0;
XtSetArg(args[n], XtNforeground, &foreground); ++n;
XtSetArg(args[n], XtNbackground, &background); ++n;
XtSetArg(args[n], XtNdepth, &depth); ++n;
XtGetValues(w, args, n);
pixMap = XCreatePixmap(dpy, win, width, height, depth);
Clear();
} /* END CONSTRUCTOR */
/* -------------------------------------------------------------------- */
PixMap::~PixMap()
{
if (pixMap)
XFreePixmap(dpy, pixMap);
} /* END DESTRUCTOR */
/* -------------------------------------------------------------------- */
void PixMap::Clear() const
{
XSetForeground(dpy, defaultGC, background);
XFillRectangle(dpy, pixMap, defaultGC, 0, 0, width, height);
XSetForeground(dpy, defaultGC, foreground);
} /* END CLEAR */
/* -------------------------------------------------------------------- */
void PixMap::Copy() const
{
} /* END RESIZE */
/* END PIXMAP.CC */