ScummVM API documentation
menu.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 ZVISION_MENU_H
23 #define ZVISION_MENU_H
24 
25 #include "graphics/surface.h"
26 #include "common/rect.h"
27 
28 #include "zvision/zvision.h"
29 #include "zvision/scripting/script_manager.h"
30 
31 namespace ZVision {
32 
33 enum menuBar {
34  kMenubarExit = 0x1,
35  kMenubarSettings = 0x2,
36  kMenubarRestore = 0x4,
37  kMenubarSave = 0x8,
38  kMenubarItems = 0x100,
39  kMenubarMagic = 0x200
40 };
41 
42 class MenuHandler {
43 public:
44  MenuHandler(ZVision *engine);
45  virtual ~MenuHandler() {};
46  virtual void onMouseMove(const Common::Point &Pos) {};
47  virtual void onMouseDown(const Common::Point &Pos) {};
48  virtual void onMouseUp(const Common::Point &Pos) {};
49  virtual void process(uint32 deltaTimeInMillis) {};
50 
51  void setEnable(uint16 flags) {
52  menuBarFlag = flags;
53  }
54  uint16 getEnable() {
55  return menuBarFlag;
56  }
57 protected:
58  uint16 menuBarFlag;
59  ZVision *_engine;
60 };
61 
62 class MenuZGI: public MenuHandler {
63 public:
64  MenuZGI(ZVision *engine);
65  ~MenuZGI() override;
66  void onMouseMove(const Common::Point &Pos) override;
67  void onMouseUp(const Common::Point &Pos) override;
68  void process(uint32 deltaTimeInMillis) override;
69 private:
70  Graphics::Surface menuBack[3][2];
71  Graphics::Surface menuBar[4][2];
72  Graphics::Surface *items[50][2];
73  uint itemId[50];
74 
75  Graphics::Surface *magic[12][2];
76  uint magicId[12];
77 
78  int menuMouseFocus;
79  bool inMenu;
80 
81  int mouseOnItem;
82 
83  bool scrolled[3];
84  int16 scrollPos[3];
85 
86  bool clean;
87  bool redraw;
88 
89 };
90 
91 class MenuNemesis: public MenuHandler {
92 public:
93  MenuNemesis(ZVision *engine);
94  ~MenuNemesis() override;
95  void onMouseMove(const Common::Point &Pos) override;
96  void onMouseUp(const Common::Point &Pos) override;
97  void process(uint32 deltaTimeInMillis) override;
98 private:
99  Graphics::Surface but[4][6];
100  Graphics::Surface menuBar;
101 
102  bool inMenu;
103 
104  int mouseOnItem;
105 
106  bool scrolled;
107  int16 scrollPos;
108 
109  bool redraw;
110 
111  int frm;
112  int16 delay;
113 
114 };
115 
116 } // End of namespace ZVision
117 
118 #endif
Definition: surface.h:66
Definition: menu.h:42
Definition: clock.h:29
Definition: menu.h:91
Definition: rect.h:45
Definition: menu.h:62