mirror of
https://github.com/rustdesk/qemu-display.git
synced 2025-07-01 15:25:29 +00:00
qd: rename Introspect->Display
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
848cd7af0a
commit
458d9887d5
@ -6,12 +6,12 @@ use zvariant::OwnedObjectPath;
|
|||||||
|
|
||||||
use crate::{Audio, Chardev, Result, UsbRedir};
|
use crate::{Audio, Chardev, Result, UsbRedir};
|
||||||
|
|
||||||
pub struct Introspect {
|
pub struct Display {
|
||||||
conn: Connection,
|
conn: Connection,
|
||||||
objects: ManagedObjects,
|
objects: ManagedObjects,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Introspect {
|
impl Display {
|
||||||
pub async fn new(conn: &Connection) -> Result<Self> {
|
pub async fn new(conn: &Connection) -> Result<Self> {
|
||||||
let objects = zbus::fdo::AsyncObjectManagerProxy::builder(&conn)
|
let objects = zbus::fdo::AsyncObjectManagerProxy::builder(&conn)
|
||||||
.destination("org.qemu")?
|
.destination("org.qemu")?
|
@ -30,8 +30,8 @@ pub use keyboard::*;
|
|||||||
mod mouse;
|
mod mouse;
|
||||||
pub use mouse::*;
|
pub use mouse::*;
|
||||||
|
|
||||||
mod introspect;
|
mod display;
|
||||||
pub use introspect::*;
|
pub use display::*;
|
||||||
|
|
||||||
mod usbredir;
|
mod usbredir;
|
||||||
pub use usbredir::*;
|
pub use usbredir::*;
|
||||||
|
@ -2,7 +2,7 @@ use gio::ApplicationFlags;
|
|||||||
use glib::{clone, MainContext};
|
use glib::{clone, MainContext};
|
||||||
use gtk::{gio, glib, prelude::*};
|
use gtk::{gio, glib, prelude::*};
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use qemu_display::{Chardev, Console, Introspect};
|
use qemu_display::{Chardev, Console, Display};
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::os::unix::net::UnixStream;
|
use std::os::unix::net::UnixStream;
|
||||||
use zbus::Connection;
|
use zbus::Connection;
|
||||||
@ -33,13 +33,15 @@ fn main() {
|
|||||||
let audio_clone = audio.clone();
|
let audio_clone = audio.clone();
|
||||||
let clipboard_clone = clipboard.clone();
|
let clipboard_clone = clipboard.clone();
|
||||||
MainContext::default().spawn_local(clone!(@strong window => async move {
|
MainContext::default().spawn_local(clone!(@strong window => async move {
|
||||||
let intro = Introspect::new(&conn).await.unwrap();
|
let display = Display::new(&conn).await.unwrap();
|
||||||
|
|
||||||
let console = Console::new(&conn, 0).await.expect("Failed to get the QEMU console");
|
let console = Console::new(&conn, 0).await.expect("Failed to get the QEMU console");
|
||||||
let display = display_qemu::DisplayQemu::new(console);
|
let rdw = display_qemu::DisplayQemu::new(console);
|
||||||
window.set_child(Some(&display));
|
window.set_child(Some(&rdw));
|
||||||
|
|
||||||
if let Ok(Some(audio)) = intro.audio().await {
|
let usbredir = display.usbredir().await;
|
||||||
|
|
||||||
|
if let Ok(Some(audio)) = display.audio().await {
|
||||||
match audio::Handler::new(audio).await {
|
match audio::Handler::new(audio).await {
|
||||||
Ok(handler) => audio_clone.set(handler).unwrap(),
|
Ok(handler) => audio_clone.set(handler).unwrap(),
|
||||||
Err(e) => log::warn!("Failed to setup audio: {}", e),
|
Err(e) => log::warn!("Failed to setup audio: {}", e),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user