initial commit
[xdos] / src / xtypes.h
1 #ifndef XTYPES_H_
2 #define XTYPES_H_
3
4 #include "inttypes.h"
5
6 typedef int8_t INT8;
7 typedef int16_t INT16;
8 typedef int32_t INT32;
9
10 #ifndef BYTE
11 typedef uint8_t BYTE;
12 #endif
13
14 typedef uint8_t CARD8;
15 typedef uint16_t CARD16;
16 typedef uint32_t CARD32;
17
18 typedef CARD32  BITMASK;
19 typedef CARD32  WINDOW;
20 typedef CARD32  PIXMAP;
21 typedef CARD32  CURSOR;
22 typedef CARD32  FONT;
23 typedef CARD32  GCONTEXT;
24 typedef CARD32  COLORMAP;
25 typedef CARD32  DRAWABLE;
26 typedef CARD32  FONTABLE;
27 typedef CARD32  ATOM;
28 typedef CARD32  VISUALID;
29 typedef CARD32  TIMESTAMP;
30 typedef CARD32  KEYSYM;
31 typedef CARD8   KEYCODE;
32 typedef CARD8   BUTTON;
33
34 typedef CARD8*  STRING8;
35
36 /* BITGRAVITY, WINGRAVITY */
37 #define Forget          0
38 #define Unmap           0
39 #define NorthWest       1
40 #define North           2
41 #define NorthEast       3
42 #define West            4
43 #define Center          5
44 #define East            6
45 #define SouthWest       7
46 #define South           8
47 #define SouthEast       9
48 #define Static          10
49
50 #define False   0
51 #define True    1
52
53 /* SETofEVENT, SETofPOINTEREVENT, SETofDEVICEEVENT bitmasks */
54 #define KeyPress                                0x00000001
55 #define KeyRelease                              0x00000002
56 #define ButtonPress                             0x00000004
57 #define ButtonRelease                   0x00000008
58 #define EnterWindow                             0x00000010
59 #define LeaveWindow                             0x00000020
60 #define PointerMotion                   0x00000040
61 #define PointerMotionHint               0x00000080
62 #define Button1Motion                   0x00000100
63 #define Button2Motion                   0x00000200
64 #define Button3Motion                   0x00000400
65 #define Button4Motion                   0x00000800
66 #define Button5Motion                   0x00001000
67 #define ButtonMotion                    0x00002000
68 #define KeymapState                             0x00004000
69 #define Exposure                                0x00008000
70 #define VisibilityChange                0x00010000
71 #define StructureNotify                 0x00020000
72 #define ResizeRedirect                  0x00040000
73 #define SubstructureNotify              0x00080000
74 #define SubstructureRedirect    0x00100000
75 #define FocusChange                             0x00200000
76 #define PropertyChange                  0x00400000
77 #define ColormapChange                  0x00800000
78 #define OwnerGrabButton                 0x01000000
79
80 #define SetOfEventUnused                0xfe000000
81 #define SetOfPointerEventUnused 0xffff8003
82 #define SetOfDeviceEventUnused  0xffffc0b0
83
84 /* SETofKEYBUTMASK, SETofKEYMASK bitmasks */
85 #define Shift                   0x0001
86 #define Lock                    0x0002
87 #define Control                 0x0004
88 #define Mod1                    0x0008
89 #define Mod2                    0x0010
90 #define Mod3                    0x0020
91 #define Mod4                    0x0040
92 #define Mod5                    0x0080
93 #define Button1                 0x0100
94 #define Button2                 0x0200
95 #define Button3                 0x0400
96 #define Button4                 0x0800
97 #define Button5                 0x1000
98
99 #define SetOfKeyButMaskUnused   0xe000
100 #define SetOfKeyMaskUnused              0xff00
101
102 typedef struct {
103         CARD8 byte1, byte2;
104 } CHAR2B;
105
106 typedef CHAR2B* STRING16;
107
108 typedef struct {
109         INT16 x, y;
110 } POINT;
111
112 typedef struct {
113         INT16 x, y;
114         CARD16 width, height;
115 } RECTANGLE;
116
117 typedef struct {
118         INT16 x, y;
119         CARD16 width, height;
120         INT16 angle1, angle2;
121 } ARC;
122
123 /* family field of the HOST structure */
124 enum {
125         Internet                        = 0,
126         DECnet                          = 1,
127         Chaos                           = 2,
128         ServerInterpreted       = 5,
129         InternetV6                      = 6
130 };
131
132 typedef struct {
133         CARD8 family, unused1;
134         CARD16 addr_length;
135         BYTE addr[1];
136 } HOST;
137
138 typedef struct {
139         CARD8 length;
140         STRING8 name;
141 } STR;
142
143 #endif  /* XTYPES_H_ */