display_window_description.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2016 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 
35 namespace clan
36 {
39 
40  class Sizef;
41  class Rectf;
42  class DisplayWindow;
43  class DisplayWindowDescription_Impl;
44  struct DisplayWindowHandle;
45 
50  {
51  public:
54 
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 
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 
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 
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 }
void show_caption(bool value=true)
Controls if a title bar (including frame) is shown or not.
void set_popup_window()
Display the window as a popup.
Definition: clanapp.h:35
int get_swap_interval() const
Returns the swap interval to be used for the window.
void show_sysmenu(bool value=true)
Sets if the window has a window menu on its title bar.
int get_multisampling() const
Returns the number of samples per pixel.
DisplayWindowDescription & operator=(const DisplayWindowDescription &copy)
Copy assignment operator.
bool is_fullscreen() const
Returns if window should be initially fullscreen.
Rectf get_position() const
Returns the initial position of the window.
int get_stencil_size() const
Returns the minimum required stencil buffer.
void set_no_activate(bool value=true)
Prevents window from being automatically activated.
void set_allow_resize(bool allow_resize=true)
Sets if windows should be resizable.
bool has_maximize_button() const
Returns true if the window has a maximize button.
bool get_allow_screensaver() const
Returns true if the screensaver is allowed.
bool has_drop_shadow() const
Returns true if the window is drawn with a drop shadow effect.
Definition: display_window.h:85
DisplayWindowHandle get_handle() const
bool has_minimize_button() const
Returns true if the window has a minimize button.
Sizef get_size() const
Returns the size of the window stored in description.
const std::string & get_title() const
Returns the window title stored in the description.
void set_allow_screensaver(bool allow_screensaver=true)
Allow the screensaver to appear.
void set_visible(bool value=true)
Toggles whether the window is created as initially visible.
void set_update_supported(bool value) const
Controls if DisplayWindow::update is supported.
bool is_topmost() const
Returns true if the window should be placed above all non-topmost windows.
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.
void set_flipping_buffers(int num_buffers=2)
Sets the amount of flipping buffers to be used.
void show_maximize_button(bool value=true)
Sets if the window has a maximize button.
void set_swap_interval(int interval=-1)
Sets the swap interval to be used for the window.
int get_depth_size() const
Returns the minimum required depth buffer.
void set_stencil_size(int value)
Sets the minimum required stencil buffer.
void set_title(const std::string &title)
Sets the title of the window.
void set_position(const Rectf &position, bool client_area)
Sets the position of the window (including window frame).
void set_main_window()
Display this window as of the main windows of the application.
bool has_no_activate() const
Indicates if window is automatically activated or not.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:502
void set_depth_size(int value)
Sets the minimum required depth buffer.
void set_handle(DisplayWindowHandle handle)
bool is_dialog() const
Returns true if it is a dialog window.
void set_owner_window(const DisplayWindow &owner)
Specifies another window which owns this one.
void set_drop_shadow(bool value=true)
Enables a drop shadow effect on the window.
int get_flipping_buffers() const
Returns the amount of flipping buffers to be created.
bool has_sysmenu() const
Returns true if the window has a window menu on its title bar.
bool is_main() const
Returns true if it is a main window.
int get_fullscreen_monitor() const
Returns the index of the monitor to go fullscreen on. See ScreenInfo.
bool get_allow_resize() const
Returns true if window should be resizeable.
bool is_visible() const
Returns true if the window is initially visible.
bool is_popup() const
Returns true if it is a popup window.
DisplayWindowDescription()
Constructs a window description with default values.
int get_bpp() const
Returns the numbers of bytes per pixel in the window.
bool get_position_client_area() const
Returns if the client area is used for the initial position of the window.
void set_dialog_window()
Display the window as a modal dialog.
bool is_layered() const
Returns true if window is layered (black is transparent)
Display window description class.
Definition: display_window_description.h:49
void set_layered(bool layered)
Creates a layered window (complex shaped window)
void set_multisampling(int value)
Sets the number of samples per pixel.
void show_minimize_button(bool value=true)
Sets if the window has a minimize button.
void set_size(const Sizef &size, bool client_area)
Sets the size of the window (including window frame).
Top-level window class.
Definition: display_window.h:100
void set_refresh_rate(int refresh_rate)
bool has_caption() const
Returns true if a title bar is shown.
void set_fullscreen(bool fullscreen=true, int monitor=0)
Makes the window initially fullscreen.
DisplayWindow get_owner() const
Returns the window owning this one.
2D (width,height) size structure - Float
Definition: size.h:183
void set_topmost(bool value=true)
Sets if the window should be placed above all non-topmost windows.