display_window_description.h Source File - ClanLib SDK
Description: display_window_description.h Source File

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
49 class DisplayWindowDescription
50 {
51 public:
53 DisplayWindowDescription();
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
69 DisplayWindowDescription(const DisplayWindowDescription &copy);
70
71 ~DisplayWindowDescription();
72
74 const std::string &get_title() const;
75
77 Sizef get_size() const;
78
80 Rectf get_position() const;
81
83 bool get_position_client_area() const;
84
86 bool is_fullscreen() const;
87
89 int get_flipping_buffers() const;
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
110 DisplayWindowHandle get_handle() const;
111
113 bool has_caption() const;
114
116 bool has_sysmenu() const;
117
119 bool has_minimize_button() const;
120
122 bool has_maximize_button() const;
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
137 DisplayWindow get_owner() const;
138
140 int get_depth_size() const;
141
143 int get_stencil_size() const;
144
146 int get_fullscreen_monitor() const;
147
149 bool get_allow_screensaver() const;
150
152 bool is_update_supported() const;
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
167 DisplayWindowDescription &operator =(const DisplayWindowDescription &copy);
168
172 void set_main_window();
173
177 void set_dialog_window();
178
183 void set_popup_window();
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
272 void set_handle(DisplayWindowHandle handle);
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}
clan::DisplayWindowDescription::get_title
const std::string & get_title() const
Returns the window title stored in the description.
clan::DisplayWindowDescription::set_main_window
void set_main_window()
Display this window as of the main windows of the application.
clan::DisplayWindowDescription::set_topmost
void set_topmost(bool value=true)
Sets if the window should be placed above all non-topmost windows.
clan::DisplayWindowDescription::is_visible
bool is_visible() const
Returns true if the window is initially visible.
clan::DisplayWindowDescription::get_depth_size
int get_depth_size() const
Returns the minimum required depth buffer.
clan::DisplayWindowDescription::set_visible
void set_visible(bool value=true)
Toggles whether the window is created as initially visible.
clan::DisplayWindowDescription::get_size
Sizef get_size() const
Returns the size of the window stored in description.
clan::DisplayWindowDescription::set_no_activate
void set_no_activate(bool value=true)
Prevents window from being automatically activated.
clan::DisplayWindowDescription::get_allow_resize
bool get_allow_resize() const
Returns true if window should be resizeable.
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription(const std::string &title)
Constructs a window description with default values and a title.
clan::DisplayWindowDescription::is_fullscreen
bool is_fullscreen() const
Returns if window should be initially fullscreen.
clan::DisplayWindowDescription::has_no_activate
bool has_no_activate() const
Indicates if window is automatically activated or not.
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription(const std::string &title, const Rectf &position, bool client_area)
Constructs a window description with default values, a title and a position.
clan::DisplayWindowDescription::show_maximize_button
void show_maximize_button(bool value=true)
Sets if the window has a maximize button.
clan::DisplayWindowDescription::operator=
DisplayWindowDescription & operator=(const DisplayWindowDescription &copy)
Copy assignment operator.
clan::DisplayWindowDescription::set_multisampling
void set_multisampling(int value)
Sets the number of samples per pixel.
clan::DisplayWindowDescription::set_owner_window
void set_owner_window(const DisplayWindow &owner)
Specifies another window which owns this one.
clan::DisplayWindowDescription::set_fullscreen
void set_fullscreen(bool fullscreen=true, int monitor=0)
Makes the window initially fullscreen.
clan::DisplayWindowDescription::is_dialog
bool is_dialog() const
Returns true if it is a dialog window.
clan::DisplayWindowDescription::set_allow_resize
void set_allow_resize(bool allow_resize=true)
Sets if windows should be resizable.
clan::DisplayWindowDescription::is_main
bool is_main() const
Returns true if it is a main window.
clan::DisplayWindowDescription::is_popup
bool is_popup() const
Returns true if it is a popup window.
clan::DisplayWindowDescription::has_sysmenu
bool has_sysmenu() const
Returns true if the window has a window menu on its title bar.
clan::DisplayWindowDescription::has_minimize_button
bool has_minimize_button() const
Returns true if the window has a minimize button.
clan::DisplayWindowDescription::set_flipping_buffers
void set_flipping_buffers(int num_buffers=2)
Sets the amount of flipping buffers to be used.
clan::DisplayWindowDescription::get_multisampling
int get_multisampling() const
Returns the number of samples per pixel.
clan::DisplayWindowDescription::get_position
Rectf get_position() const
Returns the initial position of the window.
clan::DisplayWindowDescription::get_position_client_area
bool get_position_client_area() const
Returns if the client area is used for the initial position of the window.
clan::DisplayWindowDescription::set_depth_size
void set_depth_size(int value)
Sets the minimum required depth buffer.
clan::DisplayWindowDescription::set_size
void set_size(const Sizef &size, bool client_area)
Sets the size of the window (including window frame).
clan::DisplayWindowDescription::get_refresh_rate
int get_refresh_rate() const
clan::DisplayWindowDescription::get_swap_interval
int get_swap_interval() const
Returns the swap interval to be used for the window.
clan::DisplayWindowDescription::has_maximize_button
bool has_maximize_button() const
Returns true if the window has a maximize button.
clan::DisplayWindowDescription::get_flipping_buffers
int get_flipping_buffers() const
Returns the amount of flipping buffers to be created.
clan::DisplayWindowDescription::set_bpp
void set_bpp(int bpp)
Sets the number of bytes per pixel.
clan::DisplayWindowDescription::is_update_supported
bool is_update_supported() const
Returns true if DisplayWindow::update should be supported.
clan::DisplayWindowDescription::has_caption
bool has_caption() const
Returns true if a title bar is shown.
clan::DisplayWindowDescription::set_title
void set_title(const std::string &title)
Sets the title of the window.
clan::DisplayWindowDescription::show_sysmenu
void show_sysmenu(bool value=true)
Sets if the window has a window menu on its title bar.
clan::DisplayWindowDescription::is_layered
bool is_layered() const
Returns true if window is layered (black is transparent)
clan::DisplayWindowDescription::set_layered
void set_layered(bool layered)
Creates a layered window (complex shaped window)
clan::DisplayWindowDescription::set_popup_window
void set_popup_window()
Display the window as a popup.
clan::DisplayWindowDescription::set_refresh_rate
void set_refresh_rate(int refresh_rate)
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription()
Constructs a window description with default values.
clan::DisplayWindowDescription::get_stencil_size
int get_stencil_size() const
Returns the minimum required stencil buffer.
clan::DisplayWindowDescription::is_topmost
bool is_topmost() const
Returns true if the window should be placed above all non-topmost windows.
clan::DisplayWindowDescription::get_fullscreen_monitor
int get_fullscreen_monitor() const
Returns the index of the monitor to go fullscreen on. See ScreenInfo.
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription(const Rectf &position, bool client_area)
Constructs a window description with default values and a position.
clan::DisplayWindowDescription::set_swap_interval
void set_swap_interval(int interval=-1)
Sets the swap interval to be used for the window.
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription(const std::string &title, const Sizef &size, bool client_area)
Constructs a window description with default values, a title and a size.
clan::DisplayWindowDescription::set_handle
void set_handle(DisplayWindowHandle handle)
clan::DisplayWindowDescription::set_drop_shadow
void set_drop_shadow(bool value=true)
Enables a drop shadow effect on the window.
clan::DisplayWindowDescription::get_allow_screensaver
bool get_allow_screensaver() const
Returns true if the screensaver is allowed.
clan::DisplayWindowDescription::show_minimize_button
void show_minimize_button(bool value=true)
Sets if the window has a minimize button.
clan::DisplayWindowDescription::DisplayWindowDescription
DisplayWindowDescription(const DisplayWindowDescription &copy)
Constructs a DisplayWindowDescription.
clan::DisplayWindowDescription::get_handle
DisplayWindowHandle get_handle() const
clan::DisplayWindowDescription::get_owner
DisplayWindow get_owner() const
Returns the window owning this one.
clan::DisplayWindowDescription::get_bpp
int get_bpp() const
Returns the numbers of bytes per pixel in the window.
clan::DisplayWindowDescription::show_caption
void show_caption(bool value=true)
Controls if a title bar (including frame) is shown or not.
clan::DisplayWindowDescription::set_position
void set_position(const Rectf &position, bool client_area)
Sets the position of the window (including window frame).
clan::DisplayWindowDescription::has_drop_shadow
bool has_drop_shadow() const
Returns true if the window is drawn with a drop shadow effect.
clan::DisplayWindowDescription::~DisplayWindowDescription
~DisplayWindowDescription()
clan::DisplayWindowDescription::set_stencil_size
void set_stencil_size(int value)
Sets the minimum required stencil buffer.
clan::DisplayWindowDescription::set_update_supported
void set_update_supported(bool value) const
Controls if DisplayWindow::update is supported.
clan::DisplayWindowDescription::set_allow_screensaver
void set_allow_screensaver(bool allow_screensaver=true)
Allow the screensaver to appear.
clan::DisplayWindowDescription::set_dialog_window
void set_dialog_window()
Display the window as a modal dialog.
clan::DisplayWindow
Top-level window class.
Definition display_window.h:101
clan::Rectf
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:460
clan::Sizef
2D (width,height) size structure - Float
Definition size.h:189
clan
Definition clanapp.h:36
clan::DisplayWindowHandle
Definition display_window.h:86