ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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  private:
41  //int _field32 = 0;
42 
43  public:
44  BackpackClass(const RectClass &r, const Common::String &btnName, int16 tag,
45  int16 relaxed, int16 over, int16 picked, int sprite) :
46  ButtonClass(r, btnName, tag, relaxed, over, picked, sprite) {}
47  ~BackpackClass() override {}
48  };
49 
50 private:
51  void setup();
52 
53  void trackIcons();
54  ControlStatus trackHotspots(int event, int x, int y);
55  void dispatch_command();
56  void handleState(ControlStatus status);
57 
58 public:
59  GUI::InterfaceBox *_interfaceBox = nullptr;
60  GUI::Inventory *_inventory = nullptr;
61  GUI::TextField *_textField = nullptr;
62  GUI::ButtonClass *_btnTake = nullptr;
63  GUI::ButtonClass *_btnManipulate = nullptr;
64  GUI::ButtonClass *_btnHandle = nullptr;
65  BackpackClass *_btnBackpack = nullptr;
66  GUI::ButtonClass *_btnBinky = nullptr;
67 
68  int _sprite = 22; // main_interface_sprite;
69  bool _shown = false;
70  const HotSpotRec *_hotspot = nullptr;
71  int _savedX = 0, _savedY = 0;
72  char _prepText[40] = { 0 };
73  char _nounText[40] = { 0 };
74  char _verbText[40] = { 0 };
75  bool _iconSelected = false;
76  int _state = 0;
77 
78  Interface();
79  ~Interface() override;
80 
81  bool init(int arrow, int wait, int look, int grab, int use) override;
82 
83  void cancel_sentence() override;
84 
85  void freshen_sentence() override;
86 
87  bool set_interface_palette(RGB8 *myPalette) override;
88 
89  void track_hotspots_refresh() override;
90 
91  bool eventHandler(void *bufferPtr, int32 eventType, int32 event, int32 x, int32 y, bool *z) override;
92 
93  void show() override;
94 
95  void l_cb();
96  void u_cb();
97  void t_cb();
98  void a_cb();
99 };
100 
101 } // namespace Interface
102 } // namespace Riddle
103 } // namespace M4
104 
105 #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