diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-11 17:46:32 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-11 17:46:32 +0000 |
commit | 1617f3813486071779fe3ff6c724dcd6ae3f6223 (patch) | |
tree | 2692d0d051773ef6f9a81d93caf838c7074654f0 /src/select/propset.h | |
parent | 95106ec57637a13990f644f2a0c574164ac9a20a (diff) | |
download | libcss-1617f3813486071779fe3ff6c724dcd6ae3f6223.tar.gz libcss-1617f3813486071779fe3ff6c724dcd6ae3f6223.tar.bz2 |
Change encoding of font-family
Move list-style-position to make room for it.
svn path=/trunk/libcss/; revision=6440
Diffstat (limited to 'src/select/propset.h')
-rw-r--r-- | src/select/propset.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/select/propset.h b/src/select/propset.h index c60d7e5..3a73044 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -509,27 +509,6 @@ static inline css_error set_list_style_image( #undef LIST_STYLE_IMAGE_SHIFT #undef LIST_STYLE_IMAGE_INDEX -#define FONT_FAMILY_INDEX 5 -#define FONT_FAMILY_SHIFT 0 -#define FONT_FAMILY_MASK 0x1 -static inline css_error set_font_family( - css_computed_style *style, uint8_t type, - css_string *names) -{ - uint8_t *bits = &style->bits[FONT_FAMILY_INDEX]; - - /* 1bit: type */ - *bits = (*bits & ~FONT_FAMILY_MASK) | - ((type & 0x1) << FONT_FAMILY_SHIFT); - - style->font_family = names; - - return CSS_OK; -} -#undef FONT_FAMILY_MASK -#undef FONT_FAMILY_SHIFT -#undef FONT_FAMILY_INDEX - #define TOP_INDEX 6 #define TOP_SHIFT 2 #define TOP_MASK 0xfc @@ -1419,23 +1398,26 @@ static inline css_error set_text_decoration( #undef TEXT_DECORATION_SHIFT #undef TEXT_DECORATION_INDEX -#define LIST_STYLE_POSITION_INDEX 28 -#define LIST_STYLE_POSITION_SHIFT 1 -#define LIST_STYLE_POSITION_MASK 0x3 -static inline css_error set_list_style_position( - css_computed_style *style, uint8_t type) +#define FONT_FAMILY_INDEX 28 +#define FONT_FAMILY_SHIFT 0 +#define FONT_FAMILY_MASK 0x7 +static inline css_error set_font_family( + css_computed_style *style, uint8_t type, + css_string *names) { - uint8_t *bits = &style->bits[LIST_STYLE_POSITION_INDEX]; + uint8_t *bits = &style->bits[FONT_FAMILY_INDEX]; - /* 2bits: type */ - *bits = (*bits & ~LIST_STYLE_POSITION_MASK) | - ((type & 0x3) << LIST_STYLE_POSITION_SHIFT); + /* 3bits: type */ + *bits = (*bits & ~FONT_FAMILY_MASK) | + ((type & 0x7) << FONT_FAMILY_SHIFT); + + style->font_family = names; return CSS_OK; } -#undef LIST_STYLE_POSITION_MASK -#undef LIST_STYLE_POSITION_SHIFT -#undef LIST_STYLE_POSITION_INDEX +#undef FONT_FAMILY_MASK +#undef FONT_FAMILY_SHIFT +#undef FONT_FAMILY_INDEX #define BORDER_TOP_STYLE_INDEX 29 #define BORDER_TOP_STYLE_SHIFT 4 @@ -1617,4 +1599,22 @@ static inline css_error set_visibility( #undef VISIBILITY_SHIFT #undef VISIBILITY_INDEX +#define LIST_STYLE_POSITION_INDEX 33 +#define LIST_STYLE_POSITION_SHIFT 4 +#define LIST_STYLE_POSITION_MASK 0x30 +static inline css_error set_list_style_position( + css_computed_style *style, uint8_t type) +{ + uint8_t *bits = &style->bits[LIST_STYLE_POSITION_INDEX]; + + /* 2bits: type */ + *bits = (*bits & ~LIST_STYLE_POSITION_MASK) | + ((type & 0x3) << LIST_STYLE_POSITION_SHIFT); + + return CSS_OK; +} +#undef LIST_STYLE_POSITION_MASK +#undef LIST_STYLE_POSITION_SHIFT +#undef LIST_STYLE_POSITION_INDEX + #endif |