-
Notifications
You must be signed in to change notification settings - Fork 909
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 out platform-independent types into a new winit-core crate #3455
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3a81764
chore: Move winit files to winit subfolder
notgull a97255e
chore: Bring up winit-core crate
notgull 623b3e5
chore: Move part of error.rs to winit-core
notgull 5574644
chore: Move dpi.rs to winit-core wholesale
notgull 2f19731
chore: Move most of keyboard.rs to winit-core
notgull 114e699
chore: Move parts of window.rs to winit-core
notgull 48831f7
feat: Re-export cursor types in winit-core/window
notgull a232f7b
feat: Move WindowId to winit-core
notgull 859a6f1
feat: Move DeviceId to winit-core
notgull 284f4c0
feat: Move Event to winit-core
notgull c6e5743
chore: Move over ControlFlow
notgull daf1304
chore: Housekeeping
notgull 4b28f10
chore: fmt and doc fixes
notgull 52532d2
chore: Fix failing CI
notgull 1b9c576
ci: Use -p option in CI
notgull cfd35d2
ci: Missed a spot
notgull d28c867
chore: Rebase on latest master
notgull 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
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 |
---|---|---|
@@ -1,265 +1,16 @@ | ||
[package] | ||
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" | ||
|
||
[package.metadata.docs.rs] | ||
features = [ | ||
"rwh_04", | ||
"rwh_05", | ||
"rwh_06", | ||
"serde", | ||
"mint", | ||
# Enabled to get docs to compile | ||
"android-native-activity", | ||
] | ||
default-target = "x86_64-unknown-linux-gnu" | ||
# 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", | ||
[workspace] | ||
members = [ | ||
"run-wasm", | ||
"winit", | ||
"winit-core" | ||
] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
resolver = "2" | ||
|
||
[features] | ||
default = ["rwh_06", "x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"] | ||
x11 = ["x11-dl", "bytemuck", "percent-encoding", "xkbcommon-dl/x11", "x11rb"] | ||
wayland = ["wayland-client", "wayland-backend", "wayland-protocols", "wayland-protocols-plasma", "sctk", "ahash", "memmap2"] | ||
wayland-dlopen = ["wayland-backend/dlopen"] | ||
wayland-csd-adwaita = ["sctk-adwaita", "sctk-adwaita/ab_glyph"] | ||
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"] | ||
rwh_04 = ["dep:rwh_04", "ndk/rwh_04"] | ||
rwh_05 = ["dep:rwh_05", "ndk/rwh_05"] | ||
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"] | ||
|
||
[build-dependencies] | ||
cfg_aliases = "0.2.0" | ||
|
||
[dependencies] | ||
[workspace.dependencies] | ||
bitflags = "2" | ||
cfg_aliases = "0.2.0" | ||
cursor-icon = "1.1.0" | ||
log = "0.4" | ||
mint = { version = "0.5.6", optional = true } | ||
once_cell = "1.12" | ||
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 = { version = "1", features = ["serde_derive"] } | ||
smol_str = "0.2.0" | ||
|
||
[dev-dependencies] | ||
image = { version = "0.24.0", default-features = false, features = ["png"] } | ||
simple_logger = { version = "4.2.0", default_features = false } | ||
winit = { path = ".", features = ["rwh_05"] } | ||
|
||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies] | ||
softbuffer = { version = "0.3.0", default-features = false, features = ["x11", "x11-dlopen", "wayland", "wayland-dlopen"] } | ||
|
||
[target.'cfg(target_os = "android")'.dependencies] | ||
android-activity = "0.5.0" | ||
ndk = { version = "0.8.0", default-features = false } | ||
ndk-sys = "0.5.0" | ||
|
||
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies] | ||
core-foundation = "0.9.3" | ||
objc2 = "0.5.0" | ||
|
||
[target.'cfg(target_os = "macos")'.dependencies] | ||
core-graphics = "0.23.1" | ||
|
||
[target.'cfg(target_os = "macos")'.dependencies.icrate] | ||
version = "0.1.0" | ||
features = [ | ||
"dispatch", | ||
"Foundation", | ||
"Foundation_NSArray", | ||
"Foundation_NSAttributedString", | ||
"Foundation_NSMutableAttributedString", | ||
"Foundation_NSData", | ||
"Foundation_NSDictionary", | ||
"Foundation_NSString", | ||
"Foundation_NSProcessInfo", | ||
"Foundation_NSThread", | ||
"Foundation_NSNumber", | ||
"AppKit", | ||
"AppKit_NSAppearance", | ||
"AppKit_NSApplication", | ||
"AppKit_NSBitmapImageRep", | ||
"AppKit_NSButton", | ||
"AppKit_NSColor", | ||
"AppKit_NSControl", | ||
"AppKit_NSCursor", | ||
"AppKit_NSEvent", | ||
"AppKit_NSGraphicsContext", | ||
"AppKit_NSImage", | ||
"AppKit_NSImageRep", | ||
"AppKit_NSMenu", | ||
"AppKit_NSMenuItem", | ||
"AppKit_NSPasteboard", | ||
"AppKit_NSResponder", | ||
"AppKit_NSScreen", | ||
"AppKit_NSTextInputContext", | ||
"AppKit_NSView", | ||
"AppKit_NSWindow", | ||
"AppKit_NSWindowTabGroup", | ||
] | ||
|
||
[target.'cfg(target_os = "ios")'.dependencies.icrate] | ||
version = "0.1.0" | ||
features = [ | ||
"dispatch", | ||
"Foundation", | ||
"Foundation_NSArray", | ||
"Foundation_NSString", | ||
"Foundation_NSProcessInfo", | ||
"Foundation_NSThread", | ||
"Foundation_NSSet", | ||
] | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies] | ||
unicode-segmentation = "1.7.1" | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies.windows-sys] | ||
version = "0.48" | ||
features = [ | ||
"Win32_Devices_HumanInterfaceDevice", | ||
"Win32_Foundation", | ||
"Win32_Globalization", | ||
"Win32_Graphics_Dwm", | ||
"Win32_Graphics_Gdi", | ||
"Win32_Media", | ||
"Win32_System_Com_StructuredStorage", | ||
"Win32_System_Com", | ||
"Win32_System_LibraryLoader", | ||
"Win32_System_Ole", | ||
"Win32_System_SystemInformation", | ||
"Win32_System_SystemServices", | ||
"Win32_System_Threading", | ||
"Win32_System_WindowsProgramming", | ||
"Win32_UI_Accessibility", | ||
"Win32_UI_Controls", | ||
"Win32_UI_HiDpi", | ||
"Win32_UI_Input_Ime", | ||
"Win32_UI_Input_KeyboardAndMouse", | ||
"Win32_UI_Input_Pointer", | ||
"Win32_UI_Input_Touch", | ||
"Win32_UI_Shell", | ||
"Win32_UI_TextServices", | ||
"Win32_UI_WindowsAndMessaging", | ||
] | ||
|
||
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies] | ||
ahash = { version = "0.8.3", features = ["no-rng"], optional = true } | ||
bytemuck = { version = "1.13.1", default-features = false, optional = true } | ||
calloop = "0.12.3" | ||
libc = "0.2.64" | ||
memmap2 = { version = "0.9.0", optional = true } | ||
percent-encoding = { version = "2.0", optional = true } | ||
rustix = { version = "0.38.4", default-features = false, features = ["std", "system", "thread", "process"] } | ||
sctk = { package = "smithay-client-toolkit", version = "0.18.0", default-features = false, features = ["calloop"], optional = true } | ||
sctk-adwaita = { version = "0.8.0", default_features = false, optional = true } | ||
wayland-backend = { version = "0.3.0", default_features = false, features = ["client_system"], optional = true } | ||
wayland-client = { version = "0.31.1", optional = true } | ||
wayland-protocols = { version = "0.31.0", features = [ "staging"], optional = true } | ||
wayland-protocols-plasma = { version = "0.2.0", features = [ "client" ], optional = true } | ||
x11-dl = { version = "2.18.5", optional = true } | ||
x11rb = { version = "0.13.0", default-features = false, features = ["allow-unsafe-code", "dl-libxcb", "randr", "resource_manager", "xinput", "xkb"], optional = true } | ||
xkbcommon-dl = "0.4.0" | ||
|
||
[target.'cfg(target_os = "redox")'.dependencies] | ||
orbclient = { version = "0.3.47", default-features = false } | ||
redox_syscall = "0.4.1" | ||
|
||
[target.'cfg(target_family = "wasm")'.dependencies.web_sys] | ||
package = "web-sys" | ||
version = "0.3.64" | ||
features = [ | ||
'AbortController', | ||
'AbortSignal', | ||
'Blob', | ||
'console', | ||
'CssStyleDeclaration', | ||
'Document', | ||
'DomException', | ||
'DomRect', | ||
'DomRectReadOnly', | ||
'Element', | ||
'Event', | ||
'EventTarget', | ||
'FocusEvent', | ||
'HtmlCanvasElement', | ||
'HtmlElement', | ||
'HtmlImageElement', | ||
'ImageBitmap', | ||
'ImageBitmapOptions', | ||
'ImageBitmapRenderingContext', | ||
'ImageData', | ||
'IntersectionObserver', | ||
'IntersectionObserverEntry', | ||
'KeyboardEvent', | ||
'MediaQueryList', | ||
'MessageChannel', | ||
'MessagePort', | ||
'Node', | ||
'PageTransitionEvent', | ||
'PointerEvent', | ||
'PremultiplyAlpha', | ||
'ResizeObserver', | ||
'ResizeObserverBoxOptions', | ||
'ResizeObserverEntry', | ||
'ResizeObserverOptions', | ||
'ResizeObserverSize', | ||
'VisibilityState', | ||
'Window', | ||
'WheelEvent', | ||
'Url', | ||
] | ||
|
||
[target.'cfg(target_family = "wasm")'.dependencies] | ||
js-sys = "0.3.64" | ||
pin-project = "1" | ||
wasm-bindgen = "0.2" | ||
wasm-bindgen-futures = "0.4" | ||
web-time = "1" | ||
|
||
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies] | ||
atomic-waker = "1" | ||
concurrent-queue = { version = "2", default-features = false } | ||
|
||
[target.'cfg(target_family = "wasm")'.dev-dependencies] | ||
console_log = "1" | ||
web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] } | ||
|
||
[workspace] | ||
members = [ | ||
"run-wasm", | ||
] | ||
|
||
[[example]] | ||
doc-scrape-examples = true | ||
name = "window" | ||
winit-core = { path = "./winit-core", default-features = false, features = ["std"] } |
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
This file was deleted.
Oops, something went wrong.
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.
I think it's a mistake to move
winit
to a subdirectory, at least yet, and it also complicates this PR unnecessarily. There is especially value in having the top-levelexamples
directory.Let's use theTheinclude
field instead to specify which files should be included in thewinit
package.include
field isn't needed, Cargo automatically doesn't include subcrates.