1 /* NetHack 3.6 macwin.h $NHDT-Date: 1447755970 2015/11/17 10:26:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
7 #undef red /* undef internal color const strings from decl */
18 #include <pascal.h> /* for CtoPStr and PtoCStr */
22 #define PLAYER_NAME_RES_ID 1001
24 /* fake some things if we don't have universal headers.. */
25 #if 0 /*ndef NewUserItemProc*/
26 typedef pascal void (*UserItemProcPtr)(WindowPtr theWindow, short itemNo);
27 typedef UserItemProcPtr UserItemUPP;
28 #define NewUserItemProc(p) (UserItemUPP)(p)
30 typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl,
32 typedef ControlActionProcPtr ControlActionUPP;
33 #define NewControlActionProc(p) (ControlActionUPP)(p)
35 typedef ModalFilterProcPtr ModalFilterUPP;
36 #define DisposeRoutineDescriptor(p)
41 #define ResumeProcPtr long /* for call to InitDialogs */
44 /* working dirs structure */
45 typedef struct macdirs {
59 typedef struct macflags {
60 Bitfield(processes, 1);
66 Bitfield(trueType, 1);
69 Bitfield(standardFile, 1);
70 Bitfield(hasDebugger, 1);
75 extern MacDirs theDirs; /* used in macfile.c */
76 extern MacFlags macFlags;
81 #define NUM_MACWINDOWS 15
82 #define TEXT_BLOCK 512L
84 /* Window constants */
86 #define kStatusWindow 1
87 #define kMessageWindow 2
90 #define kLastWindowKind kMenuWindow
93 * This determines the minimum logical line length in text windows
94 * That is; even if physical width is less, this is where line breaks
95 * go at the minimum. 350 is about right for score lines with a
107 typedef struct NhWindow {
108 WindowPtr its_window;
121 short last_more_lin; /* Used by message window */
122 short save_lin; /* Used by message window */
124 short miSize; /* size of menu items arrays */
125 short miLen; /* number of menu items in array */
126 MacMHMenuItem **menuInfo; /* Used by menus (array handle) */
127 char menuChar; /* next menu accelerator to use */
128 short **menuSelected; /* list of selected elements from list */
129 short miSelLen; /* number of items selected */
130 short how; /* menu mode */
136 ControlHandle scrollBar;
139 extern Boolean CheckNhWin(WindowPtr mac_win);
141 #define NUM_STAT_ROWS 2
143 #define NUM_COLS 80 /* We shouldn't use column 0 */
146 extern NhWindow *theWindows;
148 extern struct window_procs mac_procs;
151 extern winid BASE_WINDOW, WIN_MAP, WIN_MESSAGE, WIN_INVEN, WIN_STATUS;
154 * External declarations for the window routines.
159 /* ### dprintf.c ### */
161 extern void dprintf(char *, ...);
163 /* ### maccurs.c ### */
165 extern Boolean RetrievePosition(short, short *, short *);
166 extern Boolean RetrieveSize(short, short, short, short *, short *);
167 extern void SaveWindowPos(WindowPtr);
168 extern void SaveWindowSize(WindowPtr);
169 extern Boolean FDECL(RetrieveWinPos, (WindowPtr, short *, short *));
171 /* ### macerrs.c ### */
173 extern void showerror(char *, const char *);
174 extern Boolean itworked(short);
175 extern void mustwork(short);
176 extern void attemptingto(char *);
177 /* appear to be unused
178 extern void comment(char *,long);
179 extern void pushattemptingto(char *);
180 extern void popattempt(void);
182 /* ### macfile.c ### */
184 /* extern char *macgets(int fd, char *ptr, unsigned len); unused */
185 extern void FDECL(C2P, (const char *c, unsigned char *p));
186 extern void FDECL(P2C, (const unsigned char *p, char *c));
188 /* ### macmenu.c ### */
190 extern void DoMenuEvt(long);
191 extern void InitMenuRes(void);
192 extern void AdjustMenus(short);
193 #define DimMenuBar() AdjustMenus(1)
194 #define UndimMenuBar() AdjustMenus(0)
196 /* ### macmain.c ### */
198 extern void FDECL(process_openfile,
199 (short s_vol, long s_dir, Str255 fNm, OSType ft));
201 /* ### macwin.c ### */
203 extern void AddToKeyQueue(unsigned char, Boolean);
204 extern unsigned char GetFromKeyQueue(void);
205 void trans_num_keys(EventRecord *);
206 extern void NDECL(InitMac);
207 int FDECL(try_key_queue, (char *));
208 void FDECL(enter_topl_mode, (char *));
209 void FDECL(leave_topl_mode, (char *));
210 void FDECL(topl_set_resp, (char *, char));
211 Boolean FDECL(topl_key, (unsigned char, Boolean));
212 E void FDECL(HandleEvent, (EventRecord *)); /* used in mmodal.c */
213 extern void NDECL(port_help);
215 extern Boolean small_screen;
217 E void FDECL(mac_init_nhwindows, (int *, char **));
218 E void NDECL(mac_askname);
219 E void NDECL(mac_get_nh_event);
220 E void FDECL(mac_exit_nhwindows, (const char *));
221 E winid FDECL(mac_create_nhwindow, (int));
222 E void FDECL(mac_clear_nhwindow, (winid));
223 E void FDECL(mac_display_nhwindow, (winid, BOOLEAN_P));
224 E void FDECL(mac_destroy_nhwindow, (winid));
225 E void FDECL(mac_curs, (winid, int, int));
226 E void FDECL(mac_putstr, (winid, int, const char *));
227 E void FDECL(mac_start_menu, (winid));
228 E void FDECL(mac_add_menu, (winid, int, const anything *, CHAR_P, CHAR_P, int,
229 const char *, BOOLEAN_P));
230 E void FDECL(mac_end_menu, (winid, const char *));
231 E int FDECL(mac_select_menu, (winid, int, menu_item **));
233 E void FDECL(mac_cliparound, (int, int));
235 E int NDECL(mac_nhgetch);
236 E int FDECL(mac_nh_poskey, (int *, int *, int *));
237 E int NDECL(mac_doprev_message);
238 E char FDECL(mac_yn_function, (const char *, const char *, CHAR_P));
239 E void FDECL(mac_getlin, (const char *, char *));
240 E int NDECL(mac_get_ext_cmd);
241 E void FDECL(mac_number_pad, (int));
242 E void NDECL(mac_delay_output);
246 #endif /* ! MACWIN_H */