ScummVM API documentation
gamewidget.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 MUTATIONOFJB_GAMEWIDGET_H
23 #define MUTATIONOFJB_GAMEWIDGET_H
24 
25 #include "mutationofjb/widgets/widget.h"
26 
27 namespace MutationOfJB {
28 
29 class GameWidget;
30 struct Door;
31 struct Static;
32 
34 public:
35  virtual ~GameWidgetCallback() {}
36  virtual void onGameDoorClicked(GameWidget *, Door *door) = 0;
37  virtual void onGameStaticClicked(GameWidget *, Static *stat) = 0;
38  virtual void onGameEntityHovered(GameWidget *, const Common::String &entity) = 0;
39 };
40 
41 class GameWidget : public Widget {
42 public:
43  enum {
44  GAME_NORMAL_AREA_WIDTH = 320,
45  GAME_NORMAL_AREA_HEIGHT = 139,
46  GAME_FULL_AREA_WIDTH = 320,
47  GAME_FULL_AREA_HEIGHT = 200
48  };
49 
50  enum DirtyFlags {
51  DIRTY_AFTER_SCENE_CHANGE = 1 << 1,
52  DIRTY_MAP_SELECTION = 1 << 2
53  };
54 
55  GameWidget(GuiScreen &gui);
56  void setCallback(GameWidgetCallback *callback) {
57  _callback = callback;
58  }
59 
60  void handleEvent(const Common::Event &) override;
61 
62  void clearState();
63 protected:
64  void draw(Graphics::ManagedSurface &) override;
65 
66 private:
76  void handleNormalScene(const Common::Event &event);
77 
87  void handleMapScene(const Common::Event &event);
88 
89  uint8 _currentMapObjectId;
90  uint8 _nextMapObjectId;
91  GameWidgetCallback *_callback;
92 };
93 
94 }
95 
96 #endif
Definition: managed_surface.h:51
Definition: str.h:59
Definition: gamewidget.h:33
Definition: widget.h:40
Definition: gamedata.h:51
Definition: gamedata.h:213
Definition: animationdecoder.h:36
Definition: events.h:199
Definition: gamewidget.h:41
Definition: guiscreen.h:45