ScummVM API documentation
interface.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 M4_RIDDLE_INTERFACE_H
24 #define M4_RIDDLE_INTERFACE_H
25 
26 #include "m4/riddle/gui/inventory.h"
27 #include "m4/adv_r/adv_interface.h"
28 #include "m4/adv_r/adv_hotspot.h"
29 #include "m4/graphics/graphics.h"
30 #include "m4/graphics/gr_buff.h"
31 
32 namespace M4 {
33 namespace Riddle {
34 namespace GUI {
35 
36 using M4::GUI::ControlStatus;
37 
38 struct Interface : public M4::Interface {
39  class BackpackClass : public ButtonClass {
40 
41  public:
42  BackpackClass(const RectClass &r, const Common::String &btnName, int16 tag,
43  int16 relaxed, int16 over, int16 picked, int sprite) :
44  ButtonClass(r, btnName, tag, relaxed, over, picked, sprite) {}
45  ~BackpackClass() override {}
46  };
47 
48 private:
49  void setup();
50 
51  void trackIcons();
52  ControlStatus trackHotspots(int event, int x, int y);
53  void dispatch_command();
54  void handleState(ControlStatus status);
55 
56 public:
57  GUI::InterfaceBox *_interfaceBox = nullptr;
58  GUI::Inventory *_inventory = nullptr;
59  GUI::TextField *_textField = nullptr;
60  GUI::ButtonClass *_btnTake = nullptr;
61  GUI::ButtonClass *_btnManipulate = nullptr;
62  GUI::ButtonClass *_btnHandle = nullptr;
63  BackpackClass *_btnBackpack = nullptr;
64  GUI::ButtonClass *_btnBinky = nullptr;
65 
66  int _sprite = 22; // main_interface_sprite;
67  const HotSpotRec *_hotspot = nullptr;
68  int _savedX = 0, _savedY = 0;
69  char _prepText[40] = { 0 };
70  char _nounText[40] = { 0 };
71  char _verbText[40] = { 0 };
72  bool _iconSelected = false;
73  int _state = 0;
74 
75  Interface();
76  ~Interface() override;
77 
78  bool init(int arrow, int wait, int look, int grab, int use) override;
79 
80  void cancel_sentence() override;
81 
82  void freshen_sentence() override;
83 
84  bool set_interface_palette(RGB8 *myPalette) override;
85 
86  void track_hotspots_refresh() override;
87 
88  bool eventHandler(void *bufferPtr, int32 eventType, int32 event, int32 x, int32 y, bool *z) override;
89 
90  void show() override;
91 
92  void l_cb();
93  void u_cb();
94  void t_cb();
95  void a_cb();
96 };
97 
98 } // namespace Interface
99 } // namespace Riddle
100 } // namespace M4
101 
102 #endif
Definition: str.h:59
Definition: gui_cheapo.h:63
Definition: gui_cheapo.h:47
Definition: adv_interface.h:32
Definition: gui_cheapo.h:136
Definition: system.h:46
Definition: inventory.h:50
Definition: m4_types.h:88
Definition: database.h:28
Definition: adv_hotspot.h:30
Definition: gui_cheapo.h:78
Definition: interface.h:38