Partially replace custom AppKit bindings with icrate's autogenerated bindings (#2982)
* Refactor winit-specific cursor logic out of appkit module * Add relevant AppKit features that we depend on * Use icrate's NSImageRep and NSBitmapImageRep * Use icrate's NSImage * Use icrate's NSCursor * Use icrate's NSAppearance * Use icrate's NSScreen * Use icrate's NSButton * Use icrate's NSAppKitVersionNumber * Use icrate's NSTextInputContext * Use icrate's NSColor * Use icrate's NSEvent * Use icrate's NSMenu and NSMenuItem * Use icrate's NSPasteboard * Use icrate's NSResponder * Use icrate's NSTextInputClient * Use icrate's NSView
This commit is contained in:
parent
7d5bee767c
commit
674657efb6
32 changed files with 547 additions and 1362 deletions
|
|
@ -2,6 +2,7 @@
|
|||
use std::cell::Cell;
|
||||
use std::ptr;
|
||||
|
||||
use icrate::AppKit::{NSFilenamesPboardType, NSPasteboard};
|
||||
use icrate::Foundation::{NSArray, NSObject, NSSize, NSString};
|
||||
use objc2::rc::{autoreleasepool, Id};
|
||||
use objc2::runtime::AnyObject;
|
||||
|
|
@ -9,9 +10,7 @@ use objc2::{
|
|||
class, declare_class, msg_send, msg_send_id, mutability, sel, ClassType, DeclaredClass,
|
||||
};
|
||||
|
||||
use super::appkit::{
|
||||
NSApplicationPresentationOptions, NSFilenamesPboardType, NSPasteboard, NSWindowOcclusionState,
|
||||
};
|
||||
use super::appkit::{NSApplicationPresentationOptions, NSWindowOcclusionState};
|
||||
use super::{
|
||||
app_state::AppState,
|
||||
util,
|
||||
|
|
@ -144,7 +143,7 @@ declare_class!(
|
|||
use std::path::PathBuf;
|
||||
|
||||
let pb: Id<NSPasteboard> = unsafe { msg_send_id![sender, draggingPasteboard] };
|
||||
let filenames = pb.propertyListForType(unsafe { NSFilenamesPboardType });
|
||||
let filenames = pb.propertyListForType(unsafe { NSFilenamesPboardType }).unwrap();
|
||||
let filenames: Id<NSArray<NSString>> = unsafe { Id::cast(filenames) };
|
||||
|
||||
filenames.into_iter().for_each(|file| {
|
||||
|
|
@ -170,7 +169,7 @@ declare_class!(
|
|||
use std::path::PathBuf;
|
||||
|
||||
let pb: Id<NSPasteboard> = unsafe { msg_send_id![sender, draggingPasteboard] };
|
||||
let filenames = pb.propertyListForType(unsafe { NSFilenamesPboardType });
|
||||
let filenames = pb.propertyListForType(unsafe { NSFilenamesPboardType }).unwrap();
|
||||
let filenames: Id<NSArray<NSString>> = unsafe { Id::cast(filenames) };
|
||||
|
||||
filenames.into_iter().for_each(|file| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue