display_window_description.h
1 /*
2 ** UICore
3 ** Copyright (c) 1997-2015 The UICore 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 UICore 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 uicore
36 {
37  class Sizef;
38  class Rectf;
39  class DisplayWindow;
40  typedef std::shared_ptr<DisplayWindow> DisplayWindowPtr;
41  class DisplayWindowDescription_Impl;
42  struct DisplayWindowHandle;
43 
48  {
49  public:
52 
55 
57  DisplayWindowDescription(const std::string &title, const Rectf &position, bool client_area);
58 
60  DisplayWindowDescription(const std::string &title, const Sizef &size, bool client_area);
61 
63  DisplayWindowDescription(const Rectf &position, bool client_area);
64 
68 
70 
72  const std::string &title() const;
73 
75  Sizef size() const;
76 
78  Rectf position() const;
79 
81  bool position_client_area() const;
82 
84  bool is_fullscreen() const;
85 
87  int flipping_buffers() const;
88 
90  int swap_interval() const;
91 
93  bool allow_resize() const;
94 
96  bool allow_alt_enter() const;
97 
99  int bpp() const;
100 
104  int refresh_rate() const;
105 
107  bool is_layered() const;
108 
111  DisplayWindowHandle handle() const;
112 
114  bool has_caption() const;
115 
117  bool has_sysmenu() const;
118 
120  bool has_minimize_button() const;
121 
123  bool has_maximize_button() const;
124 
126  bool is_visible() const;
127 
129  bool is_topmost() const;
130 
132  bool has_no_activate() const;
133 
135  bool has_drop_shadow() const;
136 
138  DisplayWindowPtr owner() const;
139 
141  int depth_size() const;
142 
144  int stencil_size() const;
145 
147  int fullscreen_monitor() const;
148 
150  bool allow_screensaver() const;
151 
153  bool is_update_supported() const;
154 
156  int multisampling() const;
157 
159  bool is_main() const;
160 
162  bool is_dialog() const;
163 
165  bool is_popup() const;
166 
169 
173  void set_main_window();
174 
178  void set_dialog_window();
179 
184  void set_popup_window();
185 
189  void show_caption(bool value = true);
190 
194  void show_sysmenu(bool value = true);
195 
199  void show_minimize_button(bool value = true);
200 
204  void show_maximize_button(bool value = true);
205 
207  void set_visible(bool value = true);
208 
212  void set_topmost(bool value = true);
213 
215  void set_no_activate(bool value = true);
216 
218  void set_drop_shadow(bool value = true);
219 
221  void set_owner_window(const DisplayWindowPtr &owner);
222 
224  void set_title(const std::string &title);
225 
229  void set_size(const Sizef &size, bool client_area);
230 
237  void set_position(const Rectf &position, bool client_area);
238 
240  void set_fullscreen(bool fullscreen = true, int monitor = 0);
241 
243  void set_flipping_buffers(int num_buffers = 2);
244 
246  void set_swap_interval(int interval = -1);
247 
251  void set_allow_resize(bool allow_resize = true);
252 
254  void set_allow_alt_enter(bool value = true);
255 
257  void set_bpp(int bpp);
258 
262  void set_refresh_rate(int refresh_rate);
263 
267  void set_layered(bool layered);
268 
272  void set_allow_screensaver(bool allow_screensaver = true);
273 
276  void set_handle(DisplayWindowHandle handle);
277 
279 
281  void set_depth_size(int value);
282 
284 
286  void set_stencil_size(int value);
287 
292  void set_update_supported(bool value) const;
293 
295  void set_multisampling(int value);
296 
297  private:
298  std::unique_ptr<DisplayWindowDescription_Impl> impl;
299  };
300 }
bool has_sysmenu() const
Returns true if the window has a window menu on its title bar.
DisplayWindowDescription & operator=(const DisplayWindowDescription &copy)
Copy assignment operator.
void set_title(const std::string &title)
Sets the title of the window.
bool is_layered() const
Returns true if window is layered (black is transparent)
bool has_no_activate() const
Indicates if window is automatically activated or not.
int stencil_size() const
Returns the minimum required stencil buffer.
void set_visible(bool value=true)
Toggles whether the window is created as initially visible.
bool allow_resize() const
Returns true if window should be resizeable.
bool has_maximize_button() const
Returns true if the window has a maximize button.
bool has_minimize_button() const
Returns true if the window has a minimize button.
DisplayWindowDescription()
Constructs a window description with default values.
std::shared_ptr< DisplayWindow > DisplayWindowPtr
Definition: canvas.h:41
bool is_topmost() const
Returns true if the window should be placed above all non-topmost windows.
int fullscreen_monitor() const
Returns the index of the monitor to go fullscreen on. See ScreenInfo.
Definition: display_window.h:86
bool is_dialog() const
Returns true if it is a dialog window.
int multisampling() const
Returns the number of samples per pixel.
bool is_update_supported() const
Returns true if DisplayWindow::update should be supported.
DisplayWindowPtr owner() const
Returns the window owning this one.
bool is_popup() const
Returns true if it is a popup window.
void set_drop_shadow(bool value=true)
Enables a drop shadow effect on the window.
bool is_main() const
Returns true if it is a main window.
void set_popup_window()
Display the window as a popup.
void set_allow_screensaver(bool allow_screensaver=true)
Allow the screensaver to appear.
void set_swap_interval(int interval=-1)
Sets the swap interval to be used for the window.
void set_handle(DisplayWindowHandle handle)
void set_stencil_size(int value)
Sets the minimum required stencil buffer.
void set_no_activate(bool value=true)
Prevents window from being automatically activated.
void set_owner_window(const DisplayWindowPtr &owner)
Specifies another window which owns this one.
void show_caption(bool value=true)
Controls if a title bar (including frame) is shown or not.
bool is_visible() const
Returns true if the window is initially visible.
2D (width,height) size structure - Float
Definition: size.h:180
bool is_fullscreen() const
Returns if window should be initially fullscreen.
void set_dialog_window()
Display the window as a modal dialog.
bool has_caption() const
Returns true if a title bar is shown.
void set_flipping_buffers(int num_buffers=2)
Sets the amount of flipping buffers to be used.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:505
Rectf position() const
Returns the initial position of the window.
void set_refresh_rate(int refresh_rate)
void show_minimize_button(bool value=true)
Sets if the window has a minimize button.
void set_depth_size(int value)
Sets the minimum required depth buffer.
const std::string & title() const
Returns the window title stored in the description.
void set_layered(bool layered)
Creates a layered window (complex shaped window)
bool allow_screensaver() const
Returns true if the screensaver is allowed.
void set_allow_alt_enter(bool value=true)
Sets if alt-enter switches to fullscreen or not.
void set_bpp(int bpp)
Sets the number of bytes per pixel.
void set_multisampling(int value)
Sets the number of samples per pixel.
void set_position(const Rectf &position, bool client_area)
Sets the position of the window (including window frame).
void set_fullscreen(bool fullscreen=true, int monitor=0)
Makes the window initially fullscreen.
Sizef size() const
Returns the size of the window stored in description.
int bpp() const
Returns the numbers of bytes per pixel in the window.
Display window description class.
Definition: display_window_description.h:47
void set_topmost(bool value=true)
Sets if the window should be placed above all non-topmost windows.
int depth_size() const
Returns the minimum required depth buffer.
void show_sysmenu(bool value=true)
Sets if the window has a window menu on its title bar.
void set_size(const Sizef &size, bool client_area)
Sets the size of the window (including window frame).
int swap_interval() const
Returns the swap interval to be used for the window.
void set_main_window()
Display this window as of the main windows of the application.
bool allow_alt_enter() const
Returns true if alt-enter enters fullscreen or not.
bool has_drop_shadow() const
Returns true if the window is drawn with a drop shadow effect.
int flipping_buffers() const
Returns the amount of flipping buffers to be created.
void set_update_supported(bool value) const
Controls if DisplayWindow::update is supported.
DisplayWindowHandle handle() const
void set_allow_resize(bool allow_resize=true)
Sets if windows should be resizable.
Definition: Application/application.h:35
void show_maximize_button(bool value=true)
Sets if the window has a maximize button.
bool position_client_area() const
Returns if the client area is used for the initial position of the window.