chore: cleanup more windows use (#9376)

This commit is contained in:
Ezekiel Warren
2024-03-14 18:00:03 -07:00
committed by GitHub
parent ff8a4a89c7
commit f9b9123606
4 changed files with 9 additions and 50 deletions
@@ -10,15 +10,7 @@ use async_task::Runnable;
use flume::Sender;
use parking::Parker;
use parking_lot::Mutex;
use windows::Win32::{
Foundation::{BOOLEAN, HANDLE},
System::Threading::{
CreateThreadpool, CreateThreadpoolWork, CreateTimerQueueTimer, DeleteTimerQueueTimer,
SetEvent, SetThreadpoolThreadMinimum, SubmitThreadpoolWork, PTP_CALLBACK_INSTANCE,
PTP_POOL, PTP_WORK, TP_CALLBACK_ENVIRON_V3, TP_CALLBACK_PRIORITY_NORMAL,
WT_EXECUTEONLYONCE,
},
};
use windows::Win32::{Foundation::*, System::Threading::*};
use crate::{PlatformDispatcher, TaskLabel};
+1 -7
View File
@@ -2,13 +2,7 @@ use itertools::Itertools;
use smallvec::SmallVec;
use std::rc::Rc;
use uuid::Uuid;
use windows::Win32::{
Foundation::{BOOL, LPARAM, POINT, RECT},
Graphics::Gdi::{
EnumDisplayMonitors, GetMonitorInfoW, MonitorFromPoint, HDC, HMONITOR, MONITORINFO,
MONITORINFOEXW, MONITOR_DEFAULTTOPRIMARY,
},
};
use windows::Win32::{Foundation::*, Graphics::Gdi::*};
use crate::{Bounds, DisplayId, GlobalPixels, PlatformDisplay, Point, Size};
+6 -28
View File
@@ -21,35 +21,13 @@ use smallvec::SmallVec;
use time::UtcOffset;
use util::{ResultExt, SemanticVersion};
use windows::{
core::{IUnknown, HRESULT, HSTRING, PCWSTR, PWSTR},
Wdk::System::SystemServices::RtlGetVersion,
core::*,
Wdk::System::SystemServices::*,
Win32::{
Foundation::{CloseHandle, HANDLE, HWND},
Graphics::{
DirectComposition::DCompositionWaitForCompositorClock,
Gdi::{RedrawWindow, HRGN, RDW_INVALIDATE, RDW_UPDATENOW},
},
System::{
Com::{CoCreateInstance, CreateBindCtx, CLSCTX_ALL},
Ole::{OleInitialize, OleUninitialize},
Threading::{CreateEventW, INFINITE},
Time::{GetTimeZoneInformation, TIME_ZONE_ID_INVALID},
},
UI::{
Input::KeyboardAndMouse::GetDoubleClickTime,
Shell::{
FileOpenDialog, FileSaveDialog, IFileOpenDialog, IFileSaveDialog, IShellItem,
SHCreateItemFromParsingName, ShellExecuteW, FILEOPENDIALOGOPTIONS,
FOS_ALLOWMULTISELECT, FOS_FILEMUSTEXIST, FOS_PICKFOLDERS, SIGDN_FILESYSPATH,
},
WindowsAndMessaging::{
DispatchMessageW, LoadImageW, PeekMessageW, PostQuitMessage, SetCursor,
SystemParametersInfoW, TranslateMessage, HCURSOR, IDC_ARROW, IDC_CROSS, IDC_HAND,
IDC_IBEAM, IDC_NO, IDC_SIZENS, IDC_SIZEWE, IMAGE_CURSOR, LR_DEFAULTSIZE, LR_SHARED,
MSG, PM_REMOVE, SPI_GETWHEELSCROLLCHARS, SPI_GETWHEELSCROLLLINES, SW_SHOWDEFAULT,
SYSTEM_PARAMETERS_INFO_UPDATE_FLAGS, WM_QUIT, WM_SETTINGCHANGE,
},
},
Foundation::*,
Graphics::{DirectComposition::*, Gdi::*},
System::{Com::*, Ole::*, Threading::*, Time::*},
UI::{Input::KeyboardAndMouse::*, Shell::*, WindowsAndMessaging::*},
},
};
+1 -6
View File
@@ -1,9 +1,4 @@
use windows::Win32::{
Foundation::{HWND, LPARAM, WPARAM},
UI::WindowsAndMessaging::{
GetWindowLongPtrW, GetWindowLongW, SetWindowLongPtrW, SetWindowLongW, WINDOW_LONG_PTR_INDEX,
},
};
use windows::Win32::{Foundation::*, UI::WindowsAndMessaging::*};
pub(crate) trait HiLoWord {
fn hiword(&self) -> u16;