Update objc2 crates (#3634)

Changes relevant to Winit:
- `icrate` has been deprecated in favour of separate crates per
  framework, in our case `objc2-foundation` and `objc2-app-kit` (and in
  the future `objc2-ui-kit` on iOS).
- Moved `MainThreadMarker::run_on_main` to free-standing function
  `run_on_main`.
- Changed how features work, this should result in less code that we
  need to compile.
- Enums are now real structs instead of type-aliases and free constants.
This commit is contained in:
Mads Marquart 2024-04-18 17:34:19 +02:00 committed by GitHub
parent 575d978202
commit 259e868c05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 289 additions and 270 deletions

View file

@ -1,6 +1,6 @@
use icrate::Foundation::{CGRect, MainThreadMarker, NSArray, NSObject};
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::{CGRect, MainThreadMarker, NSArray, NSObject};
use super::{UIResponder, UIWindow};

View file

@ -1,5 +1,5 @@
use icrate::Foundation::NSObject;
use objc2::{extern_class, mutability, ClassType};
use objc2_foundation::NSObject;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,7 +1,7 @@
use icrate::Foundation::{MainThreadMarker, NSInteger, NSObject};
use objc2::encode::{Encode, Encoding};
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::{MainThreadMarker, NSInteger, NSObject};
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,5 +1,5 @@
use icrate::Foundation::NSObject;
use objc2::{extern_class, mutability, ClassType};
use objc2_foundation::NSObject;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,5 +1,5 @@
use icrate::Foundation::NSUInteger;
use objc2::encode::{Encode, Encoding};
use objc2_foundation::NSUInteger;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

View file

@ -1,8 +1,8 @@
use icrate::Foundation::{CGFloat, NSInteger, NSObject, NSUInteger};
use objc2::{
encode::{Encode, Encoding},
extern_class, extern_methods, mutability, ClassType,
};
use objc2_foundation::{CGFloat, NSInteger, NSObject, NSUInteger};
// https://developer.apple.com/documentation/uikit/uigesturerecognizer
extern_class!(

View file

@ -3,7 +3,7 @@
use std::os::raw::{c_char, c_int};
use icrate::Foundation::NSString;
use objc2_foundation::NSString;
mod application;
mod coordinate_space;

View file

@ -1,5 +1,5 @@
use icrate::Foundation::NSObject;
use objc2::{extern_class, mutability, ClassType};
use objc2_foundation::NSObject;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,7 +1,7 @@
use icrate::Foundation::{CGFloat, CGRect, MainThreadMarker, NSArray, NSInteger, NSObject};
use objc2::encode::{Encode, Encoding};
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::{CGFloat, CGRect, MainThreadMarker, NSArray, NSInteger, NSObject};
use super::{UICoordinateSpace, UIScreenMode};

View file

@ -1,5 +1,5 @@
use icrate::Foundation::{CGSize, NSObject};
use objc2::{extern_class, extern_methods, mutability, ClassType};
use objc2_foundation::{CGSize, NSObject};
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,5 +1,5 @@
use icrate::Foundation::NSInteger;
use objc2::encode::{Encode, Encoding};
use objc2_foundation::NSInteger;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[allow(dead_code)]

View file

@ -1,6 +1,6 @@
use icrate::Foundation::{CGFloat, CGPoint, NSInteger, NSObject};
use objc2::encode::{Encode, Encoding};
use objc2::{extern_class, extern_methods, mutability, ClassType};
use objc2_foundation::{CGFloat, CGPoint, NSInteger, NSObject};
use super::UIView;

View file

@ -1,6 +1,6 @@
use icrate::Foundation::{NSInteger, NSObject};
use objc2::encode::{Encode, Encoding};
use objc2::{extern_class, extern_methods, mutability, ClassType};
use objc2_foundation::{NSInteger, NSObject};
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]

View file

@ -1,7 +1,7 @@
use icrate::Foundation::{CGFloat, CGRect, NSObject};
use objc2::encode::{Encode, Encoding};
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::{CGFloat, CGRect, NSObject};
use super::{UICoordinateSpace, UIGestureRecognizer, UIResponder, UIViewController};

View file

@ -1,7 +1,7 @@
use icrate::Foundation::{NSObject, NSUInteger};
use objc2::encode::{Encode, Encoding};
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::{NSObject, NSUInteger};
use super::{UIResponder, UIView};

View file

@ -1,6 +1,6 @@
use icrate::Foundation::NSObject;
use objc2::rc::Id;
use objc2::{extern_class, extern_methods, msg_send_id, mutability, ClassType};
use objc2_foundation::NSObject;
use super::{UIResponder, UIScreen, UIView};