Skip to content

Commit 558a85c

Browse files
author
pyroxymat
committed
Remove use GTK optional feature
1 parent 3ffe5e4 commit 558a85c

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

druid-shell/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ categories = ["os::macos-apis", "os::windows-apis", "gui"]
1010
edition = "2018"
1111

1212
[features]
13-
use_gtk = ["gtk", "gtk-sys", "gio", "gdk", "gdk-sys", "glib", "glib-sys", "cairo-rs"]
1413
x11 = ["xcb", "cairo-sys-rs"]
1514

1615
[package.metadata.docs.rs]

druid-shell/src/application.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ impl Application {
6161
// TODO: do these two go in some kind of PlatformExt trait?
6262
/// Hide the application this window belongs to. (cmd+H)
6363
pub fn hide() {
64-
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
64+
#[cfg(target_os = "macos")]
6565
platform::Application::hide()
6666
}
6767

6868
/// Hide all other applications. (cmd+opt+H)
6969
pub fn hide_others() {
70-
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
70+
#[cfg(target_os = "macos")]
7171
platform::Application::hide_others()
7272
}
7373

druid-shell/src/clipboard.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl From<platform::Clipboard> for Clipboard {
215215
}
216216

217217
cfg_if::cfg_if! {
218-
if #[cfg(all(target_os = "macos", not(feature = "use_gtk")))] {
218+
if #[cfg(target_os = "macos")] {
219219
impl ClipboardFormat {
220220
pub const PDF: &'static str = "com.adobe.pdf";
221221
pub const TEXT: &'static str = "public.utf8-plain-text";
@@ -224,7 +224,7 @@ cfg_if::cfg_if! {
224224
} else {
225225
impl ClipboardFormat {
226226
cfg_if::cfg_if! {
227-
if #[cfg(any(feature = "use_gtk", target_os = "linux"))] {
227+
if #[cfg(target_os = "linux")] {
228228
// trial and error; this is the most supported string type for gtk?
229229
pub const TEXT: &'static str = "UTF8_STRING";
230230
} else {

druid-shell/src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
pub use kurbo;
2525
pub use piet_common as piet;
2626

27+
#[cfg(target_os = "windows")]
28+
#[macro_use]
29+
extern crate winapi;
30+
31+
#[cfg(target_os = "macos")]
32+
#[macro_use]
33+
extern crate objc;
34+
35+
#[cfg(not(target_os = "linux"))]
36+
#[macro_use]
37+
extern crate lazy_static;
38+
2739
mod application;
2840
mod clipboard;
2941
mod common_util;

druid-shell/src/platform/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
//! Platform specific implementations.
1616
1717
cfg_if::cfg_if! {
18-
if #[cfg(all(target_os = "windows", not(feature = "use_gtk")))] {
18+
if #[cfg(target_os = "windows")] {
1919
mod windows;
2020
pub use windows::*;
21-
} else if #[cfg(all(target_os = "macos", not(feature = "use_gtk")))] {
21+
} else if #[cfg(target_os = "macos")] {
2222
mod mac;
2323
pub use mac::*;
24-
} else if #[cfg(all(feature = "x11", target_os = "linux"))] {
25-
mod x11;
26-
pub use x11::*;
27-
} else if #[cfg(any(feature = "use_gtk", target_os = "linux"))] {
24+
} else if #[cfg(target_os = "linux")] {
2825
mod gtk;
2926
pub use self::gtk::*;
3027
}

druid/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ edition = "2018"
1414
default-target = "x86_64-pc-windows-msvc"
1515

1616
[features]
17-
use_gtk = ["druid-shell/use_gtk"]
1817
x11 = ["druid-shell/x11"]
1918
svg = ["usvg"]
2019

druid/src/win_handler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -585,12 +585,12 @@ impl<T: Data> AppState<T> {
585585
}
586586

587587
fn hide_app(&self) {
588-
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
588+
#[cfg(target_os = "macos")]
589589
Application::hide()
590590
}
591591

592592
fn hide_others(&mut self) {
593-
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
593+
#[cfg(target_os = "macos")]
594594
Application::hide_others()
595595
}
596596
}

0 commit comments

Comments
 (0)