chore(deps): update windows crate to 0.54 (#887)

This commit is contained in:
Amr Bashir
2024-03-26 15:53:06 +02:00
committed by GitHub
parent ad7fa44101
commit 17f54d4028
6 changed files with 22 additions and 31 deletions

5
.changes/windows-0.54.md Normal file
View File

@@ -0,0 +1,5 @@
---
"tao": "patch"
---
Update `windows` crate to `0.54`

View File

@@ -55,13 +55,11 @@ softbuffer = "0.4.1"
[target."cfg(target_os = \"windows\")".dependencies]
parking_lot = "0.12"
unicode-segmentation = "1.10"
image = { version = "0.24", default-features = false }
windows-implement = "0.52"
windows-version = "0.1"
[target."cfg(target_os = \"windows\")".dependencies.windows]
version = "0.52"
features = [
[target."cfg(target_os = \"windows\")".dependencies.windows]
version = "0.54"
features = [
"implement",
"Win32_Devices_HumanInterfaceDevice",
"Win32_Foundation",
@@ -110,13 +108,11 @@ core-foundation = "0.9"
core-graphics = "0.23"
dispatch = "0.2"
scopeguard = "1.2"
png = "0.17"
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
gtk = "0.18"
gdkx11-sys = "0.18"
gdkwayland-sys = "0.18.0"
x11-dl = "2.21"
png = "0.17"
parking_lot = "0.12"
dlopen2 = "0.7.0"

View File

@@ -46,16 +46,4 @@ impl PlatformIcon {
row_stride,
})
}
pub fn write_to_png(&self, path: impl AsRef<Path>) {
let png = File::create(path).unwrap();
let ref mut w = BufWriter::new(png);
let mut encoder = png::Encoder::new(w, self.width as _, self.height as _);
encoder.set_color(png::ColorType::Rgba);
encoder.set_depth(png::BitDepth::Eight);
let mut writer = encoder.write_header().unwrap();
writer.write_image_data(&self.raw).unwrap();
}
}

View File

@@ -4,18 +4,21 @@
use std::{cell::UnsafeCell, ffi::OsString, os::windows::ffi::OsStringExt, path::PathBuf, ptr};
use windows::Win32::{
Foundation::{self as win32f, HWND, POINTL},
System::{
Com::{IDataObject, DVASPECT_CONTENT, FORMATETC, TYMED_HGLOBAL},
Ole::{IDropTarget, IDropTarget_Impl, CF_HDROP, DROPEFFECT, DROPEFFECT_COPY, DROPEFFECT_NONE},
SystemServices::MODIFIERKEYS_FLAGS,
use windows::{
core::implement,
Win32::{
Foundation::{self as win32f, HWND, POINTL},
System::{
Com::{IDataObject, DVASPECT_CONTENT, FORMATETC, TYMED_HGLOBAL},
Ole::{
IDropTarget, IDropTarget_Impl, CF_HDROP, DROPEFFECT, DROPEFFECT_COPY, DROPEFFECT_NONE,
},
SystemServices::MODIFIERKEYS_FLAGS,
},
UI::Shell::{DragFinish, DragQueryFileW, HDROP},
},
UI::Shell::{DragFinish, DragQueryFileW, HDROP},
};
use windows_implement::implement;
use crate::platform_impl::platform::WindowId;
use crate::{event::Event, window::WindowId as SuperWindowId};

View File

@@ -22,7 +22,6 @@ use std::{
use windows::{
core::{s, PCWSTR},
Win32::{
Devices::HumanInterfaceDevice::*,
Foundation::{
BOOL, HANDLE, HINSTANCE, HMODULE, HWND, LPARAM, LRESULT, POINT, RECT, WAIT_TIMEOUT, WPARAM,
},
@@ -2370,7 +2369,7 @@ unsafe fn handle_raw_input<T: 'static>(
if data.header.dwType == RIM_TYPEMOUSE.0 {
let mouse = data.data.mouse;
if util::has_flag(mouse.usFlags, MOUSE_MOVE_RELATIVE as u16) {
if util::has_flag(mouse.usFlags.0, MOUSE_MOVE_RELATIVE.0) {
let x = mouse.lLastX as f64;
let y = mouse.lLastY as f64;

View File

@@ -1276,7 +1276,7 @@ impl Drop for ComInitialized {
thread_local! {
static COM_INITIALIZED: ComInitialized = {
unsafe {
ComInitialized(match CoInitializeEx(None, COINIT_APARTMENTTHREADED) {
ComInitialized(match CoInitializeEx(None, COINIT_APARTMENTTHREADED).ok() {
Ok(()) => Some(()),
Err(_) => None,
})