-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
223 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(non_snake_case)] | ||
|
||
#![cfg(target_os="macos")] | ||
|
||
#[macro_use] | ||
extern crate objc; | ||
#[allow(non_camel_case_types)] | ||
pub type id = *mut objc::runtime::Object; | ||
type Class = *mut objc::runtime::Class; | ||
#[inline] | ||
fn class(name: &str) -> Class { | ||
unsafe { std::mem::transmute(objc::runtime::Class::get(name)) } | ||
} | ||
pub trait Foo { | ||
unsafe fn method(); | ||
unsafe fn methodWithInt_(foo: ::std::os::raw::c_int); | ||
unsafe fn methodWithFoo_(foo: id); | ||
unsafe fn methodReturningInt() | ||
-> ::std::os::raw::c_int; | ||
unsafe fn methodReturningFoo() | ||
-> *mut id; | ||
unsafe fn methodWithArg1_andArg2_andArg3_(intvalue: ::std::os::raw::c_int, | ||
ptr: | ||
*mut ::std::os::raw::c_char, | ||
floatvalue: f32); | ||
} | ||
impl Foo for id { | ||
unsafe fn method() { msg_send!(class ( "Foo" ) , method) } | ||
unsafe fn methodWithInt_(foo: ::std::os::raw::c_int) { | ||
msg_send!(class ( "Foo" ) , methodWithInt:foo ) | ||
} | ||
unsafe fn methodWithFoo_(foo: id) { | ||
msg_send!(class ( "Foo" ) , methodWithFoo:foo ) | ||
} | ||
unsafe fn methodReturningInt() -> ::std::os::raw::c_int { | ||
msg_send!(class ( "Foo" ) , methodReturningInt) | ||
} | ||
unsafe fn methodReturningFoo() -> *mut id { | ||
msg_send!(class ( "Foo" ) , methodReturningFoo) | ||
} | ||
unsafe fn methodWithArg1_andArg2_andArg3_(intvalue: ::std::os::raw::c_int, | ||
ptr: | ||
*mut ::std::os::raw::c_char, | ||
floatvalue: f32) { | ||
msg_send!(class ( "Foo" ) , | ||
methodWithArg1:intvalue andArg2:ptr andArg3:floatvalue ) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.