Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic binding generation #264

Closed
wants to merge 131 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
15f80d7
Add initial header translation
madsmtm Sep 4, 2022
c8be96d
Closer to usable
madsmtm Sep 7, 2022
2315c68
Mostly works with NSCursor
madsmtm Sep 7, 2022
197a05e
Mostly works with NSAlert.h
madsmtm Sep 8, 2022
2474385
Refactor a bit
madsmtm Sep 9, 2022
91cc01c
AppKit is now parse-able
madsmtm Sep 9, 2022
d09866c
handle reserved keywords
madsmtm Sep 9, 2022
556a5d8
Handle protocols somewhat
madsmtm Sep 9, 2022
f3093fc
Handle the few remaining entity kinds
madsmtm Sep 9, 2022
fb6096c
Works with Foundation
madsmtm Sep 9, 2022
399afc8
Cleanup
madsmtm Sep 9, 2022
61535ee
Refactor
madsmtm Sep 9, 2022
80a3404
Refactor Method to (almost) be PartialEq
madsmtm Sep 9, 2022
8249f69
Parse more things
madsmtm Sep 9, 2022
236d9d3
Parse NSConsumed
madsmtm Sep 9, 2022
68503bb
Verify memory management
madsmtm Sep 9, 2022
00522fe
More work
madsmtm Sep 9, 2022
5e95345
Fix reserved keywords
madsmtm Sep 9, 2022
bc25f91
Refactor statements
madsmtm Sep 9, 2022
7e35057
Add initial availability
madsmtm Sep 9, 2022
29b7560
Prepare RustType
madsmtm Sep 9, 2022
00b4678
Split RustType up in parse and ToToken part
madsmtm Sep 9, 2022
69a3d46
Add icrate
madsmtm Dec 8, 2022
5956025
Add config files
madsmtm Sep 17, 2022
cb9da7d
Temporarily disable protocol generation
madsmtm Sep 17, 2022
e7d9e13
Generate files
madsmtm Sep 17, 2022
f4165ee
Add initial generated files for Foundation
madsmtm Sep 17, 2022
88f5459
Skip "index" header
madsmtm Sep 17, 2022
0044e4d
Add basic imports
madsmtm Sep 17, 2022
c6a6058
Allow skipping methods
madsmtm Sep 17, 2022
1aecbea
Properly emit `unsafe`
madsmtm Sep 17, 2022
522955a
Make classes public
madsmtm Sep 17, 2022
1a59c17
Rename objc feature flag
madsmtm Sep 17, 2022
9ba52d1
Improve imports somewhat
madsmtm Sep 17, 2022
0d9a20c
Further import improvements
madsmtm Sep 17, 2022
09381b2
Handle basic typedefs
madsmtm Sep 19, 2022
ca1093f
Improve generics handling
madsmtm Sep 19, 2022
ac6a706
Improve pointers to objects
madsmtm Sep 19, 2022
5a4c02f
Refactor RustType::TypeDef
madsmtm Sep 19, 2022
7652279
Mostly support generics
madsmtm Sep 19, 2022
d9f6424
Refactor config setup
madsmtm Sep 19, 2022
3cd224a
Small fixes
madsmtm Sep 19, 2022
fc07a0c
Support nested generics
madsmtm Sep 19, 2022
2b181be
Comment out a bit of debug logging
madsmtm Sep 19, 2022
0cd5ee8
Emit all files
madsmtm Sep 19, 2022
02792f1
Parse sized integer types
madsmtm Sep 19, 2022
5ee3e77
Parse typedefs that map to other typedefs
madsmtm Sep 19, 2022
39b448c
Appease clippy
madsmtm Sep 23, 2022
3bc7009
Add `const`-parsing for RustType::Id
madsmtm Oct 3, 2022
9bdc5b6
Parse Objective-C in/out/inout/bycopy/byref/oneway qualifiers
madsmtm Oct 3, 2022
0aa9211
Fix `id` being emitted when it actually specifies a protocol
madsmtm Oct 6, 2022
78cc5b8
Make AppKit work again
madsmtm Oct 6, 2022
6781ccb
Parse all qualifiers, in particular lifetime qualifiers
madsmtm Oct 6, 2022
932e364
More consistent ObjCObjectPointer parsing
madsmtm Oct 6, 2022
d59a273
Validate some lifetime attributes
madsmtm Oct 6, 2022
ce48683
Fix out parameters (except for NSError)
madsmtm Oct 6, 2022
d0ae01e
Refactor Stmt objc declaration parsing
madsmtm Oct 7, 2022
8e2719c
Clean up how return types work
madsmtm Oct 7, 2022
1be4828
Refactor property parsing
madsmtm Oct 7, 2022
f05e4cb
Add support for functions taking NSError as an out parameter
madsmtm Oct 8, 2022
7ae7089
Change icrate directory layout
madsmtm Dec 8, 2022
eb96988
Refactor slightly
madsmtm Oct 8, 2022
baf2918
Refactor file handling to allow for multiple frameworks simultaneously
madsmtm Oct 8, 2022
7243dba
Put method output inside an extern_methods! call
madsmtm Oct 8, 2022
b7179a7
Use extern_methods! functionality
madsmtm Oct 8, 2022
d197f00
Manually fix the formatting of attribute macros in extern_methods!
madsmtm Oct 9, 2022
e6163d0
Add AppKit bindings
madsmtm Oct 9, 2022
f2585f1
Speed things up by optionally formatting at the end instead
madsmtm Oct 9, 2022
9cbb09e
Prepare for parsing more than one SDK
madsmtm Oct 9, 2022
2d12042
Specify a minimum deployment target
madsmtm Oct 10, 2022
5b2cf14
Document SDK situation
madsmtm Oct 10, 2022
1bf1966
Parse headers on iOS as well
madsmtm Oct 10, 2022
e59d24a
Refactor stmt parsing a bit
madsmtm Oct 24, 2022
7dc5107
Remove Stmt::FileImport and Stmt::ItemImport
madsmtm Oct 29, 2022
74a3615
Do preprocessing step explicitly as the first thing
madsmtm Oct 29, 2022
b5321fb
Refactor so that file writing is done using plain Display
madsmtm Oct 29, 2022
55887dd
Improve whitespace in generated files and add warning header
madsmtm Oct 29, 2022
e31a840
Don't crash on unions
madsmtm Oct 30, 2022
bed5cae
Add initial enum parsing
madsmtm Oct 31, 2022
a901658
Add initial enum expr parsing
madsmtm Oct 31, 2022
73622ef
Add very simple enum output
madsmtm Oct 31, 2022
5233fe9
Fix duplicate enum check
madsmtm Oct 31, 2022
44d568b
Improve enum expr parsing
madsmtm Oct 31, 2022
605a57e
Add static variable parsing
madsmtm Oct 31, 2022
83a5edd
Add a bit of WIP code
madsmtm Oct 31, 2022
b79667a
Add function parsing
madsmtm Oct 31, 2022
533ae24
Fix generic struct generation
madsmtm Nov 1, 2022
75e3082
Make &Class as return type static
madsmtm Nov 1, 2022
13d6f1c
Trim unnecessary parentheses
madsmtm Nov 1, 2022
615c5b2
Fix generics default parameter
madsmtm Nov 1, 2022
a013cd8
Remove methods that are both instance and class methods
madsmtm Nov 1, 2022
f877cf7
Skip protocols that are also classes
madsmtm Nov 1, 2022
c3e10d0
Improve imports setups
madsmtm Nov 1, 2022
10c863b
Bump recursion limit
madsmtm Nov 1, 2022
fb65380
Add MacTypes.h type translation
madsmtm Nov 1, 2022
b95b357
Fix int64_t type translation
madsmtm Nov 1, 2022
4afcce1
Make statics public
madsmtm Nov 1, 2022
639ebdc
Fix init methods
madsmtm Nov 1, 2022
c44ebee
Make __inner_extern_class allowing trailing comma in generics
madsmtm Nov 1, 2022
ecb690f
Attempt to improve Rust's parsing speed of icrate
madsmtm Nov 1, 2022
797a00d
Custom NSObject
madsmtm Nov 1, 2022
e051dd5
TMP import
madsmtm Nov 1, 2022
79f4692
Remove NSProxy
madsmtm Nov 1, 2022
e7d6ab7
Temporarily remove out parameter setup
madsmtm Nov 1, 2022
da25fc0
Add struct support
madsmtm Nov 2, 2022
6afde3a
Add partial support for "related result types"
madsmtm Nov 2, 2022
dee50de
Refactor typedef parsing a bit
madsmtm Nov 2, 2022
3c3c3c4
Output remaining typedefs
madsmtm Nov 2, 2022
67f7efd
Fix Option<Sel> and *mut bool
madsmtm Nov 2, 2022
7885cb3
Fix almost all remaining type errors in Foundation
madsmtm Nov 2, 2022
be5916b
Skip statics whoose value we cannot find
madsmtm Nov 2, 2022
c18ce67
Fix anonymous enum types
madsmtm Nov 2, 2022
d5ff384
Fix AppKit duplicate methods
madsmtm Nov 2, 2022
ff3012f
Add CoreData
madsmtm Dec 8, 2022
8694beb
Properly fix imports
madsmtm Nov 2, 2022
588e17f
Add `abstract` keyword
madsmtm Nov 2, 2022
f495d75
Put enum and static declarations behind a macro
madsmtm Nov 2, 2022
98d8dd8
Add proper IncompleteArray parsing
madsmtm Nov 3, 2022
4e692fe
Refactor type parsing
madsmtm Nov 3, 2022
b2815b4
Make NSError** handling happen in all the places that it does with Swift
madsmtm Nov 3, 2022
7f61929
Refactor Ty a bit more
madsmtm Nov 3, 2022
78fcdd1
Make Display for RustType always sound
madsmtm Nov 3, 2022
d78b975
Add support for function pointers
madsmtm Nov 3, 2022
2d25da2
Add support for block pointers
madsmtm Nov 3, 2022
0bcf7d0
Add extern functions
madsmtm Nov 3, 2022
35988ba
Emit protocol information
madsmtm Nov 3, 2022
2080c5e
Make CoreData compile
madsmtm Nov 4, 2022
baff198
Make AppKit compile
madsmtm Nov 4, 2022
cb00d95
Add support for the AuthenticationServices framework
madsmtm Dec 8, 2022
d1ae521
Do clang < v13 workarounds without modifying sources
madsmtm Nov 24, 2022
1c4c875
Refactor Foundation fixes
madsmtm Dec 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add proper IncompleteArray parsing
  • Loading branch information
madsmtm committed Dec 8, 2022
commit 98d8dd80bdbdaa8b469eae49e15a9b3f182a7625
81 changes: 66 additions & 15 deletions crates/header-translator/src/rust_type.rs
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ impl GenericType {
.get_objc_type_arguments()
.into_iter()
.map(|param| {
match RustType::parse(param, false, Nullability::Unspecified) {
match RustType::parse(param, false, Nullability::Unspecified, false) {
RustType::Id {
type_,
is_const: _,
@@ -112,6 +112,7 @@ fn parse_attributed<'a>(
nullability: &mut Nullability,
lifetime: &mut Lifetime,
kindof: Option<&mut bool>,
inside_partial_array: bool,
) -> Type<'a> {
let mut modified_ty = ty.clone();
while modified_ty.get_kind() == TypeKind::Attributed {
@@ -186,6 +187,13 @@ fn parse_attributed<'a>(
}
}

if inside_partial_array {
if let Some(rest) = name.strip_prefix("__unsafe_unretained") {
*lifetime = Lifetime::Unretained;
name = rest.trim();
}
}

if let Some(rest) = name.strip_suffix("__unsafe_unretained") {
*lifetime = Lifetime::Unretained;
name = rest.trim();
@@ -292,6 +300,11 @@ pub enum RustType {
is_const: bool,
pointee: Box<RustType>,
},
IncompleteArray {
nullability: Nullability,
is_const: bool,
pointee: Box<RustType>,
},
Array {
element_type: Box<RustType>,
num_elements: usize,
@@ -356,13 +369,24 @@ impl RustType {
}
}

fn parse(ty: Type<'_>, is_consumed: bool, mut nullability: Nullability) -> Self {
fn parse(
ty: Type<'_>,
is_consumed: bool,
mut nullability: Nullability,
inside_partial_array: bool,
) -> Self {
use TypeKind::*;

// println!("{:?}, {:?}", ty, ty.get_class_type());

let mut lifetime = Lifetime::Unspecified;
let ty = parse_attributed(ty, &mut nullability, &mut lifetime, None);
let ty = parse_attributed(
ty,
&mut nullability,
&mut lifetime,
None,
inside_partial_array,
);

// println!("{:?}: {:?}", ty.get_kind(), ty.get_display_name());

@@ -398,7 +422,7 @@ impl RustType {
let ty = ty.get_pointee_type().expect("pointer type to have pointee");
// Note: Can't handle const id pointers
// assert!(!ty.is_const_qualified(), "expected pointee to not be const");
let pointee = Self::parse(ty, is_consumed, Nullability::Unspecified);
let pointee = Self::parse(ty, is_consumed, Nullability::Unspecified, false);
Self::Pointer {
nullability,
is_const,
@@ -408,7 +432,13 @@ impl RustType {
ObjCObjectPointer => {
let ty = ty.get_pointee_type().expect("pointer type to have pointee");
let mut kindof = false;
let ty = parse_attributed(ty, &mut nullability, &mut lifetime, Some(&mut kindof));
let ty = parse_attributed(
ty,
&mut nullability,
&mut lifetime,
Some(&mut kindof),
false,
);
let type_ = GenericType::parse_objc_pointer(ty);

Self::Id {
@@ -507,14 +537,24 @@ impl RustType {
FunctionPrototype => Self::TypeDef {
name: "TodoFunction".to_string(),
},
IncompleteArray => Self::TypeDef {
name: "TodoArray".to_string(),
},
IncompleteArray => {
let is_const = ty.is_const_qualified();
let ty = ty
.get_element_type()
.expect("incomplete array to have element type");
let pointee = Self::parse(ty, is_consumed, Nullability::Unspecified, true);
Self::IncompleteArray {
nullability,
is_const,
pointee: Box::new(pointee),
}
}
ConstantArray => {
let element_type = Self::parse(
ty.get_element_type().expect("array to have element type"),
is_consumed,
Nullability::Unspecified,
false,
);
let num_elements = ty
.get_size()
@@ -536,20 +576,26 @@ impl RustType {
match self {
Self::Id { lifetime, .. } => f(*lifetime),
Self::Pointer { pointee, .. } => pointee.visit_lifetime(f),
Self::IncompleteArray { pointee, .. } => pointee.visit_lifetime(f),
Self::Array { element_type, .. } => element_type.visit_lifetime(f),
_ => {}
}
}

pub fn parse_argument(ty: Type<'_>, is_consumed: bool) -> Self {
let this = Self::parse(ty, is_consumed, Nullability::Unspecified);
let this = Self::parse(ty, is_consumed, Nullability::Unspecified, false);

match &this {
Self::Pointer { pointee, .. } => pointee.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Autoreleasing && lifetime != Lifetime::Unspecified {
panic!("unexpected lifetime {lifetime:?} in pointer argument {ty:?}");
}
}),
Self::IncompleteArray { pointee, .. } => pointee.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Unretained && lifetime != Lifetime::Unspecified {
panic!("unexpected lifetime {lifetime:?} in incomplete array argument {ty:?}");
}
}),
_ => this.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Strong && lifetime != Lifetime::Unspecified {
panic!("unexpected lifetime {lifetime:?} in argument {ty:?}");
@@ -591,7 +637,7 @@ impl RustType {
Self::TypeDef { name: type_.name }
}
_ => {
let this = Self::parse(ty, false, Nullability::Unspecified);
let this = Self::parse(ty, false, Nullability::Unspecified, false);

this.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Unspecified {
@@ -605,7 +651,7 @@ impl RustType {
}

pub fn parse_property(ty: Type<'_>, default_nullability: Nullability) -> Self {
let this = Self::parse(ty, false, default_nullability);
let this = Self::parse(ty, false, default_nullability, false);

this.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Unspecified {
@@ -617,7 +663,7 @@ impl RustType {
}

pub fn parse_struct_field(ty: Type<'_>) -> Self {
let this = Self::parse(ty, false, Nullability::Unspecified);
let this = Self::parse(ty, false, Nullability::Unspecified, false);

this.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Unspecified {
@@ -629,7 +675,7 @@ impl RustType {
}

pub fn parse_enum(ty: Type<'_>) -> Self {
let this = Self::parse(ty, false, Nullability::Unspecified);
let this = Self::parse(ty, false, Nullability::Unspecified, false);

this.visit_lifetime(|_lifetime| {
panic!("unexpected lifetime in enum {this:?}");
@@ -706,6 +752,11 @@ impl fmt::Display for RustType {
nullability,
is_const,
pointee,
}
| IncompleteArray {
nullability,
is_const,
pointee,
} => match &**pointee {
// Self::Id {
// type_,
@@ -800,7 +851,7 @@ impl RustTypeReturn {
}

pub fn parse(ty: Type<'_>) -> Self {
Self::new(RustType::parse(ty, false, Nullability::Unspecified))
Self::new(RustType::parse(ty, false, Nullability::Unspecified, false))
}

pub fn as_error(&self) -> String {
@@ -873,7 +924,7 @@ pub struct RustTypeStatic {

impl RustTypeStatic {
pub fn parse(ty: Type<'_>) -> Self {
let inner = RustType::parse(ty, false, Nullability::Unspecified);
let inner = RustType::parse(ty, false, Nullability::Unspecified, false);

inner.visit_lifetime(|lifetime| {
if lifetime != Lifetime::Strong && lifetime != Lifetime::Unspecified {
3 changes: 3 additions & 0 deletions crates/header-translator/src/stmt.rs
Original file line number Diff line number Diff line change
@@ -469,6 +469,9 @@ impl Stmt {
};
Some(Self::AliasDecl { name, type_ })
}
RustType::IncompleteArray { .. } => {
unimplemented!("incomplete array in struct")
}
type_ => Some(Self::AliasDecl { name, type_ }),
}
}
4 changes: 2 additions & 2 deletions crates/icrate/src/generated/AppKit/NSBitmapImageRep.rs
Original file line number Diff line number Diff line change
@@ -259,10 +259,10 @@ extern_methods!(
pub unsafe fn colorAtX_y(&self, x: NSInteger, y: NSInteger) -> Option<Id<NSColor, Shared>>;

#[method(getPixel:atX:y:)]
pub unsafe fn getPixel_atX_y(&self, p: TodoArray, x: NSInteger, y: NSInteger);
pub unsafe fn getPixel_atX_y(&self, p: NonNull<NSUInteger>, x: NSInteger, y: NSInteger);

#[method(setPixel:atX:y:)]
pub unsafe fn setPixel_atX_y(&self, p: TodoArray, x: NSInteger, y: NSInteger);
pub unsafe fn setPixel_atX_y(&self, p: NonNull<NSUInteger>, x: NSInteger, y: NSInteger);

#[method(CGImage)]
pub unsafe fn CGImage(&self) -> CGImageRef;
12 changes: 8 additions & 4 deletions crates/icrate/src/generated/Foundation/NSArray.rs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ extern_methods!(
#[method_id(@__retain_semantics Init initWithObjects:count:)]
pub unsafe fn initWithObjects_count(
this: Option<Allocated<Self>>,
objects: TodoArray,
objects: *mut NonNull<ObjectType>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -92,7 +92,11 @@ extern_methods!(
) -> Option<Id<ObjectType, Shared>>;

#[method(getObjects:range:)]
pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange);
pub unsafe fn getObjects_range(
&self,
objects: NonNull<NonNull<ObjectType>>,
range: NSRange,
);

#[method(indexOfObject:)]
pub unsafe fn indexOfObject(&self, anObject: &ObjectType) -> NSUInteger;
@@ -270,7 +274,7 @@ extern_methods!(

#[method_id(@__retain_semantics Other arrayWithObjects:count:)]
pub unsafe fn arrayWithObjects_count(
objects: TodoArray,
objects: NonNull<NonNull<ObjectType>>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -339,7 +343,7 @@ extern_methods!(
/// NSDeprecated
unsafe impl<ObjectType: Message> NSArray<ObjectType> {
#[method(getObjects:)]
pub unsafe fn getObjects(&self, objects: TodoArray);
pub unsafe fn getObjects(&self, objects: NonNull<NonNull<ObjectType>>);

#[method_id(@__retain_semantics Other arrayWithContentsOfFile:)]
pub unsafe fn arrayWithContentsOfFile(
20 changes: 12 additions & 8 deletions crates/icrate/src/generated/Foundation/NSDictionary.rs
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@ extern_methods!(
#[method_id(@__retain_semantics Init initWithObjects:forKeys:count:)]
pub unsafe fn initWithObjects_forKeys_count(
this: Option<Allocated<Self>>,
objects: TodoArray,
keys: TodoArray,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<NSCopying>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -105,8 +105,8 @@ extern_methods!(
#[method(getObjects:andKeys:count:)]
pub unsafe fn getObjects_andKeys_count(
&self,
objects: TodoArray,
keys: TodoArray,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<KeyType>,
count: NSUInteger,
);

@@ -158,7 +158,11 @@ extern_methods!(
/// NSDeprecated
unsafe impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType> {
#[method(getObjects:andKeys:)]
pub unsafe fn getObjects_andKeys(&self, objects: TodoArray, keys: TodoArray);
pub unsafe fn getObjects_andKeys(
&self,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<KeyType>,
);

#[method_id(@__retain_semantics Other dictionaryWithContentsOfFile:)]
pub unsafe fn dictionaryWithContentsOfFile(
@@ -208,8 +212,8 @@ extern_methods!(

#[method_id(@__retain_semantics Other dictionaryWithObjects:forKeys:count:)]
pub unsafe fn dictionaryWithObjects_forKeys_count(
objects: TodoArray,
keys: TodoArray,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<NSCopying>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -363,7 +367,7 @@ extern_methods!(
pub unsafe fn countByEnumeratingWithState_objects_count(
&self,
state: NonNull<NSFastEnumerationState>,
buffer: TodoArray,
buffer: NonNull<*mut K>,
len: NSUInteger,
) -> NSUInteger;
}
4 changes: 2 additions & 2 deletions crates/icrate/src/generated/Foundation/NSIndexPath.rs
Original file line number Diff line number Diff line change
@@ -19,14 +19,14 @@ extern_methods!(

#[method_id(@__retain_semantics Other indexPathWithIndexes:length:)]
pub unsafe fn indexPathWithIndexes_length(
indexes: TodoArray,
indexes: *mut NSUInteger,
length: NSUInteger,
) -> Id<Self, Shared>;

#[method_id(@__retain_semantics Init initWithIndexes:length:)]
pub unsafe fn initWithIndexes_length(
this: Option<Allocated<Self>>,
indexes: TodoArray,
indexes: *mut NSUInteger,
length: NSUInteger,
) -> Id<Self, Shared>;

10 changes: 5 additions & 5 deletions crates/icrate/src/generated/Foundation/NSOrderedSet.rs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ extern_methods!(
#[method_id(@__retain_semantics Init initWithObjects:count:)]
pub unsafe fn initWithObjects_count(
this: Option<Allocated<Self>>,
objects: TodoArray,
objects: *mut NonNull<ObjectType>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -47,7 +47,7 @@ extern_methods!(
/// NSExtendedOrderedSet
unsafe impl<ObjectType: Message> NSOrderedSet<ObjectType> {
#[method(getObjects:range:)]
pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange);
pub unsafe fn getObjects_range(&self, objects: *mut NonNull<ObjectType>, range: NSRange);

#[method_id(@__retain_semantics Other objectsAtIndexes:)]
pub unsafe fn objectsAtIndexes(
@@ -203,7 +203,7 @@ extern_methods!(

#[method_id(@__retain_semantics Other orderedSetWithObjects:count:)]
pub unsafe fn orderedSetWithObjects_count(
objects: TodoArray,
objects: NonNull<NonNull<ObjectType>>,
cnt: NSUInteger,
) -> Id<Self, Shared>;

@@ -377,7 +377,7 @@ extern_methods!(
pub unsafe fn addObject(&self, object: &ObjectType);

#[method(addObjects:count:)]
pub unsafe fn addObjects_count(&self, objects: TodoArray, count: NSUInteger);
pub unsafe fn addObjects_count(&self, objects: *mut NonNull<ObjectType>, count: NSUInteger);

#[method(addObjectsFromArray:)]
pub unsafe fn addObjectsFromArray(&self, array: &NSArray<ObjectType>);
@@ -409,7 +409,7 @@ extern_methods!(
pub unsafe fn replaceObjectsInRange_withObjects_count(
&self,
range: NSRange,
objects: TodoArray,
objects: *mut NonNull<ObjectType>,
count: NSUInteger,
);

Loading