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

panda/src/display/windowProperties.h

Go to the documentation of this file.
00001 // Filename: windowProperties.h
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 #ifndef WINDOWPROPERTIES_H
00020 #define WINDOWPROPERTIES_H
00021 
00022 #include "pandabase.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : WindowProperties
00026 // Description : A container for the various kinds of properties we
00027 //               might ask to have on a graphics window before we open
00028 //               it.  This also serves to hold the current properties
00029 //               for a window after it has been opened.
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDA WindowProperties {
00032 PUBLISHED:
00033   WindowProperties();
00034   INLINE WindowProperties(const WindowProperties &copy);
00035   void operator = (const WindowProperties &copy);
00036   INLINE ~WindowProperties();
00037 
00038   bool operator == (const WindowProperties &other) const;
00039   INLINE bool operator != (const WindowProperties &other) const;
00040 
00041   void clear();
00042   INLINE bool is_any_specified() const;
00043   
00044   INLINE void set_origin(int x_origin, int y_origin);
00045   INLINE int get_x_origin() const;
00046   INLINE int get_y_origin() const;
00047   INLINE bool has_origin() const;
00048   INLINE void clear_origin();
00049 
00050   INLINE void set_size(int x_size, int y_size);
00051   INLINE int get_x_size() const;
00052   INLINE int get_y_size() const;
00053   INLINE bool has_size() const;
00054   INLINE void clear_size();
00055 
00056   INLINE void set_title(const string &title);
00057   INLINE const string &get_title() const;
00058   INLINE bool has_title() const;
00059   INLINE void clear_title();
00060 
00061   INLINE void set_undecorated(bool undecorated);
00062   INLINE bool get_undecorated() const;
00063   INLINE bool has_undecorated() const;
00064   INLINE void clear_undecorated();
00065 
00066   INLINE void set_fullscreen(bool fullscreen);
00067   INLINE bool get_fullscreen() const;
00068   INLINE bool has_fullscreen() const;
00069   INLINE void clear_fullscreen();
00070 
00071   INLINE void set_foreground(bool foreground);
00072   INLINE bool get_foreground() const;
00073   INLINE bool has_foreground() const;
00074   INLINE void clear_foreground();
00075 
00076   INLINE void set_minimized(bool minimized);
00077   INLINE bool get_minimized() const;
00078   INLINE bool has_minimized() const;
00079   INLINE void clear_minimized();
00080 
00081   INLINE void set_open(bool open);
00082   INLINE bool get_open() const;
00083   INLINE bool has_open() const;
00084   INLINE void clear_open();
00085 
00086   INLINE void set_cursor_hidden(bool cursor_hidden);
00087   INLINE bool get_cursor_hidden() const;
00088   INLINE bool has_cursor_hidden() const;
00089   INLINE void clear_cursor_hidden();
00090 
00091   void add_properties(const WindowProperties &other);
00092 
00093   void output(ostream &out) const;
00094   
00095 private:
00096   // This bitmask indicates which of the parameters in the properties
00097   // structure have been filled in by the user, and which remain
00098   // unspecified.
00099   enum Specified {
00100     S_origin           = 0x0001,
00101     S_size             = 0x0002,
00102     S_title            = 0x0004,
00103     S_undecorated      = 0x0008,
00104     S_fullscreen       = 0x0010,
00105     S_foreground       = 0x0020,
00106     S_minimized        = 0x0040,
00107     S_open             = 0x0080,
00108     S_cursor_hidden    = 0x0100,
00109   };
00110 
00111   // This bitmask represents the true/false settings for various
00112   // boolean flags (assuming the corresponding S_* bit has been set,
00113   // above).
00114   enum Flags {
00115     F_undecorated    = S_undecorated,
00116     F_fullscreen     = S_fullscreen,
00117     F_foreground     = S_foreground,
00118     F_minimized      = S_minimized,
00119     F_open           = S_open,
00120     F_cursor_hidden  = S_cursor_hidden,
00121   };
00122 
00123   int _specified;
00124   int _x_origin;
00125   int _y_origin;
00126   int _x_size;
00127   int _y_size;
00128   string _title;
00129   int _flags;
00130 };
00131 
00132 INLINE ostream &operator << (ostream &out, const WindowProperties &properties);
00133 
00134 #include "windowProperties.I"
00135 
00136 #endif

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