Merge branch 'style_better' into 'master'

Style better

See merge request Librem5/squeekboard!180
This commit is contained in:
David Boddie
2019-09-29 14:28:42 +00:00
5 changed files with 75 additions and 93 deletions

View File

@ -40,11 +40,6 @@ pub mod c {
#[repr(transparent)]
pub struct UserData(*const c_void);
/// The index in the relevant outline table
#[repr(C)]
#[derive(Clone, Debug)]
pub struct OutlineRef(u32);
/// Defined in eek-types.h
#[repr(C)]
#[derive(Clone, Debug)]
@ -194,6 +189,13 @@ pub mod c {
let button = unsafe { &*button };
button.name.as_ptr()
}
#[no_mangle]
pub extern "C"
fn squeek_button_get_outline_name(button: *const Button) -> *const c_char {
let button = unsafe { &*button };
button.outline_name.as_ptr()
}
#[no_mangle]
pub extern "C"
@ -509,6 +511,7 @@ pub mod c {
bounds: c::Bounds {
x: 0f64, y: 0f64, width: 0f64, height: 0f64
},
outline_name: CString::new("test").unwrap(),
label: Label::Text(CString::new(name).unwrap()),
state: state,
})
@ -571,6 +574,8 @@ pub struct Button {
/// TODO: position the buttons before they get initial bounds
/// Position relative to some origin (i.e. parent/row)
pub bounds: c::Bounds,
/// The name of the visual class applied
pub outline_name: CString,
/// current state, shared with other buttons
pub state: Rc<RefCell<KeyState>>,
}