Automated the work from #16

This commit is contained in:
4bb4 2021-03-17 19:17:14 +01:00
parent 3c30e3f919
commit 5779f7e6d6
6 changed files with 69 additions and 958 deletions

View file

@ -1,24 +1,9 @@
/* automatically generated by rust-bindgen 0.55.1 */
/* automatically generated by rust-bindgen 0.57.0 */
pub use imgui_sys::{ImVec2, ImVec4, ImGuiCond, ImTextureID};
pub use imgui_sys::{ImGuiContext, ImGuiKeyModFlags, ImDrawList};
pub use imgui_sys::{ImGuiMouseButton, ImGuiDragDropFlags};
pub type va_list = __builtin_va_list;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImGuiContext {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawListSharedData {
_unused: [u8; 0],
}
pub type ImGuiCond = ::std::os::raw::c_int;
pub type ImGuiMouseButton = ::std::os::raw::c_int;
pub type ImDrawListFlags = ::std::os::raw::c_int;
pub type ImGuiDragDropFlags = ::std::os::raw::c_int;
pub type ImGuiKeyModFlags = ::std::os::raw::c_int;
pub type ImTextureID = *mut ::std::os::raw::c_void;
pub type ImS8 = ::std::os::raw::c_schar;
pub type ImU8 = ::std::os::raw::c_uchar;
pub type ImS16 = ::std::os::raw::c_short;
@ -27,834 +12,6 @@ pub type ImS32 = ::std::os::raw::c_int;
pub type ImU32 = ::std::os::raw::c_uint;
pub type ImS64 = i64;
pub type ImU64 = u64;
pub type ImDrawCallback = ::std::option::Option<
unsafe extern "C" fn(parent_list: *const ImDrawList, cmd: *const ImDrawCmd),
>;
pub type ImDrawIdx = ::std::os::raw::c_ushort;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImDrawChannel {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImDrawChannel,
}
#[test]
fn bindgen_test_layout_ImVector_ImDrawChannel() {
assert_eq!(
::std::mem::size_of::<ImVector_ImDrawChannel>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImDrawChannel))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImDrawChannel>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImDrawChannel))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawChannel>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawChannel),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawChannel>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawChannel),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawChannel>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawChannel),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImDrawCmd {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImDrawCmd,
}
#[test]
fn bindgen_test_layout_ImVector_ImDrawCmd() {
assert_eq!(
::std::mem::size_of::<ImVector_ImDrawCmd>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImDrawCmd))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImDrawCmd>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImDrawCmd))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawCmd>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawCmd),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawCmd>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawCmd),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawCmd>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawCmd),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImDrawIdx {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImDrawIdx,
}
#[test]
fn bindgen_test_layout_ImVector_ImDrawIdx() {
assert_eq!(
::std::mem::size_of::<ImVector_ImDrawIdx>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImDrawIdx))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImDrawIdx>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImDrawIdx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawIdx>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawIdx),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawIdx>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawIdx),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawIdx>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawIdx),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImDrawVert {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImDrawVert,
}
#[test]
fn bindgen_test_layout_ImVector_ImDrawVert() {
assert_eq!(
::std::mem::size_of::<ImVector_ImDrawVert>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImDrawVert))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImDrawVert>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImDrawVert))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawVert>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawVert),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawVert>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawVert),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImDrawVert>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImDrawVert),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImTextureID {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImTextureID,
}
#[test]
fn bindgen_test_layout_ImVector_ImTextureID() {
assert_eq!(
::std::mem::size_of::<ImVector_ImTextureID>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImTextureID))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImTextureID>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImTextureID))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImTextureID>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImTextureID),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImTextureID>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImTextureID),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImTextureID>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImTextureID),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImVec2 {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImVec2,
}
#[test]
fn bindgen_test_layout_ImVector_ImVec2() {
assert_eq!(
::std::mem::size_of::<ImVector_ImVec2>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImVec2))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImVec2>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImVec2))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec2>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec2),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec2>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec2),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec2>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec2),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVector_ImVec4 {
pub Size: ::std::os::raw::c_int,
pub Capacity: ::std::os::raw::c_int,
pub Data: *mut ImVec4,
}
#[test]
fn bindgen_test_layout_ImVector_ImVec4() {
assert_eq!(
::std::mem::size_of::<ImVector_ImVec4>(),
16usize,
concat!("Size of: ", stringify!(ImVector_ImVec4))
);
assert_eq!(
::std::mem::align_of::<ImVector_ImVec4>(),
8usize,
concat!("Alignment of ", stringify!(ImVector_ImVec4))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec4>())).Size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec4),
"::",
stringify!(Size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec4>())).Capacity as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec4),
"::",
stringify!(Capacity)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVector_ImVec4>())).Data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImVector_ImVec4),
"::",
stringify!(Data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVec2 {
pub x: f32,
pub y: f32,
}
#[test]
fn bindgen_test_layout_ImVec2() {
assert_eq!(
::std::mem::size_of::<ImVec2>(),
8usize,
concat!("Size of: ", stringify!(ImVec2))
);
assert_eq!(
::std::mem::align_of::<ImVec2>(),
4usize,
concat!("Alignment of ", stringify!(ImVec2))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec2>())).x as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(ImVec2), "::", stringify!(x))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec2>())).y as *const _ as usize },
4usize,
concat!("Offset of field: ", stringify!(ImVec2), "::", stringify!(y))
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImVec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[test]
fn bindgen_test_layout_ImVec4() {
assert_eq!(
::std::mem::size_of::<ImVec4>(),
16usize,
concat!("Size of: ", stringify!(ImVec4))
);
assert_eq!(
::std::mem::align_of::<ImVec4>(),
4usize,
concat!("Alignment of ", stringify!(ImVec4))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec4>())).x as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(ImVec4), "::", stringify!(x))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec4>())).y as *const _ as usize },
4usize,
concat!("Offset of field: ", stringify!(ImVec4), "::", stringify!(y))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec4>())).z as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(ImVec4), "::", stringify!(z))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImVec4>())).w as *const _ as usize },
12usize,
concat!("Offset of field: ", stringify!(ImVec4), "::", stringify!(w))
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawCmd {
pub ClipRect: ImVec4,
pub TextureId: ImTextureID,
pub VtxOffset: ::std::os::raw::c_uint,
pub IdxOffset: ::std::os::raw::c_uint,
pub ElemCount: ::std::os::raw::c_uint,
pub UserCallback: ImDrawCallback,
pub UserCallbackData: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_ImDrawCmd() {
assert_eq!(
::std::mem::size_of::<ImDrawCmd>(),
56usize,
concat!("Size of: ", stringify!(ImDrawCmd))
);
assert_eq!(
::std::mem::align_of::<ImDrawCmd>(),
8usize,
concat!("Alignment of ", stringify!(ImDrawCmd))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).ClipRect as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(ClipRect)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).TextureId as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(TextureId)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).VtxOffset as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(VtxOffset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).IdxOffset as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(IdxOffset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).ElemCount as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(ElemCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).UserCallback as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(UserCallback)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawCmd>())).UserCallbackData as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ImDrawCmd),
"::",
stringify!(UserCallbackData)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawVert {
pub pos: ImVec2,
pub uv: ImVec2,
pub col: ImU32,
}
#[test]
fn bindgen_test_layout_ImDrawVert() {
assert_eq!(
::std::mem::size_of::<ImDrawVert>(),
20usize,
concat!("Size of: ", stringify!(ImDrawVert))
);
assert_eq!(
::std::mem::align_of::<ImDrawVert>(),
4usize,
concat!("Alignment of ", stringify!(ImDrawVert))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawVert>())).pos as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImDrawVert),
"::",
stringify!(pos)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawVert>())).uv as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImDrawVert),
"::",
stringify!(uv)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawVert>())).col as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ImDrawVert),
"::",
stringify!(col)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawChannel {
pub _CmdBuffer: ImVector_ImDrawCmd,
pub _IdxBuffer: ImVector_ImDrawIdx,
}
#[test]
fn bindgen_test_layout_ImDrawChannel() {
assert_eq!(
::std::mem::size_of::<ImDrawChannel>(),
32usize,
concat!("Size of: ", stringify!(ImDrawChannel))
);
assert_eq!(
::std::mem::align_of::<ImDrawChannel>(),
8usize,
concat!("Alignment of ", stringify!(ImDrawChannel))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawChannel>()))._CmdBuffer as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImDrawChannel),
"::",
stringify!(_CmdBuffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawChannel>()))._IdxBuffer as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ImDrawChannel),
"::",
stringify!(_IdxBuffer)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawListSplitter {
pub _Current: ::std::os::raw::c_int,
pub _Count: ::std::os::raw::c_int,
pub _Channels: ImVector_ImDrawChannel,
}
#[test]
fn bindgen_test_layout_ImDrawListSplitter() {
assert_eq!(
::std::mem::size_of::<ImDrawListSplitter>(),
24usize,
concat!("Size of: ", stringify!(ImDrawListSplitter))
);
assert_eq!(
::std::mem::align_of::<ImDrawListSplitter>(),
8usize,
concat!("Alignment of ", stringify!(ImDrawListSplitter))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawListSplitter>()))._Current as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImDrawListSplitter),
"::",
stringify!(_Current)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawListSplitter>()))._Count as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ImDrawListSplitter),
"::",
stringify!(_Count)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawListSplitter>()))._Channels as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ImDrawListSplitter),
"::",
stringify!(_Channels)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImDrawList {
pub CmdBuffer: ImVector_ImDrawCmd,
pub IdxBuffer: ImVector_ImDrawIdx,
pub VtxBuffer: ImVector_ImDrawVert,
pub Flags: ImDrawListFlags,
pub _Data: *const ImDrawListSharedData,
pub _OwnerName: *const ::std::os::raw::c_char,
pub _VtxCurrentIdx: ::std::os::raw::c_uint,
pub _VtxWritePtr: *mut ImDrawVert,
pub _IdxWritePtr: *mut ImDrawIdx,
pub _ClipRectStack: ImVector_ImVec4,
pub _TextureIdStack: ImVector_ImTextureID,
pub _Path: ImVector_ImVec2,
pub _CmdHeader: ImDrawCmd,
pub _Splitter: ImDrawListSplitter,
}
#[test]
fn bindgen_test_layout_ImDrawList() {
assert_eq!(
::std::mem::size_of::<ImDrawList>(),
224usize,
concat!("Size of: ", stringify!(ImDrawList))
);
assert_eq!(
::std::mem::align_of::<ImDrawList>(),
8usize,
concat!("Alignment of ", stringify!(ImDrawList))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>())).CmdBuffer as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(CmdBuffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>())).IdxBuffer as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(IdxBuffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>())).VtxBuffer as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(VtxBuffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>())).Flags as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(Flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._Data as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_Data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._OwnerName as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_OwnerName)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._VtxCurrentIdx as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_VtxCurrentIdx)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._VtxWritePtr as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_VtxWritePtr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._IdxWritePtr as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_IdxWritePtr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._ClipRectStack as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_ClipRectStack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._TextureIdStack as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_TextureIdStack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._Path as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_Path)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._CmdHeader as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_CmdHeader)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ImDrawList>()))._Splitter as *const _ as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(ImDrawList),
"::",
stringify!(_Splitter)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ImPlotContext {
@ -1113,7 +270,7 @@ fn bindgen_test_layout_ImPlotLimits() {
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ImPlotStyle {
pub LineWeight: f32,
pub Marker: ::std::os::raw::c_int,
@ -1482,7 +639,7 @@ fn bindgen_test_layout_ImPlotStyle() {
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ImPlotInputMap {
pub PanButton: ImGuiMouseButton,
pub PanMod: ImGuiKeyModFlags,
@ -4328,25 +3485,6 @@ extern "C" {
...
);
}
extern "C" {
pub fn ImPlot_AnnotateVStr(
x: f64,
y: f64,
pix_offset: ImVec2,
fmt: *const ::std::os::raw::c_char,
args: *mut __va_list_tag,
);
}
extern "C" {
pub fn ImPlot_AnnotateVVec4(
x: f64,
y: f64,
pix_offset: ImVec2,
color: ImVec4,
fmt: *const ::std::os::raw::c_char,
args: *mut __va_list_tag,
);
}
extern "C" {
pub fn ImPlot_AnnotateClampedStr(
x: f64,
@ -4366,25 +3504,6 @@ extern "C" {
...
);
}
extern "C" {
pub fn ImPlot_AnnotateClampedVStr(
x: f64,
y: f64,
pix_offset: ImVec2,
fmt: *const ::std::os::raw::c_char,
args: *mut __va_list_tag,
);
}
extern "C" {
pub fn ImPlot_AnnotateClampedVVec4(
x: f64,
y: f64,
pix_offset: ImVec2,
color: ImVec4,
fmt: *const ::std::os::raw::c_char,
args: *mut __va_list_tag,
);
}
extern "C" {
pub fn ImPlot_DragLineX(
id: *const ::std::os::raw::c_char,
@ -4666,65 +3785,3 @@ extern "C" {
offset: ::std::os::raw::c_int,
);
}
pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
pub gp_offset: ::std::os::raw::c_uint,
pub fp_offset: ::std::os::raw::c_uint,
pub overflow_arg_area: *mut ::std::os::raw::c_void,
pub reg_save_area: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout___va_list_tag() {
assert_eq!(
::std::mem::size_of::<__va_list_tag>(),
24usize,
concat!("Size of: ", stringify!(__va_list_tag))
);
assert_eq!(
::std::mem::align_of::<__va_list_tag>(),
8usize,
concat!("Alignment of ", stringify!(__va_list_tag))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(gp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(fp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(overflow_arg_area)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(reg_save_area)
)
);
}

View file

@ -36,6 +36,15 @@ impl From<(f64, f64)> for ImPlotRange {
}
}
impl From<ImVec2> for ImPlotRange {
fn from(from: ImVec2) -> Self {
ImPlotRange {
Min: from.x as f64,
Max: from.y as f64,
}
}
}
#[cfg(test)]
mod tests {
use super::*;