-
Notifications
You must be signed in to change notification settings - Fork 16
/
GraphicsAttributes.H
59 lines (50 loc) · 2.05 KB
/
GraphicsAttributes.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
// ---------------------------------------------------------------
// GraphicsAttributes.H
// ---------------------------------------------------------------
#ifndef _GRAPHICSATTRIBUTES_H
#define _GRAPHICSATTRIBUTES_H
#include <AMReX_AmrvisConstants.H>
#include <iostream>
using std::ostream;
#include <X11/X.h>
#include <X11/Intrinsic.h>
#undef index
class GraphicsAttributes {
friend ostream& operator<<(ostream &os, const GraphicsAttributes &ga);
protected:
Widget appTopLevel;
Display *display;
Screen *screen;
Visual *visual;
XVisualInfo visual_info;
GC gc;
Window root;
int depth, screennumber, bytesPerPixel;
int CalculateNBP();
unsigned long red_shift;
unsigned long green_shift;
unsigned long blue_shift;
public:
explicit GraphicsAttributes(Widget);
Widget PTopLevel() const { return appTopLevel; }
Display *PDisplay() const { return display; }
Screen *PScreen() const { return screen; }
Visual *PVisual() const { return visual; }
GC PGC() const { return gc; }
Window PRoot() const { return root; }
int PDepth() const { return depth; }
int PScreenNumber() const { return screennumber; }
int PBytesPerPixel() const { return bytesPerPixel; }
int PBitsPerRGB() const { return visual_info.bits_per_rgb; }
bool IsTrueColor() const { return visual_info.c_class == TrueColor; }
unsigned long PRedMask() const { return visual_info.red_mask; }
unsigned long PGreenMask() const { return visual_info.green_mask; }
unsigned long PBlueMask() const { return visual_info.blue_mask; }
unsigned long PRedShift() const { return red_shift; }
unsigned long PGreenShift() const { return green_shift; }
unsigned long PBlueShift() const { return blue_shift; }
int PBitmapPaddedWidth(int width) const;
};
#endif
// -------------------------------------------------------------------
// -------------------------------------------------------------------