Update helper functions of StyleComplexColor

This commit is contained in:
Xidorn Quan 2016-12-29 12:24:20 +11:00
parent b29b33c84c
commit 7d59e3bd93
3 changed files with 12 additions and 0 deletions

View file

@ -3042,6 +3042,7 @@ pub mod root {
pub struct StyleComplexColor { pub struct StyleComplexColor {
pub mColor: root::nscolor, pub mColor: root::nscolor,
pub mForegroundRatio: u8, pub mForegroundRatio: u8,
pub mIsAuto: bool,
} }
#[test] #[test]
fn bindgen_test_layout_StyleComplexColor() { fn bindgen_test_layout_StyleComplexColor() {

View file

@ -3024,6 +3024,7 @@ pub mod root {
pub struct StyleComplexColor { pub struct StyleComplexColor {
pub mColor: root::nscolor, pub mColor: root::nscolor,
pub mForegroundRatio: u8, pub mForegroundRatio: u8,
pub mIsAuto: bool,
} }
#[test] #[test]
fn bindgen_test_layout_StyleComplexColor() { fn bindgen_test_layout_StyleComplexColor() {

View file

@ -11,6 +11,7 @@ impl From<nscolor> for StyleComplexColor {
StyleComplexColor { StyleComplexColor {
mColor: other, mColor: other,
mForegroundRatio: 0, mForegroundRatio: 0,
mIsAuto: false,
} }
} }
} }
@ -20,6 +21,15 @@ impl StyleComplexColor {
StyleComplexColor { StyleComplexColor {
mColor: 0, mColor: 0,
mForegroundRatio: 255, mForegroundRatio: 255,
mIsAuto: false,
}
}
pub fn auto() -> Self {
StyleComplexColor {
mColor: 0,
mForegroundRatio: 255,
mIsAuto: true,
} }
} }
} }