diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cfead00e..90436c4b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,6 +164,7 @@ You can find its changes [documented below](#070---2021-01-01). - Added examples in `TextBox` ([#2284] by [@ThomasMcandrew]) - Removed outdated section in docs for `LifeCycle::WidgetAdded` ([#2320] by [@sprocklem]) - Updated `Event::AnimFrame` docs with info about when `paint` happens. ([#2323] by [@xStrom]) +- Implemented standardized Druid naming convention. ([#2337] by [@xStrom]) ### Examples - Add readme ([#1423] by [@JAicewizard]) @@ -344,16 +345,16 @@ values and their textual representations. ([#1377]) #### X11 backend for druid-shell. -[@crsaracco] got us started and implemented basic support to run druid on bare-metal X11 in [#599]. +[@crsaracco] got us started and implemented basic support to run Druid on bare-metal X11 in [#599]. Additional features got fleshed out in [#894] and [#900] by [@xStrom] and in [#920], [#961], and [#982] by [@jneem]. -While still incomplete this lays the foundation for running druid on Linux without relying on GTK. +While still incomplete this lays the foundation for running Druid on Linux without relying on GTK. #### Web backend for druid-shell. [@elrnv] continued the work of [@tedsta] and implemented a mostly complete web backend -via WebAssembly (Wasm) in [#759] and enabled all druid examples to +via WebAssembly (Wasm) in [#759] and enabled all Druid examples to [run in the browser](https://elrnv.github.io/druid-wasm-examples/). While some features like the clipboard, menus or file dialogs are not yet available, @@ -364,8 +365,8 @@ all fundamental features are there. [@cmyr] continued the work of [@jrmuizel] and implemented Core Graphics support for Piet in [piet#176](https://github.com/linebender/piet/pull/176). -Those changes made it into druid via [#905]. -This means that druid no longer requires cairo on macOS and uses Core Graphics instead. +Those changes made it into Druid via [#905]. +This means that Druid no longer requires cairo on macOS and uses Core Graphics instead. ### Added @@ -494,7 +495,7 @@ This means that druid no longer requires cairo on macOS and uses Core Graphics i ### Outside News -- There are new projects using druid: +- There are new projects using Druid: - [Kondo](https://github.com/tbillington/kondo) Save disk space by cleaning unneeded files from software projects. - [jack-mixer](https://github.com/derekdreery/jack-mixer) A jack client that provides mixing, levels and a 3-band eq. - [kiro-synth](https://github.com/chris-zen/kiro-synth) An in progress modular sound synthesizer. @@ -893,6 +894,7 @@ Last release without a changelog :( [#2324]: https://github.com/linebender/druid/pull/2324 [#2331]: https://github.com/linebender/druid/pull/2331 [#2335]: https://github.com/linebender/druid/pull/2335 +[#2337]: https://github.com/linebender/druid/pull/2337 [#2338]: https://github.com/linebender/druid/pull/2338 [#2340]: https://github.com/linebender/druid/pull/2340 [#2343]: https://github.com/linebender/druid/pull/2343 diff --git a/docs/src/02_getting_started.md b/docs/src/02_getting_started.md index a64e467dc..4662484ac 100644 --- a/docs/src/02_getting_started.md +++ b/docs/src/02_getting_started.md @@ -31,7 +31,7 @@ On OpenBSD, Druid requires gtk+3; install from packages: ## Starting a project -Create a new cargo binary crate, and add druid as a dependency: +Create a new cargo binary crate, and add `druid` as a dependency: ```sh > cargo new my-druid-app diff --git a/docs/src/05_lens.md b/docs/src/05_lens.md index 1d3173295..16d0500b8 100644 --- a/docs/src/05_lens.md +++ b/docs/src/05_lens.md @@ -108,7 +108,7 @@ impl Lens for NameLens { As you'll see, we've introduced `Rc`: the reference-counted pointer. You will see this and its multithreaded cousin `Arc` used pervasively in the examples. Now, the only time we actually have to copy memory is when `Rc::make_mut` is called in the `f` in `with_mut`. This means that in the case where nothing changes, all we will be doing is incrementing and decrementing reference counts. Moreover, we give the compiler the opportunity to inline `f` and `with`/`with_mut`, making this abstraction potentially zero-cost (disclaimer: I haven't actually studied the produced assembly to validate this claim). -The trade-off is that we introduce more complexity into the `Name` type: to make changes to the data we have to use `Rc::make_mut` to get mutable access to the `String`. (The code in the lens will ensure that the newer copy of the `Rc`d data is saved to the outer type.) This means the writing fast druid code requires knowledge of the Rust pointer types (`Rc`/`Arc`, and also potentially `RefCell`/`Mutex`). +The trade-off is that we introduce more complexity into the `Name` type: to make changes to the data we have to use `Rc::make_mut` to get mutable access to the `String`. (The code in the lens will ensure that the newer copy of the `Rc`d data is saved to the outer type.) This means the writing fast Druid code requires knowledge of the Rust pointer types (`Rc`/`Arc`, and also potentially `RefCell`/`Mutex`). We can actually do even better than this. Suppose that we are working on a vector of data rather than a string. We can import the `im` crate to get collections that use *structural sharing*, meaning that even when the vector is mutated, we only *Clone* what we need to. Because `im` is so useful, it is included in `druid` (behind the `im` feature). diff --git a/docs/src/07_resolution_independence.md b/docs/src/07_resolution_independence.md index 15b344b89..93fbb0c5f 100644 --- a/docs/src/07_resolution_independence.md +++ b/docs/src/07_resolution_independence.md @@ -54,7 +54,7 @@ the large image assets would be scaled down to the size that makes sense for the Druid aims to make all of this as **easy and automatic** as possible. Druid has expressive vector drawing capabilities that you should use whenever possible. -Vector drawing is also used by the widgets that come included with druid. +Vector drawing is also used by the widgets that come included with Druid. Handling different pixel densities is done at the `druid-shell` level already. In fact pixels mostly don't even enter the conversation at the `druid` level. The `druid` coordinate system is instead measured in **display points** (**dp**), @@ -62,9 +62,9 @@ e.g. you might say a widget has a width of **100dp**. *Display points* are conceptually similar to Microsoft's *device-independent pixels*, Google's *density-independent pixels*, Apple's *points*, and CSS's *pixel units*. -You **describe the UI using display points and then druid will automatically +You **describe the UI using display points and then Druid will automatically translate that into pixels** based on the pixel density of the platform. Remember there might be multiple displays connected with different pixel densities, and your application might have multiple windows - with each window on a different display. -It will all just work, because druid will adjust the actual pixel dimensions +It will all just work, because Druid will adjust the actual pixel dimensions based on the display that the window is currently located on. diff --git a/druid-derive/Cargo.toml b/druid-derive/Cargo.toml index 81b7434d7..d8551a273 100644 --- a/druid-derive/Cargo.toml +++ b/druid-derive/Cargo.toml @@ -3,7 +3,7 @@ name = "druid-derive" version = "0.4.0" license = "Apache-2.0" authors = ["Druid authors"] -description = "derive impls for druid, a Rust UI toolkit." +description = "derive impls for Druid, a Rust UI toolkit." repository = "https://github.com/linebender/druid" edition = "2018" diff --git a/druid-derive/README.md b/druid-derive/README.md index c92dcb029..13df6da66 100644 --- a/druid-derive/README.md +++ b/druid-derive/README.md @@ -1,5 +1,5 @@ # druid-derive -This crate is implementations of derive macros for [druid][]. +This crate contains the implementations of derive macros for [Druid]. -[druid]: https://github.com/linebender/druid +[Druid]: https://github.com/linebender/druid diff --git a/druid-derive/src/lib.rs b/druid-derive/src/lib.rs index 095f78add..ee4bf1dd2 100644 --- a/druid-derive/src/lib.rs +++ b/druid-derive/src/lib.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! derive macros for druid. +//! derive macros for Druid. #![deny(clippy::trivially_copy_pass_by_ref)] #![doc( diff --git a/druid-shell/Cargo.toml b/druid-shell/Cargo.toml index bae19d2d3..8282449b1 100755 --- a/druid-shell/Cargo.toml +++ b/druid-shell/Cargo.toml @@ -3,7 +3,7 @@ name = "druid-shell" version = "0.7.0" license = "Apache-2.0" authors = ["Raph Levien "] -description = "Platform abstracting application shell used for druid toolkit." +description = "Platform abstracting application shell used for Druid toolkit." repository = "https://github.com/linebender/druid" readme = "README.md" categories = ["os::macos-apis", "os::windows-apis", "gui"] diff --git a/druid-shell/examples/edit_text.rs b/druid-shell/examples/edit_text.rs index 75ec42c67..351a62bbb 100644 --- a/druid-shell/examples/edit_text.rs +++ b/druid-shell/examples/edit_text.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This example shows a how a single-line text field might be implemented for druid-shell. +//! This example shows a how a single-line text field might be implemented for `druid-shell`. //! Beyond the omission of multiple lines and text wrapping, it also is missing many motions //! (like "move to previous word") and bidirectional text support. diff --git a/druid-shell/src/backend/mac/mod.rs b/druid-shell/src/backend/mac/mod.rs index c84d879cf..6832d1953 100644 --- a/druid-shell/src/backend/mac/mod.rs +++ b/druid-shell/src/backend/mac/mod.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! macOS druid-shell backend. +//! macOS `druid-shell` backend. #![allow(clippy::let_unit_value)] diff --git a/druid-shell/src/backend/mac/window.rs b/druid-shell/src/backend/mac/window.rs index 6e16b870d..ff694fd40 100644 --- a/druid-shell/src/backend/mac/window.rs +++ b/druid-shell/src/backend/mac/window.rs @@ -899,7 +899,7 @@ fn set_size_deferred(this: &mut Object, _view_state: &mut ViewState, size: Size) let current_frame: NSRect = msg_send![window, frame]; let mut new_frame = current_frame; - // maintain druid origin (as mac origin is bottom left) + // maintain Druid origin (as mac origin is bottom left) new_frame.origin.y -= size.height - current_frame.size.height; new_frame.size.width = size.width; new_frame.size.height = size.height; diff --git a/druid-shell/src/backend/wayland/error.rs b/druid-shell/src/backend/wayland/error.rs index 1e79b29e2..b7074b319 100644 --- a/druid-shell/src/backend/wayland/error.rs +++ b/druid-shell/src/backend/wayland/error.rs @@ -27,7 +27,7 @@ pub enum Error { version: u32, inner: Arc, }, - /// An unexpected error occurred. It's not handled by druid-shell/wayland, so you should + /// An unexpected error occurred. It's not handled by `druid-shell`/wayland, so you should /// terminate the app. Fatal(Arc), String(ErrorString), diff --git a/druid-shell/src/backend/wayland/keyboard.rs b/druid-shell/src/backend/wayland/keyboard.rs index 3fb21d3da..c6ed94e94 100644 --- a/druid-shell/src/backend/wayland/keyboard.rs +++ b/druid-shell/src/backend/wayland/keyboard.rs @@ -135,7 +135,7 @@ impl Keyboard { event.mods = self.xkb_mods.get(); if let Err(cause) = keystroke.queue.send(event) { - tracing::error!("failed to send druid key event: {:?}", cause); + tracing::error!("failed to send Druid key event: {:?}", cause); } } diff --git a/druid-shell/src/backend/windows/mod.rs b/druid-shell/src/backend/windows/mod.rs index 8c169b3dd..28ddcf812 100644 --- a/druid-shell/src/backend/windows/mod.rs +++ b/druid-shell/src/backend/windows/mod.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Windows implementation of druid-shell. +//! Windows implementation of `druid-shell`. mod accels; pub mod application; @@ -40,7 +40,7 @@ pub mod window; // // https://docs.microsoft.com/en-us/windows/win32/direct2d/devices-and-device-contexts // A Device Context, ID2D1DeviceContext, is available as of windows 7 platform update. This -// is the minimum compatibility target for druid. We are not making an effort to do +// is the minimum compatibility target for Druid. We are not making an effort to do // RenderTarget only. // // Basically, go from HwndRenderTarget or DxgiSurfaceRenderTarget (2d or 3d) to a Device Context. diff --git a/druid-shell/src/backend/windows/window.rs b/druid-shell/src/backend/windows/window.rs index d6c692d0f..63b702e6f 100644 --- a/druid-shell/src/backend/windows/window.rs +++ b/druid-shell/src/backend/windows/window.rs @@ -137,7 +137,7 @@ pub enum PresentStrategy { /// We work hard to avoid calling into `WinHandler` re-entrantly. Since we use /// the system's event loop, and since the `WinHandler` gets a `WindowHandle` to use, this implies /// that none of the `WindowHandle`'s methods can return control to the system's event loop -/// (because if it did, the system could call back into druid-shell with some mouse event, and then +/// (because if it did, the system could call back into `druid-shell` with some mouse event, and then /// we'd try to call the `WinHandler` again). /// /// The solution is that for every `WindowHandle` method that *wants* to return control to the @@ -146,12 +146,12 @@ pub enum PresentStrategy { /// method returns. /// /// An example call trace might look like: -/// 1. the system hands a mouse click event to druid-shell -/// 2. druid-shell calls `WinHandler::mouse_up` +/// 1. the system hands a mouse click event to `druid-shell` +/// 2. `druid-shell` calls `WinHandler::mouse_up` /// 3. after some processing, the `WinHandler` calls `WindowHandle::save_as`, which schedules a /// deferred op and returns immediately /// 4. after some more processing, `WinHandler::mouse_up` returns -/// 5. druid-shell displays the "save as" dialog that was requested in step 3. +/// 5. `druid-shell` displays the "save as" dialog that was requested in step 3. enum DeferredOp { SaveAs(FileDialogOptions, FileDialogToken), Open(FileDialogOptions, FileDialogToken), diff --git a/druid-shell/src/backend/x11/mod.rs b/druid-shell/src/backend/x11/mod.rs index ae2e9b092..388f1e38b 100644 --- a/druid-shell/src/backend/x11/mod.rs +++ b/druid-shell/src/backend/x11/mod.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! X11 implementation of druid-shell. +//! X11 implementation of `druid-shell`. // TODO(x11/render_improvements): screen is currently flashing when resizing in perftest. // Might be related to the "sleep scheduler" in XWindow::render()? diff --git a/druid-shell/src/lib.rs b/druid-shell/src/lib.rs index 5510e5dac..ad82ffa42 100644 --- a/druid-shell/src/lib.rs +++ b/druid-shell/src/lib.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Platform abstraction for druid toolkit. +//! Platform abstraction for Druid toolkit. //! //! `druid-shell` is an abstraction around a given platform UI & application //! framework. It provides common types, which then defer to a platform-defined diff --git a/druid-shell/src/scale.rs b/druid-shell/src/scale.rs index 2d0a53d2c..14b5cee7f 100644 --- a/druid-shell/src/scale.rs +++ b/druid-shell/src/scale.rs @@ -28,7 +28,7 @@ use crate::kurbo::{Insets, Line, Point, Rect, Size, Vec2}; /// These display points will be automatically converted into pixels under the hood. /// One pixel is equal to one display point when the platform scale factor is `1.0`. /// -/// Read more about pixels and display points [in the druid book]. +/// Read more about pixels and display points [in the Druid book]. /// /// ## Converting with `Scale` /// @@ -42,7 +42,7 @@ use crate::kurbo::{Insets, Line, Point, Rect, Size, Vec2}; /// /// [`x`]: #method.x /// [`y`]: #method.y -/// [in the druid book]: https://linebender.org/druid/resolution_independence.html +/// [in the Druid book]: https://linebender.org/druid/07_resolution_independence.html #[derive(Copy, Clone, PartialEq, Debug)] pub struct Scale { /// The scale factor on the x axis. diff --git a/druid-shell/src/text.rs b/druid-shell/src/text.rs index 89280e832..d79e95184 100644 --- a/druid-shell/src/text.rs +++ b/druid-shell/src/text.rs @@ -54,7 +54,7 @@ //! 3. The user presses a key on the keyboard. The platform first calls //! `WinHandler::key_down`. If this method returns `true`, the application //! has indicated the keypress was captured, and we skip the remaining steps. -//! 4. If `key_down` returned `false`, druid-shell forwards the key event to the +//! 4. If `key_down` returned `false`, `druid-shell` forwards the key event to the //! platform's text input system //! 5. The platform, in response to either this key event or some other user //! action, determines it's time for some text input. It calls @@ -97,7 +97,7 @@ //! ## Supported Platforms //! //! Currently, `druid-shell` text input is fully implemented on macOS. Our goal -//! is to have full support for all druid-shell targets, but for now, +//! is to have full support for all `druid-shell` targets, but for now, //! `InputHandler` calls are simulated from keypresses on other platforms, which //! doesn't allow for IME input, dead keys, etc. diff --git a/druid/examples/game_of_life.rs b/druid/examples/game_of_life.rs index f2711edff..f531bba4c 100644 --- a/druid/examples/game_of_life.rs +++ b/druid/examples/game_of_life.rs @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This is an example of how you would implement the game of life with druid. -//! This example doesn't showcase anything specific in druid. +//! This is an example of how you would implement the game of life with Druid. +//! This example doesn't showcase anything specific in Druid. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] diff --git a/druid/examples/hello.rs b/druid/examples/hello.rs index 04687f27e..5338e05d5 100644 --- a/druid/examples/hello.rs +++ b/druid/examples/hello.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This is a very small example of how to setup a druid application. +//! This is a very small example of how to setup a Druid application. //! It does the almost bare minimum while still being useful. // On Windows platform, don't show a console when opening the app. diff --git a/druid/examples/hello_web/README.md b/druid/examples/hello_web/README.md index bfb864a74..a6962353c 100644 --- a/druid/examples/hello_web/README.md +++ b/druid/examples/hello_web/README.md @@ -1,7 +1,7 @@ # Druid web hello world -This is a minimal example of building a single druid application for the web. -To build all the druid examples for the web, check out the `web` example directory. +This is a minimal example of building a single Druid application for the web. +To build all the Druid examples for the web, check out the `web` example directory. ## Building diff --git a/druid/examples/layout.rs b/druid/examples/layout.rs index ba8a1a689..2d8fc500b 100644 --- a/druid/examples/layout.rs +++ b/druid/examples/layout.rs @@ -71,7 +71,7 @@ fn build_app() -> impl Widget { .background(Color::WHITE); col.add_flex_child(aspect_ratio_box.center(), 1.0); - // This method asks druid to draw colored rectangles around our widgets, + // This method asks Druid to draw colored rectangles around our widgets, // so we can visually inspect their layout rectangles. col.debug_paint_layout() } diff --git a/druid/examples/readme.md b/druid/examples/readme.md index b986532de..86097835a 100644 --- a/druid/examples/readme.md +++ b/druid/examples/readme.md @@ -52,7 +52,7 @@ two possible widgets. ``` cargo run --example hello ``` -This shows some of the basics of druid. If you need a start of how to build an application with a text-box and some labels this is where to start. +This shows some of the basics of Druid. If you need a start of how to build an application with a text-box and some labels this is where to start. ## Hello_web For more info and prerequistes see [druid/examples/hello_web/README.md](druid/examples/hello_web/README.md). @@ -62,7 +62,7 @@ wasm-pack build --out-dir pkg --out-name hello_web ``` [View at http://localhost:8000](http://localhost:8000). -This is an example of how to get almost any druid application can be used on the web. This is just the hello_world example but should work for all of them. +This is an example of how to get almost any Druid application can be used on the web. This is just the hello_world example but should work for all of them. ## Web For more info and prerequistes see [druid/examples/web/README.md](druid/examples/web/README.md). @@ -78,7 +78,7 @@ Simple web app. ``` cargo run --example identity ``` -In druid identity is used to send specific widgets commands. Instead of a command going to all the widgets, you can send them to just the one you need. This example has some colorwells and some buttons that interact with them. All of them are identical, except the identity, which makes it possible for the buttons to only affect a single colorwell. +In Druid identity is used to send specific widgets commands. Instead of a command going to all the widgets, you can send them to just the one you need. This example has some colorwells and some buttons that interact with them. All of them are identical, except the identity, which makes it possible for the buttons to only affect a single colorwell. ## Invalidation ``` @@ -90,13 +90,13 @@ A demonstration how to use debug invalidation regions in your own widgets, inclu ``` cargo run --example layout ``` -An example of how basic widget composition works in druid. There are no custom widgets just compositions of builtin ones. +An example of how basic widget composition works in Druid. There are no custom widgets just compositions of builtin ones. ## Lens ``` cargo run --example lens ``` -Lenses are a core part of druid, they allow you to zoom into a part of the app state. +Lenses are a core part of Druid, they allow you to zoom into a part of the app state. ## List ``` @@ -166,13 +166,13 @@ This shows you how to display an SVG as a widget. ``` cargo run --example switches ``` -Switches are useful in many ways, this example shows how to use the druid built-in ones. This includes on/off and up/down for incrementing numeric values. +Switches are useful in many ways, this example shows how to use the Druid built-in ones. This includes on/off and up/down for incrementing numeric values. ## Tabs ``` cargo run --example tabs --features="im" ``` -Tabs allow you to separate different portions of the UI. This example shows you how to use them in druid. similar to [view switcher](#View Switcher) but with with a different purpose. +Tabs allow you to separate different portions of the UI. This example shows you how to use them in Druid. similar to [view switcher](#View Switcher) but with with a different purpose. ## Text ``` @@ -255,7 +255,7 @@ cargo run --example image --features "image png" Image shows off all the knobs you can turn on images. You can play with them with real time results, which you to figure out what settings are best for you. -Please note that the image is exported with some kind of interpolation. So even when you turn interpolation off/NearestNeighbor in druid, you will still see this because that's how the image actually looks. +Please note that the image is exported with some kind of interpolation. So even when you turn interpolation off/NearestNeighbor in Druid, you will still see this because that's how the image actually looks. ## Scroll Colors ``` @@ -269,7 +269,7 @@ This is a showcase is scrolling through an image gradient square. The square is cargo run --example styled_text ``` -In druid you can change all kinds of styling aspects of text as not all text should look +In Druid you can change all kinds of styling aspects of text as not all text should look the same. This showcases some of those things such as, color, size, and monospace. ## Widget Gallery diff --git a/druid/examples/styled_text.rs b/druid/examples/styled_text.rs index 05090c052..82d5a1210 100644 --- a/druid/examples/styled_text.rs +++ b/druid/examples/styled_text.rs @@ -81,7 +81,7 @@ fn ui_builder() -> impl Widget { } }); - // This is druid's default text style. + // This is Druid's default text style. // It's set by theme::LABEL_COLOR and theme::UI_FONT let label = Label::new(|data: &String, _env: &_| format!("Default: {data}")).lens(AppData::text); diff --git a/druid/examples/value_formatting/README.md b/druid/examples/value_formatting/README.md index 5cc1c0dc4..b423b848c 100644 --- a/druid/examples/value_formatting/README.md +++ b/druid/examples/value_formatting/README.md @@ -5,7 +5,7 @@ that the textbox contains valid data. The example is reasonably complex, for a number of reasons: firstly there are currently no built-in implementations of the `Formatter` trait included in -druid, which means we have to write versions for the example, and additionally +Druid, which means we have to write versions for the example, and additionally the mechanism for reporting errors that occur during formatting are difficult to -handle in druid's current architecture, and involve some fairly ugly use of +handle in Druid's current architecture, and involve some fairly ugly use of `Command` in order to function. diff --git a/druid/examples/web/Cargo.toml b/druid/examples/web/Cargo.toml index cf9d3fbf2..3d0116fb0 100644 --- a/druid/examples/web/Cargo.toml +++ b/druid/examples/web/Cargo.toml @@ -2,7 +2,7 @@ name = "druid-web-examples" version = "0.1.0" license = "Apache-2.0" -description = "Scaffolding for druid web examples" +description = "Scaffolding for Druid web examples" repository = "https://github.com/linebender/druid" edition = "2021" publish = false diff --git a/druid/src/app.rs b/druid/src/app.rs index b774a28f3..a20d701dc 100644 --- a/druid/src/app.rs +++ b/druid/src/app.rs @@ -83,7 +83,7 @@ pub struct WindowDesc { } /// The parts of a window, pending construction, that are dependent on top level app state -/// or are not part of the druid shells windowing abstraction. +/// or are not part of the `druid-shell`'s windowing abstraction. /// This includes the boxed root widget, as well as other window properties such as the title. pub struct PendingWindow { pub(crate) root: Box>, diff --git a/druid/src/box_constraints.rs b/druid/src/box_constraints.rs index 2bf8aca58..3d97e61a3 100644 --- a/druid/src/box_constraints.rs +++ b/druid/src/box_constraints.rs @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The fundamental druid types. +//! The fundamental Druid types. use crate::kurbo::Size; use crate::widget::Axis; /// Constraints for layout. /// -/// The layout strategy for druid is strongly inspired by Flutter, +/// The layout strategy for Druid is strongly inspired by Flutter, /// and this struct is similar to the [Flutter BoxConstraints] class. /// /// At the moment, it represents simply a minimum and maximum size. diff --git a/druid/src/command.rs b/druid/src/command.rs index 35c14c895..bf3fe426d 100644 --- a/druid/src/command.rs +++ b/druid/src/command.rs @@ -36,7 +36,7 @@ pub(crate) type SelectorSymbol = &'static str; /// The type parameter `T` specifies the command's payload type. /// See [`Command`] for more information. /// -/// Certain `Selector`s are defined by druid, and have special meaning +/// Certain `Selector`s are defined by Druid, and have special meaning /// to the framework; these are listed in the [`druid::commands`] module. /// /// [`Command`]: struct.Command.html @@ -161,7 +161,7 @@ pub enum Target { Auto, } -/// Commands with special meaning, defined by druid. +/// Commands with special meaning, defined by Druid. /// /// See [`Command`] for more info. pub mod sys { @@ -173,7 +173,7 @@ pub mod sys { FileDialogOptions, FileInfo, Rect, SingleUse, WidgetId, WindowConfig, }; - /// Quit the running application. This command is handled by the druid library. + /// Quit the running application. This command is handled by the Druid library. pub const QUIT_APP: Selector = Selector::new("druid-builtin.quit-app"); /// Hide the application. (mac only) @@ -549,9 +549,9 @@ impl Notification { self.source } - /// Builder-style method to set warn_if_unused. + /// Builder-style method to set `warn_if_unused`. /// - /// The default is true. + /// The default is `true`. pub fn warn_if_unused(mut self, warn_if_unused: bool) -> Self { self.warn_if_unused = warn_if_unused; self diff --git a/druid/src/core.rs b/druid/src/core.rs index 71ef3ea85..db2ec7314 100644 --- a/druid/src/core.rs +++ b/druid/src/core.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The fundamental druid types. +//! The fundamental Druid types. use std::collections::VecDeque; use tracing::{trace, trace_span, warn}; @@ -38,7 +38,7 @@ pub(crate) type CommandQueue = VecDeque; /// but rather contain a `WidgetPod`, which has additional state needed /// for layout and for the widget to participate in event flow. /// -/// `WidgetPod` will translate internal druid events to regular events, +/// `WidgetPod` will translate internal Druid events to regular events, /// synthesize additional events of interest, and stop propagation when it makes sense. /// /// This struct also contains the previous data for a widget, which is diff --git a/druid/src/data.rs b/druid/src/data.rs index 65804dbce..b5a5e1f36 100644 --- a/druid/src/data.rs +++ b/druid/src/data.rs @@ -71,13 +71,13 @@ use piet::ImageBuf; /// ## Collection types /// /// `Data` is not implemented for `std` collection types, because comparing them -/// can be expensive. To use collection types with druid, there are two easy options: -/// either wrap the collection in an `Arc`, or build druid with the `im` feature, +/// can be expensive. To use collection types with Druid, there are two easy options: +/// either wrap the collection in an `Arc`, or build `druid` with the `im` feature, /// which adds `Data` implementations to the collections from the [`im` crate], -/// a set of immutable data structures that fit nicely with druid. +/// a set of immutable data structures that fit nicely with Druid. /// /// If the `im` feature is used, the `im` crate is reexported from the root -/// of the druid crate. +/// of the `druid` crate. /// /// ### Example: /// diff --git a/druid/src/dialog.rs b/druid/src/dialog.rs index ab1248a6b..9e84d715d 100644 --- a/druid/src/dialog.rs +++ b/druid/src/dialog.rs @@ -14,7 +14,7 @@ //! Configuration for open and save file dialogs. //! -//! This is a wrapper around [`druid_shell::FileDialogOptions`] with a few extra druid specifics. +//! This is a wrapper around [`druid_shell::FileDialogOptions`] with a few extra Druid specifics. //! As such, many of the docs are copied from `druid_shell`, and should be kept in sync. use std::path::PathBuf; diff --git a/druid/src/env.rs b/druid/src/env.rs index 20fd137d6..9aae7046b 100644 --- a/druid/src/env.rs +++ b/druid/src/env.rs @@ -339,7 +339,7 @@ impl Env { /// Returns a reference to the [`L10nManager`], which handles localization /// resources. /// - /// This always exists on the base `Env` configured by druid. + /// This always exists on the base `Env` configured by Druid. pub(crate) fn localization_manager(&self) -> Option<&L10nManager> { self.0.l10n.as_deref() } diff --git a/druid/src/event.rs b/druid/src/event.rs index 228260f5f..b118d00a4 100644 --- a/druid/src/event.rs +++ b/druid/src/event.rs @@ -204,7 +204,7 @@ pub enum Event { /// should check the shared state, perform invalidation, and update `Data` /// as necessary. ImeStateChange, - /// Internal druid event. + /// Internal Druid event. /// /// This should always be passed down to descendant [`WidgetPod`]s. /// @@ -212,7 +212,7 @@ pub enum Event { Internal(InternalEvent), } -/// Internal events used by druid inside [`WidgetPod`]. +/// Internal events used by Druid inside [`WidgetPod`]. /// /// These events are translated into regular [`Event`]s /// and should not be used directly. @@ -294,7 +294,7 @@ pub enum LifeCycle { /// See [`is_hot`](crate::EventCtx::is_hot) for /// discussion about the hot status. HotChanged(bool), - /// This is called when the widget-tree changes and druid wants to rebuild the + /// This is called when the widget-tree changes and Druid wants to rebuild the /// Focus-chain. /// /// It is the only place from which [`register_for_focus`] should be called. @@ -320,7 +320,7 @@ pub enum LifeCycle { /// /// [`view_context_changed`]: crate::EventCtx::view_context_changed ViewContextChanged(ViewContext), - /// Internal druid lifecycle event. + /// Internal Druid lifecycle event. /// /// This should always be passed down to descendant [`WidgetPod`]s. /// @@ -328,7 +328,7 @@ pub enum LifeCycle { Internal(InternalLifeCycle), } -/// Internal lifecycle events used by druid inside [`WidgetPod`]. +/// Internal lifecycle events used by Druid inside [`WidgetPod`]. /// /// These events are translated into regular [`LifeCycle`] events /// and should not be used directly. diff --git a/druid/src/lib.rs b/druid/src/lib.rs index 63dd2a64c..6c2fce571 100644 --- a/druid/src/lib.rs +++ b/druid/src/lib.rs @@ -35,7 +35,7 @@ //! As your application grows, you can use [`Lens`]es to expose only certain //! subsets of your data model to certain subsets of your widget tree. //! -//! For more information you should read the [druid book]. +//! For more information you should read the [Druid book]. //! //! # Examples //! @@ -143,7 +143,7 @@ //! [`druid-shell`]: druid_shell //! [`piet`]: piet //! [`druid/examples`]: https://github.com/linebender/druid/tree/v0.7.0/druid/examples -//! [druid book]: https://linebender.org/druid/ +//! [Druid book]: https://linebender.org/druid/ //! [`im` crate]: https://crates.io/crates/im //! [`im` module]: im/index.html //! [`usvg` crate]: https://crates.io/crates/usvg diff --git a/druid/src/menu/mod.rs b/druid/src/menu/mod.rs index 5258c847d..ae3c6c936 100644 --- a/druid/src/menu/mod.rs +++ b/druid/src/menu/mod.rs @@ -79,13 +79,13 @@ //! .entry(MenuItem::new(LocalizedString::new("macos-menu-services"))) //! .entry( //! MenuItem::new(LocalizedString::new("macos-menu-hide-app")) -//! // druid handles the HIDE_APPLICATION command automatically +//! // Druid handles the HIDE_APPLICATION command automatically //! .command(commands::HIDE_APPLICATION) //! .hotkey(SysMods::Cmd, "h"), //! ) //! .entry( //! MenuItem::new(LocalizedString::new("macos-menu-hide-others")) -//! // druid handles the HIDE_OTHERS command automatically +//! // Druid handles the HIDE_OTHERS command automatically //! .command(commands::HIDE_OTHERS) //! .hotkey(SysMods::AltCmd, "h"), //! ) @@ -98,7 +98,7 @@ //! .separator() //! .entry( //! MenuItem::new(LocalizedString::new("macos-menu-quit-app")) -//! // druid handles the QUIT_APP command automatically +//! // Druid handles the QUIT_APP command automatically //! .command(commands::QUIT_APP) //! .hotkey(SysMods::Cmd, "q"), //! ) @@ -827,7 +827,7 @@ struct MenuItemState { /// Uniquely identifies a menu item. /// -/// On the druid-shell side, the id is represented as a u32. +/// On the `druid-shell` side, the id is represented as a u32. /// We reserve '0' as a placeholder value; on the Rust side /// we represent this as an `Option`, which better /// represents the semantics of our program. diff --git a/druid/src/tests/harness.rs b/druid/src/tests/harness.rs index a4c95938d..dc5940e22 100644 --- a/druid/src/tests/harness.rs +++ b/druid/src/tests/harness.rs @@ -33,7 +33,7 @@ pub(crate) const DEFAULT_SIZE: Size = Size::new(400., 400.); /// You create a `Harness` with some widget and its initial data; then you /// can send events to that widget and verify that expected conditions are met. /// -/// Harness tries to act like the normal druid environment; for instance, it will +/// Harness tries to act like the normal Druid environment; for instance, it will /// attempt to dispatch any `Command`s that are sent during event handling, and /// it will call `update` automatically after an event. /// @@ -42,7 +42,7 @@ pub(crate) const DEFAULT_SIZE: Size = Size::new(400., 400.); /// `children_changed` flags on the window after an update. /// /// In addition, layout and paint **are not called automatically**. This is -/// because paint is triggered by druid-shell, and there is no druid-shell here; +/// because paint is triggered by `druid-shell`, and there is no `druid-shell` here; /// /// if you want those functions run you will need to call them yourself. /// diff --git a/druid/src/text/input_methods.rs b/druid/src/text/input_methods.rs index 48f086ff3..371697430 100644 --- a/druid/src/text/input_methods.rs +++ b/druid/src/text/input_methods.rs @@ -14,8 +14,8 @@ //! Types related to input method editing. //! -//! Most IME-related code is in druid-shell; these are helper types used -//! exclusively in druid. +//! Most IME-related code is in `druid-shell`; these are helper types used +//! exclusively in `druid`. use std::rc::Rc; @@ -29,7 +29,7 @@ use crate::WidgetId; /// [`LifeCycle::WidgetAdded`] event. /// /// The widget does not explicitly *deregister* afterwards; rather anytime -/// the widget tree changes, druid will call [`is_alive`] on each registered +/// the widget tree changes, `druid` will call [`is_alive`] on each registered /// `ImeHandlerRef`, and deregister those that return `false`. /// /// [`LifeCycle::WidgetAdded`]: crate::LifeCycle::WidgetAdded diff --git a/druid/src/text/storage.rs b/druid/src/text/storage.rs index a9b27f129..2f7e1efde 100644 --- a/druid/src/text/storage.rs +++ b/druid/src/text/storage.rs @@ -78,7 +78,7 @@ impl<'a, 'b> EnvUpdateCtx<'a, 'b> { /// A reference counted string slice. /// -/// This is a data-friendly way to represent strings in druid. Unlike `String` +/// This is a data-friendly way to represent strings in Druid. Unlike `String` /// it cannot be mutated, but unlike `String` it can be cheaply cloned. pub type ArcStr = Arc; diff --git a/druid/src/widget/align.rs b/druid/src/widget/align.rs index 277f52d40..c3b813156 100644 --- a/druid/src/widget/align.rs +++ b/druid/src/widget/align.rs @@ -32,7 +32,7 @@ impl Align { /// /// Note that the `align` parameter is specified as a `UnitPoint` in /// terms of left and right. This is inadequate for bidi-aware layout - /// and thus the API will change when druid gains bidi capability. + /// and thus the API will change when Druid gains bidi capability. pub fn new(align: UnitPoint, child: impl Widget + 'static) -> Align { Align { align, diff --git a/druid/src/widget/image.rs b/druid/src/widget/image.rs index 9596d4bd3..74799e429 100644 --- a/druid/src/widget/image.rs +++ b/druid/src/widget/image.rs @@ -260,7 +260,7 @@ mod tests { use crate::piet::ImageFormat; use test_log::test; - /// Painting an empty image shouldn't crash druid. + /// Painting an empty image shouldn't crash Druid. #[test] fn empty_paint() { use crate::{tests::harness::Harness, WidgetId}; diff --git a/druid/src/widget/lens_wrap.rs b/druid/src/widget/lens_wrap.rs index ce68f4bab..d227f0c1d 100644 --- a/druid/src/widget/lens_wrap.rs +++ b/druid/src/widget/lens_wrap.rs @@ -26,7 +26,7 @@ use tracing::{instrument, trace}; /// A wrapper for its widget subtree to have access to a part /// of its parent's data. /// -/// Every widget in druid is instantiated with access to data of some +/// Every widget in Druid is instantiated with access to data of some /// type; the root widget has access to the entire application data. /// Often, a part of the widget hierarchy is only concerned with a part /// of that data. The `LensWrap` widget is a way to "focus" the data diff --git a/druid/src/widget/value_textbox.rs b/druid/src/widget/value_textbox.rs index 50c916913..3c9339285 100644 --- a/druid/src/widget/value_textbox.rs +++ b/druid/src/widget/value_textbox.rs @@ -371,7 +371,7 @@ impl Widget for ValueTextBox { self.old_buffer = self.buffer.clone(); } else { // textbox is not well equipped to deal with the fact that, in - // druid, data can change anywhere in the tree. If we are actively + // Druid, data can change anywhere in the tree. If we are actively // editing, and new data arrives, we ignore the new data and keep // editing; the alternative would be to cancel editing, which // could also make sense. diff --git a/druid/src/win_handler.rs b/druid/src/win_handler.rs index fd0981927..12385a56d 100644 --- a/druid/src/win_handler.rs +++ b/druid/src/win_handler.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The implementation of the WinHandler trait (druid-shell integration). +//! The implementation of the `WinHandler` trait (`druid-shell` integration). use std::any::{Any, TypeId}; use std::cell::RefCell; @@ -45,7 +45,7 @@ pub(crate) const RUN_COMMANDS_TOKEN: IdleToken = IdleToken::new(1); /// A token we are called back with if an external event was submitted. pub(crate) const EXT_EVENT_IDLE_TOKEN: IdleToken = IdleToken::new(2); -/// The struct implements the druid-shell `WinHandler` trait. +/// The struct implements the `druid-shell` `WinHandler` trait. /// /// One `DruidHandler` exists per window. /// @@ -60,7 +60,7 @@ pub struct DruidHandler { /// The top level event handler. /// -/// This corresponds to the `AppHandler` trait in druid-shell, which is only +/// This corresponds to the `AppHandler` trait in `druid-shell`, which is only /// used to handle events that are not associated with a window. /// /// Currently, this means only menu items on macOS when no window is open. @@ -74,7 +74,7 @@ pub(crate) struct AppState { inner: Rc>>, } -/// The information for forwarding druid-shell's file dialog reply to the right place. +/// The information for forwarding `druid-shell`'s file dialog reply to the right place. struct DialogInfo { /// The window to send the command to. id: WindowId, @@ -641,7 +641,7 @@ impl AppState { } } - /// Handle a 'command' message from druid-shell. These map to an item + /// Handle a 'command' message from `druid-shell`. These map to an item /// in an application, window, or context (right-click) menu. /// /// If the menu is associated with a window (the general case) then