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/adv_r/adv_interface.h"
27 #include "m4/adv_r/adv_hotspot.h"
28 #include "m4/graphics/graphics.h"
29 #include "m4/graphics/gr_buff.h"
30 
31 namespace M4 {
32 namespace Riddle {
33 namespace GUI {
34 
35 enum ControlStatus {
36  NOTHING, IN_CONTROL, OVER_CONTROL, SELECTED, TRACKING
37 };
38 
39 struct Interface : public M4::Interface {
40 private:
41  void setup();
42 
43  void trackIcons();
44  ControlStatus trackHotspots(int event, int x, int y);
45  void dispatch_command();
46  void handleState(ControlStatus status);
47 
48 public:
49  int _sprite = 22; // main_interface_sprite;
50  bool _shown = false;
51  const HotSpotRec *_hotspot = nullptr;
52  int _savedX = 0, _savedY = 0;
53  char _prepText[40] = { 0 };
54  char _nounText[40] = { 0 };
55  char _verbText[40] = { 0 };
56  bool _iconSelected = false;
57  int _state = 0;
58 
59  Interface();
60  ~Interface() override;
61 
62  bool init(int arrow, int wait, int look, int grab, int use) override;
63 
64  void cancel_sentence() override;
65 
66  void freshen_sentence() override;
67 
68  bool set_interface_palette(RGB8 *myPalette) override;
69 
70  void track_hotspots_refresh() override;
71 
72  bool eventHandler(void *bufferPtr, int32 eventType, int32 event, int32 x, int32 y, bool *z) override;
73 
74  void show() override;
75 
76  void refresh_right_arrow();
77  void refresh_left_arrow();
78 
79  void l_cb();
80  void u_cb();
81  void t_cb();
82  void a_cb();
83 };
84 
85 } // namespace Interface
86 } // namespace Riddle
87 } // namespace M4
88 
89 #endif
Definition: adv_interface.h:30
Definition: system.h:46
Definition: m4_types.h:88
Definition: database.h:28
Definition: adv_hotspot.h:30
Definition: interface.h:39