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

panda/src/display/windowProperties.I

Go to the documentation of this file.
00001 // Filename: windowProperties.I
00002 // Created by:  drose (13Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: WindowProperties::Copy Constructor
00022 //       Access: Published
00023 //  Description:
00024 ////////////////////////////////////////////////////////////////////
00025 INLINE WindowProperties::
00026 WindowProperties(const WindowProperties &copy) {
00027   (*this) = copy;
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: WindowProperties::Destructor
00032 //       Access: Published
00033 //  Description:
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE WindowProperties::
00036 ~WindowProperties() {
00037 }
00038 
00039 ////////////////////////////////////////////////////////////////////
00040 //     Function: WindowProperties::operator !=
00041 //       Access: Published
00042 //  Description:
00043 ////////////////////////////////////////////////////////////////////
00044 INLINE bool WindowProperties::
00045 operator != (const WindowProperties &other) const {
00046   return !operator == (other);
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: WindowProperties::is_any_specified
00051 //       Access: Published
00052 //  Description: Returns true if any properties have been specified,
00053 //               false otherwise.
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE bool WindowProperties::
00056 is_any_specified() const {
00057   return (_specified != 0);
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: WindowProperties::set_origin
00062 //       Access: Published
00063 //  Description: Specifies the origin on the screen (in pixels,
00064 //               relative to the top-left corner) at which the window
00065 //               should appear.  This is the origin of the top-left
00066 //               corner of the useful part of the window, not
00067 //               including decorations.
00068 ////////////////////////////////////////////////////////////////////
00069 INLINE void WindowProperties::
00070 set_origin(int x_origin, int y_origin) {
00071   _x_origin = x_origin;
00072   _y_origin = y_origin;
00073   _specified |= S_origin;
00074 }
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //     Function: WindowProperties::get_x_origin
00078 //       Access: Published
00079 //  Description: Returns the x coordinate of the window's top-left
00080 //               corner, not including decorations.
00081 ////////////////////////////////////////////////////////////////////
00082 INLINE int WindowProperties::
00083 get_x_origin() const {
00084   nassertr(has_origin(), 0);
00085   return _x_origin;
00086 }
00087 
00088 ////////////////////////////////////////////////////////////////////
00089 //     Function: WindowProperties::get_y_origin
00090 //       Access: Published
00091 //  Description: Returns the y coordinate of the window's top-left
00092 //               corner, not including decorations.
00093 ////////////////////////////////////////////////////////////////////
00094 INLINE int WindowProperties::
00095 get_y_origin() const {
00096   nassertr(has_origin(), 0);
00097   return _y_origin;
00098 }
00099 
00100 ////////////////////////////////////////////////////////////////////
00101 //     Function: WindowProperties::has_origin
00102 //       Access: Published
00103 //  Description: Returns true if the window origin has been specified,
00104 //               false otherwise.
00105 ////////////////////////////////////////////////////////////////////
00106 INLINE bool WindowProperties::
00107 has_origin() const {
00108   return ((_specified & S_origin) != 0);
00109 }
00110 
00111 ////////////////////////////////////////////////////////////////////
00112 //     Function: WindowProperties::clear_origin
00113 //       Access: Published
00114 //  Description: Removes the origin specification from the properties.
00115 ////////////////////////////////////////////////////////////////////
00116 INLINE void WindowProperties::
00117 clear_origin() {
00118   _specified &= ~S_origin;
00119   _x_origin = 0;
00120   _y_origin = 0;
00121 }
00122 
00123 ////////////////////////////////////////////////////////////////////
00124 //     Function: WindowProperties::set_size
00125 //       Access: Published
00126 //  Description: Specifies the requested size of the window, in
00127 //               pixels.  This is the size of the useful part of the
00128 //               window, not including decorations.
00129 ////////////////////////////////////////////////////////////////////
00130 INLINE void WindowProperties::
00131 set_size(int x_size, int y_size) {
00132   _x_size = x_size;
00133   _y_size = y_size;
00134   _specified |= S_size;
00135 }
00136 
00137 ////////////////////////////////////////////////////////////////////
00138 //     Function: WindowProperties::get_x_size
00139 //       Access: Published
00140 //  Description: Returns size in pixels in the x dimension of the
00141 //               useful part of the window, not including decorations.
00142 //               That is, this is the window's width.
00143 ////////////////////////////////////////////////////////////////////
00144 INLINE int WindowProperties::
00145 get_x_size() const {
00146   nassertr(has_size(), 0);
00147   return _x_size;
00148 }
00149 
00150 ////////////////////////////////////////////////////////////////////
00151 //     Function: WindowProperties::get_y_size
00152 //       Access: Published
00153 //  Description: Returns size in pixels in the y dimension of the
00154 //               useful part of the window, not including decorations.
00155 //               That is, this is the window's height.
00156 ////////////////////////////////////////////////////////////////////
00157 INLINE int WindowProperties::
00158 get_y_size() const {
00159   nassertr(has_size(), 0);
00160   return _y_size;
00161 }
00162 
00163 ////////////////////////////////////////////////////////////////////
00164 //     Function: WindowProperties::has_size
00165 //       Access: Published
00166 //  Description: Returns true if the window size has been specified,
00167 //               false otherwise.
00168 ////////////////////////////////////////////////////////////////////
00169 INLINE bool WindowProperties::
00170 has_size() const {
00171   return ((_specified & S_size) != 0);
00172 }
00173 
00174 ////////////////////////////////////////////////////////////////////
00175 //     Function: WindowProperties::clear_size
00176 //       Access: Published
00177 //  Description: Removes the size specification from the properties.
00178 ////////////////////////////////////////////////////////////////////
00179 INLINE void WindowProperties::
00180 clear_size() {
00181   _specified &= ~S_size;
00182   _x_size = 0;
00183   _y_size = 0;
00184 }
00185 
00186 ////////////////////////////////////////////////////////////////////
00187 //     Function: WindowProperties::set_title
00188 //       Access: Published
00189 //  Description: Specifies the title that should be assigned to the
00190 //               window.
00191 ////////////////////////////////////////////////////////////////////
00192 INLINE void WindowProperties::
00193 set_title(const string &title) {
00194   _title = title;
00195   _specified |= S_title;
00196 }
00197 
00198 ////////////////////////////////////////////////////////////////////
00199 //     Function: WindowProperties::get_title
00200 //       Access: Published
00201 //  Description: Returns the window's title.
00202 ////////////////////////////////////////////////////////////////////
00203 INLINE const string &WindowProperties::
00204 get_title() const {
00205   nassertr(has_title(), _title);
00206   return _title;
00207 }
00208 
00209 ////////////////////////////////////////////////////////////////////
00210 //     Function: WindowProperties::has_title
00211 //       Access: Published
00212 //  Description: Returns true if the window title has been specified,
00213 //               false otherwise.
00214 ////////////////////////////////////////////////////////////////////
00215 INLINE bool WindowProperties::
00216 has_title() const {
00217   return ((_specified & S_title) != 0);
00218 }
00219 
00220 ////////////////////////////////////////////////////////////////////
00221 //     Function: WindowProperties::clear_title
00222 //       Access: Published
00223 //  Description: Removes the title specification from the properties.
00224 ////////////////////////////////////////////////////////////////////
00225 INLINE void WindowProperties::
00226 clear_title() {
00227   _specified &= ~S_title;
00228   _title = string();
00229 }
00230 
00231 ////////////////////////////////////////////////////////////////////
00232 //     Function: WindowProperties::set_undecorated
00233 //       Access: Published
00234 //  Description: Specifies whether the window should be created with a
00235 //               visible title and border (false, the default) or not
00236 //               (true).
00237 ////////////////////////////////////////////////////////////////////
00238 INLINE void WindowProperties::
00239 set_undecorated(bool undecorated) {
00240   if (undecorated) {
00241     _flags |= F_undecorated;
00242   } else {
00243     _flags &= ~F_undecorated;
00244   }
00245   _specified |= S_undecorated;
00246 }
00247 
00248 ////////////////////////////////////////////////////////////////////
00249 //     Function: WindowProperties::get_undecorated
00250 //       Access: Published
00251 //  Description: Returns true if the window has no border.
00252 ////////////////////////////////////////////////////////////////////
00253 INLINE bool WindowProperties::
00254 get_undecorated() const {
00255   return (_flags & F_undecorated) != 0;
00256 }
00257 
00258 ////////////////////////////////////////////////////////////////////
00259 //     Function: WindowProperties::has_undecorated
00260 //       Access: Published
00261 //  Description: Returns true if set_undecorated() has been specified.
00262 ////////////////////////////////////////////////////////////////////
00263 INLINE bool WindowProperties::
00264 has_undecorated() const {
00265   return ((_specified & S_undecorated) != 0);
00266 }
00267 
00268 ////////////////////////////////////////////////////////////////////
00269 //     Function: WindowProperties::clear_undecorated
00270 //       Access: Published
00271 //  Description: Removes the undecorated specification from the properties.
00272 ////////////////////////////////////////////////////////////////////
00273 INLINE void WindowProperties::
00274 clear_undecorated() {
00275   _specified &= ~S_undecorated;
00276   _flags &= ~F_undecorated;
00277 }
00278 
00279 ////////////////////////////////////////////////////////////////////
00280 //     Function: WindowProperties::set_fullscreen
00281 //       Access: Published
00282 //  Description: Specifies whether the window should be opened in
00283 //               fullscreen mode (true) or normal windowed mode
00284 //               (false, the default).
00285 ////////////////////////////////////////////////////////////////////
00286 INLINE void WindowProperties::
00287 set_fullscreen(bool fullscreen) {
00288   if (fullscreen) {
00289     _flags |= F_fullscreen;
00290   } else {
00291     _flags &= ~F_fullscreen;
00292   }
00293   _specified |= S_fullscreen;
00294 }
00295 
00296 ////////////////////////////////////////////////////////////////////
00297 //     Function: WindowProperties::get_fullscreen
00298 //       Access: Published
00299 //  Description: Returns true if the window is in fullscreen mode.
00300 ////////////////////////////////////////////////////////////////////
00301 INLINE bool WindowProperties::
00302 get_fullscreen() const {
00303   return (_flags & F_fullscreen) != 0;
00304 }
00305 
00306 ////////////////////////////////////////////////////////////////////
00307 //     Function: WindowProperties::has_fullscreen
00308 //       Access: Published
00309 //  Description: Returns true if set_fullscreen() has been specified.
00310 ////////////////////////////////////////////////////////////////////
00311 INLINE bool WindowProperties::
00312 has_fullscreen() const {
00313   return ((_specified & S_fullscreen) != 0);
00314 }
00315 
00316 ////////////////////////////////////////////////////////////////////
00317 //     Function: WindowProperties::clear_fullscreen
00318 //       Access: Published
00319 //  Description: Removes the fullscreen specification from the properties.
00320 ////////////////////////////////////////////////////////////////////
00321 INLINE void WindowProperties::
00322 clear_fullscreen() {
00323   _specified &= ~S_fullscreen;
00324   _flags &= ~F_fullscreen;
00325 }
00326 
00327 ////////////////////////////////////////////////////////////////////
00328 //     Function: WindowProperties::set_foreground
00329 //       Access: Published
00330 //  Description: Specifies whether the window should be opened in
00331 //               the foreground (true), or left in the background
00332 //               (false).
00333 ////////////////////////////////////////////////////////////////////
00334 INLINE void WindowProperties::
00335 set_foreground(bool foreground) {
00336   if (foreground) {
00337     _flags |= F_foreground;
00338   } else {
00339     _flags &= ~F_foreground;
00340   }
00341   _specified |= S_foreground;
00342 }
00343 
00344 ////////////////////////////////////////////////////////////////////
00345 //     Function: WindowProperties::get_foreground
00346 //       Access: Published
00347 //  Description: Returns true if the window is in the foreground.
00348 ////////////////////////////////////////////////////////////////////
00349 INLINE bool WindowProperties::
00350 get_foreground() const {
00351   return (_flags & F_foreground) != 0;
00352 }
00353 
00354 ////////////////////////////////////////////////////////////////////
00355 //     Function: WindowProperties::has_foreground
00356 //       Access: Published
00357 //  Description: Returns true if set_foreground() has been specified.
00358 ////////////////////////////////////////////////////////////////////
00359 INLINE bool WindowProperties::
00360 has_foreground() const {
00361   return ((_specified & S_foreground) != 0);
00362 }
00363 
00364 ////////////////////////////////////////////////////////////////////
00365 //     Function: WindowProperties::clear_foreground
00366 //       Access: Published
00367 //  Description: Removes the foreground specification from the properties.
00368 ////////////////////////////////////////////////////////////////////
00369 INLINE void WindowProperties::
00370 clear_foreground() {
00371   _specified &= ~S_foreground;
00372   _flags &= ~F_foreground;
00373 }
00374 
00375 ////////////////////////////////////////////////////////////////////
00376 //     Function: WindowProperties::set_minimized
00377 //       Access: Published
00378 //  Description: Specifies whether the window should be created
00379 //               minimized (true), or normal (false).
00380 ////////////////////////////////////////////////////////////////////
00381 INLINE void WindowProperties::
00382 set_minimized(bool minimized) {
00383   if (minimized) {
00384     _flags |= F_minimized;
00385   } else {
00386     _flags &= ~F_minimized;
00387   }
00388   _specified |= S_minimized;
00389 }
00390 
00391 ////////////////////////////////////////////////////////////////////
00392 //     Function: WindowProperties::get_minimized
00393 //       Access: Published
00394 //  Description: Returns true if the window is minimized.
00395 ////////////////////////////////////////////////////////////////////
00396 INLINE bool WindowProperties::
00397 get_minimized() const {
00398   return (_flags & F_minimized) != 0;
00399 }
00400 
00401 ////////////////////////////////////////////////////////////////////
00402 //     Function: WindowProperties::has_minimized
00403 //       Access: Published
00404 //  Description: Returns true if set_minimized() has been specified.
00405 ////////////////////////////////////////////////////////////////////
00406 INLINE bool WindowProperties::
00407 has_minimized() const {
00408   return ((_specified & S_minimized) != 0);
00409 }
00410 
00411 ////////////////////////////////////////////////////////////////////
00412 //     Function: WindowProperties::clear_minimized
00413 //       Access: Published
00414 //  Description: Removes the minimized specification from the properties.
00415 ////////////////////////////////////////////////////////////////////
00416 INLINE void WindowProperties::
00417 clear_minimized() {
00418   _specified &= ~S_minimized;
00419   _flags &= ~F_minimized;
00420 }
00421 
00422 ////////////////////////////////////////////////////////////////////
00423 //     Function: WindowProperties::set_open
00424 //       Access: Published
00425 //  Description: Specifies whether the window should be open.  It is
00426 //               legal to create a GraphicsWindow in the closed state,
00427 //               and later request it to open by changing this flag.
00428 ////////////////////////////////////////////////////////////////////
00429 INLINE void WindowProperties::
00430 set_open(bool open) {
00431   if (open) {
00432     _flags |= F_open;
00433   } else {
00434     _flags &= ~F_open;
00435   }
00436   _specified |= S_open;
00437 }
00438 
00439 ////////////////////////////////////////////////////////////////////
00440 //     Function: WindowProperties::get_open
00441 //       Access: Published
00442 //  Description: Returns true if the window is open.
00443 ////////////////////////////////////////////////////////////////////
00444 INLINE bool WindowProperties::
00445 get_open() const {
00446   return (_flags & F_open) != 0;
00447 }
00448 
00449 ////////////////////////////////////////////////////////////////////
00450 //     Function: WindowProperties::has_open
00451 //       Access: Published
00452 //  Description: Returns true if set_open() has been specified.
00453 ////////////////////////////////////////////////////////////////////
00454 INLINE bool WindowProperties::
00455 has_open() const {
00456   return ((_specified & S_open) != 0);
00457 }
00458 
00459 ////////////////////////////////////////////////////////////////////
00460 //     Function: WindowProperties::clear_open
00461 //       Access: Published
00462 //  Description: Removes the open specification from the properties.
00463 ////////////////////////////////////////////////////////////////////
00464 INLINE void WindowProperties::
00465 clear_open() {
00466   _specified &= ~S_open;
00467   _flags &= ~F_open;
00468 }
00469 
00470 ////////////////////////////////////////////////////////////////////
00471 //     Function: WindowProperties::set_cursor_hidden
00472 //       Access: Published
00473 //  Description: Specifies whether the mouse cursor should be visible.
00474 ////////////////////////////////////////////////////////////////////
00475 INLINE void WindowProperties::
00476 set_cursor_hidden(bool cursor_hidden) {
00477   if (cursor_hidden) {
00478     _flags |= F_cursor_hidden;
00479   } else {
00480     _flags &= ~F_cursor_hidden;
00481   }
00482   _specified |= S_cursor_hidden;
00483 }
00484 
00485 ////////////////////////////////////////////////////////////////////
00486 //     Function: WindowProperties::set_cursor_hidden
00487 //       Access: Published
00488 //  Description: Returns true if the mouse cursor is invisible.
00489 ////////////////////////////////////////////////////////////////////
00490 INLINE bool WindowProperties::
00491 get_cursor_hidden() const {
00492   return (_flags & F_cursor_hidden) != 0;
00493 }
00494 
00495 ////////////////////////////////////////////////////////////////////
00496 //     Function: WindowProperties::has_cursor_hidden
00497 //       Access: Published
00498 //  Description: Returns true if set_cursor_hidden() has been specified.
00499 ////////////////////////////////////////////////////////////////////
00500 INLINE bool WindowProperties::
00501 has_cursor_hidden() const {
00502   return ((_specified & S_cursor_hidden) != 0);
00503 }
00504 
00505 ////////////////////////////////////////////////////////////////////
00506 //     Function: WindowProperties::clear_cursor_hidden
00507 //       Access: Published
00508 //  Description: Removes the cursor_hidden specification from the properties.
00509 ////////////////////////////////////////////////////////////////////
00510 INLINE void WindowProperties::
00511 clear_cursor_hidden() {
00512   _specified &= ~S_cursor_hidden;
00513   _flags &= ~F_cursor_hidden;
00514 }
00515 
00516 INLINE ostream &
00517 operator << (ostream &out, const WindowProperties &properties) {
00518   properties.output(out);
00519   return out;
00520 }

Generated on Fri May 2 00:36:36 2003 for Panda by doxygen1.3