1
0
Fork 0
baseview/src/lib.rs

44 lines
735 B
Rust
Raw Normal View History

2020-05-26 04:04:48 +10:00
use std::ffi::c_void;
#[cfg(target_os = "windows")]
mod win;
#[cfg(target_os = "windows")]
pub use win::*;
#[cfg(target_os = "linux")]
2020-05-26 05:35:33 +10:00
mod x11;
#[cfg(target_os = "linux")]
2020-06-01 04:29:32 +10:00
pub use crate::x11::*;
#[cfg(target_os = "macos")]
2020-05-26 07:14:42 +10:00
mod macos;
#[cfg(target_os = "macos")]
pub use macos::*;
2020-05-26 07:14:42 +10:00
mod message;
pub use message::*;
2020-05-26 04:04:48 +10:00
pub enum Parent {
None,
AsIfParented,
2020-05-26 05:35:03 +10:00
WithParent(*mut c_void),
2020-05-26 04:04:48 +10:00
}
pub struct WindowOpenOptions<'a> {
pub title: &'a str,
pub width: usize,
pub height: usize,
2020-05-26 05:35:03 +10:00
pub parent: Parent,
2020-05-26 04:04:48 +10:00
}
pub trait Receiver {
fn create_context(
&mut self,
window: raw_window_handle::RawWindowHandle,
window_info: &WindowInfo,
);
fn on_message(&mut self, message: Message);
}