mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-24 03:41:29 +11:00
raw window handle 0.5.0
This commit is contained in:
parent
9df8b59940
commit
a8d6d94726
|
@ -24,7 +24,7 @@ png = "0.17"
|
||||||
cc = "1.0"
|
cc = "1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
raw-window-handle = "0.4"
|
raw-window-handle = "0.5"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies.winapi]
|
[target.'cfg(windows)'.dependencies.winapi]
|
||||||
version = "0.3"
|
version = "0.3"
|
||||||
|
|
|
@ -263,7 +263,7 @@ unsafe extern "C" fn char_callback(window: *mut c_void, code_point: u32) {
|
||||||
|
|
||||||
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
let mut handle = raw_window_handle::AppKitHandle::empty();
|
let mut handle = raw_window_handle::AppKitWindowHandle::empty();
|
||||||
handle.ns_window = self.window_handle as *mut _;
|
handle.ns_window = self.window_handle as *mut _;
|
||||||
handle.ns_view = self.view_handle as *mut _;
|
handle.ns_view = self.view_handle as *mut _;
|
||||||
raw_window_handle::RawWindowHandle::AppKit(handle)
|
raw_window_handle::RawWindowHandle::AppKit(handle)
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ impl Window {
|
||||||
|
|
||||||
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
let mut handle = raw_window_handle::WaylandHandle::empty();
|
let mut handle = raw_window_handle::WaylandWindowHandle::empty();
|
||||||
handle.surface = self.display.surface.as_ref().c_ptr() as *mut _ as *mut c_void;
|
handle.surface = self.display.surface.as_ref().c_ptr() as *mut _ as *mut c_void;
|
||||||
handle.display = self
|
handle.display = self
|
||||||
.display
|
.display
|
||||||
|
|
|
@ -332,7 +332,7 @@ pub struct Window {
|
||||||
|
|
||||||
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
let mut handle = raw_window_handle::XlibHandle::empty();
|
let mut handle = raw_window_handle::XlibWindowHandle::empty();
|
||||||
handle.window = self.handle;
|
handle.window = self.handle;
|
||||||
handle.display = self.d.display as *mut core::ffi::c_void;
|
handle.display = self.d.display as *mut core::ffi::c_void;
|
||||||
raw_window_handle::RawWindowHandle::Xlib(handle)
|
raw_window_handle::RawWindowHandle::Xlib(handle)
|
||||||
|
|
|
@ -428,7 +428,7 @@ impl Menu {
|
||||||
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
//TODO: assign a different ID to each window
|
//TODO: assign a different ID to each window
|
||||||
let handle = raw_window_handle::WebHandle::empty();
|
let handle = raw_window_handle::WebWindowHandle::empty();
|
||||||
raw_window_handle::RawWindowHandle::Web(handle)
|
raw_window_handle::RawWindowHandle::Web(handle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,7 +509,7 @@ pub struct Window {
|
||||||
|
|
||||||
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
let mut handle = raw_window_handle::Win32Handle::empty();
|
let mut handle = raw_window_handle::Win32WindowHandle::empty();
|
||||||
handle.hwnd = self.window.unwrap() as *mut raw::c_void;
|
handle.hwnd = self.window.unwrap() as *mut raw::c_void;
|
||||||
handle.hinstance =
|
handle.hinstance =
|
||||||
unsafe { libloaderapi::GetModuleHandleA(ptr::null()) } as *mut raw::c_void;
|
unsafe { libloaderapi::GetModuleHandleA(ptr::null()) } as *mut raw::c_void;
|
||||||
|
|
Loading…
Reference in a new issue