-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1750 from simlay/objc-inheritance
Objective-c inheritance support
- Loading branch information
Showing
8 changed files
with
398 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
#![allow( | ||
dead_code, | ||
non_snake_case, | ||
non_camel_case_types, | ||
non_upper_case_globals | ||
)] | ||
#![cfg(target_os = "macos")] | ||
|
||
#[macro_use] | ||
extern crate objc; | ||
#[allow(non_camel_case_types)] | ||
pub type id = *mut objc::runtime::Object; | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Foo(pub id); | ||
impl std::ops::Deref for Foo { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Foo {} | ||
impl Foo { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) | ||
} | ||
} | ||
impl IFoo for Foo {} | ||
pub trait IFoo: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Bar(pub id); | ||
impl std::ops::Deref for Bar { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Bar {} | ||
impl Bar { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Bar), alloc) }) | ||
} | ||
} | ||
impl IFoo for Bar {} | ||
impl IBar for Bar {} | ||
pub trait IBar: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Baz(pub id); | ||
impl std::ops::Deref for Baz { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Baz {} | ||
impl Baz { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) | ||
} | ||
} | ||
impl IBar for Baz {} | ||
impl IFoo for Baz {} | ||
impl IBaz for Baz {} | ||
pub trait IBaz: Sized + std::ops::Deref {} |
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,68 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
#![allow( | ||
dead_code, | ||
non_snake_case, | ||
non_camel_case_types, | ||
non_upper_case_globals | ||
)] | ||
#![cfg(target_os = "macos")] | ||
|
||
#[macro_use] | ||
extern crate objc; | ||
#[allow(non_camel_case_types)] | ||
pub type id = *mut objc::runtime::Object; | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Foo(pub id); | ||
impl std::ops::Deref for Foo { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Foo {} | ||
impl Foo { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) | ||
} | ||
} | ||
impl IFoo for Foo {} | ||
pub trait IFoo: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Bar(pub id); | ||
impl std::ops::Deref for Bar { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Bar {} | ||
impl Bar { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Bar), alloc) }) | ||
} | ||
} | ||
impl IFoo for Bar {} | ||
impl IBar for Bar {} | ||
pub trait IBar: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Baz(pub id); | ||
impl std::ops::Deref for Baz { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Baz {} | ||
impl Baz { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) | ||
} | ||
} | ||
impl IBar for Baz {} | ||
impl IFoo for Baz {} | ||
impl IBaz for Baz {} | ||
pub trait IBaz: Sized + std::ops::Deref {} |
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,68 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
#![allow( | ||
dead_code, | ||
non_snake_case, | ||
non_camel_case_types, | ||
non_upper_case_globals | ||
)] | ||
#![cfg(target_os = "macos")] | ||
|
||
#[macro_use] | ||
extern crate objc; | ||
#[allow(non_camel_case_types)] | ||
pub type id = *mut objc::runtime::Object; | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Foo(pub id); | ||
impl std::ops::Deref for Foo { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Foo {} | ||
impl Foo { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) | ||
} | ||
} | ||
impl IFoo for Foo {} | ||
pub trait IFoo: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Bar(pub id); | ||
impl std::ops::Deref for Bar { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Bar {} | ||
impl Bar { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Bar), alloc) }) | ||
} | ||
} | ||
impl IFoo for Bar {} | ||
impl IBar for Bar {} | ||
pub trait IBar: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Baz(pub id); | ||
impl std::ops::Deref for Baz { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Baz {} | ||
impl Baz { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) | ||
} | ||
} | ||
impl IBar for Baz {} | ||
impl IFoo for Baz {} | ||
impl IBaz for Baz {} | ||
pub trait IBaz: Sized + std::ops::Deref {} |
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,68 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
#![allow( | ||
dead_code, | ||
non_snake_case, | ||
non_camel_case_types, | ||
non_upper_case_globals | ||
)] | ||
#![cfg(target_os = "macos")] | ||
|
||
#[macro_use] | ||
extern crate objc; | ||
#[allow(non_camel_case_types)] | ||
pub type id = *mut objc::runtime::Object; | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Foo(pub id); | ||
impl std::ops::Deref for Foo { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Foo {} | ||
impl Foo { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) | ||
} | ||
} | ||
impl IFoo for Foo {} | ||
pub trait IFoo: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Bar(pub id); | ||
impl std::ops::Deref for Bar { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Bar {} | ||
impl Bar { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Bar), alloc) }) | ||
} | ||
} | ||
impl IFoo for Bar {} | ||
impl IBar for Bar {} | ||
pub trait IBar: Sized + std::ops::Deref {} | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy)] | ||
pub struct Baz(pub id); | ||
impl std::ops::Deref for Baz { | ||
type Target = objc::runtime::Object; | ||
fn deref(&self) -> &Self::Target { | ||
unsafe { &*self.0 } | ||
} | ||
} | ||
unsafe impl objc::Message for Baz {} | ||
impl Baz { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) | ||
} | ||
} | ||
impl IBar for Baz {} | ||
impl IFoo for Baz {} | ||
impl IBaz for Baz {} | ||
pub trait IBaz: Sized + std::ops::Deref {} |
Oops, something went wrong.