-
Notifications
You must be signed in to change notification settings - Fork 920
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
Split dpi
module out into a separate crate
#3518
+253
−206
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ name = "winit" | |
version = "0.29.10" | ||
authors = ["The winit contributors", "Pierre Krieger <[email protected]>"] | ||
description = "Cross-platform window creation library." | ||
edition = "2021" | ||
keywords = ["windowing"] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/rust-windowing/winit" | ||
documentation = "https://docs.rs/winit" | ||
categories = ["gui"] | ||
rust-version = "1.70.0" | ||
rust-version.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
features = [ | ||
|
@@ -22,7 +22,6 @@ features = [ | |
# Enabled to get docs to compile | ||
"android-native-activity", | ||
] | ||
default-target = "x86_64-unknown-linux-gnu" | ||
# These are all tested in CI | ||
targets = [ | ||
# Windows | ||
|
@@ -53,8 +52,8 @@ wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"] | |
wayland-csd-adwaita-notitle = ["sctk-adwaita"] | ||
android-native-activity = ["android-activity/native-activity"] | ||
android-game-activity = ["android-activity/game-activity"] | ||
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde"] | ||
mint = ["dep:mint"] | ||
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde", "dpi/serde"] | ||
mint = ["dpi/mint"] | ||
rwh_04 = ["dep:rwh_04", "ndk/rwh_04"] | ||
rwh_05 = ["dep:rwh_05", "ndk/rwh_05"] | ||
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"] | ||
|
@@ -66,12 +65,12 @@ cfg_aliases = "0.2.0" | |
bitflags = "2" | ||
cursor-icon = "1.1.0" | ||
log = "0.4" | ||
mint = { version = "0.5.6", optional = true } | ||
rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true } | ||
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true } | ||
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"], optional = true } | ||
serde = { version = "1", optional = true, features = ["serde_derive"] } | ||
serde = { workspace = true, optional = true } | ||
smol_str = "0.2.0" | ||
dpi = { path = "dpi" } | ||
|
||
[dev-dependencies] | ||
image = { version = "0.24.0", default-features = false, features = ["png"] } | ||
|
@@ -256,11 +255,23 @@ concurrent-queue = { version = "2", default-features = false } | |
console_log = "1" | ||
web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] } | ||
|
||
[[example]] | ||
doc-scrape-examples = true | ||
name = "window" | ||
|
||
[workspace] | ||
resolver = "2" | ||
members = [ | ||
"dpi", | ||
"run-wasm", | ||
] | ||
|
||
[[example]] | ||
doc-scrape-examples = true | ||
name = "window" | ||
[workspace.package] | ||
rust-version = "1.70.0" | ||
repository = "https://github.com/rust-windowing/winit" | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
|
||
[workspace.dependencies] | ||
serde = { version = "1", features = ["serde_derive"] } | ||
mint = "0.5.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[package] | ||
name = "dpi" | ||
version = "0.0.0" | ||
description = "Types for handling UI scaling" | ||
keywords = ["DPI", "HiDPI", "scale-factor"] | ||
categories = ["gui"] | ||
rust-version.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
|
||
[features] | ||
serde = ["dep:serde"] | ||
mint = ["dep:mint"] | ||
|
||
[dependencies] | ||
serde = { workspace = true, optional = true } | ||
mint = { workspace = true, optional = true } | ||
|
||
[package.metadata.docs.rs] | ||
features = ["serde", "mint"] | ||
# These are all tested in CI | ||
targets = [ | ||
# Windows | ||
"i686-pc-windows-msvc", | ||
"x86_64-pc-windows-msvc", | ||
# macOS | ||
"x86_64-apple-darwin", | ||
# Unix (X11 & Wayland) | ||
"i686-unknown-linux-gnu", | ||
"x86_64-unknown-linux-gnu", | ||
# iOS | ||
"x86_64-apple-ios", | ||
# Android | ||
"aarch64-linux-android", | ||
# Web | ||
"wasm32-unknown-unknown", | ||
] | ||
rustdoc-args = ["--cfg", "docsrs"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the point to name it dpi and not
winit-dpi
, since it's tailored towards the dpi needs of winit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because the name
dpi
was free, but also because the crate isn't really fundamentally tied to Winit.