-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathinterface.rs
More file actions
24 lines (17 loc) · 819 Bytes
/
Copy pathinterface.rs
File metadata and controls
24 lines (17 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use cursor_icon::CursorIcon;
use raw_window_handle::{HasDisplayHandle, HasWindowHandle, RawWindowHandle};
use crate::{error::Error, event::EventCallback, window::WindowAttributes, LogicalPosition, LogicalSize};
use super::os_window_handle::OsWindowHandle;
pub(crate) trait OsWindowInterface: HasDisplayHandle + HasWindowHandle + Sized {
fn open(
parent_window_handle: RawWindowHandle,
window_attributes: WindowAttributes,
event_callback: Box<EventCallback>,
) -> Result<OsWindowHandle, Error>;
fn os_scale(&self) -> f64;
fn resized(&self, size: LogicalSize, scale: f64);
fn set_cursor(&self, cursor: Option<CursorIcon>);
fn set_input_focus(&self, focus: bool);
fn warp_mouse(&self, position: LogicalPosition);
fn poll_events(&self) -> Result<(), Error>;
}