Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

WindowProperties Class Reference

A container for the various kinds of properties we might ask to have on a graphics window before we open it. More...

#include <windowProperties.h>

List of all members.

Public Member Functions

 WindowProperties ()
 WindowProperties (const WindowProperties &copy)
void operator= (const WindowProperties &copy)
 ~WindowProperties ()
bool operator== (const WindowProperties &other) const
bool operator!= (const WindowProperties &other) const
void clear ()
 Unsets all properties that have been specified so far, and resets the WindowProperties structure to its initial empty state.

bool is_any_specified () const
 Returns true if any properties have been specified, false otherwise.

void set_origin (int x_origin, int y_origin)
 Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window should appear.

int get_x_origin () const
 Returns the x coordinate of the window's top-left corner, not including decorations.

int get_y_origin () const
 Returns the y coordinate of the window's top-left corner, not including decorations.

bool has_origin () const
 Returns true if the window origin has been specified, false otherwise.

void clear_origin ()
 Removes the origin specification from the properties.

void set_size (int x_size, int y_size)
 Specifies the requested size of the window, in pixels.

int get_x_size () const
 Returns size in pixels in the x dimension of the useful part of the window, not including decorations.

int get_y_size () const
 Returns size in pixels in the y dimension of the useful part of the window, not including decorations.

bool has_size () const
 Returns true if the window size has been specified, false otherwise.

void clear_size ()
 Removes the size specification from the properties.

void set_title (const string &title)
 Specifies the title that should be assigned to the window.

const string & get_title () const
 Returns the window's title.

bool has_title () const
 Returns true if the window title has been specified, false otherwise.

void clear_title ()
 Removes the title specification from the properties.

void set_undecorated (bool undecorated)
 Specifies whether the window should be created with a visible title and border (false, the default) or not (true).

bool get_undecorated () const
 Returns true if the window has no border.

bool has_undecorated () const
 Returns true if set_undecorated() has been specified.

void clear_undecorated ()
 Removes the undecorated specification from the properties.

void set_fullscreen (bool fullscreen)
 Specifies whether the window should be opened in fullscreen mode (true) or normal windowed mode (false, the default).

bool get_fullscreen () const
 Returns true if the window is in fullscreen mode.

bool has_fullscreen () const
 Returns true if set_fullscreen() has been specified.

void clear_fullscreen ()
 Removes the fullscreen specification from the properties.

void set_foreground (bool foreground)
 Specifies whether the window should be opened in the foreground (true), or left in the background (false).

bool get_foreground () const
 Returns true if the window is in the foreground.

bool has_foreground () const
 Returns true if set_foreground() has been specified.

void clear_foreground ()
 Removes the foreground specification from the properties.

void set_minimized (bool minimized)
 Specifies whether the window should be created minimized (true), or normal (false).

bool get_minimized () const
 Returns true if the window is minimized.

bool has_minimized () const
 Returns true if set_minimized() has been specified.

void clear_minimized ()
 Removes the minimized specification from the properties.

void set_open (bool open)
 Specifies whether the window should be open.

bool get_open () const
 Returns true if the window is open.

bool has_open () const
 Returns true if set_open() has been specified.

void clear_open ()
 Removes the open specification from the properties.

void set_cursor_hidden (bool cursor_hidden)
 Specifies whether the mouse cursor should be visible.

bool get_cursor_hidden () const
 Returns true if the mouse cursor is invisible.

bool has_cursor_hidden () const
 Returns true if set_cursor_hidden() has been specified.

void clear_cursor_hidden ()
 Removes the cursor_hidden specification from the properties.

void add_properties (const WindowProperties &other)
 Sets any properties that are explicitly specified in other on this object.

void output (ostream &out) const
 Sets any properties that are explicitly specified in other on this object.


Private Types

enum  Specified {
  S_origin = 0x0001, S_size = 0x0002, S_title = 0x0004, S_undecorated = 0x0008,
  S_fullscreen = 0x0010, S_foreground = 0x0020, S_minimized = 0x0040, S_open = 0x0080,
  S_cursor_hidden = 0x0100
}
enum  Flags {
  F_undecorated = S_undecorated, F_fullscreen = S_fullscreen, F_foreground = S_foreground, F_minimized = S_minimized,
  F_open = S_open, F_cursor_hidden = S_cursor_hidden
}

Private Attributes

int _specified
int _x_origin
int _y_origin
int _x_size
int _y_size
string _title
int _flags


Detailed Description

A container for the various kinds of properties we might ask to have on a graphics window before we open it.

This also serves to hold the current properties for a window after it has been opened.

Definition at line 40 of file windowProperties.h.


Member Enumeration Documentation

enum WindowProperties::Flags [private]
 

Enumeration values:
F_undecorated 
F_fullscreen 
F_foreground 
F_minimized 
F_open 
F_cursor_hidden 

Definition at line 123 of file windowProperties.h.

enum WindowProperties::Specified [private]
 

Enumeration values:
S_origin 
S_size 
S_title 
S_undecorated 
S_fullscreen 
S_foreground 
S_minimized 
S_open 
S_cursor_hidden 

Definition at line 108 of file windowProperties.h.


Constructor & Destructor Documentation

WindowProperties::WindowProperties  ) 
 

Definition at line 33 of file windowProperties.cxx.

References _specified, _title, _x_origin, _x_size, _y_origin, and _y_size.

WindowProperties::WindowProperties const WindowProperties &  copy  )  [inline]
 

Definition at line 31 of file windowProperties.I.

References INLINE.

WindowProperties::~WindowProperties  )  [inline]
 

Definition at line 43 of file windowProperties.I.

References INLINE, and operator==().


Member Function Documentation

void WindowProperties::add_properties const WindowProperties &  other  ) 
 

Sets any properties that are explicitly specified in other on this object.

Leaves other properties unchanged.

Definition at line 109 of file windowProperties.cxx.

References get_minimized(), and set_minimized().

Referenced by GraphicsWindow::clear(), GraphicsWindow::clear_rejected_properties(), and GraphicsWindow::verify_window_sizes().

void WindowProperties::clear  ) 
 

Unsets all properties that have been specified so far, and resets the WindowProperties structure to its initial empty state.

Definition at line 86 of file windowProperties.cxx.

References get_foreground(), get_fullscreen(), get_title(), get_undecorated(), get_x_origin(), get_x_size(), get_y_origin(), get_y_size(), has_foreground(), has_fullscreen(), has_origin(), has_size(), has_title(), has_undecorated(), set_foreground(), set_fullscreen(), set_origin(), set_size(), set_title(), and set_undecorated().

Referenced by GraphicsWindow::verify_window_sizes().

void WindowProperties::clear_cursor_hidden  )  [inline]
 

Removes the cursor_hidden specification from the properties.

Definition at line 663 of file windowProperties.I.

void WindowProperties::clear_foreground  )  [inline]
 

Removes the foreground specification from the properties.

Definition at line 483 of file windowProperties.I.

void WindowProperties::clear_fullscreen  )  [inline]
 

Removes the fullscreen specification from the properties.

Definition at line 421 of file windowProperties.I.

References _flags, _specified, F_open, INLINE, and S_open.

void WindowProperties::clear_minimized  )  [inline]
 

Removes the minimized specification from the properties.

Definition at line 543 of file windowProperties.I.

void WindowProperties::clear_open  )  [inline]
 

Removes the open specification from the properties.

Definition at line 605 of file windowProperties.I.

void WindowProperties::clear_origin  )  [inline]
 

Removes the origin specification from the properties.

Definition at line 152 of file windowProperties.I.

References _y_size, has_size(), INLINE, and nassertr.

Referenced by GraphicsWindow::clear().

void WindowProperties::clear_size  )  [inline]
 

Removes the size specification from the properties.

Definition at line 237 of file windowProperties.I.

References _flags, _specified, F_undecorated, INLINE, and S_undecorated.

Referenced by GraphicsWindow::clear().

void WindowProperties::clear_title  )  [inline]
 

Removes the title specification from the properties.

Definition at line 297 of file windowProperties.I.

References _flags, F_fullscreen, and INLINE.

void WindowProperties::clear_undecorated  )  [inline]
 

Removes the undecorated specification from the properties.

Definition at line 359 of file windowProperties.I.

References _specified, INLINE, and S_foreground.

bool WindowProperties::get_cursor_hidden  )  const [inline]
 

Returns true if the mouse cursor is invisible.

Definition at line 637 of file windowProperties.I.

bool WindowProperties::get_foreground  )  const [inline]
 

Returns true if the window is in the foreground.

Definition at line 457 of file windowProperties.I.

Referenced by clear().

bool WindowProperties::get_fullscreen  )  const [inline]
 

Returns true if the window is in fullscreen mode.

Definition at line 395 of file windowProperties.I.

References _flags, F_minimized, and INLINE.

Referenced by clear().

bool WindowProperties::get_minimized  )  const [inline]
 

Returns true if the window is minimized.

Definition at line 517 of file windowProperties.I.

References output().

Referenced by add_properties(), and glxGraphicsWindow::open_window().

bool WindowProperties::get_open  )  const [inline]
 

Returns true if the window is open.

Definition at line 579 of file windowProperties.I.

const string & WindowProperties::get_title  )  const [inline]
 

Returns the window's title.

Definition at line 268 of file windowProperties.I.

References _flags, _specified, F_undecorated, INLINE, and S_undecorated.

Referenced by clear(), and glxGraphicsWindow::open_window().

bool WindowProperties::get_undecorated  )  const [inline]
 

Returns true if the window has no border.

Definition at line 333 of file windowProperties.I.

References _flags, _specified, F_foreground, INLINE, and S_foreground.

Referenced by clear(), glxGraphicsWindow::open_window(), and WinGraphicsWindow::reconsider_fullscreen_size().

int WindowProperties::get_x_origin  )  const [inline]
 

Returns the x coordinate of the window's top-left corner, not including decorations.

Definition at line 107 of file windowProperties.I.

References _specified, and S_origin.

Referenced by clear(), GraphicsWindow::clear(), wdxGraphicsWindow8::end_flip(), and glxGraphicsWindow::open_window().

int WindowProperties::get_x_size  )  const [inline]
 

Returns size in pixels in the x dimension of the useful part of the window, not including decorations.

That is, this is the window's width.

Definition at line 190 of file windowProperties.I.

References _specified, _title, INLINE, and S_title.

Referenced by GraphicsWindow::begin_flip(), clear(), GraphicsWindow::clear(), wdxGraphicsWindow8::end_flip(), DisplayRegion::get_bottom(), GraphicsWindow::get_mouse_data(), DisplayRegion::get_pipe(), GraphicsWindow::has_pointer(), glxGraphicsWindow::open_window(), WindowFramework::set_one_sided_reverse(), and MouseAndKeyboard::set_source().

int WindowProperties::get_y_origin  )  const [inline]
 

Returns the y coordinate of the window's top-left corner, not including decorations.

Definition at line 123 of file windowProperties.I.

References _specified, _x_size, _y_size, INLINE, and S_size.

Referenced by clear(), GraphicsWindow::clear(), wdxGraphicsWindow8::end_flip(), and glxGraphicsWindow::open_window().

int WindowProperties::get_y_size  )  const [inline]
 

Returns size in pixels in the y dimension of the useful part of the window, not including decorations.

That is, this is the window's height.

Definition at line 208 of file windowProperties.I.

References _specified, INLINE, and S_title.

Referenced by GraphicsWindow::begin_flip(), clear(), GraphicsWindow::clear(), wdxGraphicsWindow8::end_flip(), DisplayRegion::get_bottom(), GraphicsWindow::get_mouse_data(), DisplayRegion::get_pipe(), GraphicsWindow::has_pointer(), glxGraphicsWindow::open_window(), and WindowFramework::set_one_sided_reverse().

bool WindowProperties::has_cursor_hidden  )  const [inline]
 

Returns true if set_cursor_hidden() has been specified.

Definition at line 650 of file windowProperties.I.

bool WindowProperties::has_foreground  )  const [inline]
 

Returns true if set_foreground() has been specified.

Definition at line 470 of file windowProperties.I.

References _flags, _specified, F_cursor_hidden, INLINE, and S_cursor_hidden.

Referenced by clear().

bool WindowProperties::has_fullscreen  )  const [inline]
 

Returns true if set_fullscreen() has been specified.

Definition at line 408 of file windowProperties.I.

References _specified, and S_minimized.

Referenced by clear().

bool WindowProperties::has_minimized  )  const [inline]
 

Returns true if set_minimized() has been specified.

Definition at line 530 of file windowProperties.I.

Referenced by glxGraphicsWindow::open_window().

bool WindowProperties::has_open  )  const [inline]
 

Returns true if set_open() has been specified.

Definition at line 592 of file windowProperties.I.

bool WindowProperties::has_origin  )  const [inline]
 

Returns true if the window origin has been specified, false otherwise.

Definition at line 139 of file windowProperties.I.

References _x_size, has_size(), INLINE, and nassertr.

Referenced by clear(), GraphicsWindow::clear(), glxGraphicsWindow::open_window(), and set_origin().

bool WindowProperties::has_size  )  const [inline]
 

Returns true if the window size has been specified, false otherwise.

Definition at line 224 of file windowProperties.I.

References _specified, _title, INLINE, and S_title.

Referenced by clear(), GraphicsWindow::clear(), clear_origin(), DisplayRegion::get_pipe(), has_origin(), glxGraphicsWindow::open_window(), and WindowFramework::set_one_sided_reverse().

bool WindowProperties::has_title  )  const [inline]
 

Returns true if the window title has been specified, false otherwise.

Definition at line 284 of file windowProperties.I.

References _flags, _specified, F_fullscreen, INLINE, and S_fullscreen.

Referenced by clear(), and glxGraphicsWindow::open_window().

bool WindowProperties::has_undecorated  )  const [inline]
 

Returns true if set_undecorated() has been specified.

Definition at line 346 of file windowProperties.I.

References _flags, F_foreground, and INLINE.

Referenced by clear(), and WinGraphicsWindow::reconsider_fullscreen_size().

bool WindowProperties::is_any_specified  )  const [inline]
 

Returns true if any properties have been specified, false otherwise.

Definition at line 69 of file windowProperties.I.

References _specified, _x_origin, _y_origin, INLINE, and S_origin.

Referenced by GraphicsWindow::verify_window_sizes().

bool WindowProperties::operator!= const WindowProperties &  other  )  const [inline]
 

Definition at line 54 of file windowProperties.I.

References _specified, and INLINE.

void WindowProperties::operator= const WindowProperties &  copy  ) 
 

Definition at line 45 of file windowProperties.cxx.

References _flags.

bool WindowProperties::operator== const WindowProperties &  other  )  const
 

Definition at line 63 of file windowProperties.cxx.

References _flags, _specified, _title, _x_origin, _x_size, _y_origin, and _y_size.

Referenced by ~WindowProperties().

void WindowProperties::output ostream &  out  )  const
 

Sets any properties that are explicitly specified in other on this object.

Leaves other properties unchanged.

Definition at line 152 of file windowProperties.cxx.

Referenced by get_minimized().

void WindowProperties::set_cursor_hidden bool  cursor_hidden  )  [inline]
 

Specifies whether the mouse cursor should be visible.

Definition at line 619 of file windowProperties.I.

void WindowProperties::set_foreground bool  foreground  )  [inline]
 

Specifies whether the window should be opened in the foreground (true), or left in the background (false).

Definition at line 439 of file windowProperties.I.

References _flags, F_open, and INLINE.

Referenced by clear().

void WindowProperties::set_fullscreen bool  fullscreen  )  [inline]
 

Specifies whether the window should be opened in fullscreen mode (true) or normal windowed mode (false, the default).

Definition at line 377 of file windowProperties.I.

References _flags, _specified, F_minimized, INLINE, and S_minimized.

Referenced by clear().

void WindowProperties::set_minimized bool  minimized  )  [inline]
 

Specifies whether the window should be created minimized (true), or normal (false).

Definition at line 499 of file windowProperties.I.

References _specified, INLINE, and S_cursor_hidden.

Referenced by add_properties().

void WindowProperties::set_open bool  open  )  [inline]
 

Specifies whether the window should be open.

It is legal to create a GraphicsWindow in the closed state, and later request it to open by changing this flag.

Definition at line 561 of file windowProperties.I.

void WindowProperties::set_origin int  x_origin,
int  y_origin
[inline]
 

Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window should appear.

This is the origin of the top-left corner of the useful part of the window, not including decorations.

Definition at line 90 of file windowProperties.I.

References _y_origin, has_origin(), INLINE, and nassertr.

Referenced by clear(), GraphicsWindow::clear(), and WinGraphicsWindow::fullscreen_minimized().

void WindowProperties::set_size int  x_size,
int  y_size
[inline]
 

Specifies the requested size of the window, in pixels.

This is the size of the useful part of the window, not including decorations.

Definition at line 171 of file windowProperties.I.

References _specified, and S_size.

Referenced by clear(), GraphicsWindow::clear(), and WinGraphicsWindow::fullscreen_minimized().

void WindowProperties::set_title const string &  title  )  [inline]
 

Specifies the title that should be assigned to the window.

Definition at line 254 of file windowProperties.I.

References _flags, and F_undecorated.

Referenced by clear().

void WindowProperties::set_undecorated bool  undecorated  )  [inline]
 

Specifies whether the window should be created with a visible title and border (false, the default) or not (true).

Definition at line 315 of file windowProperties.I.

References _flags, _specified, F_fullscreen, INLINE, and S_fullscreen.

Referenced by clear().


Member Data Documentation

int WindowProperties::_flags [private]
 

Definition at line 138 of file windowProperties.h.

Referenced by clear_fullscreen(), clear_size(), clear_title(), get_fullscreen(), get_title(), get_undecorated(), has_foreground(), has_title(), has_undecorated(), operator=(), operator==(), set_foreground(), set_fullscreen(), set_title(), and set_undecorated().

int WindowProperties::_specified [private]
 

Definition at line 132 of file windowProperties.h.

Referenced by clear_fullscreen(), clear_size(), clear_undecorated(), get_title(), get_undecorated(), get_x_origin(), get_x_size(), get_y_origin(), get_y_size(), has_foreground(), has_fullscreen(), has_size(), has_title(), is_any_specified(), operator!=(), operator==(), set_fullscreen(), set_minimized(), set_size(), set_undecorated(), and WindowProperties().

string WindowProperties::_title [private]
 

Definition at line 137 of file windowProperties.h.

Referenced by get_x_size(), has_size(), operator==(), and WindowProperties().

int WindowProperties::_x_origin [private]
 

Definition at line 133 of file windowProperties.h.

Referenced by is_any_specified(), operator==(), and WindowProperties().

int WindowProperties::_x_size [private]
 

Definition at line 135 of file windowProperties.h.

Referenced by get_y_origin(), has_origin(), operator==(), and WindowProperties().

int WindowProperties::_y_origin [private]
 

Definition at line 134 of file windowProperties.h.

Referenced by is_any_specified(), operator==(), set_origin(), and WindowProperties().

int WindowProperties::_y_size [private]
 

Definition at line 136 of file windowProperties.h.

Referenced by clear_origin(), get_y_origin(), operator==(), and WindowProperties().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:56:28 2003 for Panda by doxygen1.3