ScummVM API documentation
base_pda.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_BAGLIB_BASE_PDA_H
24 #define BAGEL_BAGLIB_BASE_PDA_H
25 
26 #include "bagel/spacebar/baglib/storage_dev_bmp.h"
27 
28 namespace Bagel {
29 namespace SpaceBar {
30 
31 #define PDA_MAP (100)
32 #define PDA_STASH (101)
33 #define PDA_ZOOM (102)
34 #define PDA_SYSTEM (103)
35 #define PDA_LOG (104)
36 #define PDA_OFF (105)
37 #define PDA_MSGLIGHT (110)
38 #define PDA_ZOOMFLASH "ZOOMFLASH"
39 
40 enum PdaMode {
41  PDA_NO_MODE,
42  PDA_MAP_MODE,
43  PDA_INV_MODE,
44  PDA_LOG_MODE,
45  PDA_MOO_MODE
46 };
47 enum PdaPos {
48  PDA_POS_UNINITIALIZED,
49  PDA_UP,
50  PDA_DOWN
51 };
52 
53 class SBBasePda {
54 protected:
55  // All PDA's in the game should share the same mode
56  static PdaMode _pdaMode;
57  static PdaPos _pdaPos;
58  int _numMoves;
59  int _activating;
60  bool _activated;
61  int _moveDist;
62  CBagStorageDevBmp *_mooWnd; // Pointer to the PDAMOVIE object
63  CBagStorageDevBmp *_invWnd; // Pointer to the inventory object
64  CBagStorageDevBmp *_mapWnd; // Pointer to the Map object
65  CBagStorageDevBmp *_logWnd; // Pointer to the Map object
66  CBagStorageDevBmp *_curDisplay; // Pointer to the object currently displayed in PDA
67  CBofWindow *_parent;
68  bool _zoomedFl;
69  bool _deactivateFl; // should we deactivate when done w/movie?
70 
71  // hold this info for restore method
72  CBagStorageDevBmp *_holdDisplay;
73  static PdaMode _holdMode;
74 
75 public:
76  SBBasePda(CBofWindow *parent = nullptr, const CBofRect &rect = CBofRect(), bool activated = false);
77  virtual ~SBBasePda();
78  static void initialize();
79 
83  static void setPdaMode(PdaMode pdaMode) {
84  _pdaMode = pdaMode;
85  }
86  static PdaMode getPdaMode() {
87  return _pdaMode;
88  }
89  bool isActivated() const {
90  return _activating ? !_activated : _activated;
91  }
92  bool isActivating() const {
93  return _activating;
94  }
95 
96  virtual ErrorCode attachActiveObjects();
97  virtual ErrorCode detachActiveObjects();
98 
102  void synchronizePdaState();
103 
104  void activate();
105  void deactivate();
106 
110  virtual bool showInventory();
111 
115  virtual bool hideInventory();
116 
120  virtual bool showMovie();
121 
125  virtual bool hideMovie();
126 
132  bool setMovie(CBofString &movieName) const;
133 
137  void stopMovie(bool bResetPDA) const;
138 
139  void setDeactivate(bool b) {
140  _deactivateFl = b;
141  }
142 
143  bool getDeactivate() const {
144  return _deactivateFl;
145  }
146 
150  virtual bool showMap();
151 
155  virtual bool hideMap();
156 
160  virtual bool zoom() {
161  return true;
162  }
163 
164  virtual bool showLog();
165 
166  virtual bool msgLight();
167 
172  virtual bool hideCurDisplay();
173 
178  virtual bool restoreCurDisplay();
179 
180  static void *pdaButtonHandler(int refId, void *info);
181 
182  void setPdaState();
183  void getPdaState();
184 
185  void setZoomed(bool newVal) {
186  _zoomedFl = newVal;
187  }
188  bool getZoomed() const {
189  return _zoomedFl;
190  }
191 
192  int getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) const;
193 
197  CBofRect getViewRect() const;
198 };
199 
200 } // namespace SpaceBar
201 } // namespace Bagel
202 
203 #endif
Definition: base_pda.h:53
virtual bool zoom()
Definition: base_pda.h:160
bool setMovie(CBofString &movieName) const
virtual bool restoreCurDisplay()
Definition: window.h:53
virtual bool hideCurDisplay()
Definition: rect.h:35
CBofRect getViewRect() const
virtual bool showInventory()
static void setPdaMode(PdaMode pdaMode)
Definition: base_pda.h:83
void stopMovie(bool bResetPDA) const
virtual bool hideInventory()
Definition: string.h:38
Definition: afxwin.h:27
Definition: point.h:32
Definition: storage_dev_bmp.h:32