static const class _left{} left;
static const class _center{} center;
static const class _right{} right;
-
- background_position(const _left &) : _base("background-position", "left") {}
- background_position(const _center &) : _base("background-position", "center") {}
- background_position(const _right &) : _base("background-position", "right") {}
+ static const class _top{} top;
+ static const class _bottom{} bottom;
+ private:
+ const char* _horizontal(const _left &){ return "left"; }
+ const char* _horizontal(const _center &){ return "center"; }
+ const char* _horizontal(const _right &){ return "right"; }
+ const char* _vertical(const _top &){ return "top"; }
+ const char* _vertical(const _center &){ return "center"; }
+ const char* _vertical(const _bottom &){ return "bottom"; }
+
+ ::std::string _composite(const char* horizontal, const char* vertical){
+ ::std::string s(horizontal);
+ s += ' ';
+ s += vertical;
+ return s;
+ }
+ public:
+ template <typename T1, typename T2>
+ background_position(const T1 &t1, const T2 &t2) : _base("background-position", _composite(_horizontal(t1), _vertical(t2)).c_str() ) {}
};
const background_position::_left background_position::left;
const background_position::_center background_position::center;
const background_position::_right background_position::right;
+ const background_position::_top background_position::top;
+ const background_position::_bottom background_position::bottom;
/*
\83}\81[\83W\83\93
margin