display_window_description.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Harry Storbacka
28** Kenneth Gangstoe
29*/
30
31#pragma once
32
33#include <memory>
34
35namespace clan
36{
39
40 class Sizef;
41 class Rectf;
42 class DisplayWindow;
43 class DisplayWindowDescription_Impl;
44 struct DisplayWindowHandle;
45
50 {
51 public:
54
56 DisplayWindowDescription(const std::string &title);
57
59 DisplayWindowDescription(const std::string &title, const Rectf &position, bool client_area);
60
62 DisplayWindowDescription(const std::string &title, const Sizef &size, bool client_area);
63
65 DisplayWindowDescription(const Rectf &position, bool client_area);
66
70
72
74 const std::string &get_title() const;
75
77 Sizef get_size() const;
78
81
84
86 bool is_fullscreen() const;
87
90
92 int get_swap_interval() const;
93
95 bool get_allow_resize() const;
96
98 int get_bpp() const;
99
103 int get_refresh_rate() const;
104
106 bool is_layered() const;
107
111
113 bool has_caption() const;
114
116 bool has_sysmenu() const;
117
120
123
125 bool is_visible() const;
126
128 bool is_topmost() const;
129
131 bool has_no_activate() const;
132
134 bool has_drop_shadow() const;
135
138
140 int get_depth_size() const;
141
143 int get_stencil_size() const;
144
147
150
153
155 int get_multisampling() const;
156
158 bool is_main() const;
159
161 bool is_dialog() const;
162
164 bool is_popup() const;
165
168
173
178
184
188 void show_caption(bool value = true);
189
193 void show_sysmenu(bool value = true);
194
198 void show_minimize_button(bool value = true);
199
203 void show_maximize_button(bool value = true);
204
206 void set_visible(bool value = true);
207
211 void set_topmost(bool value = true);
212
214 void set_no_activate(bool value = true);
215
217 void set_drop_shadow(bool value = true);
218
220 void set_owner_window(const DisplayWindow &owner);
221
223 void set_title(const std::string &title);
224
228 void set_size(const Sizef &size, bool client_area);
229
236 void set_position(const Rectf &position, bool client_area);
237
239 void set_fullscreen(bool fullscreen = true, int monitor = 0);
240
242 void set_flipping_buffers(int num_buffers = 2);
243
245 void set_swap_interval(int interval = -1);
246
250 void set_allow_resize(bool allow_resize = true);
251
253 void set_bpp(int bpp);
254
258 void set_refresh_rate(int refresh_rate);
259
263 void set_layered(bool layered);
264
268 void set_allow_screensaver(bool allow_screensaver = true);
269
273
275
277 void set_depth_size(int value);
278
280
282 void set_stencil_size(int value);
283
288 void set_update_supported(bool value) const;
289
291 void set_multisampling(int value);
292
293 private:
294 std::unique_ptr<DisplayWindowDescription_Impl> impl;
295 };
296
298}
Display window description class.
Definition display_window_description.h:50
const std::string & get_title() const
Returns the window title stored in the description.
void set_main_window()
Display this window as of the main windows of the application.
void set_topmost(bool value=true)
Sets if the window should be placed above all non-topmost windows.
bool is_visible() const
Returns true if the window is initially visible.
int get_depth_size() const
Returns the minimum required depth buffer.
void set_visible(bool value=true)
Toggles whether the window is created as initially visible.
Sizef get_size() const
Returns the size of the window stored in description.
void set_no_activate(bool value=true)
Prevents window from being automatically activated.
bool get_allow_resize() const
Returns true if window should be resizeable.
DisplayWindowDescription(const std::string &title)
Constructs a window description with default values and a title.
bool is_fullscreen() const
Returns if window should be initially fullscreen.
bool has_no_activate() const
Indicates if window is automatically activated or not.
DisplayWindowDescription(const std::string &title, const Rectf &position, bool client_area)
Constructs a window description with default values, a title and a position.
void show_maximize_button(bool value=true)
Sets if the window has a maximize button.
DisplayWindowDescription & operator=(const DisplayWindowDescription &copy)
Copy assignment operator.
void set_multisampling(int value)
Sets the number of samples per pixel.
void set_owner_window(const DisplayWindow &owner)
Specifies another window which owns this one.
void set_fullscreen(bool fullscreen=true, int monitor=0)
Makes the window initially fullscreen.
bool is_dialog() const
Returns true if it is a dialog window.
void set_allow_resize(bool allow_resize=true)
Sets if windows should be resizable.
bool is_main() const
Returns true if it is a main window.
bool is_popup() const
Returns true if it is a popup window.
bool has_sysmenu() const
Returns true if the window has a window menu on its title bar.
bool has_minimize_button() const
Returns true if the window has a minimize button.
void set_flipping_buffers(int num_buffers=2)
Sets the amount of flipping buffers to be used.
int get_multisampling() const
Returns the number of samples per pixel.
Rectf get_position() const
Returns the initial position of the window.
bool get_position_client_area() const
Returns if the client area is used for the initial position of the window.
void set_depth_size(int value)
Sets the minimum required depth buffer.
void set_size(const Sizef &size, bool client_area)
Sets the size of the window (including window frame).
int get_swap_interval() const
Returns the swap interval to be used for the window.
bool has_maximize_button() const
Returns true if the window has a maximize button.
int get_flipping_buffers() const
Returns the amount of flipping buffers to be created.
void set_bpp(int bpp)
Sets the number of bytes per pixel.
bool is_update_supported() const
Returns true if DisplayWindow::update should be supported.
bool has_caption() const
Returns true if a title bar is shown.
void set_title(const std::string &title)
Sets the title of the window.
void show_sysmenu(bool value=true)
Sets if the window has a window menu on its title bar.
bool is_layered() const
Returns true if window is layered (black is transparent)
void set_layered(bool layered)
Creates a layered window (complex shaped window)
void set_popup_window()
Display the window as a popup.
void set_refresh_rate(int refresh_rate)
DisplayWindowDescription()
Constructs a window description with default values.
int get_stencil_size() const
Returns the minimum required stencil buffer.
bool is_topmost() const
Returns true if the window should be placed above all non-topmost windows.
int get_fullscreen_monitor() const
Returns the index of the monitor to go fullscreen on. See ScreenInfo.
DisplayWindowDescription(const Rectf &position, bool client_area)
Constructs a window description with default values and a position.
void set_swap_interval(int interval=-1)
Sets the swap interval to be used for the window.
DisplayWindowDescription(const std::string &title, const Sizef &size, bool client_area)
Constructs a window description with default values, a title and a size.
void set_handle(DisplayWindowHandle handle)
void set_drop_shadow(bool value=true)
Enables a drop shadow effect on the window.
bool get_allow_screensaver() const
Returns true if the screensaver is allowed.
void show_minimize_button(bool value=true)
Sets if the window has a minimize button.
DisplayWindowDescription(const DisplayWindowDescription &copy)
Constructs a DisplayWindowDescription.
DisplayWindowHandle get_handle() const
DisplayWindow get_owner() const
Returns the window owning this one.
int get_bpp() const
Returns the numbers of bytes per pixel in the window.
void show_caption(bool value=true)
Controls if a title bar (including frame) is shown or not.
void set_position(const Rectf &position, bool client_area)
Sets the position of the window (including window frame).
bool has_drop_shadow() const
Returns true if the window is drawn with a drop shadow effect.
void set_stencil_size(int value)
Sets the minimum required stencil buffer.
void set_update_supported(bool value) const
Controls if DisplayWindow::update is supported.
void set_allow_screensaver(bool allow_screensaver=true)
Allow the screensaver to appear.
void set_dialog_window()
Display the window as a modal dialog.
Top-level window class.
Definition display_window.h:101
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:503
2D (width,height) size structure - Float
Definition size.h:184
Definition clanapp.h:36
Definition display_window.h:86