Update for language changes

This commit is contained in:
Brian Anderson
2013-06-25 19:44:47 -07:00
parent d916b97966
commit 3ef4cf7fda
3 changed files with 13 additions and 8 deletions
+4 -3
View File
@@ -8,6 +8,7 @@
// except according to those terms.
use base;
use std::str;
pub type CGFloat = f32;
@@ -46,14 +47,14 @@ pub struct NSRect {
#[nolink]
#[link_args="-framework AppKit"]
pub extern mod appkit {
extern {
fn NSBeep();
}
pub fn NSApp() -> base::id {
unsafe {
let klass = str::as_c_str(~"NSApplication", |s| base::objc_getClass(s));
let sel = str::as_c_str(~"sharedApplication", |s| base::sel_registerName(s));
let klass = str::as_c_str("NSApplication", |s| base::objc_getClass(s));
let sel = str::as_c_str("sharedApplication", |s| base::sel_registerName(s));
base::objc_msgSend(klass, sel)
}
}
+4 -1
View File
@@ -9,7 +9,10 @@
use appkit::NSRect;
use core::libc::c_long;
use std::libc;
use std::libc::c_long;
use std::io;
use std::str;
pub type id = libc::intptr_t;
pub type Class = libc::intptr_t;
+5 -4
View File
@@ -8,10 +8,11 @@
// except according to those terms.
use base;
use std::str;
#[nolink]
#[link_args="-framework Foundation"]
extern mod foundation {
extern {
}
enum NSAutoreleasePool {
@@ -20,12 +21,12 @@ enum NSAutoreleasePool {
fn NSAutoreleasePool() -> base::id {
unsafe {
let klass = str::as_c_str(~"NSAutoreleasePool", |s|
let klass = str::as_c_str("NSAutoreleasePool", |s|
base::objc_getClass(s)
);
let alloc_sel = str::as_c_str(~"alloc", |s| base::sel_registerName(s));
let init_sel = str::as_c_str(~"init", |s| base::sel_registerName(s));
let alloc_sel = str::as_c_str("alloc", |s| base::sel_registerName(s));
let init_sel = str::as_c_str("init", |s| base::sel_registerName(s));
let pool = base::objc_msgSend(klass, alloc_sel);
base::objc_msgSend(pool, init_sel)