Skip to content

Commit 23b3f2f

Browse files
fix: Bump objc2 to 0.5.0; bring icrate 0.1.0 (#323)
Co-authored-by: Matt Campbell <[email protected]>
1 parent 52560da commit 23b3f2f

File tree

17 files changed

+257
-494
lines changed

17 files changed

+257
-494
lines changed

Cargo.lock

Lines changed: 36 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

platforms/macos/Cargo.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,19 @@ default-target = "x86_64-apple-darwin"
1616
[dependencies]
1717
accesskit = { version = "0.12.1", path = "../../common" }
1818
accesskit_consumer = { version = "0.16.1", path = "../../consumer" }
19-
objc2 = ">=0.3.0-beta.3, <0.3.0-beta.4" # Allow `0.3.0-beta.3.patch-leaks`
19+
objc2 = "0.5.0"
2020
once_cell = "1.13.0"
21+
22+
[dependencies.icrate]
23+
version = "0.1.0"
24+
features = [
25+
"AppKit",
26+
"AppKit_NSAccessibilityElement",
27+
"AppKit_NSView",
28+
"AppKit_NSWindow",
29+
"Foundation",
30+
"Foundation_NSArray",
31+
"Foundation_NSMutableDictionary",
32+
"Foundation_NSNumber",
33+
"Foundation_NSThread",
34+
]

platforms/macos/src/adapter.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
use accesskit::{ActionHandler, TreeUpdate};
77
use accesskit_consumer::{FilterResult, Tree};
8-
use objc2::{
9-
foundation::{MainThreadMarker, NSArray, NSObject, NSPoint},
10-
rc::{Id, Shared, WeakId},
8+
use icrate::{
9+
AppKit::NSView,
10+
Foundation::{MainThreadMarker, NSArray, NSObject, NSPoint},
1111
};
12+
use objc2::rc::{Id, WeakId};
1213
use std::{ffi::c_void, ptr::null_mut, rc::Rc};
1314

1415
use crate::{
15-
appkit::NSView,
1616
context::Context,
1717
event::{EventGenerator, QueuedEvents},
1818
filters::filter,
@@ -40,7 +40,7 @@ impl Adapter {
4040
action_handler: Box<dyn ActionHandler>,
4141
) -> Self {
4242
let view = unsafe { Id::retain(view as *mut NSView) }.unwrap();
43-
let view = WeakId::new(&view);
43+
let view = WeakId::from_id(&view);
4444
let tree = Tree::new(initial_state, is_view_focused);
4545
let mtm = MainThreadMarker::new().unwrap();
4646
Self {
@@ -83,7 +83,7 @@ impl Adapter {
8383
self.context.get_or_create_platform_node(node.id()),
8484
))
8585
})
86-
.collect::<Vec<Id<NSObject, Shared>>>()
86+
.collect::<Vec<Id<NSObject>>>()
8787
};
8888
let array = NSArray::from_vec(platform_nodes);
8989
Id::autorelease_return(array)

platforms/macos/src/appkit/accessibility_constants.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

platforms/macos/src/appkit/accessibility_element.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

platforms/macos/src/appkit/accessibility_functions.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

platforms/macos/src/appkit/mod.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

platforms/macos/src/appkit/responder.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)