From cab89193ad9175d770c8747dfb91b547119cff8d Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Wed, 4 Feb 2015 07:58:02 +1100 Subject: [PATCH 1/4] Use correct msg_send function --- src/appkit.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/appkit.rs b/src/appkit.rs index 22c4192..5cbc58c 100644 --- a/src/appkit.rs +++ b/src/appkit.rs @@ -1033,7 +1033,7 @@ impl NSWindow for id { } unsafe fn mouseLocationOutsideOfEventStream(self) -> NSPoint { - msg_send_stret()(self, selector("mouseLocationOutsideOfEventStream")) + msg_send()(self, selector("mouseLocationOutsideOfEventStream")) } unsafe fn setAcceptsMouseMovedEvents_(self, acceptMouseMovedEvents: BOOL) { @@ -1847,7 +1847,7 @@ impl NSEvent for id { } unsafe fn locationInWindow(self) -> NSPoint { - msg_send_stret()(self, selector("locationInWindow")) + msg_send()(self, selector("locationInWindow")) } unsafe fn modifierFlags(self) -> NSEventModifierFlags { @@ -1918,7 +1918,7 @@ impl NSEvent for id { } unsafe fn mouseLocation(_: Self) -> NSPoint { - msg_send_stret()(class("NSEvent"), selector("mouseLocation")) + msg_send()(class("NSEvent"), selector("mouseLocation")) } unsafe fn buttonNumber(self) -> NSInteger { @@ -2056,7 +2056,7 @@ impl NSEvent for id { } unsafe fn tilt(self) -> NSPoint { - msg_send_stret()(self, selector("tilt")) + msg_send()(self, selector("tilt")) } unsafe fn vendorDefined(self) -> id { From 9b542ec8c3a00d38c6caef379c8e262b249139e8 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Wed, 4 Feb 2015 07:58:36 +1100 Subject: [PATCH 2/4] Use correct selector name --- src/appkit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appkit.rs b/src/appkit.rs index 5cbc58c..52b65fd 100644 --- a/src/appkit.rs +++ b/src/appkit.rs @@ -1860,7 +1860,7 @@ impl NSEvent for id { // NOTE: renamed from `- type` due to Rust keyword collision unsafe fn event_type(self) -> NSEventType { - msg_send()(self, selector("event_type")) + msg_send()(self, selector("type")) } unsafe fn window(self) -> id /* (NSWindow *) */ { From 5c2a2b2a9ecdb1c91db5ba24dacfbdc5686f2967 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Wed, 4 Feb 2015 07:58:54 +1100 Subject: [PATCH 3/4] Use consistent naming style --- src/appkit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/appkit.rs b/src/appkit.rs index 52b65fd..b73efe0 100644 --- a/src/appkit.rs +++ b/src/appkit.rs @@ -1635,7 +1635,7 @@ pub trait NSEvent { unsafe fn modifierFlags(self) -> NSEventModifierFlags; unsafe fn timestamp(self) -> NSTimeInterval; // NOTE: renamed from `- type` due to Rust keyword collision - unsafe fn event_type(self) -> NSEventType; + unsafe fn eventType(self) -> NSEventType; unsafe fn window(self) -> id /* (NSWindow *) */; unsafe fn windowNumber(self) -> NSInteger; unsafe fn eventRef(self) -> *const libc::c_void; @@ -1859,7 +1859,7 @@ impl NSEvent for id { } // NOTE: renamed from `- type` due to Rust keyword collision - unsafe fn event_type(self) -> NSEventType { + unsafe fn eventType(self) -> NSEventType { msg_send()(self, selector("type")) } From cbab45e9086082fc5d5ee0ea0c3ecf67b46aaeec Mon Sep 17 00:00:00 2001 From: tomaka Date: Fri, 6 Feb 2015 20:36:34 +0100 Subject: [PATCH 4/4] Use libc from crates.io --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index de25f59..9643938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,4 @@ crate-type = ["rlib"] [dependencies] bitflags = "0.1" +libc = "*"