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[Graphics::PALETTE_COUNT];
68  byte _lookupTable1[Graphics::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::CustomEventType _action;
104  Common::Point _lookPos;
105  ScrollHighlight _scrollHighlight;
106  Common::SeekableReadStream *_mask, *_mask1;
107  Common::Point _maskOffset;
108  int _maskCounter;
109  int _lockoutTimer;
110  ImageFile *_interfaceImages;
111  WidgetCredits _creditsWidget;
112  WidgetOptions _optionsWidget;
113  WidgetText _textWidget;
114  WidgetSceneTooltip _tooltipWidget;
115  WidgetVerbs _verbsWidget;
116  WidgetList _postRenderWidgets;
117 public:
119  ~TattooUserInterface() override;
120 
124  void doBgAnimRestoreUI();
125 
129  void doScroll();
130 
134  void initScrollVars();
135 
139  void lookAtObject();
140 
146  void printObjectDesc(const Common::String &str, bool firstTime);
147 
151  void doJournal();
152 
156  void doInventory(int mode);
157 
161  void doControls();
162 
166  void doQuitMenu();
167 
171  void pickUpObject(int objNum);
172 
176  void putMessage(MSVC_PRINTF const char *formatStr, ...) GCC_PRINTF(2, 3);
177 
181  void setupBGArea(const byte cMap[Graphics::PALETTE_SIZE]);
182 
186  void doBgAnimEraseBackground();
187 
191  void drawMaskArea(bool mode);
192 
198  void maskArea(Common::SeekableReadStream &mask, const Common::Point &pt);
199 
203  void makeBGArea(const Common::Rect &r);
204 
208  void drawDialogRect(Surface &s, const Common::Rect &r, bool raised);
209 
214  void displayObjectNames();
215 
219  void loadGame();
220 
224  void saveGame();
225 
230  void addFixedWidget(WidgetBase *widget);
231 public:
235  void reset() override;
236 
240  void handleInput() override;
241 
245  void drawInterface(int bufferNum = 3) override;
246 
250  void clearWindow() override;
251 
257  void banishWindow(bool slideUp = true) override;
258 };
259 
260 } // End of namespace Tattoo
261 
262 } // End of namespace Sherlock
263 
264 #endif
Definition: tattoo_user_interface.h:52
Definition: surface.h:130
Definition: str.h:59
Definition: widget_verbs.h:36
Definition: animation.h:29
Definition: list.h:44
Definition: rect.h:524
Definition: widget_inventory.h:82
uint32 CustomEventType
Definition: events.h:204
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:206
Definition: rect.h:144
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