Impl Clone for EventsLoopProxy (#331)

This commit is contained in:
Chris Tolliday 2017-10-25 11:03:57 -07:00 committed by Victor Berger
parent 58181dbff9
commit 159364bec3
10 changed files with 10 additions and 0 deletions

View file

@ -12,6 +12,7 @@
- Monitor enumeration on Windows is now implemented using `EnumDisplayMonitors` instead of - Monitor enumeration on Windows is now implemented using `EnumDisplayMonitors` instead of
`EnumDisplayDevices`. This changes the value returned by `MonitorId::get_name()`. `EnumDisplayDevices`. This changes the value returned by `MonitorId::get_name()`.
- On Windows added `MonitorIdExt::hmonitor` method - On Windows added `MonitorIdExt::hmonitor` method
- Impl `Clone` for `EventsLoopProxy`
# Version 0.8.3 (2017-10-11) # Version 0.8.3 (2017-10-11)

View file

@ -246,6 +246,7 @@ impl EventsLoop {
} }
/// Used to wake up the `EventsLoop` from another thread. /// Used to wake up the `EventsLoop` from another thread.
#[derive(Clone)]
pub struct EventsLoopProxy { pub struct EventsLoopProxy {
events_loop_proxy: platform::EventsLoopProxy, events_loop_proxy: platform::EventsLoopProxy,
} }

View file

@ -20,6 +20,7 @@ pub struct EventsLoop {
event_rx: Receiver<android_glue::Event>, event_rx: Receiver<android_glue::Event>,
} }
#[derive(Clone)]
pub struct EventsLoopProxy; pub struct EventsLoopProxy;
impl EventsLoop { impl EventsLoop {

View file

@ -68,6 +68,7 @@ pub fn set_main_loop_callback<F>(callback : F) where F : FnMut() {
} }
} }
#[derive(Clone)]
pub struct EventsLoopProxy; pub struct EventsLoopProxy;
impl EventsLoopProxy { impl EventsLoopProxy {

View file

@ -156,6 +156,7 @@ pub struct EventsLoop {
delegate_state: *mut DelegateState delegate_state: *mut DelegateState
} }
#[derive(Clone)]
pub struct EventsLoopProxy; pub struct EventsLoopProxy;
impl EventsLoop { impl EventsLoop {

View file

@ -297,6 +297,7 @@ pub enum EventsLoop {
X(x11::EventsLoop) X(x11::EventsLoop)
} }
#[derive(Clone)]
pub enum EventsLoopProxy { pub enum EventsLoopProxy {
X(x11::EventsLoopProxy), X(x11::EventsLoopProxy),
Wayland(wayland::EventsLoopProxy), Wayland(wayland::EventsLoopProxy),

View file

@ -76,6 +76,7 @@ pub struct EventsLoop {
// A handle that can be sent across threads and used to wake up the `EventsLoop`. // A handle that can be sent across threads and used to wake up the `EventsLoop`.
// //
// We should only try and wake up the `EventsLoop` if it still exists, so we hold Weak ptrs. // We should only try and wake up the `EventsLoop` if it still exists, so we hold Weak ptrs.
#[derive(Clone)]
pub struct EventsLoopProxy { pub struct EventsLoopProxy {
display: Weak<wl_display::WlDisplay>, display: Weak<wl_display::WlDisplay>,
pending_wakeup: Weak<AtomicBool>, pending_wakeup: Weak<AtomicBool>,

View file

@ -43,6 +43,7 @@ pub struct EventsLoop {
wakeup_dummy_window: ffi::Window, wakeup_dummy_window: ffi::Window,
} }
#[derive(Clone)]
pub struct EventsLoopProxy { pub struct EventsLoopProxy {
pending_wakeup: Weak<AtomicBool>, pending_wakeup: Weak<AtomicBool>,
display: Weak<XConnection>, display: Weak<XConnection>,

View file

@ -29,6 +29,7 @@ pub struct Shared {
user_callback: UserCallback, user_callback: UserCallback,
} }
#[derive(Clone)]
pub struct Proxy {} pub struct Proxy {}
struct Modifiers { struct Modifiers {

View file

@ -243,6 +243,7 @@ impl Drop for EventsLoop {
} }
} }
#[derive(Clone)]
pub struct EventsLoopProxy { pub struct EventsLoopProxy {
thread_id: winapi::DWORD, thread_id: winapi::DWORD,
} }