api: convert Window to dyn Window
This should allow us to make future split of backends much easier. The `Box<dyn Window>` is a _temporary_ solution, which will be removed with the future updates when we decide on how the Window should be stored.
This commit is contained in:
parent
e716adcc0a
commit
241b7a80bb
41 changed files with 2625 additions and 2448 deletions
|
|
@ -23,8 +23,10 @@ use crate::keyboard::{
|
|||
Key, KeyCode, KeyLocation, ModifiersKeys, ModifiersState, NamedKey, NativeKey, NativeKeyCode,
|
||||
PhysicalKey,
|
||||
};
|
||||
use crate::platform_impl::Window;
|
||||
use crate::window::{
|
||||
CustomCursor as RootCustomCursor, CustomCursorSource, Theme, WindowId as RootWindowId,
|
||||
CustomCursor as RootCustomCursor, CustomCursorSource, Theme, Window as CoreWindow,
|
||||
WindowId as RootWindowId,
|
||||
};
|
||||
|
||||
fn convert_scancode(scancode: u8) -> (PhysicalKey, Option<NamedKey>) {
|
||||
|
|
@ -729,9 +731,8 @@ impl RootActiveEventLoop for ActiveEventLoop {
|
|||
fn create_window(
|
||||
&self,
|
||||
window_attributes: crate::window::WindowAttributes,
|
||||
) -> Result<crate::window::Window, crate::error::OsError> {
|
||||
let window = crate::platform_impl::Window::new(self, window_attributes)?;
|
||||
Ok(crate::window::Window { window })
|
||||
) -> Result<Box<dyn CoreWindow>, crate::error::OsError> {
|
||||
Ok(Box::new(Window::new(self, window_attributes)?))
|
||||
}
|
||||
|
||||
fn create_custom_cursor(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue