Merge remote-tracking branch 'origin/main' into room
This commit is contained in:
commit
afaacba41f
92 changed files with 10800 additions and 6586 deletions
|
@ -6,7 +6,7 @@ use crate::{
|
|||
geometry::vector::{vec2f, Vector2F},
|
||||
keymap,
|
||||
platform::{self, CursorStyle},
|
||||
Action, ClipboardItem, Event, Menu, MenuItem,
|
||||
Action, AppVersion, ClipboardItem, Event, Menu, MenuItem,
|
||||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use block::ConcreteBlock;
|
||||
|
@ -18,7 +18,8 @@ use cocoa::{
|
|||
},
|
||||
base::{id, nil, selector, YES},
|
||||
foundation::{
|
||||
NSArray, NSAutoreleasePool, NSBundle, NSData, NSInteger, NSString, NSUInteger, NSURL,
|
||||
NSArray, NSAutoreleasePool, NSBundle, NSData, NSInteger, NSProcessInfo, NSString,
|
||||
NSUInteger, NSURL,
|
||||
},
|
||||
};
|
||||
use core_foundation::{
|
||||
|
@ -758,6 +759,22 @@ impl platform::Platform for MacPlatform {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn os_name(&self) -> &'static str {
|
||||
"macOS"
|
||||
}
|
||||
|
||||
fn os_version(&self) -> Result<crate::AppVersion> {
|
||||
unsafe {
|
||||
let process_info = NSProcessInfo::processInfo(nil);
|
||||
let version = process_info.operatingSystemVersion();
|
||||
Ok(AppVersion {
|
||||
major: version.majorVersion as usize,
|
||||
minor: version.minorVersion as usize,
|
||||
patch: version.patchVersion as usize,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn path_from_objc(path: id) -> PathBuf {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue