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 * aint32 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 * Based on the original sources 23 * Faery Tale II -- The Halls of the Dead 24 * (c) 1993-1996 The Wyrmkeep Entertainment Co. 25 */ 26 27 #ifndef SAGA2_MSGBOX_H 28 #define SAGA2_MSGBOX_H 29 30 #include "saga2/grequest.h" 31 32 namespace Saga2 { 33 34 struct textPallete; 35 36 void ModalModeSetup(void); 37 void ModalModeCleanup(void); 38 void ModalModeHandleTask(void); 39 void ModalModeHandleKey(short, short); 40 41 //Modal Mode GameMode Object 42 43 extern GameMode ModalMode; 44 45 /* ===================================================================== * 46 ModalWindow -- 47 * ===================================================================== */ 48 49 class SimpleWindow : public gWindow { 50 51 GameMode *prevModeStackPtr[Max_Modes]; 52 int prevModeStackCtr; 53 54 public: 55 56 SimpleWindow(const Rect16 &r, 57 uint16 ident, 58 const char *title, 59 AppFunc *cmd); 60 ~SimpleWindow(); 61 62 bool isModal(void); 63 void update(const Rect16 &); 64 void draw(void); // redraw the panel. 65 void drawClipped(gPort &port, const Point16 &offset, const Rect16 &r); 66 static void DrawOutlineFrame(gPort &port, const Rect16 &r, int16 fillColor); 67 static void writeWrappedPlaqText(gPort &port, 68 const Rect16 &r, 69 gFont *font, 70 int16 textPos, 71 textPallete &pal, 72 bool hiLite, 73 const char *msg, ...); 74 75 }; 76 77 class SimpleButton : public gControl { 78 gWindow *window; 79 public: 80 SimpleButton(gWindow &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL); 81 82 void draw(void); // redraw the panel. 83 void drawClipped(gPort &port, const Point16 &offset, const Rect16 &r); 84 85 private: 86 bool activate(gEventType why); // activate the control 87 void deactivate(void); 88 bool pointerHit(gPanelMessage &msg); 89 void pointerDrag(gPanelMessage &msg); 90 void pointerRelease(gPanelMessage &msg); 91 }; 92 93 class ErrorWindow : public SimpleWindow { 94 static char mbChs1Text[8]; 95 static char mbChs2Text[8]; 96 static uint8 numBtns; 97 public: 98 99 static requestInfo rInfo; 100 ErrorWindow(const char *msg, const char *btnMsg1, const char *btnMsg2); 101 ~ErrorWindow(); 102 int16 getResult(void); 103 static APPFUNC(cmdMessageWindow); ErrorModeSetup(void)104 static void ErrorModeSetup(void) {} ErrorModeCleanup(void)105 static void ErrorModeCleanup(void) {} ErrorModeHandleTask(void)106 static void ErrorModeHandleTask(void) {} 107 static void ErrorModeHandleKey(short key, short); 108 109 }; 110 111 int16 FTAMessageBox(const char *msg, const char *btnMsg1, const char *btnMsg2); 112 113 } // end of namespace Saga2 114 115 #endif 116