diff --git a/cocoa-foundation/src/foundation.rs b/cocoa-foundation/src/foundation.rs index 80d97ca..b9ca8b0 100644 --- a/cocoa-foundation/src/foundation.rs +++ b/cocoa-foundation/src/foundation.rs @@ -229,12 +229,8 @@ pub trait NSProcessInfo: Sized { msg_send![class!(NSProcessInfo), processInfo] } - unsafe fn systemUptime(_: Self) -> NSTimeInterval { - msg_send![class!(NSProcessInfo), systemUptime] - } - + unsafe fn systemUptime(self) -> NSTimeInterval; unsafe fn processName(self) -> id; - unsafe fn uptime(self) -> NSTimeInterval; unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion; unsafe fn isOperatingSystemAtLeastVersion(self, version: NSOperatingSystemVersion) -> bool; } @@ -244,7 +240,7 @@ impl NSProcessInfo for id { msg_send![self, processName] } - unsafe fn uptime(self) -> NSTimeInterval { + unsafe fn systemUptime(self) -> NSTimeInterval { msg_send![self, systemUptime] } diff --git a/core-foundation/Cargo.toml b/core-foundation/Cargo.toml index fba824b..ce2e09e 100644 --- a/core-foundation/Cargo.toml +++ b/core-foundation/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["macos", "framework", "objc"] [dependencies.core-foundation-sys] path = "../core-foundation-sys" -version = "0.8.0" +version = "0.8.3" [dependencies] libc = "0.2" diff --git a/core-text/src/font.rs b/core-text/src/font.rs index ebe6d58..d710705 100644 --- a/core-text/src/font.rs +++ b/core-text/src/font.rs @@ -691,6 +691,8 @@ fn macos_version() -> (i32, i32, i32) { #[test] fn copy_system_font() { + use crate::*; + let small = unsafe { CTFont::wrap_under_create_rule( CTFontCreateUIFontForLanguage(kCTFontSystemDetailFontType, 19., std::ptr::null()) @@ -712,6 +714,12 @@ fn copy_system_font() { let ctfont = new_from_descriptor(&desc, 20.); assert_eq!(big.postscript_name(), ctfont.postscript_name()); + // check that we can construct a new version by attributes + let attr = desc.attributes(); + let desc_from_attr = font_descriptor::new_from_attributes(&attr); + let font_from_attr = new_from_descriptor(&desc_from_attr, 19.); + assert_eq!(font_from_attr.postscript_name(), small.postscript_name()); + // on newer versions of macos we can't construct by name anymore if macos_version() < (10, 13, 0) { let ui_font_by_name = new_from_name(&small.postscript_name(), 19.).unwrap();