aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/cocoa
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 09:15:53 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 12:03:55 +0200
commit48fe9b26442662517b1590cb98ab81d79b059953 (patch)
treee2043b1941d340090fa7c7e9590bf2f3e7c81b47 /src/api/cocoa
parentc244f8c033f100a6e0f3e0b2b408f6ddc1006d47 (diff)
downloadglutin-48fe9b26442662517b1590cb98ab81d79b059953.tar.gz
glutin-48fe9b26442662517b1590cb98ab81d79b059953.zip
Extract WindowAttributes from the BuilderAttribs
Diffstat (limited to 'src/api/cocoa')
-rw-r--r--src/api/cocoa/headless.rs2
-rw-r--r--src/api/cocoa/mod.rs12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/api/cocoa/headless.rs b/src/api/cocoa/headless.rs
index 7cd0f88..ad1a464 100644
--- a/src/api/cocoa/headless.rs
+++ b/src/api/cocoa/headless.rs
@@ -28,7 +28,7 @@ pub struct HeadlessContext {
impl HeadlessContext {
pub fn new(builder: BuilderAttribs) -> Result<HeadlessContext, CreationError> {
- let (width, height) = builder.dimensions.unwrap_or((1024, 768));
+ let (width, height) = builder.window.dimensions.unwrap_or((1024, 768));
let context = unsafe {
let attributes = [
NSOpenGLPFAAccelerated as u32,
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs
index e259f39..e3feda2 100644
--- a/src/api/cocoa/mod.rs
+++ b/src/api/cocoa/mod.rs
@@ -301,7 +301,7 @@ impl Window {
};
unsafe {
- if builder.transparent {
+ if builder.window.transparent {
let clear_col = {
let cls = Class::get("NSColor").unwrap();
@@ -317,7 +317,7 @@ impl Window {
}
app.activateIgnoringOtherApps_(YES);
- if builder.visible {
+ if builder.window.visible {
window.makeKeyAndOrderFront_(nil);
} else {
window.makeKeyWindow();
@@ -358,7 +358,7 @@ impl Window {
fn create_window(builder: &BuilderAttribs) -> Option<IdRef> {
unsafe {
- let screen = match builder.monitor {
+ let screen = match builder.window.monitor {
Some(ref monitor_id) => {
let native_id = match monitor_id.get_native_identifier() {
NativeMonitorId::Numeric(num) => num,
@@ -390,12 +390,12 @@ impl Window {
let frame = match screen {
Some(screen) => NSScreen::frame(screen),
None => {
- let (width, height) = builder.dimensions.unwrap_or((800, 600));
+ let (width, height) = builder.window.dimensions.unwrap_or((800, 600));
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))
}
};
- let masks = if screen.is_some() || !builder.decorations {
+ let masks = if screen.is_some() || !builder.window.decorations {
NSBorderlessWindowMask as NSUInteger |
NSResizableWindowMask as NSUInteger
} else {
@@ -412,7 +412,7 @@ impl Window {
NO,
));
window.non_nil().map(|window| {
- let title = IdRef::new(NSString::alloc(nil).init_str(&builder.title));
+ let title = IdRef::new(NSString::alloc(nil).init_str(&builder.window.title));
window.setTitle_(*title);
window.setAcceptsMouseMovedEvents_(YES);
if screen.is_some() {