Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ default = [
"animation",
"bevy_asset",
"bevy_audio",
"bevy_clipboard",
"bevy_color",
"bevy_core_pipeline",
"bevy_core_widgets",
Expand Down Expand Up @@ -308,12 +307,15 @@ bevy_log = ["bevy_internal/bevy_log"]
# Enable input focus subsystem
bevy_input_focus = ["bevy_internal/bevy_input_focus"]

# Clipboard access
bevy_clipboard = ["bevy_internal/bevy_clipboard"]
# Platform agnostic features
bevy_platform_services = ["bevy_internal/bevy_platform_services"]

# Headless widget collection for Bevy UI.
bevy_core_widgets = ["bevy_internal/bevy_core_widgets"]

# Clipboard access
clipboard = ["bevy_internal/clipboard"]

# Feathers widget collection.
experimental_bevy_feathers = ["bevy_internal/bevy_feathers"]

Expand Down
7 changes: 0 additions & 7 deletions crates/bevy_clipboard/README.md

This file was deleted.

5 changes: 3 additions & 2 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ web = [
]

# Clipboard support
bevy_clipboard = ["dep:bevy_clipboard"]
bevy_platform_services = ["dep:bevy_platform_services"]
clipboard = ["bevy_platform_services/clipboard"]

hotpatching = ["bevy_app/hotpatching", "bevy_ecs/hotpatching"]

Expand Down Expand Up @@ -460,7 +461,7 @@ bevy_window = { path = "../bevy_window", optional = true, version = "0.17.0-dev"
"bevy_reflect",
] }
bevy_winit = { path = "../bevy_winit", optional = true, version = "0.17.0-dev", default-features = false }
bevy_clipboard = { path = "../bevy_clipboard", optional = true, version = "0.17.0-dev" }
bevy_platform_services = { path = "../bevy_platform_services", optional = true, version = "0.17.0-dev" }

[lints]
workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_internal/src/default_plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ plugin_group! {
bevy_dev_tools:::DevToolsPlugin,
#[cfg(feature = "bevy_ci_testing")]
bevy_dev_tools::ci_testing:::CiTestingPlugin,
#[cfg(feature = "bevy_clipboard")]
bevy_clipboard:::ClipboardPlugin,
#[cfg(feature = "bevy_platform_services")]
bevy_platform_services:::ClipboardPlugin,
#[cfg(feature = "hotpatching")]
bevy_app::hotpatch:::HotPatchPlugin,
#[plugin_group]
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_internal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ pub use bevy_asset as asset;
pub use bevy_audio as audio;
#[cfg(feature = "bevy_camera")]
pub use bevy_camera as camera;
#[cfg(feature = "bevy_clipboard")]
pub use bevy_clipboard as clipboard;
#[cfg(feature = "bevy_color")]
pub use bevy_color as color;
#[cfg(feature = "bevy_core_pipeline")]
Expand Down Expand Up @@ -64,6 +62,8 @@ pub use bevy_pbr as pbr;
#[cfg(feature = "bevy_picking")]
pub use bevy_picking as picking;
pub use bevy_platform as platform;
#[cfg(feature = "bevy_platform_services")]
pub use bevy_platform_services as platform_services;
pub use bevy_ptr as ptr;
pub use bevy_reflect as reflect;
#[cfg(feature = "bevy_remote")]
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_internal/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ pub use crate::gltf::prelude::*;
pub use crate::picking::prelude::*;

#[doc(hidden)]
#[cfg(feature = "bevy_clipboard")]
pub use crate::clipboard::prelude::*;
#[cfg(feature = "bevy_platform_services")]
pub use crate::platform_services::prelude::*;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "bevy_clipboard"
name = "bevy_platform_services"
version = "0.17.0-dev"
edition = "2024"
description = "Provides clipboard support for Bevy Engine"
Expand All @@ -8,6 +8,10 @@ repository = "https://github.com/bevyengine/bevy"
license = "MIT OR Apache-2.0"
keywords = ["bevy", "clipboard"]

[features]
default = []
clipboard = []

[dependencies]
# bevy
bevy_app = { path = "../bevy_app", version = "0.17.0-dev", default-features = false }
Expand Down
8 changes: 8 additions & 0 deletions crates/bevy_platform_services/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Bevy Platform Services

[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/bevyengine/bevy#license)
[![Crates.io](https://img.shields.io/crates/v/bevy_platform_services.svg)](https://crates.io/crates/bevy_platform_services)
[![Downloads](https://img.shields.io/crates/d/bevy_platform_services.svg)](https://crates.io/crates/bevy_platform_services)
[![Docs](https://docs.rs/bevy_platform_services/badge.svg)](https://docs.rs/bevy_platform_services/latest/bevy_platform_services/)
[![Discord](https://img.shields.io/discord/691052431525675048.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/bevy)

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ use bevy_ecs::resource::Resource;
#[cfg(target_arch = "wasm32")]
use {alloc::sync::Arc, bevy_platform::sync::Mutex, wasm_bindgen_futures::JsFuture};

/// The clipboard prelude
pub mod prelude {
pub use crate::{Clipboard, ClipboardRead};
}

/// Clipboard plugin
#[derive(Default)]
pub struct ClipboardPlugin;
Expand Down
16 changes: 16 additions & 0 deletions crates/bevy_platform_services/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Implementations of high-level OS-specific services.
//!
//! Currently, only the clipboard is implemented, but this crate can serve to later contain other
//! OS independent services such as an on-screen keyboard for mobile and consoles, or desktop notifications.

/// Container for standard features
pub mod prelude {
#[cfg(feature = "clipboard")]
pub use crate::clipboard::{Clipboard, ClipboardPlugin, ClipboardRead};
}

#[cfg(feature = "clipboard")]
pub mod clipboard;

#[cfg(feature = "clipboard")]
pub use clipboard::ClipboardPlugin;
2 changes: 1 addition & 1 deletion docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The default feature set enables most of the expected features of a game engine,
|bevy_anti_aliasing|Provides various anti aliasing solutions|
|bevy_asset|Provides asset functionality|
|bevy_audio|Provides audio functionality|
|bevy_clipboard|Clipboard access|
|bevy_color|Provides shared color types and operations|
|bevy_core_pipeline|Provides cameras and other basic render pipeline features|
|bevy_core_widgets|Headless widget collection for Bevy UI.|
Expand All @@ -31,6 +30,7 @@ The default feature set enables most of the expected features of a game engine,
|bevy_mesh_picking_backend|Provides an implementation for picking meshes|
|bevy_pbr|Adds PBR rendering|
|bevy_picking|Provides picking functionality|
|bevy_platform_services|OS-independent services such as clipboard access|
|bevy_render|Provides rendering functionality|
|bevy_scene|Provides scene functionality|
|bevy_sprite|Provides sprite functionality|
Expand Down
2 changes: 1 addition & 1 deletion examples/ui/clipboard.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! This example demonstrates accessing the clipboard to retrieve and display text.

use bevy::{
clipboard::{Clipboard, ClipboardRead},
color::palettes::css::{GREY, NAVY, RED},
diagnostic::FrameTimeDiagnosticsPlugin,
platform_services::clipboard::{Clipboard, ClipboardRead},
prelude::*,
};

Expand Down