mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
Remove typeshare use
This commit is contained in:
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -1079,10 +1079,6 @@ version = "3.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cpuctl"
|
|
||||||
version = "6.1.0-rc1"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpufeatures"
|
name = "cpufeatures"
|
||||||
version = "0.2.16"
|
version = "0.2.16"
|
||||||
@@ -4133,7 +4129,6 @@ dependencies = [
|
|||||||
"pix",
|
"pix",
|
||||||
"png_pong",
|
"png_pong",
|
||||||
"serde",
|
"serde",
|
||||||
"typeshare",
|
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4145,7 +4140,6 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"ron",
|
"ron",
|
||||||
"serde",
|
"serde",
|
||||||
"typeshare",
|
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4172,7 +4166,6 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"rusb",
|
"rusb",
|
||||||
"serde",
|
"serde",
|
||||||
"typeshare",
|
|
||||||
"udev 0.8.0",
|
"udev 0.8.0",
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
@@ -4184,7 +4177,6 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"rog_platform",
|
"rog_platform",
|
||||||
"serde",
|
"serde",
|
||||||
"typeshare",
|
|
||||||
"udev 0.8.0",
|
"udev 0.8.0",
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
@@ -4196,7 +4188,6 @@ dependencies = [
|
|||||||
"ron",
|
"ron",
|
||||||
"serde",
|
"serde",
|
||||||
"sg",
|
"sg",
|
||||||
"typeshare",
|
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4216,7 +4207,6 @@ version = "6.1.0-rc1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"dmi_id",
|
"dmi_id",
|
||||||
"serde",
|
"serde",
|
||||||
"typeshare",
|
|
||||||
"zbus 5.2.0",
|
"zbus 5.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5320,28 +5310,6 @@ version = "1.17.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "typeshare"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "19be0f411120091e76e13e5a0186d8e2bcc3e7e244afdb70152197f1a8486ceb"
|
|
||||||
dependencies = [
|
|
||||||
"chrono",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"typeshare-annotation",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "typeshare-annotation"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f"
|
|
||||||
dependencies = [
|
|
||||||
"quote",
|
|
||||||
"syn 2.0.93",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "udev"
|
name = "udev"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ members = [
|
|||||||
"asusd",
|
"asusd",
|
||||||
"asusd-user",
|
"asusd-user",
|
||||||
"config-traits",
|
"config-traits",
|
||||||
"cpuctl",
|
|
||||||
"dmi-id",
|
"dmi-id",
|
||||||
"rog-platform",
|
"rog-platform",
|
||||||
"rog-dbus",
|
"rog-dbus",
|
||||||
@@ -49,7 +48,6 @@ logind-zbus = { version = "5.0.0" } #, default-features = false, features = ["no
|
|||||||
|
|
||||||
serde = { version = "^1.0", features = ["serde_derive"] }
|
serde = { version = "^1.0", features = ["serde_derive"] }
|
||||||
ron = "*"
|
ron = "*"
|
||||||
typeshare = "1.0.0"
|
|
||||||
|
|
||||||
log = "^0.4"
|
log = "^0.4"
|
||||||
env_logger = "^0.10.0"
|
env_logger = "^0.10.0"
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -122,12 +122,6 @@ vendor:
|
|||||||
tar pcfJ vendor_asusctl_$(VERSION).tar.xz vendor
|
tar pcfJ vendor_asusctl_$(VERSION).tar.xz vendor
|
||||||
rm -rf vendor
|
rm -rf vendor
|
||||||
|
|
||||||
bindings:
|
|
||||||
typeshare ./rog-anime/src/ --lang=typescript --output-file=bindings/ts/anime.ts
|
|
||||||
typeshare ./rog-aura/src/ --lang=typescript --output-file=bindings/ts/aura.ts
|
|
||||||
typeshare ./rog-profiles/src/ --lang=typescript --output-file=bindings/ts/profiles.ts
|
|
||||||
typeshare ./rog-platform/src/ --lang=typescript --output-file=bindings/ts/platform.ts
|
|
||||||
|
|
||||||
translate:
|
translate:
|
||||||
find -name \*.slint | xargs slint-tr-extractor -o rog-control-center/translations/en/rog-control-center.po
|
find -name \*.slint | xargs slint-tr-extractor -o rog-control-center/translations/en/rog-control-center.po
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "cpuctl"
|
|
||||||
license.workspace = true
|
|
||||||
version.workspace = true
|
|
||||||
readme.workspace = true
|
|
||||||
authors.workspace = true
|
|
||||||
repository.workspace = true
|
|
||||||
homepage.workspace = true
|
|
||||||
edition.workspace = true
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
pub fn add(left: usize, right: usize) -> usize {
|
|
||||||
left + right
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn it_works() {
|
|
||||||
let result = add(2, 2);
|
|
||||||
assert_eq!(result, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -30,7 +30,6 @@ log.workspace = true
|
|||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
|
||||||
glam.workspace = true
|
glam.workspace = true
|
||||||
typeshare.workspace = true
|
|
||||||
|
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use std::time::{Duration, Instant};
|
|||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use log::info;
|
use log::info;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
@@ -29,9 +28,7 @@ pub const USB_PREFIX2: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02];
|
|||||||
/// Third packet is for GA402 matrix
|
/// Third packet is for GA402 matrix
|
||||||
pub const USB_PREFIX3: [u8; 7] = [0x5e, 0xc0, 0x02, 0xe7, 0x04, 0x73, 0x02];
|
pub const USB_PREFIX3: [u8; 7] = [0x5e, 0xc0, 0x02, 0xe7, 0x04, 0x73, 0x02];
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Default, Deserialize, PartialEq, Eq, Clone, Copy, Serialize, Debug)]
|
#[derive(Default, Deserialize, PartialEq, Eq, Clone, Copy, Serialize, Debug)]
|
||||||
pub struct Animations {
|
pub struct Animations {
|
||||||
pub boot: AnimBooting,
|
pub boot: AnimBooting,
|
||||||
@@ -41,9 +38,7 @@ pub struct Animations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move this out
|
// TODO: move this out
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub struct DeviceState {
|
pub struct DeviceState {
|
||||||
pub display_enabled: bool,
|
pub display_enabled: bool,
|
||||||
@@ -56,7 +51,6 @@ pub struct DeviceState {
|
|||||||
pub brightness_on_battery: Brightness,
|
pub brightness_on_battery: Brightness,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))]
|
#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
|
||||||
pub enum AnimeType {
|
pub enum AnimeType {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
@@ -29,7 +28,6 @@ pub const PROD_ID: u16 = 0x193b;
|
|||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
zvariant(signature = "u")
|
zvariant(signature = "u")
|
||||||
)]
|
)]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
/// Base LED brightness of the display
|
/// Base LED brightness of the display
|
||||||
pub enum Brightness {
|
pub enum Brightness {
|
||||||
@@ -82,7 +80,6 @@ impl From<Brightness> for i32 {
|
|||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
zvariant(signature = "s")
|
zvariant(signature = "s")
|
||||||
)]
|
)]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub enum AnimBooting {
|
pub enum AnimBooting {
|
||||||
#[default]
|
#[default]
|
||||||
@@ -123,7 +120,6 @@ impl From<AnimBooting> for i32 {
|
|||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
zvariant(signature = "s")
|
zvariant(signature = "s")
|
||||||
)]
|
)]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub enum AnimAwake {
|
pub enum AnimAwake {
|
||||||
#[default]
|
#[default]
|
||||||
@@ -164,7 +160,6 @@ impl From<AnimAwake> for i32 {
|
|||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
zvariant(signature = "s")
|
zvariant(signature = "s")
|
||||||
)]
|
)]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub enum AnimSleeping {
|
pub enum AnimSleeping {
|
||||||
#[default]
|
#[default]
|
||||||
@@ -205,7 +200,6 @@ impl From<AnimSleeping> for i32 {
|
|||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
zvariant(signature = "s")
|
zvariant(signature = "s")
|
||||||
)]
|
)]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub enum AnimShutdown {
|
pub enum AnimShutdown {
|
||||||
#[default]
|
#[default]
|
||||||
|
|||||||
@@ -23,6 +23,5 @@ dmi_id = { path = "../dmi-id" }
|
|||||||
|
|
||||||
# cli and logging
|
# cli and logging
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
typeshare.workspace = true
|
|
||||||
|
|
||||||
ron = { version = "*", optional = true }
|
ron = { version = "*", optional = true }
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ use std::fmt::Display;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
use crate::AURA_LAPTOP_LED_MSG_LEN;
|
use crate::AURA_LAPTOP_LED_MSG_LEN;
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
@@ -79,7 +77,6 @@ impl From<i32> for LedBrightness {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
||||||
pub struct Colour {
|
pub struct Colour {
|
||||||
@@ -140,7 +137,6 @@ impl From<Colour> for [u8; 3] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -200,7 +196,6 @@ impl From<Speed> for u8 {
|
|||||||
/// Used for Rainbow mode.
|
/// Used for Rainbow mode.
|
||||||
///
|
///
|
||||||
/// Enum corresponds to the required integer value
|
/// Enum corresponds to the required integer value
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -248,7 +243,6 @@ impl From<Direction> for i32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Enum of modes that convert to the actual number required by a USB HID packet
|
/// Enum of modes that convert to the actual number required by a USB HID packet
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -360,7 +354,6 @@ impl From<AuraEffect> for AuraModeNum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Base effects have no zoning, while multizone is 1-4
|
/// Base effects have no zoning, while multizone is 1-4
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -432,7 +425,6 @@ impl From<AuraZone> for i32 {
|
|||||||
/// ```rust
|
/// ```rust
|
||||||
/// // let bytes: [u8; LED_MSG_LEN] = mode.into();
|
/// // let bytes: [u8; LED_MSG_LEN] = mode.into();
|
||||||
/// ```
|
/// ```
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||||
pub struct AuraEffect {
|
pub struct AuraEffect {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use log::warn;
|
use log::warn;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
|
|
||||||
@@ -194,7 +193,6 @@ impl LedCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Represents the per-key raw USB packets
|
/// Represents the per-key raw USB packets
|
||||||
#[typeshare]
|
|
||||||
pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
||||||
|
|
||||||
/// A `UsbPackets` contains all data to change the full set of keyboard
|
/// A `UsbPackets` contains all data to change the full set of keyboard
|
||||||
@@ -204,7 +202,6 @@ pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
|||||||
/// to the keyboard EC. One row controls one group of keys, these keys are not
|
/// to the keyboard EC. One row controls one group of keys, these keys are not
|
||||||
/// necessarily all on the same row of the keyboard, with some splitting between
|
/// necessarily all on the same row of the keyboard, with some splitting between
|
||||||
/// two rows.
|
/// two rows.
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct LedUsbPackets {
|
pub struct LedUsbPackets {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use std::ops::{BitAnd, BitOr};
|
|||||||
|
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
@@ -16,7 +15,6 @@ use crate::{AuraDeviceType, PowerZones};
|
|||||||
/// - 2021+, the struct is a single zone with 4 states
|
/// - 2021+, the struct is a single zone with 4 states
|
||||||
/// - pre-2021, the struct is 1 or 2 zones and 3 states
|
/// - pre-2021, the struct is 1 or 2 zones and 3 states
|
||||||
/// - Tuf, the struct is 1 zone and 3 states
|
/// - Tuf, the struct is 1 zone and 3 states
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct AuraPowerState {
|
pub struct AuraPowerState {
|
||||||
@@ -145,7 +143,6 @@ impl AuraPowerState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct LaptopAuraPower {
|
pub struct LaptopAuraPower {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
@@ -64,7 +63,6 @@ pub const ORANGE: Colour = Colour {
|
|||||||
};
|
};
|
||||||
pub const GRADIENT: [Colour; 7] = [RED, VIOLET, BLUE, TEAL, GREEN, YELLOW, ORANGE];
|
pub const GRADIENT: [Colour; 7] = [RED, VIOLET, BLUE, TEAL, GREEN, YELLOW, ORANGE];
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||||
pub enum AuraDeviceType {
|
pub enum AuraDeviceType {
|
||||||
@@ -116,7 +114,6 @@ impl From<&str> for AuraDeviceType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The powerr zones this laptop supports
|
/// The powerr zones this laptop supports
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ zbus.workspace = true
|
|||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
udev.workspace = true
|
udev.workspace = true
|
||||||
inotify.workspace = true
|
inotify.workspace = true
|
||||||
typeshare.workspace = true
|
|
||||||
|
|
||||||
rusb.workspace = true
|
rusb.workspace = true
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
use crate::error::{PlatformError, Result};
|
use crate::error::{PlatformError, Result};
|
||||||
@@ -147,7 +146,6 @@ impl CPUControl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy,
|
Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy,
|
||||||
@@ -179,7 +177,6 @@ impl From<CPUGovernor> for String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Deserialize,
|
Deserialize,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use std::io::{Read, Write};
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
use crate::error::PlatformError;
|
use crate::error::PlatformError;
|
||||||
@@ -252,7 +251,6 @@ define_attribute_getters!(
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// CamelCase names of the properties. Intended for use with DBUS
|
/// CamelCase names of the properties. Intended for use with DBUS
|
||||||
#[typeshare]
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Clone, Copy, Serialize, Deserialize, Type, Value, OwnedValue, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Serialize, Deserialize, Type, Value, OwnedValue, PartialEq, PartialOrd)]
|
||||||
#[zvariant(signature = "s")]
|
#[zvariant(signature = "s")]
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
use crate::error::{PlatformError, Result};
|
use crate::error::{PlatformError, Result};
|
||||||
@@ -148,7 +147,6 @@ impl Default for RogPlatform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Serialize, Deserialize, Default, Type, Value, OwnedValue, Debug, PartialEq, Eq, Clone, Copy,
|
Serialize, Deserialize, Default, Type, Value, OwnedValue, Debug, PartialEq, Eq, Clone, Copy,
|
||||||
@@ -245,7 +243,6 @@ impl Display for GpuMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Deserialize,
|
Deserialize,
|
||||||
@@ -352,7 +349,6 @@ impl Display for ThrottlePolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// CamelCase names of the properties. Intended for use with DBUS
|
/// CamelCase names of the properties. Intended for use with DBUS
|
||||||
#[typeshare]
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, PartialEq, PartialOrd)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, PartialEq, PartialOrd)]
|
||||||
#[zvariant(signature = "s")]
|
#[zvariant(signature = "s")]
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ dbus = ["zbus"]
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
udev.workspace = true
|
udev.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
typeshare.workspace = true
|
|
||||||
rog_platform = { path = "../rog-platform" }
|
rog_platform = { path = "../rog-platform" }
|
||||||
|
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use log::{error, trace};
|
use log::{error, trace};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
use udev::Device;
|
use udev::Device;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
@@ -31,7 +30,6 @@ pub(crate) fn temp_str(fan: char, index: usize) -> String {
|
|||||||
string
|
string
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||||
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
|
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
|
||||||
pub struct CurveData {
|
pub struct CurveData {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use fan_curve_set::CurveData;
|
|||||||
use log::debug;
|
use log::debug;
|
||||||
use rog_platform::platform::ThrottlePolicy;
|
use rog_platform::platform::ThrottlePolicy;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
pub use udev::Device;
|
pub use udev::Device;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
@@ -33,7 +32,6 @@ pub fn find_fan_curve_node() -> Result<Device, ProfileError> {
|
|||||||
Err(ProfileError::NotSupported)
|
Err(ProfileError::NotSupported)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -105,7 +103,6 @@ impl Default for FanCurvePU {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Main purpose of `FanCurves` is to enable restoring state on system boot
|
/// Main purpose of `FanCurves` is to enable restoring state on system boot
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||||
#[derive(Deserialize, Serialize, Debug, Default)]
|
#[derive(Deserialize, Serialize, Debug, Default)]
|
||||||
pub struct FanCurveProfiles {
|
pub struct FanCurveProfiles {
|
||||||
|
|||||||
@@ -20,6 +20,5 @@ serde.workspace = true
|
|||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
|
|
||||||
# cli and logging
|
# cli and logging
|
||||||
typeshare.workspace = true
|
|
||||||
|
|
||||||
ron = { version = "*", optional = true }
|
ron = { version = "*", optional = true }
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ use std::fmt::Display;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
use crate::scsi::{apply_task, dir_task, mode_task, rgb_task, save_task, speed_task};
|
use crate::scsi::{apply_task, dir_task, mode_task, rgb_task, save_task, speed_task};
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
||||||
pub struct Colour {
|
pub struct Colour {
|
||||||
@@ -54,7 +52,6 @@ impl From<Colour> for [u8; 3] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
@@ -95,7 +92,6 @@ impl From<Direction> for u8 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -152,7 +148,6 @@ impl From<u8> for Speed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Enum of modes that convert to the actual number required by a USB HID packet
|
/// Enum of modes that convert to the actual number required by a USB HID packet
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "dbus",
|
feature = "dbus",
|
||||||
derive(Type, Value, OwnedValue),
|
derive(Type, Value, OwnedValue),
|
||||||
@@ -297,7 +292,6 @@ impl From<AuraEffect> for AuraMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Default factory modes structure.
|
/// Default factory modes structure.
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||||
pub struct AuraEffect {
|
pub struct AuraEffect {
|
||||||
|
|||||||
@@ -23,6 +23,5 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
typeshare.workspace = true
|
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
dmi_id = { path = "../dmi-id", optional = true }
|
dmi_id = { path = "../dmi-id", optional = true }
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
use zbus::zvariant::{OwnedValue, Value};
|
use zbus::zvariant::{OwnedValue, Value};
|
||||||
@@ -66,7 +65,6 @@ impl FromStr for SlashType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub enum SlashMode {
|
pub enum SlashMode {
|
||||||
@@ -158,9 +156,7 @@ impl SlashMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
|
||||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||||
#[typeshare]
|
|
||||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||||
pub struct DeviceState {
|
pub struct DeviceState {
|
||||||
pub slash_enabled: bool,
|
pub slash_enabled: bool,
|
||||||
|
|||||||
Reference in New Issue
Block a user