From f7dbd4f5ec40d3a752e47559f61cab99406db3cd Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 15 May 2025 21:51:44 +0200 Subject: [PATCH 1/3] Deprecate cocoa-foundation --- cocoa-foundation/src/base.rs | 1 + cocoa-foundation/src/foundation.rs | 2 +- cocoa-foundation/src/lib.rs | 3 ++- cocoa-foundation/tests/foundation.rs | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cocoa-foundation/src/base.rs b/cocoa-foundation/src/base.rs index 028205e89..314c703dc 100644 --- a/cocoa-foundation/src/base.rs +++ b/cocoa-foundation/src/base.rs @@ -6,6 +6,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deprecated = "use the objc2 crate instead"] use objc::runtime; diff --git a/cocoa-foundation/src/foundation.rs b/cocoa-foundation/src/foundation.rs index f518d6e00..6800e2c23 100644 --- a/cocoa-foundation/src/foundation.rs +++ b/cocoa-foundation/src/foundation.rs @@ -6,7 +6,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. - +#![deprecated = "use the objc2-foundation crate instead"] #![allow(non_upper_case_globals)] use crate::base::{id, nil, BOOL, NO, SEL}; diff --git a/cocoa-foundation/src/lib.rs b/cocoa-foundation/src/lib.rs index cf224b5a4..9ffc821de 100644 --- a/cocoa-foundation/src/lib.rs +++ b/cocoa-foundation/src/lib.rs @@ -7,7 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(non_snake_case)] +//! This crate has been deprecated in favour of the `objc2-foundation` crate. +#![allow(non_snake_case, deprecated)] pub mod base; pub mod foundation; diff --git a/cocoa-foundation/tests/foundation.rs b/cocoa-foundation/tests/foundation.rs index c726cc152..680e853b7 100644 --- a/cocoa-foundation/tests/foundation.rs +++ b/cocoa-foundation/tests/foundation.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + #[cfg(test)] mod foundation { mod nsstring { From 5afce24d44556153c644535e2147431f7741a7cb Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 15 May 2025 21:51:57 +0200 Subject: [PATCH 2/3] Deprecate cocoa --- cocoa/README.md | 4 +++- cocoa/examples/color.rs | 1 + cocoa/examples/fullscreen.rs | 1 + cocoa/examples/hello_world.rs | 1 + cocoa/examples/nsvisualeffectview_blur.rs | 1 + cocoa/examples/tab_view.rs | 1 + cocoa/src/appkit.rs | 1 + cocoa/src/base.rs | 10 ---------- cocoa/src/foundation.rs | 10 ---------- cocoa/src/lib.rs | 7 ++++--- cocoa/src/macros.rs | 1 + cocoa/src/quartzcore.rs | 1 + 12 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 cocoa/src/base.rs delete mode 100644 cocoa/src/foundation.rs diff --git a/cocoa/README.md b/cocoa/README.md index 597d6c582..34ac84c65 100644 --- a/cocoa/README.md +++ b/cocoa/README.md @@ -1,6 +1,8 @@ Cocoa-rs -------- +NOTE: This crate has been deprecated in favour of the `objc2` crates. + This crate provides Rust bindings to Cocoa for macOS. It's dual-licensed MIT / Apache 2.0. If you'd like to help improve cocoa-rs, check out [the Servo -contributing guide](https://github.com/servo/servo/blob/main/CONTRIBUTING.md)! +contributing guide](https://github.com/servo/servo/blob/main/CONTRIBUTING.md)! diff --git a/cocoa/examples/color.rs b/cocoa/examples/color.rs index 401bdeac7..e97cb5405 100644 --- a/cocoa/examples/color.rs +++ b/cocoa/examples/color.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // the cocoa crate is deprecated use cocoa::base::{id, nil, selector, NO}; use cocoa::appkit::{ diff --git a/cocoa/examples/fullscreen.rs b/cocoa/examples/fullscreen.rs index 7571e8d16..19c14b1c4 100644 --- a/cocoa/examples/fullscreen.rs +++ b/cocoa/examples/fullscreen.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // the cocoa crate is deprecated use cocoa::appkit::{ NSApp, NSApplication, NSApplicationActivateIgnoringOtherApps, NSApplicationActivationPolicyRegular, NSApplicationPresentationOptions, NSBackingStoreBuffered, diff --git a/cocoa/examples/hello_world.rs b/cocoa/examples/hello_world.rs index 2c64a9feb..7bba17e67 100644 --- a/cocoa/examples/hello_world.rs +++ b/cocoa/examples/hello_world.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // the cocoa crate is deprecated use cocoa::appkit::{ NSApp, NSApplication, NSApplicationActivateIgnoringOtherApps, NSApplicationActivationPolicyRegular, NSBackingStoreBuffered, NSMenu, NSMenuItem, diff --git a/cocoa/examples/nsvisualeffectview_blur.rs b/cocoa/examples/nsvisualeffectview_blur.rs index 994b94f83..d93e69502 100644 --- a/cocoa/examples/nsvisualeffectview_blur.rs +++ b/cocoa/examples/nsvisualeffectview_blur.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // the cocoa crate is deprecated use cocoa::base::{nil, selector, NO}; use objc::*; diff --git a/cocoa/examples/tab_view.rs b/cocoa/examples/tab_view.rs index 7e98eb746..4beed87ad 100644 --- a/cocoa/examples/tab_view.rs +++ b/cocoa/examples/tab_view.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] // the cocoa crate is deprecated use cocoa::base::{id, nil, selector, NO}; use cocoa::appkit::{ diff --git a/cocoa/src/appkit.rs b/cocoa/src/appkit.rs index 36bd26349..1b20503cc 100644 --- a/cocoa/src/appkit.rs +++ b/cocoa/src/appkit.rs @@ -7,6 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deprecated = "use the objc2-app-kit crate instead"] #![allow(non_upper_case_globals)] use crate::base::{id, BOOL, SEL}; diff --git a/cocoa/src/base.rs b/cocoa/src/base.rs deleted file mode 100644 index d1a6f892a..000000000 --- a/cocoa/src/base.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2013 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub use cocoa_foundation::base::*; diff --git a/cocoa/src/foundation.rs b/cocoa/src/foundation.rs deleted file mode 100644 index 3608d55d0..000000000 --- a/cocoa/src/foundation.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2013 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub use cocoa_foundation::foundation::*; diff --git a/cocoa/src/lib.rs b/cocoa/src/lib.rs index 1650ae111..ce8dee5cd 100644 --- a/cocoa/src/lib.rs +++ b/cocoa/src/lib.rs @@ -7,14 +7,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +//! This crate has been deprecated in favour of the `objc2` crates. #![crate_name = "cocoa"] #![crate_type = "rlib"] -#![allow(non_snake_case)] +#![allow(non_snake_case, deprecated)] #[cfg(target_os = "macos")] pub mod appkit; -pub mod base; -pub mod foundation; +pub use cocoa_foundation::base; +pub use cocoa_foundation::foundation; #[cfg(target_os = "macos")] pub mod quartzcore; #[macro_use] diff --git a/cocoa/src/macros.rs b/cocoa/src/macros.rs index 7063da85e..781ff4cc7 100644 --- a/cocoa/src/macros.rs +++ b/cocoa/src/macros.rs @@ -38,6 +38,7 @@ /// # } /// ``` #[macro_export] +#[deprecated = "use the objc2::define_class! macro instead"] macro_rules! delegate { ( $name:expr, { diff --git a/cocoa/src/quartzcore.rs b/cocoa/src/quartzcore.rs index c96d86512..f2133f7aa 100644 --- a/cocoa/src/quartzcore.rs +++ b/cocoa/src/quartzcore.rs @@ -7,6 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deprecated = "use the objc2-quartz-core crate instead"] #![allow(non_upper_case_globals)] use bitflags::bitflags; From 49aa42093fd9aa78c36eba0ca811bb290cc58cbb Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 12 May 2025 16:17:18 +0200 Subject: [PATCH 3/3] Deprecate io-surface --- io-surface/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/io-surface/src/lib.rs b/io-surface/src/lib.rs index 5b84aa4f5..9331cde7f 100644 --- a/io-surface/src/lib.rs +++ b/io-surface/src/lib.rs @@ -7,6 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +//! This crate has been deprecated in favour of the `objc2-io-surface` crate. +#![deprecated = "use the objc2-io-surface crate instead"] #![crate_name = "io_surface"] #![crate_type = "rlib"]