leanshot/slop-sys/lib.rs
2018-09-09 23:24:43 -05:00

265 lines
7 KiB
Rust

/* automatically generated by rust-bindgen */
#![allow(dead_code)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct slop_options {
pub quiet: ::std::os::raw::c_int,
pub border: f32,
pub padding: f32,
pub tolerance: f32,
pub highlight: ::std::os::raw::c_int,
pub noopengl: ::std::os::raw::c_int,
pub nokeyboard: ::std::os::raw::c_int,
pub nodecorations: ::std::os::raw::c_int,
pub shaders: *mut ::std::os::raw::c_char,
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
pub xdisplay: *const ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_slop_options() {
assert_eq!(
::std::mem::size_of::<slop_options>(),
64usize,
concat!("Size of: ", stringify!(slop_options))
);
assert_eq!(
::std::mem::align_of::<slop_options>(),
8usize,
concat!("Alignment of ", stringify!(slop_options))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).quiet as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(quiet)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).border as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(border)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).padding as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(padding)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).tolerance as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(tolerance)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).highlight as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(highlight)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).noopengl as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(noopengl)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).nokeyboard as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(nokeyboard)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).nodecorations as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(nodecorations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).shaders as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(shaders)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).r as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(r)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).g as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(g)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).b as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(b)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).a as *const _ as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(a)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_options>())).xdisplay as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(slop_options),
"::",
stringify!(xdisplay)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct slop_selection {
pub cancelled: ::std::os::raw::c_int,
pub x: f32,
pub y: f32,
pub w: f32,
pub h: f32,
pub id: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_slop_selection() {
assert_eq!(
::std::mem::size_of::<slop_selection>(),
24usize,
concat!("Size of: ", stringify!(slop_selection))
);
assert_eq!(
::std::mem::align_of::<slop_selection>(),
4usize,
concat!("Alignment of ", stringify!(slop_selection))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).cancelled as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(cancelled)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).x as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(x)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).y as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(y)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).w as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(w)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).h as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(h)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<slop_selection>())).id as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(slop_selection),
"::",
stringify!(id)
)
);
}
extern "C" {
pub fn slop_options_default() -> slop_options;
}
extern "C" {
pub fn slop_select(options: *mut slop_options) -> slop_selection;
}