ScummVM API documentation
tattoo_user_interface.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SHERLOCK_TATTOO_UI_H
23 #define SHERLOCK_TATTOO_UI_H
24 
25 #include "common/scummsys.h"
26 #include "common/list.h"
27 #include "sherlock/saveload.h"
28 #include "sherlock/screen.h"
29 #include "sherlock/user_interface.h"
30 #include "sherlock/tattoo/widget_credits.h"
31 #include "sherlock/tattoo/widget_files.h"
32 #include "sherlock/tattoo/widget_inventory.h"
33 #include "sherlock/tattoo/widget_options.h"
34 #include "sherlock/tattoo/widget_quit.h"
35 #include "sherlock/tattoo/widget_text.h"
36 #include "sherlock/tattoo/widget_tooltip.h"
37 #include "sherlock/tattoo/widget_verbs.h"
38 
39 namespace Sherlock {
40 
41 namespace Tattoo {
42 
43 // Button width/height
44 #define BUTTON_SIZE 15
45 // How long to play the intro before it can be skipped
46 #define STARTUP_KEYS_DISABLED_DELAY 200
47 
48 class WidgetBase;
49 
50 enum ScrollHighlight { SH_NONE = 0, SH_SCROLL_UP = 1, SH_PAGE_UP = 2, SH_THUMBNAIL = 3, SH_PAGE_DOWN = 4, SH_SCROLL_DOWN = 5 };
51 
52 class WidgetList : public Common::List <WidgetBase *> {
53 public:
54  bool contains(const WidgetBase *item) const;
55 };
56 
58  friend class WidgetBase;
59 private:
60  int _scriptZone;
61  int _cAnimFramePause;
62  WidgetInventory _inventoryWidget;
63  WidgetMessage _messageWidget;
64  WidgetQuit _quitWidget;
65  WidgetList _fixedWidgets;
66  WidgetList _widgets;
67  byte _lookupTable[PALETTE_COUNT];
68  byte _lookupTable1[PALETTE_COUNT];
69 private:
73  void doStandardControl();
74 
78  void doLookControl();
79 
83  void doFileControl();
84 
88  void doVerbControl();
89 
93  void freeMenu();
94 public:
95  Common::Point _targetScroll;
96  int _scrollSize, _scrollSpeed;
97  bool _drawMenu;
98  int _arrowZone, _oldArrowZone;
99  Object *_bgShape;
100  bool _personFound;
101  int _activeObj;
102  Common::KeyState _keyState;
103  Common::Point _lookPos;
104  ScrollHighlight _scrollHighlight;
105  Common::SeekableReadStream *_mask, *_mask1;
106  Common::Point _maskOffset;
107  int _maskCounter;
108  int _lockoutTimer;
109  ImageFile *_interfaceImages;
110  WidgetCredits _creditsWidget;
111  WidgetOptions _optionsWidget;
112  WidgetText _textWidget;
113  WidgetSceneTooltip _tooltipWidget;
114  WidgetVerbs _verbsWidget;
115  WidgetList _postRenderWidgets;
116 public:
118  ~TattooUserInterface() override;
119 
123  void doBgAnimRestoreUI();
124 
128  void doScroll();
129 
133  void initScrollVars();
134 
138  void lookAtObject();
139 
145  void printObjectDesc(const Common::String &str, bool firstTime);
146 
150  void doJournal();
151 
155  void doInventory(int mode);
156 
160  void doControls();
161 
165  void doQuitMenu();
166 
170  void pickUpObject(int objNum);
171 
175  void putMessage(MSVC_PRINTF const char *formatStr, ...) GCC_PRINTF(2, 3);
176 
180  void setupBGArea(const byte cMap[PALETTE_SIZE]);
181 
185  void doBgAnimEraseBackground();
186 
190  void drawMaskArea(bool mode);
191 
197  void maskArea(Common::SeekableReadStream &mask, const Common::Point &pt);
198 
202  void makeBGArea(const Common::Rect &r);
203 
207  void drawDialogRect(Surface &s, const Common::Rect &r, bool raised);
208 
213  void displayObjectNames();
214 
218  void loadGame();
219 
223  void saveGame();
224 
229  void addFixedWidget(WidgetBase *widget);
230 public:
234  void reset() override;
235 
239  void handleInput() override;
240 
244  void drawInterface(int bufferNum = 3) override;
245 
249  void clearWindow() override;
250 
256  void banishWindow(bool slideUp = true) override;
257 };
258 
259 } // End of namespace Tattoo
260 
261 } // End of namespace Sherlock
262 
263 #endif
Definition: tattoo_user_interface.h:52
Definition: surface.h:118
Definition: str.h:59
Definition: widget_verbs.h:36
Definition: animation.h:29
Definition: list.h:44
Definition: rect.h:144
Definition: widget_inventory.h:82
Definition: stream.h:745
Definition: widget_credits.h:45
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: widget_text.h:57
Definition: sherlock.h:76
Definition: rect.h:45
Definition: objects.h:363
Definition: widget_quit.h:34
Definition: tattoo_user_interface.h:57
Definition: widget_options.h:39
Definition: widget_text.h:34
Definition: keyboard.h:294
Definition: image_file.h:78
Definition: widget_tooltip.h:69
Definition: user_interface.h:62
Definition: widget_base.h:37