start testing suil/winit

This commit is contained in:
🪞👃🪞 2024-07-24 13:43:38 +03:00
parent dacce119c4
commit 278b213f12
8 changed files with 1071 additions and 6 deletions

View file

@ -1,6 +1,7 @@
use std::ffi::CString;
use std::ffi::{CString, c_void};
pub mod bound;
#[cfg(test)] mod test;
pub struct Host(*mut self::bound::SuilHost);
@ -9,16 +10,33 @@ pub struct Instance(*mut self::bound::SuilInstance);
pub struct Controller(*mut self::bound::SuilController);
impl Host {
fn new () -> Self {
pub fn new () -> Self {
//let write = std::ptr::null();
//let index = std::ptr::null();
//let subscribe = std::ptr::null();
//let unsubscribe = std::ptr::null();
Self(unsafe {
bound::suil_init(&mut 0, std::ptr::null_mut(), 0);
bound::suil_host_new(None, None, None, None)
bound::suil_host_new(
Some(Self::write),
Some(Self::index),
Some(Self::subscribe),
Some(Self::unsubscribe),
)
})
}
unsafe extern "C" fn write (
_: *mut c_void, _: u32, _: u32, _: u32, _: *const c_void
) {}
unsafe extern "C" fn index (
_: *mut c_void, _: *const i8
) -> u32 {0}
unsafe extern "C" fn subscribe (
_: *mut c_void, _: u32, _: u32, _: *const *const bound::LV2_Feature
) -> u32 {0}
unsafe extern "C" fn unsubscribe (
_: *mut c_void, _: u32, _: u32, _: *const *const bound::LV2_Feature
) -> u32 {0}
fn set_touch_func (&self) {
unimplemented!();
}