OSDN Git Service

web/css/attr_text.hpp: vertical_align対応
authorMyun2 <myun2@nwhite.info>
Thu, 30 Dec 2010 05:25:26 +0000 (14:25 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 30 Dec 2010 05:25:26 +0000 (14:25 +0900)
roast/include/roast/web/css/attr_text.hpp
roast/test/lexical_test/css_test.cpp

index 2f56d21..6f31d04 100644 (file)
@@ -22,10 +22,13 @@ namespace roast
                                ROAST_LEXICAL_FIXSTR(font_variant,                      "font-variant")
                                ROAST_LEXICAL_FIXSTR(font_weight,                       "font-weight")
                                ROAST_LEXICAL_FIXSTR(font_size,                         "font-size")
-                               ROAST_LEXICAL_FIXSTR(line_height,                       "line-height")
                                ROAST_LEXICAL_FIXSTR(font_family,                       "font-family")
                                ROAST_LEXICAL_FIXSTR(font_stretch,                      "font-stretch")
                                ROAST_LEXICAL_FIXSTR(font_size_adjust,          "font-size-adjust")
+                               
+                               ROAST_LEXICAL_FIXSTR(line_height,                       "line-height")
+                               ROAST_LEXICAL_FIXSTR(vertical_align,            "vertical-align")
+                               
                                ROAST_LEXICAL_FIXSTR(text_indent,                       "text-indent")
                                ROAST_LEXICAL_FIXSTR(text_align,                        "text-align")
                                ROAST_LEXICAL_FIXSTR(text_justify,                      "text-justify")
@@ -353,10 +356,22 @@ namespace roast
                        //      line_height
                        template <typename _Height>
                        struct line_height_ : declaration_<_attrname_str::line_height, _Height> {};
-                       /*
-                               'vertical-align'
-                               baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit
-               */
+                       
+                       //      vertical_align
+                       template <typename _Value>      //      defines or <percentage> | <length>
+                       struct vertical_align_ : declaration_<_attrname_str::vertical_align, _Value>
+                       {
+                               ROAST_CSS_STR_DEF(baseline)
+                               ROAST_CSS_STR_DEF(sub)
+                               ROAST_CSS_STR_DEF(super)
+                               ROAST_CSS_STR_DEF(top)
+                               ROAST_LEXICAL_FIXSTR(text_top, "text-top")
+                               ROAST_CSS_STR_DEF(middle)
+                               ROAST_CSS_STR_DEF(bottom)
+                               ROAST_LEXICAL_FIXSTR(text_bottom, "text-bottom")
+                               ROAST_CSS_STR_DEF(inherit)
+                       };
+                       typedef vertical_align_<_true_analyze> vertical_align;
                
                //      16 Text / (C3) 3.11. Text
                /*
index 277bb37..7c72ffa 100644 (file)
@@ -36,7 +36,8 @@ int main()
        //padding_<px_<10>, px_<10>, px_<10> > a;
        //color_<colorval_per<33,44,66> > a;
        //border_color_<border_color::threedshadow> a;
-       line_height_<hoge> a;
+       //line_height_<hoge> a;
+       vertical_align_<vertical_align::bottom> a;
        //padding_px_<10,20,30,8> a;
        //color_<0xFF88DA>
        //top_<chex_string<0xFF88DA> > a;