-
Notifications
You must be signed in to change notification settings - Fork 51
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
5 changed files
with
122 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use std::ffi::c_ushort; | ||
|
||
extern_struct!( | ||
pub struct NSDecimal { | ||
// signed int _exponent:8; | ||
// unsigned int _length:4; | ||
// unsigned int _isNegative:1; | ||
// unsigned int _isCompact:1; | ||
// unsigned int _reserved:18; | ||
_inner: i32, | ||
_mantissa: [c_ushort; 8], | ||
} | ||
); |
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,47 @@ | ||
objc2::__inner_extern_class! { | ||
@__inner | ||
pub struct (NSObject) {} | ||
|
||
unsafe impl () for NSObject { | ||
INHERITS = [objc2::runtime::Object]; | ||
} | ||
} | ||
|
||
unsafe impl objc2::ClassType for NSObject { | ||
type Super = objc2::runtime::Object; | ||
const NAME: &'static str = "NSObject"; | ||
|
||
#[inline] | ||
fn class() -> &'static objc2::runtime::Class { | ||
objc2::class!(NSObject) | ||
} | ||
|
||
fn as_super(&self) -> &Self::Super { | ||
&self.__inner | ||
} | ||
|
||
fn as_super_mut(&mut self) -> &mut Self::Super { | ||
&mut self.__inner | ||
} | ||
} | ||
|
||
impl PartialEq for NSObject { | ||
fn eq(&self, _other: &Self) -> bool { | ||
todo!() | ||
} | ||
} | ||
|
||
impl Eq for NSObject {} | ||
|
||
impl std::hash::Hash for NSObject { | ||
#[inline] | ||
fn hash<H: std::hash::Hasher>(&self, _state: &mut H) { | ||
todo!() | ||
} | ||
} | ||
|
||
impl std::fmt::Debug for NSObject { | ||
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
todo!() | ||
} | ||
} |
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,53 @@ | ||
use core::fmt; | ||
use core::hash; | ||
|
||
use objc2::runtime::{Class, Object}; | ||
use objc2::{ClassType, __inner_extern_class}; | ||
|
||
__inner_extern_class! { | ||
@__inner | ||
pub struct (NSProxy) {} | ||
|
||
unsafe impl () for NSProxy { | ||
INHERITS = [Object]; | ||
} | ||
} | ||
|
||
unsafe impl ClassType for NSProxy { | ||
type Super = Object; | ||
const NAME: &'static str = "NSProxy"; | ||
|
||
#[inline] | ||
fn class() -> &'static Class { | ||
objc2::class!(NSProxy) | ||
} | ||
|
||
fn as_super(&self) -> &Self::Super { | ||
&self.__inner | ||
} | ||
|
||
fn as_super_mut(&mut self) -> &mut Self::Super { | ||
&mut self.__inner | ||
} | ||
} | ||
|
||
impl PartialEq for NSProxy { | ||
fn eq(&self, _other: &Self) -> bool { | ||
todo!() | ||
} | ||
} | ||
|
||
impl Eq for NSProxy {} | ||
|
||
impl hash::Hash for NSProxy { | ||
#[inline] | ||
fn hash<H: hash::Hasher>(&self, _state: &mut H) { | ||
todo!() | ||
} | ||
} | ||
|
||
impl fmt::Debug for NSProxy { | ||
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
todo!() | ||
} | ||
} |
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,7 @@ | ||
mod NSDecimal; | ||
mod NSObject; | ||
mod NSProxy; | ||
|
||
pub use self::NSDecimal::*; | ||
pub use self::NSObject::*; | ||
pub use self::NSProxy::*; |
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