00001 #ifndef SGE_GUI_SIZE_POLICY_HPP_INCLUDED 00002 #define SGE_GUI_SIZE_POLICY_HPP_INCLUDED 00003 00004 #include "../bitfield.hpp" 00005 // hrhr, no impl crap for me! 00006 #include "../bitfield_impl.hpp" 00007 #include "../export.hpp" 00008 #include <cstddef> 00009 00010 namespace sge 00011 { 00012 namespace gui 00013 { 00014 namespace axis_policy 00015 { 00016 enum internal_type { none,can_grow,can_shrink,should_grow,size }; 00017 typedef bitfield<internal_type,size> type; 00018 }; 00019 00020 class size_policy 00021 { 00022 public: 00023 SGE_SYMBOL size_policy(axis_policy::type const &x,axis_policy::type const &y); 00024 axis_policy::type const &x() const { return x_; } 00025 axis_policy::type const &y() const { return y_; } 00026 // this is a hack so we can use it with the layouts::row::master stuff 00027 axis_policy::type const &index(std::size_t const i) const 00028 { 00029 return i == static_cast<std::size_t>(0) ? x() : y(); 00030 } 00031 00032 static size_policy const default_policy; 00033 private: 00034 axis_policy::type x_,y_; 00035 }; 00036 } 00037 } 00038 00039 #endif
1.5.5