Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prefixes from platform extensions traits (PlatformApplicationExt -> ApplicationExt) #1873

Merged
merged 3 commits into from
Jul 15, 2021
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ You can find its changes [documented below](#070---2021-01-01).
- Change the signature of `add_idle_callback` ([#1787] by [@jneem])
- Move macOS only function to Mac extension trait ([#1863] by [@Maan2003])
- x11: Only query atoms once instead of per window ([#1865] by [@psychon])
- remove prefix from platform extension traits ([#1873] by [@Maan2003])

### Deprecated

Expand Down Expand Up @@ -759,6 +760,7 @@ Last release without a changelog :(
[#1866]: https://github.com/linebender/druid/pull/1866
[#1867]: https://github.com/linebender/druid/pull/1867
[#1868]: https://github.com/linebender/druid/pull/1868
[#1873]: https://github.com/linebender/druid/pull/1873

[Unreleased]: https://github.com/linebender/druid/compare/v0.7.0...master
[0.7.0]: https://github.com/linebender/druid/compare/v0.6.0...v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion druid-shell/src/backend/gtk/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Application {
}
}

impl crate::platform::linux::LinuxApplicationExt for crate::Application {
impl crate::platform::linux::ApplicationExt for crate::Application {
fn primary_clipboard(&self) -> crate::Clipboard {
crate::Clipboard(Clipboard {
selection: gdk::SELECTION_PRIMARY,
Expand Down
2 changes: 1 addition & 1 deletion druid-shell/src/backend/mac/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl Application {
}
}

impl crate::platform::mac::MacApplicationExt for crate::Application {
impl crate::platform::mac::ApplicationExt for crate::Application {
fn hide(&self) {
unsafe {
let () = msg_send![self.backend_app.ns_app, hide: nil];
Expand Down
2 changes: 1 addition & 1 deletion druid-shell/src/backend/x11/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ impl Application {
}
}

impl crate::platform::linux::LinuxApplicationExt for crate::Application {
impl crate::platform::linux::ApplicationExt for crate::Application {
fn primary_clipboard(&self) -> crate::Clipboard {
self.backend_app.primary.clone().into()
}
Expand Down
4 changes: 2 additions & 2 deletions druid-shell/src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::Clipboard;
/// Linux specific extensions to [`Application`]
///
/// [`Application`]: crate::Application
pub trait LinuxApplicationExt {
pub trait ApplicationExt {
/// Returns a handle to the primary system clipboard.
///
/// This is useful for middle mouse paste.
Expand All @@ -32,5 +32,5 @@ mod test {

use super::*;
use static_assertions as sa;
sa::assert_impl_all!(Application: LinuxApplicationExt);
sa::assert_impl_all!(Application: ApplicationExt);
}
4 changes: 2 additions & 2 deletions druid-shell/src/platform/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// macOS specific extensions to [`Application`]
///
/// [`Application`]: crate::Application
pub trait MacApplicationExt {
pub trait ApplicationExt {
/// Hide the application this window belongs to. (cmd+H)
fn hide(&self);

Expand All @@ -36,5 +36,5 @@ mod test {

use super::*;
use static_assertions as sa;
sa::assert_impl_all!(Application: MacApplicationExt);
sa::assert_impl_all!(Application: ApplicationExt);
}
6 changes: 3 additions & 3 deletions druid/src/win_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl<T: Data> Inner<T> {

#[cfg(target_os = "macos")]
{
use druid_shell::platform::mac::MacApplicationExt;
use druid_shell::platform::mac::ApplicationExt as _;

let windows = &mut self.windows;
let window = self.menu_window.and_then(|w| windows.get_mut(w));
Expand Down Expand Up @@ -841,13 +841,13 @@ impl<T: Data> AppState<T> {

#[cfg(target_os = "macos")]
fn hide_app(&self) {
use druid_shell::platform::mac::MacApplicationExt;
use druid_shell::platform::mac::ApplicationExt as _;
self.inner.borrow().app.hide()
}

#[cfg(target_os = "macos")]
fn hide_others(&mut self) {
use druid_shell::platform::mac::MacApplicationExt;
use druid_shell::platform::mac::ApplicationExt as _;
self.inner.borrow().app.hide_others();
}

Expand Down