ScummVM API documentation
main_window.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_SPACEBAR_MAIN_WINDOW_H
24 #define BAGEL_SPACEBAR_MAIN_WINDOW_H
25 
26 #include "bagel/boflib/gfx/palette.h"
27 #include "bagel/baglib/pan_window.h"
28 #include "bagel/baglib/menu_dlg.h"
29 #include "bagel/spacebar/thud.h"
30 
31 namespace Bagel {
32 namespace SpaceBar {
33 
34 #define VRFILES ".\\*.bmp"
35 #define VRDIR ".\\"
36 #define BMPFILES ".\\BMP\\*.bmp"
37 #define BMPDIR ".\\BMP\\"
38 #define SPRITEFILES ".\\SPRITE\\*.bmp"
39 #define SPRITEDIR ".\\SPRITE\\"
40 #define SOUNDFILES ".\\SPRITE\\*.bmp"
41 #define SOUNDDIR ".\\SPRITE\\"
42 #define LINKFILES ".\\*.wld"
43 #define LINKDIR ".\\"
44 
45 //
46 //
47 // CMainWindow
48 //
49 class CMainWindow : public CBagPanWindow {
50 public:
51  static SBarThud *_pThudBmp; // Pointer to the THUD object
52 
53 private:
54  static int _nInstances; // Number of space bar windows
55  static bool _bZzazzlVision; // If Zzazzl vision is on/off
56 
57  CBagMenu *_pMenu;
58  CBofPalette *_pGamePalette;
59  static CBofRect *_xFilterRect;
60  CBofPoint _cLastPos;
61  CBofPoint _cLastLoc;
62 
63 public:
64  enum GameMode {
65  VRPLAYMODE, VRBUILDMODE, VRPANMODE
66  } _nGameMode;
67 
68  static bool chipdisp;
69  static int pause;
70 
71  static void initialize();
72  static void shutdown();
73 
74  CMainWindow();
75  virtual ~CMainWindow();
76 
77  ErrorCode attach() override;
78  ErrorCode detach() override;
79  static void setZzazzlVision(bool newValue);
80  static CBofRect &getFilterRect() {
81  return *_xFilterRect;
82  }
83  static CBofRect &setFilterRect(CBofRect &newValue) {
84  *_xFilterRect = newValue;
85  return *_xFilterRect;
86  }
87 
88  CBagMenu *getMenuPtr() {
89  return _pMenu;
90  }
91  CBofPalette *getPalPtr() {
92  return _pGamePalette;
93  }
94  void setPalPtr(CBofPalette *pal) {
95  _pGamePalette = pal;
96  }
97 
98  GameMode gameMode() {
99  return _nGameMode;
100  }
101  void setMode(GameMode mode) {
102  _nGameMode = mode;
103  }
104 
105  ErrorCode setloadFilePos(CBofPoint dstLoc) override;
106 
107  CBagObject *onNewLinkObject(const CBofString &sInit) override;
108 
109  void correctZzazzlePoint(CBofPoint *p);
110 
111  ErrorCode onCursorUpdate(int nCurrObj) override;
112 
113  void onClose() override;
114  void onSize(uint32 nType, int cx, int cy) override;
115  void onKeyHit(uint32 lKey, uint32 lRepCount) override;
116  void onLButtonUp(uint32 nFlags, CBofPoint *xPoint, void * = nullptr) override;
117  void onLButtonDown(uint32 nFlags, CBofPoint *xPoint, void * = nullptr) override;
118  void onMouseMove(uint32 nFlags, CBofPoint *p, void * = nullptr) override;
119 };
120 
121 } // namespace SpaceBar
122 } // namespace Bagel
123 
124 #endif
Definition: rect.h:36
Definition: object.h:85
Definition: pan_window.h:50
Definition: string.h:38
Definition: bagel.h:31
Definition: point.h:34
Definition: palette.h:69
Definition: menu_dlg.h:31
Definition: thud.h:31
Definition: main_window.h:49