Skip to content

Commit 22998bc

Browse files
committed
Update to objc2 v0.4.1
1 parent e821678 commit 22998bc

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[workspace]
22
members = ["core-foundation", "core-foundation-sys", "core-graphics-types", "core-graphics", "core-text", "cocoa", "cocoa-foundation", "io-surface"]
3+
4+
[patch.crates-io]
5+
objc2 = { path = "../objc2/crates/objc2" }
6+
block2 = { path = "../objc2/crates/block2" }

cocoa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ cocoa-foundation = { path = "../cocoa-foundation", version = "0.1" }
1919
core-foundation = { path = "../core-foundation", version = "0.9" }
2020
core-graphics = { path = "../core-graphics", version = "0.23" }
2121
foreign-types = "0.5"
22-
objc2 = "0.4.0"
22+
objc2 = { version = "0.4.0", features = ["relax-void-encoding"] }

cocoa/src/appkit.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use foundation::{
1515
NSInteger, NSPoint, NSRange, NSRect, NSRectEdge, NSSize, NSTimeInterval, NSUInteger,
1616
};
1717
use libc;
18-
use objc2::encode::{Encode, Encoding};
1918

2019
pub use core_graphics::base::CGFloat;
2120
pub use core_graphics::geometry::CGPoint;
@@ -4581,13 +4580,6 @@ pub trait NSColorSpace: Sized {
45814580
unsafe fn localizedName(self) -> id;
45824581
}
45834582

4584-
#[repr(transparent)]
4585-
struct CGColorSpaceRef(*const c_void);
4586-
4587-
unsafe impl Encode for CGColorSpaceRef {
4588-
const ENCODING: Encoding = Encoding::Pointer(&Encoding::Struct("CGColorSpace", &[]));
4589-
}
4590-
45914583
impl NSColorSpace for id {
45924584
unsafe fn deviceRGBColorSpace(_: Self) -> id {
45934585
msg_send![class!(NSColorSpace), deviceRGBColorSpace]
@@ -4630,12 +4622,14 @@ impl NSColorSpace for id {
46304622
msg_send![class!(NSColorSpace), alloc]
46314623
}
46324624

4633-
unsafe fn initWithCGColorSpace_(self, cg_color_space: *const c_void) -> id {
4634-
msg_send![self, initWithCGColorSpace: CGColorSpaceRef(cg_color_space)]
4625+
unsafe fn initWithCGColorSpace_(
4626+
self,
4627+
cg_color_space: *const c_void, /* (CGColorSpaceRef) */
4628+
) -> id {
4629+
msg_send![self, initWithCGColorSpace: cg_color_space]
46354630
}
4636-
unsafe fn CGColorSpace(self) -> *const c_void {
4637-
let res: CGColorSpaceRef = msg_send![self, CGColorSpace];
4638-
res.0
4631+
unsafe fn CGColorSpace(self) -> *const c_void /* (CGColorSpaceRef) */ {
4632+
msg_send![self, CGColorSpace]
46394633
}
46404634
unsafe fn localizedName(self) -> id {
46414635
msg_send![self, localizedName]

0 commit comments

Comments
 (0)