From 4d9c6c313160435fbb4404ff806d7921b147563c Mon Sep 17 00:00:00 2001 From: William Light Date: Fri, 11 Sep 2020 19:10:49 +0200 Subject: [PATCH] remove FileDropEvent we have no implementations for it, so it's just dead code for now. --- examples/open_window.rs | 3 +-- src/event.rs | 17 +---------------- src/macos/window.rs | 2 +- src/win/window.rs | 2 +- src/x11/window.rs | 2 +- 5 files changed, 5 insertions(+), 21 deletions(-) diff --git a/examples/open_window.rs b/examples/open_window.rs index 9459c5c..e784425 100644 --- a/examples/open_window.rs +++ b/examples/open_window.rs @@ -15,8 +15,7 @@ impl WindowHandler for MyProgram { match event { Event::Mouse(e) => println!("Mouse event: {:?}", e), Event::Keyboard(e) => println!("Keyboard event: {:?}", e), - Event::Window(e) => println!("Window event: {:?}", e), - Event::FileDrop(e) => println!("File drop event: {:?}", e), + Event::Window(e) => println!("Window event: {:?}", e) } } diff --git a/src/event.rs b/src/event.rs index d03cedf..a888dd1 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - #[derive(Debug, Clone, Copy, PartialEq)] pub enum KeyboardEvent { KeyPressed(u32), @@ -89,22 +87,9 @@ pub enum WindowEvent { WillClose, } -#[derive(PartialEq, Clone, Debug)] -pub enum FileDropEvent { - /// A file is being hovered over the window. - FileHovered(PathBuf), - - /// A file has beend dropped into the window. - FileDropped(PathBuf), - - /// A file was hovered, but has exited the window. - FilesHoveredLeft, -} - #[derive(Debug)] pub enum Event { Mouse(MouseEvent), Keyboard(KeyboardEvent), - Window(WindowEvent), - FileDrop(FileDropEvent), + Window(WindowEvent) } diff --git a/src/macos/window.rs b/src/macos/window.rs index 3add2ef..84020fa 100644 --- a/src/macos/window.rs +++ b/src/macos/window.rs @@ -11,7 +11,7 @@ use cocoa::foundation::{NSAutoreleasePool, NSPoint, NSRect, NSSize, NSString}; use raw_window_handle::{macos::MacOSHandle, HasRawWindowHandle, RawWindowHandle}; use crate::{ - Event, FileDropEvent, KeyboardEvent, MouseButton, MouseEvent, ScrollDelta, WindowEvent, + Event, KeyboardEvent, MouseButton, MouseEvent, ScrollDelta, WindowEvent, WindowHandler, WindowOpenOptions, }; diff --git a/src/win/window.rs b/src/win/window.rs index 0d69f00..5c2e3b8 100644 --- a/src/win/window.rs +++ b/src/win/window.rs @@ -19,7 +19,7 @@ use std::rc::Rc; use raw_window_handle::{windows::WindowsHandle, HasRawWindowHandle, RawWindowHandle}; use crate::{ - Event, FileDropEvent, KeyboardEvent, MouseButton, MouseEvent, Parent::WithParent, ScrollDelta, + Event, KeyboardEvent, MouseButton, MouseEvent, Parent::WithParent, ScrollDelta, WindowEvent, WindowHandler, WindowInfo, WindowOpenOptions, }; diff --git a/src/x11/window.rs b/src/x11/window.rs index 25c6a4d..6f7fcb8 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -6,7 +6,7 @@ use raw_window_handle::{unix::XlibHandle, HasRawWindowHandle, RawWindowHandle}; use super::XcbConnection; use crate::{ - Event, FileDropEvent, KeyboardEvent, MouseButton, MouseEvent, Parent, ScrollDelta, WindowEvent, + Event, KeyboardEvent, MouseButton, MouseEvent, Parent, ScrollDelta, WindowEvent, WindowHandler, WindowOpenOptions, };