annotate Wlib.h @ 2:fba0b6e6cdc7

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