Source/Gorgon/Window.h

Tue, 06 Jul 2021 10:22:49 +0300

author
cemkalyoncu
date
Tue, 06 Jul 2021 10:22:49 +0300
branch
4.x-dev
changeset 1701
b168349a931d
parent 1679
ba8492d69168
child 1757
af3a7aed9dfe
permissions
-rw-r--r--

* Image/Bitmap rotate

767
9e50a17da19f * Fixed messed up files
cemkalyoncu
parents: 764
diff changeset
1 /// @file Window.h contains Window class. The functions of the Window class is defined in respective window manager
9e50a17da19f * Fixed messed up files
cemkalyoncu
parents: 764
diff changeset
2 /// source code file (e.g WindowManager/X11.cpp)
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
3
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
4 #pragma once
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
5
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
6 #include "Geometry/Point.h"
903
0b31f678d757 * Input::Event is replaced by ConsumableEvent
cemkalyoncu
parents: 899
diff changeset
7 #include "ConsumableEvent.h"
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
8 #include "Geometry/Rectangle.h"
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
9 #include "Containers/Collection.h"
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
10 #include "WindowManager.h"
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
11 #include "Event.h"
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
12 #include "Layer.h"
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
13 #include "Input.h"
910
38c9cc8ac94f * Groundwork for mouse input event
cemkalyoncu
parents: 903
diff changeset
14 #include "Input/Keyboard.h"
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
15 #include "Graphics/Pointer.h"
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
16
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
17 namespace Gorgon {
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
18 /// @cond INTERNAL
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
19 namespace internal {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
20 struct windowdata;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
21 }
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
22 /// @endcond
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
23
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
24 namespace Graphics {
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
25 class Layer;
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
26 }
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
27
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
28
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
29 /// This class represents a window.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
30 /// @nosubgrouping
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
31 class Window : public Layer {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
32 friend internal::windowdata *WindowManager::internal::getdata(const Window&);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
33 friend struct internal::windowdata;
914
0858abee0f02 * Better mouse handler registration (incomplete)
cemkalyoncu
parents: 910
diff changeset
34 friend class Layer;
1345
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
35 friend class windaccess;
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
36 public:
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
37 /// Fullscreen tag
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
38 static const struct FullscreenTag {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
39
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
40 }Fullscreen;
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
41
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
42 /// Empty constructor creates a non-initialized window. This constructor is there
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
43 /// support move semantics. Any action on non-initialized window may result in a
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
44 /// crash.
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
45 Window() {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
46 }
963
218c6ee2a4bc * Font test is now separated from window test
cemkalyoncu
parents: 959
diff changeset
47
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
48 /// Creates a new window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
49 /// @param rect the position and the **interior** size of the window unless
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
50 /// use outer metrics is set to true
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
51 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
52 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
53 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
54 Window(Geometry::Rectangle rect, const std::string &name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
55 Window(WindowManager::Monitor::Primary(), rect, name, name, allowresize, visible) {}
963
218c6ee2a4bc * Font test is now separated from window test
cemkalyoncu
parents: 959
diff changeset
56
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
57 /// Creates a new window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
58 /// @param rect the position and the **interior** size of the window unless
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
59 /// use outer metrics is set to true
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
60 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
61 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
62 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
63 Window(Geometry::Rectangle rect, const char *name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
64 Window(WindowManager::Monitor::Primary(), rect, name, name, allowresize, visible) {}
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
65
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
66 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
67 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
68 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
69 /// @param title of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
70 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
71 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
72 Window(const Geometry::Size &size, const std::string &name, const std::string &title, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
73 Window(WindowManager::Monitor::Primary(), {automaticplacement, size}, name, title, allowresize, visible) { }
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
74
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
75 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
76 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
77 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
78 /// @param title of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
79 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
80 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
81 Window(const Geometry::Size &size, const char *name, const char *title, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
82 Window(WindowManager::Monitor::Primary(), {automaticplacement, size}, name, title, allowresize, visible) { }
963
218c6ee2a4bc * Font test is now separated from window test
cemkalyoncu
parents: 959
diff changeset
83
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
84 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
85 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
86 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
87 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
88 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
89 Window(const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
90 Window(WindowManager::Monitor::Primary(), {automaticplacement, size}, name, name, allowresize, visible) { }
950
057e2f64a9e4 * Windows can now be centered or made fullscreen on another monitor (X11)
cemkalyoncu
parents: 930
diff changeset
91
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
92 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
93 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
94 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
95 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
96 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
97 Window(const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
98 Window(WindowManager::Monitor::Primary(), {automaticplacement, size}, name, name, allowresize, visible) { }
963
218c6ee2a4bc * Font test is now separated from window test
cemkalyoncu
parents: 959
diff changeset
99
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
100 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
101 /// @param monitor that the window will be centered on
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
102 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
103 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
104 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
105 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
106 Window(const WindowManager::Monitor &monitor, const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
107 Window(monitor, {automaticplacement, size}, name, name, allowresize, visible) { }
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
108
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
109 /// Creates a new window at the center of the screen
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
110 /// @param monitor that the window will be centered on
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
111 /// @param size of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
112 /// @param name of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
113 /// @param visible after creation, window will be visible or invisible depending
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
114 /// on this value.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
115 Window(const WindowManager::Monitor &monitor, const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true) :
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
116 Window(monitor, {automaticplacement, size}, name, name, allowresize, visible) { }
963
218c6ee2a4bc * Font test is now separated from window test
cemkalyoncu
parents: 959
diff changeset
117
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
118 /// Creates a fullscreen window. Fullscreen windows do not have chrome and covers
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
119 /// entire screen, including any panels it contains.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
120 Window(const FullscreenTag &, const WindowManager::Monitor &monitor, const std::string &name, const std::string &title="");
950
057e2f64a9e4 * Windows can now be centered or made fullscreen on another monitor (X11)
cemkalyoncu
parents: 930
diff changeset
121
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
122 /// Creates a fullscreen window. Fullscreen windows do not have chrome and covers
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
123 /// entire screen, including any panels it contains.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
124 Window(const FullscreenTag &tag, const std::string &name, const std::string &title="") :
950
057e2f64a9e4 * Windows can now be centered or made fullscreen on another monitor (X11)
cemkalyoncu
parents: 930
diff changeset
125 Window(tag, WindowManager::Monitor::Primary(), name, title) { }
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
126
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
127 /// Copy constructor is not allowed
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
128 Window(const Window &) = delete;
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
129
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
130 /// Move constructor
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
131 Window(Window &&other) {
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
132 Swap(other);
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
133
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
134 other.Destroy();
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
135 }
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
136
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
137 /// Destroys this window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
138 virtual ~Window() { Destroy(); }
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
139
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
140 /// Destroys this window
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
141 virtual void Destroy();
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
142
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
143 /// Moves another window into this one
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
144 Window &operator =(Window &&other) {
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
145 Swap(other);
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
146
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
147 other.Destroy();
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
148
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
149 return *this;
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
150 }
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
151
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
152 /// Used for move semantics
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
153 void Swap(Window &other);
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
154
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
155 /// This method is automatically called by the system.Unless its necessary, do not use it.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
156 ///
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
157 /// @warning Notice that it is a
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
158 /// window manager defined behavior to handle tasks in Window classes differently
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
159 /// or for all of them at the same time. Therefore, OS::processmessage
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
160 /// should be used.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
161 void processmessages();
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
162
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
163 /// Activates the GL context of the window. This function is used internally and should
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
164 /// not be called unless necessary.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
165 void activatecontext();
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
166
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
167 /// Moves the window to the given position
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
168 virtual void Move(const Geometry::Point &position) override;
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
169
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
170 /// Moves the window to the given position
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
171 virtual void Move(int x, int y) override {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
172 Move({x, y});
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
173 }
1121
acf7f7054107 * Unit test for layer system, completion: 60%
cemkalyoncu
parents: 1095
diff changeset
174
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
175 /// Resizes the window to the given size. The given size is considered as the
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
176 /// interior region of the window. The restrictions for the smallest
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
177 /// sized window might change depending on the window manager or theme.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
178 /// Largest window size can be obtained using UsableScreenRegion however,
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
179 /// this size does not exclude window chrome. This function resizes all window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
180 /// sized layers.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
181 virtual void Resize(const Geometry::Size &size) override;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
182
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
183 using Layer::Resize;
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
184
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
185 /// Returns the exterior bounding box of the window. May throw or return invalid
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
186 /// values if the window is not visible
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
187 Geometry::Bounds GetExteriorBounds() const;
1121
acf7f7054107 * Unit test for layer system, completion: 60%
cemkalyoncu
parents: 1095
diff changeset
188
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
189 /// Returns the current position of the window. This value is measured from the
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
190 /// (0,0) of the virtual screen to the top-left of the window chrome.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
191 Geometry::Point GetPosition() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
192 return GetExteriorBounds().TopLeft();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
193 }
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
194
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
195 /// Minimizes the window. Use Restore function to return it to its previous
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
196 /// state.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
197 void Minimize();
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
198
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
199 /// Returns if the window is minimized
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
200 bool IsMinimized() const;
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
201
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
202 /// Maximizes the window to cover the usable area of the screen. Use Restore function
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
203 /// to return the window to its previous size and position. Maximize might take time.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
204 void Maximize();
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
205
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
206 /// Returns if the window is maximized
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
207 bool IsMaximized() const;
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
208
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
209 /// Restores a minimized or maximized window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
210 void Restore();
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
211
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
212 /// Returns the monitor that the window is currently on. May throw if the window is
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
213 /// not visible, will throw if the window is not on any currently known monitors.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
214 /// If this case occurs consider refreshing monitor list.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
215 const WindowManager::Monitor &GetMonitor() const;
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
216
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
217 /// Displays this window, may generate Activated event
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
218 virtual void Show() override;
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
219
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
220 /// Hides this window, may generate Deactivated event
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
221 virtual void Hide() override;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
222
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
223 /// Returns whether this layer is effectively visible
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
224 virtual bool IsVisible() const override { return isvisible; }
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
225
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
226 /// Focuses this window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
227 void Focus();
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
228
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
229 /// Returns if this window has the focus
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
230 bool IsFocused() const;
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
231
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
232 /// Closes the window. After this function, any use of this object might fail.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
233 void Close();
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
234
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
235 /// Changes the title of the window to the specified string
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
236 void SetTitle(const std::string &title);
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
237
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
238 /// Returns the current title of the window.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
239 std::string GetTitle() const;
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
240
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
241 /// Returns the name of the window that is set at creation time
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
242 std::string GetName() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
243 return name;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
244 }
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
245
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
246 /// Whether the window is currently closed and cannot be acted on.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
247 bool IsClosed() const;
952
a4d382883aa0 * All window functions except for icon related are completed for DWM
cemkalyoncu
parents: 951
diff changeset
248
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
249 /// Displays the pointer. If local pointers are activated, this function
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
250 /// will show local pointer, otherwise it will show window manager pointer
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
251 void ShowPointer();
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
252
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
253 /// Hides the pointer. If local pointers are activated, this function
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
254 /// will hide local pointer, otherwise it will hide window manager pointer.
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
255 /// In both cases, after calling to this function, there will be no visible
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
256 /// pointer on the screen.
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
257 void HidePointer();
1020
137f6c03dcbf * Multistep drag start
cemkalyoncu
parents: 1011
diff changeset
258
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
259 /// Returns whether the pointer is visible
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
260 bool IsPointerVisible() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
261 return showptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
262 }
1020
137f6c03dcbf * Multistep drag start
cemkalyoncu
parents: 1011
diff changeset
263
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
264 /// Removes the operating system pointer and starts using Locally defined pointers.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
265 /// If there are no pointers added to the Pointers object, this function will throw.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
266 /// After switching, ShowPointer and HidePointer will show and hide local pointers
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
267 /// not OS pointers. Calling this function will show the local pointer.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
268 void SwitchToLocalPointers();
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents: 1249
diff changeset
269
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
270 /// Stops showing local pointers and makes window manager pointer visible.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
271 void SwitchToWMPointers();
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents: 1249
diff changeset
272
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
273 /// Returns whether the current pointer is a local pointer
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
274 bool IsLocalPointer() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
275 return !iswmpointer;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
276 }
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents: 1249
diff changeset
277
954
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
278 /// Centers the window to the default monitor
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
279 void Center() {
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
280 Center(WindowManager::Monitor::Primary());
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
281 }
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
282
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
283 /// Centers the window to the given monitor
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
284 void Center(const WindowManager::Monitor &monitor) {
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
285 Move((monitor.GetUsable()-GetExteriorBounds().GetSize()).Center());
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
286 }
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
287
956
3ce6d6224374 * SetIcon for X11, Window class is finilized
cemkalyoncu
parents: 955
diff changeset
288 /// Changes the icon of the window.
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
289 void SetIcon(const WindowManager::Icon &icon);
955
9ad5d86ceff3 * Create icon from image (only DWM) and setting window icon
cemkalyoncu
parents: 954
diff changeset
290
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
291 /// Renders the contents of the window
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
292 virtual void Render() override;
916
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
293
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
294 /// Returns the mouse location on the window. If the cursor is outside the window and
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
295 /// its position cannot be determined (-1, -1) is returned. This function can return
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
296 /// coordinates outside the bounds of the window.
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
297 Geometry::Point GetMouseLocation() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
298 return mouselocation;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
299 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
300
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
301 /// Returns currently pressed buttons.
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
302 Input::Mouse::Button PressedButtons() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
303 return pressed;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
304 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
305
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
306 /// Query whether the left mouse button is pressed
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
307 bool IsLeftButtonPressed() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
308 return pressed&&Input::Mouse::Button::Left;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
309 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
310
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
311 /// Query whether the right mouse button is pressed
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
312 bool IsRightButtonPressed() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
313 return pressed&&Input::Mouse::Button::Right;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
314 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
315
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
316 /// Query whether the middle mouse button is pressed
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
317 bool IsMiddleButtonPressed() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
318 return pressed&&Input::Mouse::Button::Middle;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
319 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
320
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
321 /// Query whether the X1 mouse button is pressed
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
322 bool IsX1ButtonPressed() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
323 return pressed&&Input::Mouse::Button::X1;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
324 }
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
325
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
326 /// Query whether the X2 mouse button is pressed
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
327 bool IsX2ButtonPressed() const {
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
328 return pressed&&Input::Mouse::Button::X2;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
329 }
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
330
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
331 /// Sets the background of the window. This background image
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
332 /// will be scaled with the window automatically.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
333 void SetBackground(const Graphics::Bitmap &bg);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
334
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
335 /// Sets the background of the window. This background image
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
336 /// will be scaled with the window automatically.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
337 void SetBackground(const Graphics::RectangularAnimationProvider &bg);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
338
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
339 /// Sets the background of the window. This background image
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
340 /// will be scaled with the window automatically.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
341 void SetBackground(const Graphics::RectangularAnimation &bg);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
342
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
343 /// Sets the background of the window. This background image
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
344 /// will be scaled with the window automatically.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
345 void OwnBackground(const Graphics::RectangularAnimation &bg);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
346
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
347 /// Removes the background of the window.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
348 void RemoveBackground();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
349
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
350 /// Returns if the window has a background image
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
351 bool HasBackground() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
352 return bganim != nullptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
353 }
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
354
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
355 /// Returns the background image of the window. If window has no
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
356 /// background image, this function throws.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
357 const Graphics::RectangularAnimation &GetBackground() const {
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
358 if(!bganim)
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
359 throw std::runtime_error("Window has no background image.");
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
360
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
361 return *bganim;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
362 }
954
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
363
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
364 /// Allows window to be resized by the user
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
365 void AllowResize();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
366
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
367 /// Prevents window to be resized by the user
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
368 void PreventResize();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
369
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
370 using Layer::Add;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
371 virtual void Add(Layer &layer) override;
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
372
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
373 using Layer::Insert;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
374 virtual void Insert(Layer &layer, long under) override;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
375
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
376 using Layer::Remove;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
377 virtual void Remove(Layer &layer) override;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
378
1679
ba8492d69168 #319 OS cursor support
cemkalyoncu
parents: 1510
diff changeset
379 /// Updates current mouse pointer if OS pointer is shown. This is called automatically.
ba8492d69168 #319 OS cursor support
cemkalyoncu
parents: 1510
diff changeset
380 void UpdatePointer();
ba8492d69168 #319 OS cursor support
cemkalyoncu
parents: 1510
diff changeset
381
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
382 /// Returns the minimum size required to fit any window inside.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
383 static Geometry::Size GetMinimumRequiredSize();
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
384
1031
8312876a6b1d * Linux build is fixed
cemkalyoncu
parents: 1020
diff changeset
385 /// Pointer system to be used within the window
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
386 Graphics::PointerStack Pointers;
954
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
387
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
388 /// @name Events
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
389 /// @{
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
390
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
391 /// Called when this window is focused
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
392 Event<Window> FocusedEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
393
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
394 /// Called when this window is deactivated
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
395 Event<Window> LostFocusEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
396
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
397 /// Called when this window is destroyed. Note that at this point, any reference
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
398 /// to this object may fail.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
399 Event<Window> DestroyedEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
400
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
401 /// Called when user tries to close the window. Will not be called if window is closed
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
402 /// using Destructor or Close function
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
403 /// ### Parameters: ###
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
404 /// **allow** `(bool &)`: setting this value to false will stop window being closed.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
405 Event<Window, bool&> ClosingEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
406
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
407 /// Called after the window is moved, either by the user or programmatically
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
408 Event<Window> MovedEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
409
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
410 /// Called after the window is resized, either by the user or programmatically
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
411 Event<Window> ResizedEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
412
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
413 /// Called after the window is minimized, either by the user or programmatically
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
414 Event<Window> MinimizedEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
415
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
416 /// Called after the window is restored from minimized state, either by the user or programmatically
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
417 Event<Window> RestoredEvent{*this};
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
418
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
419 /// Called when a key is pressed or released. This key could be a keyboard key
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
420 /// or any other controller key including mouse. In case of mouse, this method
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
421 /// will be triggered if mouse call is not handled by layers.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
422 ///
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
423 /// If the input device is keyboard, key down event (amount=1) is repeated if the
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
424 /// first event is handled. The repeats will only be sent to the handler of the event.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
425 /// Additionally, Key up event (amount=0) is sent only to handler, if key down is handled
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
426 /// otherwise it will be sent to all listeners.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
427 ///
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
428 /// ### Parameters: ###
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
429 /// **Key** `(Input::Key)`: The key that is pressed or released
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
430 /// **Amount** `(float)`: Depending on the device this can be a boolean 0 and 1, number
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
431 /// of successive key strokes or amount of pressure (0 to 1) in analog controllers
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
432 ConsumableEvent<Window, Input::Key, float> KeyEvent{*this};
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
433
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
434 /// Called when a character is received. This event is raised for regular characters
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
435 /// that can be printed. If a key is handled in keypress event, this event will not be
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
436 /// fired. This event will be called multiple times when the key repeats.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
437 ConsumableEvent<Window, Input::Keyboard::Char> CharacterEvent{*this};
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
438 ///@}
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
439
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
440 /// List of currently created windows
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
441 static const Containers::Collection<Window> &Windows;
1345
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
442
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
443 /// These functions are used internally
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
444 void mouse_down(Geometry::Point location, Input::Mouse::Button button);
1345
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
445
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
446 /// These functions are used internally
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
447 void mouse_up(Geometry::Point location, Input::Mouse::Button button);
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
448
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
449 /// These functions are used internally
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
450 void mouse_event(Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount);
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
451
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
452 /// These functions are used internally
c8e54573063a #105 X11.cpp is broken down to parts to be more managable.
cemkalyoncu
parents: 1257
diff changeset
453 void mouse_location();
1497
72957a374087 * Window initializes graphics automatically
cemkalyoncu
parents: 1360
diff changeset
454
951
30f58a1bafc9 * Windows can now be centered or made fullscreen on another monitor
cemkalyoncu
parents: 950
diff changeset
455
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
456 protected:
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
457 Window(const WindowManager::Monitor &monitor, Geometry::Rectangle rect, const std::string &name, const std::string &title, bool allowresize, bool visible);
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
458
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
459 /// A window cannot be placed in another layer. This function always fails.
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
460 virtual void located(Layer *) override { Utils::ASSERT_FALSE("A window cannot be placed in another layer"); }
914
0858abee0f02 * Better mouse handler registration (incomplete)
cemkalyoncu
parents: 910
diff changeset
461
1510
c523825917a9 #216 Dialog system
cemkalyoncu
parents: 1508
diff changeset
462 void deleting(Layer *layer);
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
463
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
464 void init();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
465
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
466 virtual void osdestroy();
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
467
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
468 void redrawbg();
910
38c9cc8ac94f * Groundwork for mouse input event
cemkalyoncu
parents: 903
diff changeset
469
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
470 private:
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
471 void createglcontext();
1011
c77faf04113d * Reorganized generic test
cemkalyoncu
parents: 989
diff changeset
472
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
473 void updatedataowner();
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
474
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
475 std::string name;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
476
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
477 internal::windowdata *data = nullptr;
764
7c71952bd75b Gorgon code base has been moved to Source/Gorgon
cengizkandemir
parents:
diff changeset
478
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
479 static Containers::Collection<Window> windows;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
480
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
481 static const Geometry::Point automaticplacement;
914
0858abee0f02 * Better mouse handler registration (incomplete)
cemkalyoncu
parents: 910
diff changeset
482
916
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
483 Input::Mouse::Button pressed = Input::Mouse::Button::None;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
484
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
485 MouseHandler down;
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
486 MouseHandler over;
930
e27920cf2c80 * Mouse movement messages no longer generated when cursor is not over the window
cemkalyoncu
parents: 919
diff changeset
487
954
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
488 bool allowresize = false;
e4333603bcb1 * Resizing a window now works properly
cemkalyoncu
parents: 953
diff changeset
489
1095
a9805c714de3 * Placeholder component
cemkalyoncu
parents: 1062
diff changeset
490 bool cursorover = true;
919
13d5a8a70c7e * Mouse click bug fixed
cemkalyoncu
parents: 916
diff changeset
491
1020
137f6c03dcbf * Multistep drag start
cemkalyoncu
parents: 1011
diff changeset
492
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
493 Geometry::Point mousedownlocation = {-1, -1};
916
6c3f422da3ae * Mouse system is complete, requires through testing
cemkalyoncu
parents: 914
diff changeset
494 Geometry::Point mouselocation = {-1, -1};
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
495
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
496 Graphics::Layer *pointerlayer = nullptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
497 Graphics::Layer *contentslayer = nullptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
498 Graphics::Layer *bglayer = nullptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
499
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
500 bool iswmpointer = true;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
501 bool showptr = true;
959
e5bbf27333f9 * Pointer and pointer stack
cemkalyoncu
parents: 956
diff changeset
502 bool switchbacktolocalptr = false;
989
c7cd9cb9086d * FrameBuffers now resize as the window resizes
cemkalyoncu
parents: 977
diff changeset
503
1508
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
504 Geometry::Size glsize = {0, 0};
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
505
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
506 const Graphics::RectangularAnimation *bganim = nullptr;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
507 bool ownbg = false;
58d190b948ea #210 Gorgon::Window now contains multiple layers
cemkalyoncu
parents: 1497
diff changeset
508 };
903
0b31f678d757 * Input::Event is replaced by ConsumableEvent
cemkalyoncu
parents: 899
diff changeset
509 }

mercurial