summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-06 19:41:17 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-06 19:41:17 +0000
commit098f4a78b137fed71711f6c19d2721a1d60ddf1d (patch)
tree5bb349046283f627ec2d703d0ad514c4b61010c6 /include
parent716572fc56ab2da651ce036a19b556106f8bc453 (diff)
downloadlibcss-098f4a78b137fed71711f6c19d2721a1d60ddf1d.tar.gz
libcss-098f4a78b137fed71711f6c19d2721a1d60ddf1d.tar.bz2
More accessors
svn path=/trunk/libcss/; revision=6384
Diffstat (limited to 'include')
-rw-r--r--include/libcss/computed.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index b2a8c0d..2d9e672 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -1693,5 +1693,72 @@ static inline uint8_t css_computed_background_position(
#undef BACKGROUND_POSITION_SHIFT
#undef BACKGROUND_POSITION_INDEX
+#define DISPLAY_INDEX 27
+#define DISPLAY_SHIFT 2
+#define DISPLAY_MASK 0x7c
+static inline uint8_t css_computed_display(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[DISPLAY_INDEX];
+ bits &= DISPLAY_MASK;
+ bits >>= DISPLAY_SHIFT;
+
+ /* 5bits: type */
+ return bits;
+}
+#undef DISPLAY_MASK
+#undef DISPLAY_SHIFT
+#undef DISPLAY_INDEX
+
+#define FONT_VARIANT_INDEX 27
+#define FONT_VARIANT_SHIFT 0
+#define FONT_VARIANT_MASK 0x3
+static inline uint8_t css_computed_font_variant(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[FONT_VARIANT_INDEX];
+ bits &= FONT_VARIANT_MASK;
+ bits >>= FONT_VARIANT_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+}
+#undef FONT_VARIANT_MASK
+#undef FONT_VARIANT_SHIFT
+#undef FONT_VARIANT_INDEX
+
+#define TEXT_DECORATION_INDEX 28
+#define TEXT_DECORATION_SHIFT 3
+#define TEXT_DECORATION_MASK 0xf8
+static inline uint8_t css_computed_text_decoration(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[TEXT_DECORATION_INDEX];
+ bits &= TEXT_DECORATION_MASK;
+ bits >>= TEXT_DECORATION_SHIFT;
+
+ /* 5bits: type */
+ return bits;
+}
+#undef TEXT_DECORATION_MASK
+#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 uint8_t css_computed_list_style_position(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[LIST_STYLE_POSITION_INDEX];
+ bits &= LIST_STYLE_POSITION_MASK;
+ bits >>= LIST_STYLE_POSITION_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+}
+#undef LIST_STYLE_POSITION_MASK
+#undef LIST_STYLE_POSITION_SHIFT
+#undef LIST_STYLE_POSITION_INDEX
#endif