Bump versions (#266)

* bump wayland deps

* bump xkbcommon-sys

* bump raw-window-handle

* bump png
This commit is contained in:
vemoo 2021-12-06 14:17:01 +01:00 committed by GitHub
parent e0992261c9
commit a4ba00b209
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 31 deletions

View file

@ -20,13 +20,13 @@ exclude = [
maintenance = {status = "actively-developed"}
[dev-dependencies]
png = "0.16"
png = "0.17"
[build-dependencies]
cc = "1.0"
[dependencies]
raw-window-handle = "0.3.3"
raw-window-handle = "0.4"
[target.'cfg(windows)'.dependencies.winapi]
version = "0.3"
@ -43,12 +43,12 @@ x11 = ["x11-dl", "xkb", "libc"]
wayland = ["wayland-client", "wayland-protocols", "wayland-cursor", "tempfile", "xkb", "xkbcommon-sys"]
[target.'cfg(not(any(target_os = "macos", target_os = "redox", windows)))'.dependencies]
wayland-client = {version = "0.28", optional = true}
wayland-protocols = { version = "0.28", features = ["client", "unstable_protocols"], optional = true }
wayland-cursor = {version = "0.28", optional = true}
wayland-client = {version = "0.29", optional = true}
wayland-protocols = { version = "0.29", features = ["client", "unstable_protocols"], optional = true }
wayland-cursor = {version = "0.29", optional = true}
tempfile = {version = "3.2", optional = true}
xkb = {version = "0.2.1", optional = true}
xkbcommon-sys = {version = "0.7.5", optional = true}
xkbcommon-sys = {version = "1.3", optional = true}
x11-dl = {version = "2.19.1", optional = true}
libc = {version = "0.2.107", optional = true}

View file

@ -6,9 +6,9 @@ fn main() {
// via `Transformations`. The default output transformation is `Transformations::EXPAND
// | Transformations::STRIP_ALPHA`.
let decoder = png::Decoder::new(File::open("resources/uv.png").unwrap());
let (info, mut reader) = decoder.read_info().unwrap();
let mut reader = decoder.read_info().unwrap();
// Allocate the output buffer.
let mut buf = vec![0; info.buffer_size()];
let mut buf = vec![0; reader.output_buffer_size()];
// Read the next frame. Currently this function should only called once.
// The default options
reader.next_frame(&mut buf).unwrap();
@ -21,8 +21,8 @@ fn main() {
let mut window = Window::new(
"Noise Test - Press ESC to exit",
info.width as usize,
info.height as usize,
reader.info().width as usize,
reader.info().height as usize,
WindowOptions {
resize: true,
scale_mode: ScaleMode::Center,
@ -33,7 +33,11 @@ fn main() {
while window.is_open() && !window.is_key_down(Key::Escape) {
window
.update_with_buffer(&u32_buffer, info.width as usize, info.height as usize)
.update_with_buffer(
&u32_buffer,
reader.info().width as usize,
reader.info().height as usize,
)
.unwrap();
}
}

View file

@ -261,12 +261,10 @@ unsafe extern "C" fn char_callback(window: *mut c_void, code_point: u32) {
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
let handle = raw_window_handle::macos::MacOSHandle {
ns_window: self.window_handle as *mut _,
ns_view: self.view_handle as *mut _,
..raw_window_handle::macos::MacOSHandle::empty()
};
raw_window_handle::RawWindowHandle::MacOS(handle)
let mut handle = raw_window_handle::AppKitHandle::empty();
handle.ns_window = self.window_handle as *mut _;
handle.ns_view = self.view_handle as *mut _;
raw_window_handle::RawWindowHandle::AppKit(handle)
}
}

View file

@ -1072,12 +1072,14 @@ impl Window {
v.set_len(len as usize);
file.read_exact(&mut v)?;
let ctx = xkbcommon_sys::xkb_context_new(0);
let ctx = xkbcommon_sys::xkb_context_new(
xkbcommon_sys::xkb_context_flags::XKB_CONTEXT_NO_FLAGS,
);
let kb_map_ptr = xkbcommon_sys::xkb_keymap_new_from_string(
ctx,
v.as_ptr() as *const _ as *const std::os::raw::c_char,
xkbcommon_sys::xkb_keymap_format::XKB_KEYMAP_FORMAT_TEXT_V1,
0,
xkbcommon_sys::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS,
);
// Wrap keymap
@ -1195,7 +1197,7 @@ impl Window {
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
let mut handle = raw_window_handle::unix::WaylandHandle::empty();
let mut handle = raw_window_handle::WaylandHandle::empty();
handle.surface = self.display.surface.as_ref().c_ptr() as *mut _ as *mut c_void;
handle.display = self
.display

View file

@ -323,11 +323,9 @@ pub struct Window {
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
let handle = raw_window_handle::unix::XlibHandle {
window: self.handle,
display: self.d.display as *mut core::ffi::c_void,
..raw_window_handle::unix::XlibHandle::empty()
};
let mut handle = raw_window_handle::XlibHandle::empty();
handle.window = self.handle;
handle.display = self.d.display as *mut core::ffi::c_void;
raw_window_handle::RawWindowHandle::Xlib(handle)
}
}

View file

@ -454,12 +454,11 @@ pub struct Window {
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
let handle = raw_window_handle::windows::WindowsHandle {
hwnd: self.window.unwrap() as *mut raw::c_void,
hinstance: unsafe { libloaderapi::GetModuleHandleA(ptr::null()) } as *mut raw::c_void,
..raw_window_handle::windows::WindowsHandle::empty()
};
raw_window_handle::RawWindowHandle::Windows(handle)
let mut handle = raw_window_handle::Win32Handle::empty();
handle.hwnd = self.window.unwrap() as *mut raw::c_void;
handle.hinstance =
unsafe { libloaderapi::GetModuleHandleA(ptr::null()) } as *mut raw::c_void;
raw_window_handle::RawWindowHandle::Win32(handle)
}
}