ScummVM API documentation
screen.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 STARK_UI_SCREEN_H
23 #define STARK_UI_SCREEN_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 
28 #include "engines/stark/ui/window.h"
29 
30 namespace Stark {
31 
35 class Screen {
36 public:
37  enum Name {
38  kScreenMainMenu,
39  kScreenGame,
40  kScreenFMV,
41  kScreenDiaryIndex,
42  kScreenSettingsMenu,
43  kScreenSaveMenu,
44  kScreenLoadMenu,
45  kScreenFMVMenu,
46  kScreenDiaryPages,
47  kScreenDialog
48  };
49 
50  explicit Screen(Name name) : _name(name) {};
51  virtual ~Screen() {};
52 
54  Name getName() const { return _name; }
55 
57  virtual void open() {}
58 
60  virtual void close() {}
61 
63  virtual void render() = 0;
64 
66  virtual void handleGameLoop() {}
67 
69  virtual void onScreenChanged() {}
70 
71  virtual void handleMouseMove() = 0;
72  virtual void handleClick() = 0;
73  virtual void handleRightClick() = 0;
74  virtual void handleDoubleClick() = 0;
75 
76 private:
77  Name _name;
78 };
79 
80 class SingleWindowScreen : public Screen, public Window {
81 public:
82  SingleWindowScreen(Name name, Gfx::Driver *gfx, Cursor *cursor) :
83  Screen(name), Window(gfx, cursor) {}
84 
85  void handleGameLoop() override { Window::handleGameLoop(); }
86  void render() override { Window::render(); }
87 
88  void handleMouseMove() override { Window::handleMouseMove(); }
89  void handleClick() override { Window::handleClick(); }
90  void handleRightClick() override { Window::handleRightClick(); }
91  void handleDoubleClick() override { Window::handleDoubleClick(); }
92 };
93 
94 } // End of namespace Stark
95 
96  #endif // STARK_UI_SCREEN_H
virtual void open()
Definition: screen.h:57
Name getName() const
Definition: screen.h:54
virtual void close()
Definition: screen.h:60
void render() override
Definition: screen.h:86
void handleGameLoop()
void handleMouseMove()
Definition: window.h:54
void handleClick()
virtual void handleGameLoop()
Definition: screen.h:66
Definition: screen.h:80
Definition: driver.h:44
Definition: cursor.h:45
virtual void onScreenChanged()
Definition: screen.h:69
Definition: console.h:27
void handleRightClick()
void handleGameLoop() override
Definition: screen.h:85
virtual void render()=0
Definition: screen.h:35
void handleDoubleClick()