Skip to content

Commit dac2bc1

Browse files
authored
Merge pull request #427 from madsmtm/refactor-modules
Refactor modules
2 parents 797b146 + d5b5da9 commit dac2bc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+415
-362
lines changed

crates/header-translator/translation-config.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ imports = []
198198
extra-features = [
199199
"objective-c",
200200
"block",
201-
"Foundation_NSProxy",
202201
# Temporary, since some structs and statics use these
203202
"Foundation_NSError",
204203
"Foundation_NSAppleEventDescriptor",
@@ -558,13 +557,12 @@ countForFetchRequest_error = { skipped = true }
558557
[class.NSBundle.methods.localizedAttributedStringForKey_value_table]
559558
skipped = true
560559

561-
# Root class
560+
# Root classes, defined in `objc2` for now
562561
[class.NSProxy]
563-
definition-skipped = true
564-
565-
# Ignore categories on NSObject for now
566-
[class.NSObject]
567562
skipped = true
563+
[class.NSObject]
564+
skipped = true # Also ignore categories on NSObject for now
565+
568566
[protocol.NSObject]
569567
renamed = "NSObjectProtocol"
570568

crates/icrate/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1717
- `MetricKit`
1818
- `PhotoKit`
1919

20+
### Removed
21+
* **BREAKING**: Removed various redundant `NSProxy` methods.
22+
2023

2124
## icrate 0.0.2 - 2023-02-07
2225

crates/icrate/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,6 @@ FileProvider_all = [
21932193
Foundation = [
21942194
"objective-c",
21952195
"block",
2196-
"Foundation_NSProxy",
21972196
"Foundation_NSError",
21982197
"Foundation_NSAppleEventDescriptor",
21992198
"Foundation_NSHashTable",

crates/icrate/examples/browser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use icrate::{
66
declare::{Ivar, IvarDrop},
77
declare_class, extern_methods, msg_send,
88
rc::{Allocated, Id},
9-
runtime::{Object, Sel},
10-
sel, ClassType, ProtocolObject,
9+
runtime::{Object, ProtocolObject, Sel},
10+
sel, ClassType,
1111
},
1212
AppKit::{
1313
NSApplication, NSApplicationActivationPolicyRegular, NSBackingStoreBuffered,

crates/icrate/src/Foundation/fixes/NSProxy.rs

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

crates/icrate/src/Foundation/fixes/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ mod NSUUID;
33
mod __NSDecimal;
44
#[path = "NSNotFound.rs"]
55
mod __NSNotFound;
6-
#[path = "NSProxy.rs"]
7-
mod __NSProxy;
86
mod copy;
97
mod debug;
108
mod generic_return;
@@ -13,8 +11,6 @@ mod ns_consumed;
1311

1412
pub use self::__NSDecimal::NSDecimal;
1513
pub use self::__NSNotFound::NSNotFound;
16-
#[cfg(feature = "Foundation_NSProxy")]
17-
pub use self::__NSProxy::NSProxy;
1814
#[cfg(feature = "Foundation_NSMapTable")]
1915
pub use self::ns_consumed::NSFreeMapTable;
2016
#[cfg(feature = "Foundation_NSUUID")]

crates/icrate/src/Foundation/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ pub use self::additions::*;
112112
pub use self::fixes::*;
113113
pub use self::generated::*;
114114

115+
#[doc(inline)]
116+
#[cfg(feature = "Foundation_NSProxy")]
117+
pub use objc2::runtime::__NSProxy as NSProxy;
115118
pub use objc2::runtime::{NSObject, NSObjectProtocol, NSZone};
116119
// Available under Foundation, so makes sense here as well:
117120
// https://developer.apple.com/documentation/foundation/numbers_data_and_basic_values?language=objc

crates/icrate/src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ pub(crate) use objc2::rc::{Allocated, Id, Owned, Ownership, Shared};
1717
#[cfg(feature = "objective-c")]
1818
pub(crate) use objc2::runtime::{Bool, Class, Object, Sel};
1919
#[cfg(feature = "objective-c")]
20-
pub(crate) use objc2::runtime::{NSObject, NSObjectProtocol};
20+
pub(crate) use objc2::runtime::{NSObject, NSObjectProtocol, ProtocolObject};
2121
#[cfg(feature = "objective-c")]
2222
pub(crate) use objc2::{
2323
__inner_extern_class, extern_class, extern_methods, extern_protocol, ClassType, Message,
24-
ProtocolObject, ProtocolType,
24+
ProtocolType,
2525
};
2626

2727
#[cfg(feature = "block")]

crates/icrate/src/generated

crates/icrate/tests/proxy.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![cfg(feature = "Foundation_NSProxy")]
2+
use icrate::Foundation::NSProxy;
3+
use objc2::ClassType;
4+
5+
#[test]
6+
fn dummy() {
7+
let _cls = NSProxy::class();
8+
}

0 commit comments

Comments
 (0)