1 #![cfg(target_os = "windows")]
2
3 use winapi;
4 use winapi::shared::windef::HWND;
5
6 pub use self::events_loop::{EventsLoop, EventsLoopProxy};
7 pub use self::monitor::MonitorId;
8 pub use self::window::Window;
9
10 #[derive(Clone, Default)]
11 pub struct PlatformSpecificWindowBuilderAttributes {
12 pub parent: Option<HWND>,
13 pub taskbar_icon: Option<::Icon>,
14 pub no_redirection_bitmap: bool,
15 }
16
17 unsafe impl Send for PlatformSpecificWindowBuilderAttributes {}
18 unsafe impl Sync for PlatformSpecificWindowBuilderAttributes {}
19
20 // Cursor name in UTF-16. Used to set cursor in `WM_SETCURSOR`.
21 #[derive(Debug, Clone, Copy)]
22 pub struct Cursor(pub *const winapi::ctypes::wchar_t);
23 unsafe impl Send for Cursor {}
24 unsafe impl Sync for Cursor {}
25
26 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
27 pub struct DeviceId(u32);
28
29 impl DeviceId {
dummy() -> Self30 pub unsafe fn dummy() -> Self {
31 DeviceId(0)
32 }
33 }
34
35 impl DeviceId {
get_persistent_identifier(&self) -> Option<String>36 pub fn get_persistent_identifier(&self) -> Option<String> {
37 if self.0 != 0 {
38 raw_input::get_raw_input_device_name(self.0 as _)
39 } else {
40 None
41 }
42 }
43 }
44
45 // Constant device ID, to be removed when this backend is updated to report real device IDs.
46 const DEVICE_ID: ::DeviceId = ::DeviceId(DeviceId(0));
47
wrap_device_id(id: u32) -> ::DeviceId48 fn wrap_device_id(id: u32) -> ::DeviceId {
49 ::DeviceId(DeviceId(id))
50 }
51
52 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
53 pub struct WindowId(HWND);
54 unsafe impl Send for WindowId {}
55 unsafe impl Sync for WindowId {}
56
57 impl WindowId {
dummy() -> Self58 pub unsafe fn dummy() -> Self {
59 use std::ptr::null_mut;
60
61 WindowId(null_mut())
62 }
63 }
64
65 mod dpi;
66 mod drop_handler;
67 mod event;
68 mod events_loop;
69 mod icon;
70 mod monitor;
71 mod raw_input;
72 mod util;
73 mod window;
74 mod window_state;
75