mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add extra models to ledmodes
- Configurable anime example - Gfx power states as enum Closes #72
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
//!
|
||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||
|
||||
use rog_types::anime_matrix::{AniMeDataBuffer, AniMeImageBuffer};
|
||||
use rog_anime::AniMeDataBuffer;
|
||||
use zbus::{dbus_proxy, Connection, Result};
|
||||
|
||||
#[dbus_proxy(
|
||||
@@ -34,10 +34,7 @@ trait Daemon {
|
||||
fn set_on_off(&self, status: bool) -> zbus::Result<()>;
|
||||
|
||||
/// WriteDirect method
|
||||
fn write_direct(&self, input: &[u8]) -> zbus::Result<()>;
|
||||
|
||||
/// WriteImage method
|
||||
fn write_image(&self, input: &[Vec<u8>]) -> zbus::Result<()>;
|
||||
fn write(&self, input: &[u8]) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
pub struct AnimeProxy<'a>(DaemonProxy<'a>);
|
||||
@@ -63,12 +60,7 @@ impl<'a> AnimeProxy<'a> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn write_direct(&self, input: AniMeDataBuffer) -> Result<()> {
|
||||
self.0.write_direct(input.get())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn write_image(&self, input: AniMeImageBuffer) -> Result<()> {
|
||||
self.0.write_image(input.get())
|
||||
pub fn write(&self, input: AniMeDataBuffer) -> Result<()> {
|
||||
self.0.write(input.get())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use rog_types::gfx_vendors::{GfxRequiredUserAction, GfxVendors};
|
||||
use rog_types::gfx_vendors::{GfxPower, GfxRequiredUserAction, GfxVendors};
|
||||
use zbus::{dbus_proxy, Connection, Result};
|
||||
|
||||
#[dbus_proxy(
|
||||
@@ -30,7 +30,7 @@ use zbus::{dbus_proxy, Connection, Result};
|
||||
)]
|
||||
trait Daemon {
|
||||
/// Power method
|
||||
fn power(&self) -> zbus::Result<String>;
|
||||
fn power(&self) -> zbus::Result<GfxPower>;
|
||||
|
||||
/// SetVendor method
|
||||
fn set_vendor(&self, vendor: &GfxVendors) -> zbus::Result<GfxRequiredUserAction>;
|
||||
@@ -60,7 +60,7 @@ impl<'a> GfxProxy<'a> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn gfx_get_pwr(&self) -> Result<String> {
|
||||
pub fn gfx_get_pwr(&self) -> Result<GfxPower> {
|
||||
self.0.power()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user