Make WindowBuilder and HeadlessRendererBuilder derive Clone.

This commit is contained in:
Jan Segre 2016-05-23 03:17:31 -03:00
parent cf02e7f1f4
commit e0f36b80c9
11 changed files with 14 additions and 12 deletions

View file

@ -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> {

View file

@ -13,7 +13,7 @@ use cocoa::appkit::*;
use PixelFormat;
use api::cocoa::helpers;
#[derive(Default)]
#[derive(Clone, Default)]
pub struct PlatformSpecificHeadlessBuilderAttributes;
pub struct HeadlessContext {

View file

@ -181,7 +181,7 @@ impl Drop for WindowDelegate {
}
}
#[derive(Default)]
#[derive(Clone, Default)]
pub struct PlatformSpecificWindowBuilderAttributes {
pub activation_policy: ActivationPolicy,
}

View file

@ -177,7 +177,7 @@ impl MonitorId {
}
}
#[derive(Default)]
#[derive(Clone, Default)]
pub struct PlatformSpecificWindowBuilderAttributes;
impl Window {

View file

@ -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),

View file

@ -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,

View file

@ -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;

View file

@ -8,7 +8,7 @@ use ContextError;
pub use api::ios::*;
#[derive(Default)]
#[derive(Clone, Default)]
pub struct PlatformSpecificHeadlessBuilderAttributes;
pub struct HeadlessContext(i32);

View file

@ -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 {

View file

@ -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);

View file

@ -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.