-
Notifications
You must be signed in to change notification settings - Fork 0
/
Canvas.h
63 lines (44 loc) · 1.4 KB
/
Canvas.h
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
/*
-------------------------------------------------------------------------
OBJECT NAME: Canvas.h
FULL NAME: Generic X canvas
TYPE: Abstract
DESCRIPTION:
COPYRIGHT: University Corporation for Atmospheric Research, 1997
-------------------------------------------------------------------------
*/
#ifndef CANVAS_H
#define CANVAS_H
#define register
#include <Xm/Xm.h>
/* -------------------------------------------------------------------- */
class Canvas {
public:
Canvas(Widget w);
void Clear() const;
void ClearArea(int x, int y, int w, int h) const;
void ExposeArea(XmDrawingAreaCallbackStruct *call) const;
void ExposeAll() const;
void Resize();
void SetSize(const int height, const int width);
int Height() const { return(height); }
int Width() const { return(width); }
int Depth() const { return(depth); }
const Widget Wdgt() const { return(w); }
Drawable Surface() const { return(pixMap); }
int PutImage(XImage *im, int x, int y, int w, int h)
{ return(XPutImage(dpy, pixMap, defaultGC, im, 0, 0, x, y, w, h)); }
XImage *GetImage(int x, int y, int w, int h)
{ return(XGetImage(dpy, pixMap, x, y, w, h,
(unsigned long)AllPlanes, ZPixmap)); }
private:
Widget w;
Display *dpy;
Window win;
Pixmap pixMap;
GC defaultGC;
short width, height;
int depth;
unsigned long foreground, background;
}; /* END CANVAS.H */
#endif