From e0f36b80c9bf29bbf3306a617614f6913b705a10 Mon Sep 17 00:00:00 2001 From: Jan Segre Date: Mon, 23 May 2016 03:17:31 -0300 Subject: [PATCH] Make `WindowBuilder` and `HeadlessRendererBuilder` derive `Clone`. --- src/api/android/mod.rs | 4 ++-- src/api/cocoa/headless.rs | 2 +- src/api/cocoa/mod.rs | 2 +- src/api/ios/mod.rs | 2 +- src/headless.rs | 1 + src/lib.rs | 1 + src/platform/emscripten/mod.rs | 4 ++-- src/platform/ios/mod.rs | 2 +- src/platform/linux/api_dispatch.rs | 2 +- src/platform/linux/mod.rs | 2 +- src/platform/windows/mod.rs | 4 ++-- 11 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/api/android/mod.rs b/src/api/android/mod.rs index 433472c5..2c17d927 100644 --- a/src/api/android/mod.rs +++ b/src/api/android/mod.rs @@ -65,9 +65,9 @@ impl MonitorId { } } -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; pub struct PollEventsIterator<'a> { diff --git a/src/api/cocoa/headless.rs b/src/api/cocoa/headless.rs index ac6c4e03..8d89e404 100644 --- a/src/api/cocoa/headless.rs +++ b/src/api/cocoa/headless.rs @@ -13,7 +13,7 @@ use cocoa::appkit::*; use PixelFormat; use api::cocoa::helpers; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; pub struct HeadlessContext { diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index 3c4d802f..79f2b71c 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -181,7 +181,7 @@ impl Drop for WindowDelegate { } } -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes { pub activation_policy: ActivationPolicy, } diff --git a/src/api/ios/mod.rs b/src/api/ios/mod.rs index afcc6f42..8bee5134 100644 --- a/src/api/ios/mod.rs +++ b/src/api/ios/mod.rs @@ -177,7 +177,7 @@ impl MonitorId { } } -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes; impl Window { diff --git a/src/headless.rs b/src/headless.rs index 8ea4141a..31a9f5e4 100644 --- a/src/headless.rs +++ b/src/headless.rs @@ -11,6 +11,7 @@ use Robustness; use platform; /// Object that allows you to build headless contexts. +#[derive(Clone)] pub struct HeadlessRendererBuilder<'a> { /// The dimensions to use. pub dimensions: (u32, u32), diff --git a/src/lib.rs b/src/lib.rs index ff5d52e4..a10957d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,6 +106,7 @@ pub struct Window { } /// Object that allows you to build windows. +#[derive(Clone)] pub struct WindowBuilder<'a> { /// The attributes to use to create the window. pub window: WindowAttributes, diff --git a/src/platform/emscripten/mod.rs b/src/platform/emscripten/mod.rs index ce8d201c..22cb5653 100644 --- a/src/platform/emscripten/mod.rs +++ b/src/platform/emscripten/mod.rs @@ -58,7 +58,7 @@ impl GlContext for HeadlessContext { unsafe impl Send for HeadlessContext {} unsafe impl Sync for HeadlessContext {} -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; diff --git a/src/platform/ios/mod.rs b/src/platform/ios/mod.rs index 2e6fbec0..0b1a5509 100644 --- a/src/platform/ios/mod.rs +++ b/src/platform/ios/mod.rs @@ -8,7 +8,7 @@ use ContextError; pub use api::ios::*; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; pub struct HeadlessContext(i32); diff --git a/src/platform/linux/api_dispatch.rs b/src/platform/linux/api_dispatch.rs index 2e135e24..54e0186a 100644 --- a/src/platform/linux/api_dispatch.rs +++ b/src/platform/linux/api_dispatch.rs @@ -22,7 +22,7 @@ use api::x11::XConnection; use api::x11::XError; use api::x11::XNotSupported; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes; enum Backend { diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 18658352..31a34147 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -15,7 +15,7 @@ pub use self::api_dispatch::{WaitEventsIterator, PollEventsIterator}; pub use self::api_dispatch::PlatformSpecificWindowBuilderAttributes; mod api_dispatch; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; pub struct HeadlessContext(OsMesaContext); diff --git a/src/platform/windows/mod.rs b/src/platform/windows/mod.rs index 0c78322f..f5fa6fd8 100644 --- a/src/platform/windows/mod.rs +++ b/src/platform/windows/mod.rs @@ -51,9 +51,9 @@ lazy_static! { }; } -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes; -#[derive(Default)] +#[derive(Clone, Default)] pub struct PlatformSpecificHeadlessBuilderAttributes; /// The Win32 implementation of the main `Window` object.