zbus update
This commit is contained in:
parent
2e9660f2a8
commit
87250b5e50
23 changed files with 613 additions and 484 deletions
|
|
@ -106,16 +106,16 @@ async fn get_layout(menu_proxy: DBusMenuProxy<'static>) -> Result<Layout, String
|
|||
}
|
||||
}
|
||||
|
||||
#[zbus::dbus_proxy(interface = "org.kde.StatusNotifierItem")]
|
||||
#[zbus::proxy(interface = "org.kde.StatusNotifierItem")]
|
||||
trait StatusNotifierItem {
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn icon_name(&self) -> zbus::Result<String>;
|
||||
|
||||
// https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/Icons
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn icon_pixmap(&self) -> zbus::Result<Vec<Icon>>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn menu(&self) -> zbus::Result<zvariant::OwnedObjectPath>;
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ impl Layout {
|
|||
}
|
||||
}
|
||||
|
||||
#[zbus::dbus_proxy(interface = "com.canonical.dbusmenu")]
|
||||
#[zbus::proxy(interface = "com.canonical.dbusmenu")]
|
||||
trait DBusMenu {
|
||||
fn get_layout(
|
||||
&self,
|
||||
|
|
@ -236,6 +236,6 @@ trait DBusMenu {
|
|||
fn event(&self, id: i32, event_id: &str, data: &OwnedValue, timestamp: u32)
|
||||
-> zbus::Result<()>;
|
||||
|
||||
#[dbus_proxy(signal)]
|
||||
#[zbus(signal)]
|
||||
fn layout_updated(&self, revision: u32, parent: i32) -> zbus::Result<()>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use crate::subscriptions::status_notifier_item::StatusNotifierItem;
|
|||
// TODO: Don't use trait object
|
||||
pub type EventStream = Pin<Box<dyn Stream<Item = Event> + Send>>;
|
||||
|
||||
#[zbus::dbus_proxy(
|
||||
#[zbus::proxy(
|
||||
interface = "org.kde.StatusNotifierWatcher",
|
||||
default_service = "org.kde.StatusNotifierWatcher",
|
||||
default_path = "/StatusNotifierWatcher"
|
||||
|
|
@ -18,13 +18,13 @@ pub type EventStream = Pin<Box<dyn Stream<Item = Event> + Send>>;
|
|||
trait StatusNotifierWatcher {
|
||||
fn register_status_notifier_host(&self, name: &str) -> zbus::Result<()>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn registered_status_notifier_items(&self) -> zbus::Result<Vec<String>>;
|
||||
|
||||
#[dbus_proxy(signal)]
|
||||
#[zbus(signal)]
|
||||
fn status_notifier_item_registered(&self, name: &str) -> zbus::Result<()>;
|
||||
|
||||
#[dbus_proxy(signal)]
|
||||
#[zbus(signal)]
|
||||
fn status_notifier_item_unregistered(&self, name: &str) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ impl StatusNotifierWatcher {
|
|||
#[zbus(header)] hdr: MessageHeader<'_>,
|
||||
#[zbus(signal_context)] ctxt: SignalContext<'_>,
|
||||
) {
|
||||
let sender = hdr.sender().unwrap().unwrap();
|
||||
let sender = hdr.sender().unwrap();
|
||||
let service = if service.starts_with('/') {
|
||||
format!("{}{}", sender, service)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue