mirror of
https://gitlab.com/marcandre.lureau/qemu-display.git
synced 2024-12-22 05:35:20 +00:00
Update to latest crates
This commit is contained in:
parent
da6dc72432
commit
c874f813c1
@ -7,9 +7,11 @@ members = [
|
||||
"qemu-vte",
|
||||
"xtask",
|
||||
]
|
||||
|
||||
default-members = ["qemu-rdw"]
|
||||
resolver = "2"
|
||||
|
||||
[patch.crates-io]
|
||||
zbus = { git = "https://github.com/dbus2/zbus.git" }
|
||||
zvariant = { git = "https://github.com/dbus2/zbus.git" }
|
||||
vnc = { git = "https://github.com/elmarco/rust-vnc", branch = "server" }
|
||||
rdw4 = { git = "https://gitlab.gnome.org/malureau/rdw.git" }
|
||||
rdw4 = { path = "../rdw/rdw4" }
|
||||
|
@ -13,8 +13,8 @@ qmp = ["dep:qapi", "dep:base64"]
|
||||
cfg-if = "1.0"
|
||||
log = "0.4"
|
||||
derivative = "2.2.0"
|
||||
zbus = { version = "3.11", features = ["xml"] }
|
||||
zvariant = { version = "3.0", features = ["serde_bytes"] }
|
||||
zbus = { version = "4", features = ["xml"] }
|
||||
zvariant = { version = "4", features = ["serde_bytes"] }
|
||||
libc = "0.2.86"
|
||||
enumflags2 = { version = "0.7", features = ["serde"] }
|
||||
serde = { version = "1.0.27", features = ["derive"] }
|
||||
|
@ -1,7 +1,9 @@
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use std::convert::TryFrom;
|
||||
use zbus::{dbus_interface, dbus_proxy, zvariant::ObjectPath};
|
||||
use zvariant::Type;
|
||||
use zbus::{
|
||||
dbus_interface, dbus_proxy,
|
||||
zvariant::{ObjectPath, Type},
|
||||
};
|
||||
|
||||
use crate::Result;
|
||||
|
||||
|
@ -8,9 +8,9 @@ use zbus::{
|
||||
fdo,
|
||||
fdo::ManagedObjects,
|
||||
names::{BusName, OwnedUniqueName, UniqueName, WellKnownName},
|
||||
zvariant::OwnedObjectPath,
|
||||
Connection, OwnerChangedStream,
|
||||
};
|
||||
use zvariant::OwnedObjectPath;
|
||||
|
||||
#[cfg(unix)]
|
||||
use crate::UsbRedir;
|
||||
|
@ -62,8 +62,8 @@ impl From<zbus::fdo::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<zvariant::Error> for Error {
|
||||
fn from(e: zvariant::Error) -> Self {
|
||||
impl From<zbus::zvariant::Error> for Error {
|
||||
fn from(e: zbus::zvariant::Error) -> Self {
|
||||
Error::Zbus(e.into())
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
use enumflags2::{bitflags, BitFlags};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zbus::dbus_proxy;
|
||||
use zvariant::Type;
|
||||
use zbus::{dbus_proxy, zvariant::Type};
|
||||
|
||||
#[bitflags]
|
||||
#[repr(u32)]
|
||||
|
@ -1,6 +1,5 @@
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use zbus::dbus_proxy;
|
||||
use zvariant::Type;
|
||||
use zbus::{dbus_proxy, zvariant::Type};
|
||||
|
||||
#[repr(u32)]
|
||||
#[derive(Deserialize_repr, Serialize_repr, Type, Debug, Hash, PartialEq, Eq, Clone, Copy)]
|
||||
|
@ -28,7 +28,7 @@ use crate::{Chardev, Error, Result};
|
||||
struct InnerHandler {
|
||||
#[allow(unused)] // keep the device opened, as rusb doesn't take it
|
||||
#[cfg(unix)]
|
||||
device_fd: Option<zvariant::OwnedFd>,
|
||||
device_fd: Option<zbus::zvariant::OwnedFd>,
|
||||
stream: UnixStream,
|
||||
ctxt: rusb::Context,
|
||||
ctxt_thread: Option<JoinHandle<()>>,
|
||||
|
@ -12,15 +12,18 @@ qmp = ["qemu-display/qmp"]
|
||||
log = "0.4"
|
||||
pretty_env_logger = "0.4"
|
||||
once_cell = "1.5"
|
||||
zbus = { version = "3.11" }
|
||||
zbus = { version = "4" }
|
||||
qemu-display = { path = "../qemu-display" }
|
||||
keycodemap = { path = "../keycodemap" }
|
||||
rdw = { package = "rdw4", version = "0.1", features = ["bindings"] }
|
||||
futures-util = "0.3"
|
||||
futures = "0.3"
|
||||
async-trait = "0.1"
|
||||
tracing-subscriber = { version = "0.3.11", features = ["env-filter" , "fmt"], default-features = false }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
rdw = { package = "rdw4", version = "0.1", features = ["bindings"] }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
uds_windows = "1.0.2"
|
||||
windows = { version = "0.43.0", features = ["Win32_System_Memory", "Win32_Foundation"] }
|
||||
rdw = { package = "rdw4", version = "0.1", features = ["bindings"], default-features = false }
|
||||
|
@ -212,14 +212,14 @@ mod imp {
|
||||
continue;
|
||||
}
|
||||
this.obj().set_display_size(Some((s.width as _, s.height as _)));
|
||||
this.obj().update_area(0, 0, s.width as _, s.height as _, s.stride as _, &s.data);
|
||||
this.obj().update_area(0, 0, s.width as _, s.height as _, s.stride as _, Some(&s.data));
|
||||
}
|
||||
Update(u) => {
|
||||
if u.format != 0x20020888 {
|
||||
log::warn!("Format not yet supported: {:X}", u.format);
|
||||
continue;
|
||||
}
|
||||
this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, u.stride as _, &u.data);
|
||||
this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, u.stride as _, Some(&u.data));
|
||||
}
|
||||
#[cfg(windows)]
|
||||
ScanoutMap(s) => {
|
||||
@ -242,7 +242,7 @@ mod imp {
|
||||
|
||||
let map = MemoryMap { ptr, handle, offset, size };
|
||||
this.obj().set_display_size(Some((s.width as _, s.height as _)));
|
||||
this.obj().update_area(0, 0, s.width as _, s.height as _, s.stride as _, map.as_bytes());
|
||||
this.obj().update_area(0, 0, s.width as _, s.height as _, s.stride as _, Some(map.as_bytes()));
|
||||
this.scanout_map.replace(Some((map, s.stride)));
|
||||
}
|
||||
#[cfg(windows)]
|
||||
@ -255,7 +255,7 @@ mod imp {
|
||||
};
|
||||
let stride = *stride;
|
||||
let bytes = map.as_bytes();
|
||||
this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, stride as _, &bytes[u.y as usize * stride as usize + u.x as usize * 4..]);
|
||||
this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, stride as _, Some(&bytes[u.y as usize * stride as usize + u.x as usize * 4..]));
|
||||
}
|
||||
#[cfg(windows)]
|
||||
ScanoutD3dTexture2d(s) => {
|
||||
@ -273,9 +273,9 @@ mod imp {
|
||||
}));
|
||||
}
|
||||
#[cfg(windows)]
|
||||
UpdateD3dTexture2d { wait_tx, .. } => {
|
||||
UpdateD3dTexture2d { wait_tx, update } => {
|
||||
this.obj().set_d3d11_texture2d_can_acquire(true);
|
||||
this.obj().render();
|
||||
this.obj().update_area(update.x, update.y, update.w, update.h, 0, None);
|
||||
this.obj().set_d3d11_texture2d_can_acquire(false);
|
||||
let _ = wait_tx.send(());
|
||||
}
|
||||
@ -294,8 +294,8 @@ mod imp {
|
||||
});
|
||||
}
|
||||
#[cfg(unix)]
|
||||
UpdateDMABUF { wait_tx, .. } => {
|
||||
this.obj().render();
|
||||
UpdateDMABUF { wait_tx, update } => {
|
||||
this.obj().update_area(update.x, update.y, update.w, update.h, 0, None);
|
||||
let _ = wait_tx.send(());
|
||||
}
|
||||
Disable => {
|
||||
@ -372,14 +372,14 @@ enum ConsoleEvent {
|
||||
ScanoutD3dTexture2d(qemu_display::ScanoutD3dTexture2d),
|
||||
#[cfg(windows)]
|
||||
UpdateD3dTexture2d {
|
||||
_update: qemu_display::UpdateD3dTexture2d,
|
||||
update: qemu_display::UpdateD3dTexture2d,
|
||||
wait_tx: futures::channel::oneshot::Sender<()>,
|
||||
},
|
||||
#[cfg(unix)]
|
||||
ScanoutDMABUF(qemu_display::ScanoutDMABUF),
|
||||
#[cfg(unix)]
|
||||
UpdateDMABUF {
|
||||
_update: qemu_display::UpdateDMABUF,
|
||||
update: qemu_display::UpdateDMABUF,
|
||||
wait_tx: futures::channel::oneshot::Sender<()>,
|
||||
},
|
||||
Disable,
|
||||
@ -424,9 +424,9 @@ impl ConsoleListenerD3d11Handler for ConsoleHandler {
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
async fn update_texture2d(&mut self, _update: qemu_display::UpdateD3dTexture2d) {
|
||||
async fn update_texture2d(&mut self, update: qemu_display::UpdateD3dTexture2d) {
|
||||
let (wait_tx, wait_rx) = futures::channel::oneshot::channel();
|
||||
self.send(ConsoleEvent::UpdateD3dTexture2d { _update, wait_tx });
|
||||
self.send(ConsoleEvent::UpdateD3dTexture2d { update, wait_tx });
|
||||
if let Err(e) = wait_rx.await {
|
||||
log::warn!("wait update d3d texture2d failed: {}", e);
|
||||
}
|
||||
@ -449,9 +449,9 @@ impl ConsoleListenerHandler for ConsoleHandler {
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
async fn update_dmabuf(&mut self, _update: qemu_display::UpdateDMABUF) {
|
||||
async fn update_dmabuf(&mut self, update: qemu_display::UpdateDMABUF) {
|
||||
let (wait_tx, wait_rx) = futures::channel::oneshot::channel();
|
||||
self.send(ConsoleEvent::UpdateDMABUF { _update, wait_tx });
|
||||
self.send(ConsoleEvent::UpdateDMABUF { update, wait_tx });
|
||||
if let Err(e) = wait_rx.await {
|
||||
log::warn!("wait update dmabuf failed: {}", e);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
window.show();
|
||||
window.present();
|
||||
});
|
||||
});
|
||||
|
||||
@ -281,10 +281,10 @@ impl App {
|
||||
action_usb.connect_activate(move |_, _| {
|
||||
let usbredir = app_clone.inner.usbredir.borrow();
|
||||
if let Some(usbredir) = usbredir.as_ref() {
|
||||
let dialog = gtk::Dialog::new();
|
||||
let dialog = gtk::Window::new();
|
||||
dialog.set_transient_for(app_clone.inner.app.active_window().as_ref());
|
||||
dialog.set_child(Some(&usbredir.widget()));
|
||||
dialog.show();
|
||||
dialog.present();
|
||||
}
|
||||
});
|
||||
app.inner.app.add_action(&action_usb);
|
||||
|
@ -13,4 +13,5 @@ futures = "0.3.13"
|
||||
|
||||
[dependencies.vte]
|
||||
package = "vte4"
|
||||
version = "0.6"
|
||||
version = "0.8"
|
||||
git = "https://gitlab.gnome.org/World/Rust/vte4-rs"
|
||||
|
Loading…
Reference in New Issue
Block a user