1
|
1 /* $Id: Wlib.h,v 1.1.1.1 1997/12/06 05:41:28 darius Exp $ */
|
|
2
|
|
3 /* Wlib.h
|
|
4 *
|
|
5 * Include file for the Windowing interface.
|
|
6 *
|
|
7 * Kevin P. Smith 6/11/89
|
|
8 *
|
|
9 * The deal is this:
|
|
10 * Call W_Initialize(), and then you may call any of the listed fuinctions.
|
|
11 * Also, externals you are allowed to pass or use include W_BigFont,
|
|
12 * W_RegularFont, W_UnderlineFont, W_HighlightFont, W_White, W_Black,
|
|
13 * W_Red, W_Green, W_Yellow, W_Cyan, W_Grey, W_Textwidth, and W_Textheight.
|
|
14 */
|
|
15
|
|
16 #ifndef Wlib_h_
|
|
17 #define Wlib_h_
|
|
18
|
|
19 #include <stdio.h>
|
|
20 #include <X11/Xlib.h>
|
|
21 #include <X11/Xutil.h>
|
|
22 #include "Wlib.h"
|
|
23 #include "copyright2.h"
|
|
24
|
|
25 #ifndef P
|
|
26 #ifdef __STDC__
|
|
27 #define P(x) x
|
|
28 #else
|
|
29 #define P(x) ()
|
|
30 #endif
|
|
31 #endif /* P */
|
|
32
|
|
33 typedef struct event W_Event;
|
|
34 typedef int (*W_Callback) ();
|
|
35 typedef char *W_Window;
|
|
36 extern W_Callback W_GetWindowKeyDownHandler();
|
|
37 extern W_Callback W_GetWindowKeyUpHandler();
|
|
38 extern W_Callback W_GetWindowButtonHandler();
|
|
39 extern W_Callback W_GetWindowExposeHandler();
|
|
40 extern W_Callback W_SetWindowKeyDownHandler();
|
|
41 extern W_Callback W_SetWindowKeyUpHandler();
|
|
42 extern W_Callback W_SetWindowButtonHandler();
|
|
43 extern W_Callback W_SetWindowExposeHandler();
|
|
44 int W_Mono P((void));
|
|
45
|
|
46 /*typedef char *W_Window;*/
|
|
47 typedef char *W_Icon;
|
|
48 typedef char *W_Font;
|
|
49 typedef int W_Color;
|
|
50
|
|
51 extern W_Font W_BigFont, W_RegularFont, W_UnderlineFont, W_HighlightFont;
|
|
52 extern W_Color W_White, W_Black, W_Red, W_Green, W_Yellow, W_Cyan, W_Grey;
|
|
53 extern int W_Textwidth, W_Textheight;
|
|
54 extern int W_FastClear;
|
|
55
|
|
56 void W_Initialize P((char * /* display */));
|
|
57 W_Window
|
|
58 W_MakeWindow P(( char *, int, int, int, int, W_Window, char *, int, W_Color /* name, x, y, width, height, parent, border, color */ ));
|
|
59 W_Icon W_StoreBitmap P(( int, int, char *, W_Window
|
|
60 /* width, height, data, window */ ));
|
|
61 void W_FreeBitmap P(( W_Icon /* icon */ ));
|
|
62 W_Window W_MakeTextWindow P((
|
|
63 char *, int, int, int, int, W_Window, char *, int
|
|
64 /* name, x, y, width, height, parent, border */ ));
|
|
65 W_Window W_MakeScrollingWindow P((
|
|
66 char *, int, int, int, int, W_Window, char *, int
|
|
67 /* name, x, y, width, height, parent,border */ ));
|
|
68 W_Window W_MakeMenu P(( char *, int, int, int, int, W_Window, int
|
|
69 /* name, x, y, width, height, parent, border */ ));
|
|
70 void W_WriteText P(( W_Window, int, int, W_Color, char *, int, W_Font
|
|
71 /* window, x, y, color, str, length, font */ ));
|
|
72 void W_MaskText P(( W_Window, int, int, W_Color, char *, int, W_Font
|
|
73 /* window, x, y, color, str, length, font */ ));
|
|
74 void W_WriteBitmap P(( int, int, W_Icon, W_Color
|
|
75 /* x, y, icon, color */ ));
|
|
76 void W_WriteWinBitmap P(( W_Window, int, int, W_Icon, W_Color
|
|
77 /* win, x, y, icon, color */ ));
|
|
78 void W_ClearArea P(( W_Window, int, int, int, int
|
|
79 /* window, x, y, width, height, color */ ));
|
|
80 void W_MakeLine P(( W_Window, int, int, int, int, W_Color
|
|
81 /* window, x0, y0, x1, y1, color */ ));
|
|
82 void W_DrawPoint P(( W_Window, int, int, W_Color
|
|
83 /* window, x, y, color */ ));
|
|
84 void W_MapWindow P(( W_Window /* window */ ));
|
|
85 void W_UnmapWindow P(( W_Window /* window */ ));
|
|
86 int W_EventsPending P(( void ));
|
|
87 void W_NextEvent P(( W_Event * /* W_Event *event */ ));
|
|
88 void W_TileWindow P(( W_Window, W_Icon /* window, bitmap */ ));
|
|
89 void W_UnTileWindow P(( W_Window /* window */ ));
|
|
90 void W_ChangeBorder P(( W_Window, int /* window, color */ ));
|
|
91 void W_DefineCursor P((
|
|
92 W_Window, int, int, char *, char *, int, int
|
|
93 /* window, width, height, data, mask, xhot, yhot */ ));
|
|
94 int W_IsMapped P(( W_Window /* window */ ));
|
|
95 void W_Beep P(( void ));
|
|
96 void W_DestroyWindow P(( W_Window ));
|
|
97 int W_WindowWidth P(( W_Window /* window */ ));
|
|
98 int W_WindowHeight P(( W_Window /* window */ ));
|
|
99 int W_Socket P(( void ));
|
|
100 void W_ClearWindow P(( W_Window /* window */ ));
|
|
101 void W_SetIconWindow P(( W_Window, W_Window /* mainwindow, iconwindow */ ));
|
|
102 int W_StringWidth P(( char [], W_Font /* string, font */ ));
|
|
103 void W_TranslatePoints P(( W_Window, int *, int * /* window, x, y */ ));
|
|
104 void W_ResizeWindow P(( W_Window, int, int /* window, neww, newh */ ));
|
|
105 void W_ResizeMenu P(( W_Window, int, int /* window, neww, newh */ ));
|
|
106 void W_ResizeText P(( W_Window, int, int /* window, neww, newh */ ));
|
|
107 void W_Deiconify P(( W_Window /* window */ ));
|
|
108
|
|
109 W_Icon W_MakeShieldBitmap P(( int, int, W_Window /* width,height, window */ ));
|
|
110
|
|
111 #ifdef AMIGA
|
|
112 void switchScreen();
|
|
113 /* things ignored or different for now: */
|
|
114 /* some laziness on my part, mostly just unneeded. */
|
|
115 #define W_CacheLine W_MakeLine
|
|
116 #define W_CachePoint W_DrawPoint
|
|
117 #define W_FlushPointCaches(w)
|
|
118 #define W_FlushLineCaches(w)
|
|
119 #define W_DefineTextCursor(w) W_DefineMessageCursor(w)
|
|
120 #define W_RevertCursor(w) W_DefineTCrossCursor(w)
|
|
121 #define W_RenameWindow(w,s)
|
|
122
|
|
123 extern W_Icon W_ReadPixmap(W_Window window, char *path, char *name, int width, int height, int x, int y, int mask);
|
|
124
|
|
125 #define W_StringWidth(st,font) (strlen(st)*W_Textwidth)
|
|
126
|
|
127 /* Don't even know what this is supposed to do... */
|
|
128 #define W_SetSensitive(w,b)
|
|
129
|
|
130 extern int autoPoint, W_KeyDepth, animPointers, useWorkbench;
|
|
131 extern unsigned long w_socket;
|
|
132 #endif /* AMIGA */
|
|
133
|
|
134
|
|
135 #define W_EV_EXPOSE 1
|
|
136 #define W_EV_KEY 2
|
|
137 #define W_EV_BUTTON 3
|
|
138
|
|
139 #ifdef AUTOKEY
|
|
140 #define W_EV_KEY_OFF 4
|
|
141 #endif /* AUTOKEY */
|
|
142
|
|
143 #define W_LBUTTON 1
|
|
144 #define W_MBUTTON 2
|
|
145 #define W_RBUTTON 3
|
|
146
|
|
147 struct event {
|
|
148 int type;
|
|
149 W_Window Window;
|
|
150 int key;
|
|
151 int x, y;
|
|
152 };
|
|
153
|
|
154 #define W_BoldFont W_HighlightFont
|
|
155
|
|
156 #endif
|