3
* Include file for the Windowing interface.
5
* Kevin P. Smith 6/11/89
8
* Call W_Initialize(), and then you may call any of the listed fuinctions.
9
* Also, externals you are allowed to pass or use include W_BigFont,
10
* W_RegularFont, W_UnderlineFont, W_HighlightFont, W_White, W_Black,
11
* W_Red, W_Green, W_Yellow, W_Cyan, W_Grey, W_Textwidth, and W_Textheight.
19
#include "copyright2.h"
22
typedef void (*W_Callback) ();
24
typedef char *W_Window;
38
/* mapping for some X11 keys that are not represented by ASCII or Latin-1 */
42
extern W_Callback W_GetWindowKeyDownHandler (W_Window w);
43
extern W_Callback W_GetWindowKeyUpHandler (W_Window w);
44
extern W_Callback W_GetWindowButtonHandler (W_Window w);
45
extern W_Callback W_GetWindowExposeHandler (W_Window w);
46
extern void W_SetWindowKeyDownHandler (W_Window w, W_Callback c);
47
extern void W_SetWindowKeyUpHandler (W_Window w, W_Callback c);
48
extern void W_SetWindowButtonHandler (W_Window w, W_Callback c);
49
extern void W_SetWindowExposeHandler (W_Window w, W_Callback c);
55
extern W_Font W_BigFont, W_RegularFont, W_UnderlineFont, W_HighlightFont,
57
extern W_Color W_White, W_Black, W_Red, W_Green, W_Yellow, W_Cyan, W_Grey;
59
extern W_Color W_Ind, W_Fed, W_Rom, W_Kli, W_Ori;
61
extern int W_BigTextwidth, W_BigTextheight, W_Textwidth, W_Textheight;
62
extern int W_FastClear;
63
extern W_Font W_MyPlanetFont, W_FriendlyPlanetFont, W_EnemyPlanetFont;
65
extern void W_Initialize (char *str);
66
extern void W_RenameWindow(W_Window window, char *str);
67
extern W_Window W_MakeWindow (char *name, int x, int y, int width, int height, W_Window parent, int border, W_Color color);
68
extern W_Icon W_StoreBitmap (int width, int height, char *data, W_Window window);
69
extern W_Window W_MakeTextWindow (char *name, int x, int y, int width, int height, W_Window parent, int border);
70
extern W_Window W_MakeScrollingWindow (char *name, int x, int y, int width, int height, W_Window parent, int border);
71
extern void W_FlushScrollingWindow(W_Window window);
72
extern void W_SetSensitive(W_Window w, int v);
73
extern W_Window W_MakeMenu (char *name, int x, int y, int width, int height, W_Window parent, int border);
74
extern void W_WriteText (W_Window window, int x, int y, W_Color color, char *str, int len, W_Font font);
75
extern void W_MaskText (W_Window window, int x, int y, W_Color color, char *str, int len, W_Font font);
76
extern void W_WriteBitmap (int x, int y, W_Icon bit, W_Color color);
77
extern void W_ClearArea (W_Window window, int x, int y, int width, int height);
78
extern void W_MakeLine (W_Window window, int x0, int y0, int x1, int y1, W_Color color);
79
extern void W_MapWindow (W_Window window);
80
extern void W_UnmapWindow (W_Window window);
81
extern int W_EventsPending (void);
82
extern void W_NextEvent (W_Event *wevent);
83
extern void W_SetWindowName(W_Window window, char *name);
84
extern void W_TileWindow (W_Window window, W_Icon bit);
85
extern void W_UnTileWindow (W_Window window);
86
extern void W_ChangeBorder (W_Window window, int color);
87
void W_DefineMapcursor(W_Window window);
88
void W_DefineLocalcursor(W_Window window);
89
void W_DefineFedCursor(W_Window window);
90
void W_DefineRomCursor(W_Window window);
91
void W_DefineKliCursor(W_Window window);
92
void W_DefineOriCursor(W_Window window);
93
void W_DefineTrekCursor(W_Window window);
94
void W_DefineWarningCursor(W_Window window);
95
void W_DefineTextCursor(W_Window window);
96
extern void W_DefineCursor (W_Window window, int width, int height, char *bits, char *mask, int xhot, int yhot);
97
extern int W_IsMapped (W_Window window);
98
void W_ReinitMenu(W_Window window, int neww, int newh);
99
void W_ResizeMenu(W_Window window, int neww, int newh);
100
extern void W_Beep (void);
101
extern void W_DestroyWindow (W_Window window);
102
extern int W_WindowWidth (W_Window window);
103
extern int W_WindowHeight (W_Window window);
104
extern int W_Socket (void);
105
extern void W_ClearWindow (W_Window window);
106
extern void W_SetIconWindow (W_Window main, W_Window icon);
107
extern void W_CacheLine(W_Window, int, int, int, int, int);
108
extern void W_MakeTractLine(W_Window, int, int, int, int, W_Color);
109
extern void W_MakePhaserLine(W_Window, int, int, int, int, W_Color);
110
extern void W_WriteCircle(W_Window, int, int, int, W_Color);
111
extern void W_WriteTriangle(W_Window, int, int, int, int, W_Color);
112
extern void W_CacheClearArea(W_Window, int, int, int, int);
113
extern void W_FlushClearAreaCache(W_Window);
114
extern void W_FlushLineCaches(W_Window);
115
extern void W_ResizeTextWindow(W_Window, int, int);
116
extern int W_Mono(void);
117
extern int W_EventsQueuedCk(void);
118
extern void W_OverlayBitmap(int, int, W_Icon, W_Color);
119
extern void W_WriteTriangle(W_Window, int, int, int, int, W_Color);
120
extern void W_Flush(void);
122
#define W_EV_EXPOSE 1
124
#define W_EV_BUTTON 3
126
#ifdef MOUSE_AS_SHIFT
131
#define W_EV_KEY_OFF 4
135
#define W_EV_CM_BUTTON 5
138
#define W_EV_CLOSED 6 /* window was closed by user action */
143
#define W_WUBUTTON 4 // Mouse wheel up
144
#define W_WDBUTTON 5 // wheel down
145
#define W_X1BUTTON 6 // future extra keys
150
#define W_SHIFT_BUTTON 0x08
151
#define W_CTRL_BUTTON 0x10
152
#define W_BUTTON_RANGE 0x20
154
#define W_BUTTON_RANGE 8
157
#define W_BoldFont W_HighlightFont
159
void W_FillArea(W_Window window, int x, int y, int width, int height, W_Color color);
160
void W_DefineArrowCursor(W_Window window);
161
void W_GalacticBgd(int which);
162
void W_LocalBgd(int which);
164
int W_TTSTextHeight(void);
165
int W_TTSTextWidth(char *s, int l);
166
void W_EraseTTSText(W_Window window, int max_width, int y, int width);
167
void W_WriteTTSText(W_Window window, int max_width, int y, int width, char *str, int len);
168
void W_Halo(int x, int y, W_Color color);
170
void W_FullScreenOn(W_Window window);
171
void W_FullScreenOff(W_Window window);
172
void W_FullScreenInitialise(void);
173
int W_FullScreenToggle(W_Window window);
174
#define FULLSCREEN_NOT_COMPILED -1
175
#define FULLSCREEN_OK 0
176
#define FULLSCREEN_FAILED 1
177
void W_FullScreenBegin(W_Window window);
178
void W_FullScreen(W_Window window);
179
void W_CameraSnap(W_Window window);
180
int W_SpNextEvent(W_Event *wevent);
181
int findMouseInWin(int *x, int *y, W_Window w);
182
int W_EventsQueued(void);
183
int W_EventsQueuedCk(void);