diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2016-05-23 08:48:09 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2016-05-23 08:48:09 +0200 |
commit | e796a2e01841dcd55e1633bf4d13e993eb547876 (patch) | |
tree | f67c9d09ace81e83f6c2838569888e277aa9df32 | |
parent | cf02e7f1f44eebaaee939b8267b9457094d9bc6b (diff) | |
parent | e0f36b80c9bf29bbf3306a617614f6913b705a10 (diff) | |
download | glutin-e796a2e01841dcd55e1633bf4d13e993eb547876.tar.gz glutin-e796a2e01841dcd55e1633bf4d13e993eb547876.zip |
Merge pull request #780 from jansegre/impl-clone-builders
Make `WindowBuilder` and `HeadlessRendererBuilder` derive `Clone`.
-rw-r--r-- | src/api/android/mod.rs | 4 | ||||
-rw-r--r-- | src/api/cocoa/headless.rs | 2 | ||||
-rw-r--r-- | src/api/cocoa/mod.rs | 2 | ||||
-rw-r--r-- | src/api/ios/mod.rs | 2 | ||||
-rw-r--r-- | src/headless.rs | 1 | ||||
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/platform/emscripten/mod.rs | 4 | ||||
-rw-r--r-- | src/platform/ios/mod.rs | 2 | ||||
-rw-r--r-- | src/platform/linux/api_dispatch.rs | 2 | ||||
-rw-r--r-- | src/platform/linux/mod.rs | 2 | ||||
-rw-r--r-- | 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 433472c..2c17d92 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 ac6c4e0..8d89e40 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 3c4d802..79f2b71 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 afcc6f4..8bee513 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 8ea4141..31a9f5e 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), @@ -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 ce8d201..22cb565 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 2e6fbec..0b1a550 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 2e135e2..54e0186 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 1865835..31a3414 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 0c78322..f5fa6fd 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. |