ScummVM API documentation
window.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_WINDOW_H
23 #define STARK_UI_WINDOW_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 
28 namespace Graphics {
29 struct Surface;
30 }
31 
32 namespace Stark {
33 
34 class Cursor;
35 
36 namespace Gfx {
37 class Driver;
38 }
39 
40 namespace Resources {
41  typedef Common::Array<uint32> ActionArray;
42 }
43 
54 class Window {
55 public:
56  Window(Gfx::Driver *gfx, Cursor *cursor);
57  virtual ~Window();
58 
60  void handleMouseMove();
61 
63  void handleClick();
64 
66  void handleRightClick();
67 
69  void handleDoubleClick();
70 
72  void handleGameLoop();
73 
75  void render();
76 
78  bool isMouseInside() const;
79 
81  bool isVisible() const;
82 
84  Graphics::Surface *getScreenshot() const;
85 
86 protected:
87  virtual void onMouseMove(const Common::Point &pos) {}
88  virtual void onClick(const Common::Point &pos) {}
89  virtual void onRightClick(const Common::Point &pos) {}
90  virtual void onDoubleClick(const Common::Point &pos) {}
91  virtual void onGameLoop() {};
92  virtual void onRender() = 0;
93 
94  Common::Point getRelativeMousePosition() const;
95 
96  Gfx::Driver *_gfx;
97  Cursor *_cursor;
98 
99  Common::Rect _position;
100  bool _visible;
101 };
102 
103 } // End of namespace Stark
104 
105  #endif // STARK_UI_WINDOW_H
Definition: surface.h:67
Definition: window.h:54
Definition: rect.h:144
Definition: driver.h:44
Definition: cursor.h:45
Definition: atari-cursor.h:38
Definition: console.h:27
Definition: formatinfo.h:28
Definition: rect.h:45