diff --git a/ll.rs b/ll.rs index 149a048..0f010ae 100644 --- a/ll.rs +++ b/ll.rs @@ -301,6 +301,20 @@ pub mod properties { pub static CSS_COLOR_INHERIT: css_color_e = 0x0; pub static CSS_COLOR_COLOR: css_color_e = 0x1; + pub type css_border_style_e = c_enum; + + pub static CSS_BORDER_STYLE_INHERIT: css_border_style_e = 0x0; + pub static CSS_BORDER_STYLE_NONE: css_border_style_e = 0x1; + pub static CSS_BORDER_STYLE_HIDDEN: css_border_style_e = 0x2; + pub static CSS_BORDER_STYLE_DOTTED: css_border_style_e = 0x3; + pub static CSS_BORDER_STYLE_DASHED: css_border_style_e = 0x4; + pub static CSS_BORDER_STYLE_SOLID: css_border_style_e = 0x5; + pub static CSS_BORDER_STYLE_DOUBLE: css_border_style_e = 0x6; + pub static CSS_BORDER_STYLE_GROOVE: css_border_style_e = 0x7; + pub static CSS_BORDER_STYLE_RIDGE: css_border_style_e = 0x8; + pub static CSS_BORDER_STYLE_INSET: css_border_style_e = 0x9; + pub static CSS_BORDER_STYLE_OUTSET: css_border_style_e = 0xa; + pub type css_border_width_e = c_enum; pub static CSS_BORDER_WIDTH_INHERIT: css_border_width_e = 0x0; @@ -600,6 +614,10 @@ pub mod computed { pub fn css_computed_color(style: *css_computed_style, color: *mut css_color) -> uint8_t; pub fn css_computed_background_color(style: *css_computed_style, color: *mut css_color) -> uint8_t; + pub fn css_computed_border_top_style(style: *css_computed_style) -> uint8_t; + pub fn css_computed_border_right_style(style: *css_computed_style) -> uint8_t; + pub fn css_computed_border_bottom_style(style: *css_computed_style) -> uint8_t; + pub fn css_computed_border_left_style(style: *css_computed_style) -> uint8_t; pub fn css_computed_border_top_width(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; pub fn css_computed_border_right_width(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; pub fn css_computed_border_bottom_width(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; diff --git a/netsurfcss.rc b/netsurfcss.rc index adb837c..8930615 100644 --- a/netsurfcss.rc +++ b/netsurfcss.rc @@ -1107,7 +1107,7 @@ pub mod computed { use properties::CssPropFontSize; use hint::CssHint; use select::CssSelectResults; - use values::{CssColorValue, CssMarginValue, CssPaddingValue, CssBorderWidthValue, CssDisplayValue}; + use values::{CssColorValue, CssMarginValue, CssPaddingValue, CssBorderStyleValue, CssBorderWidthValue, CssDisplayValue}; use values::{CssFloatValue, CssClearValue, CssPositionValue, CssWidthValue, CssHeightValue, CssFontFamilyValue}; use values::{CssFontSizeValue, CssFontStyleValue, CssFontWeightValue, CssTextAlignValue, CssTextDecorationValue}; use values::{CssLineHeightValue, CssVerticalAlignValue}; @@ -1143,6 +1143,38 @@ pub mod computed { CssColorValue::new(type_, color) } + pub fn border_top_style(&self) -> CssBorderStyleValue { + let mut length = 0; + let type_ = unsafe { css_computed_border_top_style(self.computed_style) }; + let type_ = type_ as css_border_style_e; + + CssBorderStyleValue::new(type_) + } + + pub fn border_right_style(&self) -> CssBorderStyleValue { + let mut length = 0; + let type_ = unsafe { css_computed_border_right_style(self.computed_style) }; + let type_ = type_ as css_border_style_e; + + CssBorderStyleValue::new(type_) + } + + pub fn border_bottom_style(&self) -> CssBorderStyleValue { + let mut length = 0; + let type_ = unsafe { css_computed_border_bottom_style(self.computed_style) }; + let type_ = type_ as css_border_style_e; + + CssBorderStyleValue::new(type_) + } + + pub fn border_left_style(&self) -> CssBorderStyleValue { + let mut length = 0; + let type_ = unsafe { css_computed_border_left_style(self.computed_style) }; + let type_ = type_ as css_border_style_e; + + CssBorderStyleValue::new(type_) + } + pub fn border_top_width(&self) -> CssBorderWidthValue { let mut length = 0; let mut unit = 0; @@ -1530,6 +1562,39 @@ mod values { } } + pub enum CssBorderStyleValue { + CssBorderStyleInherit, + CssBorderStyleNone, + CssBorderStyleHidden, + CssBorderStyleDotted, + CssBorderStyleDashed, + CssBorderStyleSolid, + CssBorderStyleDouble, + CssBorderStyleGroove, + CssBorderStyleRidge, + CssBorderStyleInset, + CssBorderStyleOutset + } + + impl CssBorderStyleValue { + pub fn new(type_: css_border_style_e) -> CssBorderStyleValue { + match type_ { + CSS_BORDER_STYLE_INHERIT => CssBorderStyleInherit, + CSS_BORDER_STYLE_NONE => CssBorderStyleNone, + CSS_BORDER_STYLE_HIDDEN => CssBorderStyleHidden, + CSS_BORDER_STYLE_DOTTED => CssBorderStyleDotted, + CSS_BORDER_STYLE_DASHED => CssBorderStyleDashed, + CSS_BORDER_STYLE_SOLID => CssBorderStyleSolid, + CSS_BORDER_STYLE_DOUBLE => CssBorderStyleDouble, + CSS_BORDER_STYLE_GROOVE => CssBorderStyleGroove, + CSS_BORDER_STYLE_RIDGE => CssBorderStyleRidge, + CSS_BORDER_STYLE_INSET => CssBorderStyleInset, + CSS_BORDER_STYLE_OUTSET => CssBorderStyleOutset, + _ => unimpl("border style") + } + } + } + pub enum CssBorderWidthValue { CssBorderWidthInherit, CssBorderWidthThin,