00001 // /////////////////////////////////////////////////////////////////////////// 00002 // xrb_sizeproperties.hpp by Victor Dods, created 2005/06/12 00003 // /////////////////////////////////////////////////////////////////////////// 00004 // Unless a different license was explicitly granted in writing by the 00005 // copyright holder (Victor Dods), this software is freely distributable under 00006 // the terms of the GNU General Public License, version 2. Any works deriving 00007 // from this work must also be released under the GNU GPL. See the included 00008 // file LICENSE for details. 00009 // /////////////////////////////////////////////////////////////////////////// 00010 00011 #if !defined(_XRB_SIZEPROPERTIES_HPP_) 00012 #define _XRB_SIZEPROPERTIES_HPP_ 00013 00014 #include "xrb.hpp" 00015 00016 #include "xrb_ntuple.hpp" 00017 #include "xrb_screencoord.hpp" 00018 00019 namespace Xrb 00020 { 00021 00025 class SizeProperties 00026 { 00027 public: 00028 00034 enum Property 00035 { 00036 MIN = 0, 00037 MAX 00038 }; // end of enum Property 00039 00044 Bool2 m_min_size_enabled; 00051 ScreenCoordVector2 m_min_size; 00056 Bool2 m_max_size_enabled; 00063 ScreenCoordVector2 m_max_size; 00066 ScreenCoord const *m_data; 00067 00073 SizeProperties (); 00077 inline ~SizeProperties () { } 00078 00082 static inline ScreenCoord DefaultMinSizeComponent () 00083 { 00084 return 0; 00085 } 00089 static inline ScreenCoord DefaultMaxSizeComponent () 00090 { 00091 return SCREENCOORD_UPPER_BOUND; 00092 } 00098 ScreenCoord AdjustedSizeComponent ( 00099 Uint32 index, 00100 ScreenCoord component) const; 00105 ScreenCoordVector2 AdjustedSize ( 00106 ScreenCoordVector2 const &size) const; 00107 00112 void AdjustSizeComponent (Uint32 index, ScreenCoord *component) const; 00116 void AdjustSize (ScreenCoordVector2 *size) const; 00117 }; // end of class SizeProperties 00118 00119 } // end of namespace Xrb 00120 00121 #endif // !defined(_XRB_SIZEPROPERTIES_HPP_) 00122