216 lines
8.4 KiB
Rust
216 lines
8.4 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust -g -m None -d org.kde.plasmashell -p /PlasmaShell`, see https://github.com/diwic/dbus-rs
|
|
use dbus as dbus;
|
|
#[allow(unused_imports)]
|
|
use dbus::arg;
|
|
use dbus::blocking;
|
|
|
|
pub trait OrgKdePlasmaShell {
|
|
fn toggle_dashboard(&self) -> Result<(), dbus::Error>;
|
|
fn toggle_activity_manager(&self) -> Result<(), dbus::Error>;
|
|
fn toggle_widget_explorer(&self) -> Result<(), dbus::Error>;
|
|
fn set_dashboard_shown(&self, show: bool) -> Result<(), dbus::Error>;
|
|
fn evaluate_script(&self, script: &str) -> Result<String, dbus::Error>;
|
|
fn color(&self) -> Result<u32, dbus::Error>;
|
|
fn dump_current_layout_js(&self) -> Result<Vec<u8>, dbus::Error>;
|
|
fn load_look_and_feel_default_layout(&self, layout: &str) -> Result<(), dbus::Error>;
|
|
fn activate_launcher_menu(&self) -> Result<(), dbus::Error>;
|
|
fn refresh_current_shell(&self) -> Result<(), dbus::Error>;
|
|
fn wallpaper(&self, screen_num: u32) -> Result<arg::PropMap, dbus::Error>;
|
|
fn set_wallpaper(&self, wallpaper_plugin: &str, parameters: arg::PropMap, screen_num: u32) -> Result<(), dbus::Error>;
|
|
fn edit_mode(&self) -> Result<bool, dbus::Error>;
|
|
fn setedit_mode(&self, value: bool) -> Result<(), dbus::Error>;
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct OrgKdePlasmaShellWallpaperChanged {
|
|
pub screen_num: u32,
|
|
}
|
|
|
|
impl arg::AppendAll for OrgKdePlasmaShellWallpaperChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.screen_num, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for OrgKdePlasmaShellWallpaperChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(OrgKdePlasmaShellWallpaperChanged {
|
|
screen_num: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for OrgKdePlasmaShellWallpaperChanged {
|
|
const NAME: &'static str = "wallpaperChanged";
|
|
const INTERFACE: &'static str = "org.kde.PlasmaShell";
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct OrgKdePlasmaShellColorChanged {
|
|
pub changed_color: String,
|
|
}
|
|
|
|
impl arg::AppendAll for OrgKdePlasmaShellColorChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.changed_color, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for OrgKdePlasmaShellColorChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(OrgKdePlasmaShellColorChanged {
|
|
changed_color: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for OrgKdePlasmaShellColorChanged {
|
|
const NAME: &'static str = "colorChanged";
|
|
const INTERFACE: &'static str = "org.kde.PlasmaShell";
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgKdePlasmaShell for blocking::Proxy<'a, C> {
|
|
|
|
fn toggle_dashboard(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "toggleDashboard", ())
|
|
}
|
|
|
|
fn toggle_activity_manager(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "toggleActivityManager", ())
|
|
}
|
|
|
|
fn toggle_widget_explorer(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "toggleWidgetExplorer", ())
|
|
}
|
|
|
|
fn set_dashboard_shown(&self, show: bool) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "setDashboardShown", (show, ))
|
|
}
|
|
|
|
fn evaluate_script(&self, script: &str) -> Result<String, dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "evaluateScript", (script, ))
|
|
.and_then(|r: (String, )| Ok(r.0, ))
|
|
}
|
|
|
|
fn color(&self) -> Result<u32, dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "color", ())
|
|
.and_then(|r: (u32, )| Ok(r.0, ))
|
|
}
|
|
|
|
fn dump_current_layout_js(&self) -> Result<Vec<u8>, dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "dumpCurrentLayoutJS", ())
|
|
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
|
|
}
|
|
|
|
fn load_look_and_feel_default_layout(&self, layout: &str) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "loadLookAndFeelDefaultLayout", (layout, ))
|
|
}
|
|
|
|
fn activate_launcher_menu(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "activateLauncherMenu", ())
|
|
}
|
|
|
|
fn refresh_current_shell(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "refreshCurrentShell", ())
|
|
}
|
|
|
|
fn wallpaper(&self, screen_num: u32) -> Result<arg::PropMap, dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "wallpaper", (screen_num, ))
|
|
.and_then(|r: (arg::PropMap, )| Ok(r.0, ))
|
|
}
|
|
|
|
fn set_wallpaper(&self, wallpaper_plugin: &str, parameters: arg::PropMap, screen_num: u32) -> Result<(), dbus::Error> {
|
|
self.method_call("org.kde.PlasmaShell", "setWallpaper", (wallpaper_plugin, parameters, screen_num, ))
|
|
}
|
|
|
|
fn edit_mode(&self) -> Result<bool, dbus::Error> {
|
|
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(self, "org.kde.PlasmaShell", "editMode")
|
|
}
|
|
|
|
fn setedit_mode(&self, value: bool) -> Result<(), dbus::Error> {
|
|
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::set(self, "org.kde.PlasmaShell", "editMode", value)
|
|
}
|
|
}
|
|
|
|
pub trait OrgFreedesktopDBusProperties {
|
|
fn get<R0: for<'b> arg::Get<'b> + 'static>(&self, interface_name: &str, property_name: &str) -> Result<R0, dbus::Error>;
|
|
fn set<I2: arg::Arg + arg::Append>(&self, interface_name: &str, property_name: &str, value: I2) -> Result<(), dbus::Error>;
|
|
fn get_all(&self, interface_name: &str) -> Result<arg::PropMap, dbus::Error>;
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct OrgFreedesktopDBusPropertiesPropertiesChanged {
|
|
pub interface_name: String,
|
|
pub changed_properties: arg::PropMap,
|
|
pub invalidated_properties: Vec<String>,
|
|
}
|
|
|
|
impl arg::AppendAll for OrgFreedesktopDBusPropertiesPropertiesChanged {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.interface_name, i);
|
|
arg::RefArg::append(&self.changed_properties, i);
|
|
arg::RefArg::append(&self.invalidated_properties, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for OrgFreedesktopDBusPropertiesPropertiesChanged {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(OrgFreedesktopDBusPropertiesPropertiesChanged {
|
|
interface_name: i.read()?,
|
|
changed_properties: i.read()?,
|
|
invalidated_properties: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for OrgFreedesktopDBusPropertiesPropertiesChanged {
|
|
const NAME: &'static str = "PropertiesChanged";
|
|
const INTERFACE: &'static str = "org.freedesktop.DBus.Properties";
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgFreedesktopDBusProperties for blocking::Proxy<'a, C> {
|
|
|
|
fn get<R0: for<'b> arg::Get<'b> + 'static>(&self, interface_name: &str, property_name: &str) -> Result<R0, dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Properties", "Get", (interface_name, property_name, ))
|
|
.and_then(|r: (arg::Variant<R0>, )| Ok((r.0).0, ))
|
|
}
|
|
|
|
fn set<I2: arg::Arg + arg::Append>(&self, interface_name: &str, property_name: &str, value: I2) -> Result<(), dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Properties", "Set", (interface_name, property_name, arg::Variant(value), ))
|
|
}
|
|
|
|
fn get_all(&self, interface_name: &str) -> Result<arg::PropMap, dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Properties", "GetAll", (interface_name, ))
|
|
.and_then(|r: (arg::PropMap, )| Ok(r.0, ))
|
|
}
|
|
}
|
|
|
|
pub trait OrgFreedesktopDBusIntrospectable {
|
|
fn introspect(&self) -> Result<String, dbus::Error>;
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgFreedesktopDBusIntrospectable for blocking::Proxy<'a, C> {
|
|
|
|
fn introspect(&self) -> Result<String, dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Introspectable", "Introspect", ())
|
|
.and_then(|r: (String, )| Ok(r.0, ))
|
|
}
|
|
}
|
|
|
|
pub trait OrgFreedesktopDBusPeer {
|
|
fn ping(&self) -> Result<(), dbus::Error>;
|
|
fn get_machine_id(&self) -> Result<String, dbus::Error>;
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgFreedesktopDBusPeer for blocking::Proxy<'a, C> {
|
|
|
|
fn ping(&self) -> Result<(), dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Peer", "Ping", ())
|
|
}
|
|
|
|
fn get_machine_id(&self) -> Result<String, dbus::Error> {
|
|
self.method_call("org.freedesktop.DBus.Peer", "GetMachineId", ())
|
|
.and_then(|r: (String, )| Ok(r.0, ))
|
|
}
|
|
}
|