1[package]
2name = "winit"
3version = "0.30.9"
4authors = [
5 "The winit contributors",
6 "Pierre Krieger <pierre.krieger1708@gmail.com>",
7]
8description = "Cross-platform window creation library."
9keywords = ["windowing"]
10readme = "README.md"
11documentation = "https://docs.rs/winit"
12categories = ["gui"]
13rust-version.workspace = true
14repository.workspace = true
15license.workspace = true
16edition.workspace = true
17include = [
18 "/build.rs",
19 "/docs",
20 "/examples",
21 "/FEATURES.md",
22 "/LICENSE",
23 "/src",
24 "!/src/platform_impl/web/script",
25 "/src/platform_impl/web/script/**/*.min.js",
26 "/tests",
27]
28
29[package.metadata.docs.rs]
30features = [
31 "rwh_04",
32 "rwh_05",
33 "rwh_06",
34 "serde",
35 "mint",
36 # Enabled to get docs to compile
37 "android-native-activity",
38]
39# These are all tested in CI
40targets = [
41 # Windows
42 "i686-pc-windows-msvc",
43 "x86_64-pc-windows-msvc",
44 # macOS
45 "x86_64-apple-darwin",
46 # Unix (X11 & Wayland)
47 "i686-unknown-linux-gnu",
48 "x86_64-unknown-linux-gnu",
49 # iOS
50 "x86_64-apple-ios",
51 # Android
52 "aarch64-linux-android",
53 # Web
54 "wasm32-unknown-unknown",
55]
56rustdoc-args = ["--cfg", "docsrs"]
57
58# Features are documented in either `lib.rs` or under `winit::platform`.
59[features]
60default = ["rwh_06", "x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
61x11 = ["x11-dl", "bytemuck", "percent-encoding", "xkbcommon-dl/x11", "x11rb"]
62wayland = [
63 "wayland-client",
64 "wayland-backend",
65 "wayland-protocols",
66 "wayland-protocols-plasma",
67 "sctk",
68 "ahash",
69 "memmap2",
70]
71wayland-dlopen = ["wayland-backend/dlopen"]
72wayland-csd-adwaita = ["sctk-adwaita", "sctk-adwaita/ab_glyph"]
73wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"]
74wayland-csd-adwaita-notitle = ["sctk-adwaita"]
75android-native-activity = ["android-activity/native-activity"]
76android-game-activity = ["android-activity/game-activity"]
77serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde", "dpi/serde"]
78mint = ["dpi/mint"]
79rwh_04 = ["dep:rwh_04", "ndk/rwh_04"]
80rwh_05 = ["dep:rwh_05", "ndk/rwh_05"]
81rwh_06 = ["dep:rwh_06", "ndk/rwh_06"]
82
83[build-dependencies]
84cfg_aliases = "0.2.1"
85
86[dependencies]
87bitflags = "2"
88cursor-icon = "1.1.0"
89dpi = { version = "0.1.1", path = "dpi" }
90rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true }
91rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [
92 "std",
93], optional = true }
94rwh_06 = { package = "raw-window-handle", version = "0.6", features = [
95 "std",
96], optional = true }
97serde = { workspace = true, optional = true }
98smol_str = "0.2.0"
99tracing = { version = "0.1.40", default-features = false }
100
101[dev-dependencies]
102image = { version = "0.25.0", default-features = false, features = ["png"] }
103tracing = { version = "0.1.40", default-features = false, features = ["log"] }
104tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
105winit = { path = ".", features = ["rwh_05"] }
106
107[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies]
108softbuffer = { version = "0.4.0", default-features = false, features = [
109 "x11",
110 "x11-dlopen",
111 "wayland",
112 "wayland-dlopen",
113] }
114
115[target.'cfg(target_os = "android")'.dependencies]
116android-activity = "0.6.0"
117ndk = { version = "0.9.0", default-features = false }
118
119[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
120core-foundation = "0.9.3"
121objc2 = "0.5.2"
122
123[target.'cfg(target_os = "macos")'.dependencies]
124core-graphics = "0.23.1"
125block2 = "0.5.1"
126
127[target.'cfg(target_os = "macos")'.dependencies.objc2-foundation]
128version = "0.2.2"
129features = [
130 "block2",
131 "dispatch",
132 "NSArray",
133 "NSAttributedString",
134 "NSData",
135 "NSDictionary",
136 "NSDistributedNotificationCenter",
137 "NSEnumerator",
138 "NSKeyValueObserving",
139 "NSNotification",
140 "NSObjCRuntime",
141 "NSPathUtilities",
142 "NSProcessInfo",
143 "NSRunLoop",
144 "NSString",
145 "NSThread",
146 "NSValue",
147]
148
149[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit]
150version = "0.2.2"
151features = [
152 "NSAppearance",
153 "NSApplication",
154 "NSBitmapImageRep",
155 "NSButton",
156 "NSColor",
157 "NSControl",
158 "NSCursor",
159 "NSDragging",
160 "NSEvent",
161 "NSGraphics",
162 "NSGraphicsContext",
163 "NSImage",
164 "NSImageRep",
165 "NSMenu",
166 "NSMenuItem",
167 "NSOpenGLView",
168 "NSPasteboard",
169 "NSResponder",
170 "NSRunningApplication",
171 "NSScreen",
172 "NSTextInputClient",
173 "NSTextInputContext",
174 "NSView",
175 "NSWindow",
176 "NSWindowScripting",
177 "NSWindowTabGroup",
178]
179
180[target.'cfg(target_os = "ios")'.dependencies.objc2-foundation]
181version = "0.2.2"
182features = [
183 "dispatch",
184 "NSArray",
185 "NSEnumerator",
186 "NSGeometry",
187 "NSObjCRuntime",
188 "NSString",
189 "NSProcessInfo",
190 "NSThread",
191 "NSSet",
192]
193
194[target.'cfg(target_os = "ios")'.dependencies.objc2-ui-kit]
195version = "0.2.2"
196features = [
197 "UIApplication",
198 "UIDevice",
199 "UIEvent",
200 "UIGeometry",
201 "UIGestureRecognizer",
202 "UITextInput",
203 "UITextInputTraits",
204 "UIOrientation",
205 "UIPanGestureRecognizer",
206 "UIPinchGestureRecognizer",
207 "UIResponder",
208 "UIRotationGestureRecognizer",
209 "UIScreen",
210 "UIScreenMode",
211 "UITapGestureRecognizer",
212 "UITouch",
213 "UITraitCollection",
214 "UIView",
215 "UIViewController",
216 "UIWindow",
217]
218
219[target.'cfg(target_os = "windows")'.dependencies]
220unicode-segmentation = "1.7.1"
221
222[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
223version = "0.52.0"
224features = [
225 "Win32_Devices_HumanInterfaceDevice",
226 "Win32_Foundation",
227 "Win32_Globalization",
228 "Win32_Graphics_Dwm",
229 "Win32_Graphics_Gdi",
230 "Win32_Media",
231 "Win32_System_Com_StructuredStorage",
232 "Win32_System_Com",
233 "Win32_System_LibraryLoader",
234 "Win32_System_Ole",
235 "Win32_Security",
236 "Win32_System_SystemInformation",
237 "Win32_System_SystemServices",
238 "Win32_System_Threading",
239 "Win32_System_WindowsProgramming",
240 "Win32_UI_Accessibility",
241 "Win32_UI_Controls",
242 "Win32_UI_HiDpi",
243 "Win32_UI_Input_Ime",
244 "Win32_UI_Input_KeyboardAndMouse",
245 "Win32_UI_Input_Pointer",
246 "Win32_UI_Input_Touch",
247 "Win32_UI_Shell",
248 "Win32_UI_TextServices",
249 "Win32_UI_WindowsAndMessaging",
250]
251
252[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies]
253ahash = { version = "0.8.7", features = ["no-rng"], optional = true }
254bytemuck = { version = "1.13.1", default-features = false, optional = true }
255calloop = "0.13.0"
256libc = "0.2.64"
257memmap2 = { version = "0.9.0", optional = true }
258percent-encoding = { version = "2.0", optional = true }
259rustix = { version = "0.38.4", default-features = false, features = [
260 "std",
261 "system",
262 "thread",
263 "process",
264] }
265sctk = { package = "smithay-client-toolkit", version = "0.19.2", default-features = false, features = [
266 "calloop",
267], optional = true }
268sctk-adwaita = { version = "0.10.1", default-features = false, optional = true }
269wayland-backend = { version = "0.3.5", default-features = false, features = [
270 "client_system",
271], optional = true }
272wayland-client = { version = "0.31.4", optional = true }
273wayland-protocols = { version = "0.32.2", features = [
274 "staging",
275], optional = true }
276wayland-protocols-plasma = { version = "0.3.2", features = [
277 "client",
278], optional = true }
279x11-dl = { version = "2.19.1", optional = true }
280x11rb = { version = "0.13.0", default-features = false, features = [
281 "allow-unsafe-code",
282 "dl-libxcb",
283 "randr",
284 "resource_manager",
285 "xinput",
286 "xkb",
287], optional = true }
288xkbcommon-dl = "0.4.2"
289
290[target.'cfg(target_os = "redox")'.dependencies]
291orbclient = { version = "0.3.47", default-features = false }
292redox_syscall = "0.4.1"
293
294[target.'cfg(target_family = "wasm")'.dependencies]
295js-sys = "0.3.70"
296pin-project = "1"
297wasm-bindgen = "0.2.93"
298wasm-bindgen-futures = "0.4.43"
299web-time = "1"
300web_sys = { package = "web-sys", version = "0.3.70", features = [
301 "AbortController",
302 "AbortSignal",
303 "Blob",
304 "BlobPropertyBag",
305 "console",
306 "CssStyleDeclaration",
307 "Document",
308 "DomException",
309 "DomRect",
310 "DomRectReadOnly",
311 "Element",
312 "Event",
313 "EventTarget",
314 "FocusEvent",
315 "HtmlCanvasElement",
316 "HtmlElement",
317 "HtmlImageElement",
318 "ImageBitmap",
319 "ImageBitmapOptions",
320 "ImageBitmapRenderingContext",
321 "ImageData",
322 "IntersectionObserver",
323 "IntersectionObserverEntry",
324 "KeyboardEvent",
325 "MediaQueryList",
326 "MessageChannel",
327 "MessagePort",
328 "Navigator",
329 "Node",
330 "OrientationLockType",
331 "OrientationType",
332 "PageTransitionEvent",
333 "Permissions",
334 "PermissionState",
335 "PermissionStatus",
336 "PointerEvent",
337 "PremultiplyAlpha",
338 "ResizeObserver",
339 "ResizeObserverBoxOptions",
340 "ResizeObserverEntry",
341 "ResizeObserverOptions",
342 "ResizeObserverSize",
343 "Screen",
344 "ScreenOrientation",
345 "Url",
346 "VisibilityState",
347 "WheelEvent",
348 "Window",
349 "Worker",
350] }
351
352[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies]
353atomic-waker = "1"
354concurrent-queue = { version = "2", default-features = false }
355
356[target.'cfg(target_family = "wasm")'.dev-dependencies]
357console_error_panic_hook = "0.1"
358tracing-web = "0.1"
359
360[[example]]
361doc-scrape-examples = true
362name = "window"
363
364[workspace]
365resolver = "2"
366members = ["dpi"]
367
368[workspace.package]
369rust-version = "1.70.0"
370repository = "https://github.com/rust-windowing/winit"
371license = "Apache-2.0"
372edition = "2021"
373
374[workspace.dependencies]
375serde = { version = "1", features = ["serde_derive"] }
376mint = "0.5.6"
377