1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef DIRECTOR_TYPES_H 24 #define DIRECTOR_TYPES_H 25 26 namespace Director { 27 28 #define CONTINUATION (0xAC) 29 30 enum MovieFlag { 31 kMovieFlagAllowOutdatedLingo = (1 << 8) 32 }; 33 34 enum CastType { 35 kCastTypeNull = 0, 36 kCastBitmap = 1, 37 kCastFilmLoop = 2, 38 kCastText = 3, 39 kCastPalette = 4, 40 kCastPicture = 5, 41 kCastSound = 6, 42 kCastButton = 7, 43 kCastShape = 8, 44 kCastMovie = 9, 45 kCastDigitalVideo = 10, 46 kCastLingoScript = 11, 47 kCastRTE = 12 48 }; 49 50 enum ScriptType { 51 kNoneScript = -1, 52 kScoreScript = 0, 53 kCastScript = 1, 54 kMovieScript = 2, 55 kEventScript = 3, 56 kTestScript = 4, 57 kMaxScriptType = 4 // Sync with cast.cpp:46, array scriptTypes[] 58 }; 59 60 enum ScriptFlag { 61 kScriptFlagUnused = (1 << 0x0), 62 kScriptFlagFuncsGlobal = (1 << 0x1), 63 kScriptFlagVarsGlobal = (1 << 0x2), // Occurs in event scripts (which have no local vars). Correlated with use of alternate global var opcodes. 64 kScriptFlagUnk3 = (1 << 0x3), 65 kScriptFlagFactoryDef = (1 << 0x4), 66 kScriptFlagUnk5 = (1 << 0x5), 67 kScriptFlagUnk6 = (1 << 0x6), 68 kScriptFlagUnk7 = (1 << 0x7), 69 kScriptFlagHasFactory = (1 << 0x8), 70 kScriptFlagEventScript = (1 << 0x9), 71 kScriptFlagEventScript2 = (1 << 0xa), 72 kScriptFlagUnkB = (1 << 0xb), 73 kScriptFlagUnkC = (1 << 0xc), 74 kScriptFlagUnkD = (1 << 0xd), 75 kScriptFlagUnkE = (1 << 0xe), 76 kScriptFlagUnkF = (1 << 0xf) 77 }; 78 79 enum ObjectType { 80 kNoneObj = 0, 81 kFactoryObj = 1 << 0, 82 kXObj = 1 << 1, 83 kScriptObj = 1 << 2, 84 kXtraObj = 1 << 3, 85 kAllObj = kFactoryObj | kXObj | kScriptObj | kXtraObj, 86 kWindowObj = 1 << 4, 87 kCastMemberObj = 1 << 5 88 }; 89 90 enum ShapeType { 91 kShapeRectangle = 1, 92 kShapeRoundRect = 2, 93 kShapeOval = 3, 94 kShapeLine = 4 95 }; 96 97 enum TextType { 98 kTextTypeAdjustToFit, 99 kTextTypeScrolling, 100 kTextTypeFixed 101 }; 102 103 enum TextAlignType { 104 kTextAlignRight = -1, 105 kTextAlignLeft, 106 kTextAlignCenter 107 }; 108 109 enum TextFlag { 110 kTextFlagEditable = (1 << 0), 111 kTextFlagAutoTab = (1 << 1), 112 kTextFlagDoNotWrap = (1 << 2) 113 }; 114 115 enum SizeType { 116 kSizeNone, 117 kSizeSmallest, 118 kSizeSmall, 119 kSizeMedium, 120 kSizeLarge, 121 kSizeLargest 122 }; 123 124 enum ButtonType { 125 kTypeButton, 126 kTypeCheckBox, 127 kTypeRadio 128 }; 129 130 enum FrameRateType { 131 kFrameRateDefault = -1, 132 kFrameRateNormal = 0, 133 kFrameRateFastest = 1, 134 kFrameRateFixed = 2 135 }; 136 137 enum SpriteType { 138 kInactiveSprite = 0, // turns the sprite off 139 kBitmapSprite = 1, 140 kRectangleSprite = 2, // QuickDraw 141 kRoundedRectangleSprite = 3, // QuickDraw 142 kOvalSprite = 4, // QuickDraw 143 kLineTopBottomSprite = 5, // line from top left to bottom right 144 kLineBottomTopSprite = 6, // line from bottom left to top right 145 kTextSprite = 7, 146 kButtonSprite = 8, 147 kCheckboxSprite = 9, 148 kRadioButtonSprite = 10, 149 kPictSprite = 11, // Cast picture 150 kOutlinedRectangleSprite = 12, // QuickDraw 151 kOutlinedRoundedRectangleSprite = 13, // QuickDraw 152 kOutlinedOvalSprite = 14, // QuickDraw 153 kThickLineSprite = 15, // 2pt width line 154 kCastMemberSprite = 16, // Specified by cast member 155 kFilmLoopSpite = 17, 156 kDirMovieSprite = 18 157 }; 158 159 enum InkType { 160 kInkTypeCopy, 161 kInkTypeTransparent, 162 kInkTypeReverse, 163 kInkTypeGhost, 164 kInkTypeNotCopy, 165 kInkTypeNotTrans, 166 kInkTypeNotReverse, 167 kInkTypeNotGhost, 168 kInkTypeMatte, 169 kInkTypeMask, 170 //10-31 Not used (Lingo in a Nutshell) 171 kInkTypeBlend = 32, 172 kInkTypeAddPin, 173 kInkTypeAdd, 174 kInkTypeSubPin, 175 kInkTypeBackgndTrans, 176 kInkTypeLight, 177 kInkTypeSub, 178 kInkTypeDark 179 }; 180 181 enum LEvent { 182 kEventPrepareMovie, 183 kEventStartMovie, 184 kEventStepMovie, 185 kEventStopMovie, 186 187 kEventNew, 188 kEventBeginSprite, 189 kEventEndSprite, 190 191 kEventNone, 192 kEventGeneric, 193 kEventEnterFrame, 194 kEventPrepareFrame, 195 kEventIdle, 196 kEventStepFrame, 197 kEventExitFrame, 198 kEventTimeout, 199 200 kEventActivateWindow, 201 kEventDeactivateWindow, 202 kEventMoveWindow, 203 kEventResizeWindow, 204 kEventOpenWindow, 205 kEventCloseWindow, 206 207 kEventKeyUp, 208 kEventKeyDown, 209 kEventMouseUp, 210 kEventMouseDown, 211 kEventRightMouseUp, 212 kEventRightMouseDown, 213 kEventMouseEnter, 214 kEventMouseLeave, 215 kEventMouseUpOutSide, 216 kEventMouseWithin, 217 218 kEventStartUp, 219 220 kEventMenuCallback 221 }; 222 223 enum TransitionType { 224 kTransNone, 225 kTransWipeRight, 226 kTransWipeLeft, 227 kTransWipeDown, 228 kTransWipeUp, 229 kTransCenterOutHorizontal, // 5 230 kTransEdgesInHorizontal, 231 kTransCenterOutVertical, 232 kTransEdgesInVertical, 233 kTransCenterOutSquare, 234 kTransEdgesInSquare, // 10 235 kTransPushLeft, 236 kTransPushRight, 237 kTransPushDown, 238 kTransPushUp, 239 kTransRevealUp, // 15 240 kTransRevealUpRight, 241 kTransRevealRight, 242 kTransRevealDownRight, 243 kTransRevealDown, 244 kTransRevealDownLeft, // 20 245 kTransRevealLeft, 246 kTransRevealUpLeft, 247 kTransDissolvePixelsFast, 248 kTransDissolveBoxyRects, 249 kTransDissolveBoxySquares, // 25 250 kTransDissolvePatterns, 251 kTransRandomRows, 252 kTransRandomColumns, 253 kTransCoverDown, 254 kTransCoverDownLeft, // 30 255 kTransCoverDownRight, 256 kTransCoverLeft, 257 kTransCoverRight, 258 kTransCoverUp, 259 kTransCoverUpLeft, // 35 260 kTransCoverUpRight, 261 kTransVenetianBlind, 262 kTransCheckerboard, 263 kTransStripsBottomBuildLeft, 264 kTransStripsBottomBuildRight, // 40 265 kTransStripsLeftBuildDown, 266 kTransStripsLeftBuildUp, 267 kTransStripsRightBuildDown, 268 kTransStripsRightBuildUp, 269 kTransStripsTopBuildLeft, // 45 270 kTransStripsTopBuildRight, 271 kTransZoomOpen, 272 kTransZoomClose, 273 kTransVerticalBinds, 274 kTransDissolveBitsFast, // 50 275 kTransDissolvePixels, 276 kTransDissolveBits 277 }; 278 279 // TODO: Can there be any more built-in palette types? 280 enum PaletteType { 281 kClutSystemMac = -1, 282 kClutRainbow = -2, 283 kClutGrayscale = -3, 284 kClutPastels = -4, 285 kClutVivid = -5, 286 kClutNTSC = -6, 287 kClutMetallic = -7, 288 kClutSystemWin = -101 289 }; 290 291 enum DirectorCursor { 292 kCursorMouseDown, 293 kCursorMouseUp 294 }; 295 296 enum PlayState { 297 kPlayNotStarted, 298 kPlayStarted, 299 kPlayStopped 300 }; 301 302 enum SymbolType { 303 VOIDSYM, 304 OPCODE, 305 CBLTIN, // builtin command 306 FBLTIN, // builtin function 307 HBLTIN, // builtin handler (can be called as either command or func) 308 KBLTIN, // builtin constant 309 HANDLER // user-defined handler 310 }; 311 312 enum ChunkType { 313 kChunkChar, 314 kChunkWord, 315 kChunkItem, 316 kChunkLine 317 }; 318 319 enum { 320 kFileVer300 = 0x404, 321 kFileVer310 = 0x405, 322 kFileVer400 = 0x45B, 323 kFileVer404 = 0x45D, 324 kFileVer500 = 0x4B1, 325 kFileVer600 = 0x4C2, 326 kFileVer700 = 0x4C8, 327 kFileVer800 = 0x582, 328 kFileVer850 = 0x6A4, 329 kFileVer1000 = 0x73B, 330 kFileVer1100 = 0x781, 331 kFileVer1150 = 0x782, 332 kFileVer1200 = 0x783, 333 kFileVer1201 = 0x79F 334 }; 335 336 enum DatumType { 337 ARRAY, 338 ARGC, 339 ARGCNORET, 340 CASTREF, 341 CHUNKREF, 342 FIELDREF, 343 FLOAT, 344 INT, 345 OBJECT, 346 PARRAY, 347 POINT, 348 STRING, 349 SYMBOL, 350 VARREF, 351 GLOBALREF, 352 LOCALREF, 353 PROPREF, 354 VOID, 355 RECT 356 }; 357 358 enum VarType { 359 kVarGeneric, 360 kVarArgument, 361 kVarProperty, 362 kVarInstance, 363 kVarGlobal, 364 kVarLocal 365 }; 366 367 struct CastMemberID { 368 int member; 369 int castLib; 370 CastMemberIDCastMemberID371 CastMemberID() : member(0), castLib(0) {} CastMemberIDCastMemberID372 CastMemberID(int memberID, int castLibID) 373 : member(memberID), castLib(castLibID) {} 374 375 bool operator==(const CastMemberID &c) { 376 return member == c.member && castLib == c.castLib; 377 } 378 bool operator!=(const CastMemberID &c) { 379 return member != c.member || castLib != c.castLib; 380 } 381 382 Common::String asString() const; 383 }; 384 385 struct Datum; 386 struct PCell; 387 typedef Common::Array<Datum> DatumArray; 388 typedef Common::Array<PCell> PropertyArray; 389 390 const char *scriptType2str(ScriptType scr); 391 392 } // End of namespace Director 393 394 #endif 395