1 /* SCCS Id: @(#)wbdefs.h 3.1 93/01/08 2 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993. */ 3 /* NetHack may be freely redistributed. See license for details. */ 4 5 #include <exec/types.h> 6 #include <exec/memory.h> 7 #include <graphics/gfxmacros.h> 8 #include <graphics/gfxbase.h> 9 #include <workbench/workbench.h> 10 #include <workbench/startup.h> 11 #include <intuition/intuition.h> 12 #include <intuition/intuitionbase.h> 13 14 #ifdef AZTEC_C 15 #include <libraries/dosextens.h> 16 #include <functions.h> 17 #else 18 #ifdef _DCC 19 #include <clib/exec_protos.h> 20 #include <clib/dos_protos.h> 21 #include <clib/intuition_protos.h> 22 #include <clib/icon_protos.h> 23 #include <clib/graphics_protos.h> 24 #else 25 #include <proto/exec.h> 26 #include <proto/dos.h> 27 #include <proto/intuition.h> 28 #include <proto/icon.h> 29 #include <proto/graphics.h> 30 #endif 31 #endif 32 33 #include <stdlib.h> 34 #include <stdarg.h> 35 #include <string.h> 36 #include <ctype.h> 37 #include <stdio.h> 38 39 #ifdef IDCMP_CLOSEWINDOW 40 #include <graphics/displayinfo.h> 41 #ifndef INTUI_NEW_LOOK 42 #define INTUI_NEW_LOOK 1 43 #endif 44 #endif 45 46 #define R_DISK 1 /* Refresh reasons */ 47 #define R_WINDOW 2 48 #define R_SCROLL 3 49 50 #define PLAYERMENU 0 51 52 #define MENU_PROJECT 0 /* so we can shuffle them around easily */ 53 #define ITEM_HELP 0 54 #define ITEM_ABOUT 1 55 #define ITEM_SCORES 2 56 #define ITEM_RECOVER 3 57 #define ITEM_CONFIG 4 58 #define ITEM_QUIT 5 59 60 #define MENU_GAME 1 61 #define ITEM_INFO 0 62 #define ITEM_COPYOPT 1 63 #define ITEM_DISCARD 2 64 #define ITEM_RENAME 3 65 66 #define GADSCROLL 1 /* The scroll bar */ 67 #define GADNEWGAME 2 /* New Game requested */ 68 69 #define GADSCRLUP 3 /* Scroll Up Gadget */ 70 #define GADSCRLDOWN 4 /* Scroll Down Gadget */ 71 #define GADINFOSCRL 5 /* The scroll bar */ 72 73 #define GADQUESTYES 6 74 #define GADQUESTNO 7 75 76 #define GADCOMSTR 8 77 78 #define GADCHARNAME 9 79 #define GADOUTFILE 10 80 #define GADCATNAME 11 81 #define GADDOGNAME 12 82 83 #define GADSTRSAVE 15 84 #define GADSTRLEVELS 16 85 #define GADSTRPATH 17 86 #define GADSTRPENS 18 87 #define GADSTRHACKDIR 19 88 #define GADCONFSAVE 21 89 #define GADCONFLOAD 22 90 #define GADCONFNAME 23 91 #define GADTOOLUP 24 92 #define GADTOOLDOWN 25 93 #define GADADDTOOL 26 94 #define GADDELTOOL 27 95 #define GADTOOLTYPES 28 96 #define GADSTRCANCEL 29 97 #define GADHELPOKAY 30 98 #define GADHELPFRWD 31 99 #define GADHELPBKWD 32 100 #define GADEDITOPTS 33 101 102 #define GADRESTDIR 34 103 #define GADRESTOLD 35 104 #define GADRESTNEW 36 105 #define GADRESTCAN 37 106 #define GADRESTOKAY 38 107 #define GADSAVEINFO 39 108 #define GADUSEINFO 40 109 #define GADQUITINFO 41 110 #define GADPLNAME 42 111 112 #define GADOPTOKAY 243 113 #define GADOPTCANCEL 244 114 115 /* 116 * Option gadgets GadgetID's 117 */ 118 #define GADOCOLOR 101 119 #define GADOCONFIRM 102 120 #define GADODISCLOSE 103 121 #define GADOFIXINV 104 122 #define GADONULL 105 123 #define GADOTIME 106 124 #define GADONEWS 107 125 #define GADOHELP 108 126 #define GADOFLUSH 109 127 #define GADORESTONSPACE 110 128 #define GADOPICKUP 111 129 #define GADOSOUND 112 130 #define GADONUMBERPAD 113 131 #define GADOSAFEPET 114 132 #define GADOSILENT 115 133 #define GADOTOMBSTONE 116 134 #define GADOVERBOSE 117 135 #define GADOSTANDOUT 118 136 #define GADOSORTPACK 119 137 #define GADOFEMALE 120 138 #define GADOIGNINTR 121 139 #define GADOPACKORDER 122 140 #define GADODOGNAME 123 141 #define GADOCATNAME 124 142 #define GADOFRUIT 125 143 #define GADOOBJECTS 126 144 #define GADOASKSAVE 127 145 #define GADOCANCEL 128 146 #define GADOOKAY 129 147 #define GADOCHKPOINT 130 148 #define GADOHILITEPET 131 149 #define GADOLEGACY 132 150 #define GADOLITCORRIDOR 133 151 #define GADOSHOWEXP 134 152 #define GADOSHOWSCORE 135 153 #define GADONAME 136 154 #define GADOSCORE 137 155 #define GADOPALETTE 138 156 #define GADOWINDOWTYPE 139 157 #define GADOMSGHISTORY 140 158 #define GADOPICKUPTYPES 141 159 #define GADOPETTYPE 142 160 161 /* Definition of workbench size layout */ 162 163 #define ORIGINX ( win->BorderLeft + 5 ) 164 #define ORIGINY ( win->BorderTop + Message.Height + 5 ) 165 #define CORNERX ( win->Width - win->BorderRight ) 166 #define CORNERY ( win->Height - win->BorderBottom ) 167 168 /* String buffer in String Gadget */ 169 170 #define Sbuff(gd) (((struct StringInfo*)((gd)->SpecialInfo))->Buffer) 171 172 /* The string gadgets' buffers */ 173 174 #define StrPath (Sbuff(&Conf_StrPath)) 175 #define StrOptions (Sbuff(&Conf_StrOptions)) 176 #define StrHackdir (Sbuff(&Conf_StrHackdir)) 177 #define StrPens (Sbuff(&Conf_StrPens)) 178 #define StrLevels (Sbuff(&Conf_StrLevels)) 179 #define StrSave (Sbuff(&Conf_StrSave)) 180 #define StrConf (Sbuff(&Conf_ConfigName)) 181 182 #define RstDir (Sbuff(&Rst_RestDir)) 183 #define RstOld (Sbuff(&Rst_RestOld)) 184 #define RstNew (Sbuff(&Rst_RestNew)) 185 186 #define StrString (Sbuff(&Str_String)) 187 188 #define StrTools (Sbuff(&Info_ToolTypes)) 189 #define StrPlayer (Sbuff(&Info_Player)) 190 191 #define GAMEIMAGE "HackExe:NetHack" 192 #define GAMESTACK 50000 193 194 #define PATH_IDX 0 195 #define OPTIONS_IDX 1 196 #define HACKDIR_IDX 2 197 #define LEVELS_IDX 3 198 #define SAVE_IDX 4 199 #define PENS_IDX 5 200 201 #define NUMIDX 6 202 203 #define PL_RANDOM 0 204 #define PL_ARCHEOLOGIST 1 205 #define PL_BARBARIAN 2 206 #define PL_CAVEMAN 3 207 #define PL_ELF 4 208 #define PL_HEALER 5 209 #define PL_KNIGHT 6 210 #define PL_PRIEST 7 211 #define PL_ROGUE 8 212 #define PL_SAMURAI 9 213 #define PL_TOURIST 10 214 #define PL_VALKYRIE 11 215 #define PL_WIZARD 12 216 217 #define MENUITEMNO( menu, itm, sitm ) FULLMENUNUM( menu, itm, sitm ) 218 #define GADWIDTH( gad ) max((gad)->Width, \ 219 strlen((gad)->GadgetText->IText) * win->RPort->TxWidth) 220 221 /* Horizontal space between gadgets */ 222 #define GADINCX 10 223 224 /* Vertical space between gadgets */ 225 #define GADINCY (win->RPort->TxHeight + 1) 226 227 #define NO_FLASH 0 228 #define FLASH 1 229