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"
|
||||
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
||||
|
||||
[[package]]
|
||||
name = "cpuctl"
|
||||
version = "6.1.0-rc1"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.16"
|
||||
@@ -4133,7 +4129,6 @@ dependencies = [
|
||||
"pix",
|
||||
"png_pong",
|
||||
"serde",
|
||||
"typeshare",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
|
||||
@@ -4145,7 +4140,6 @@ dependencies = [
|
||||
"log",
|
||||
"ron",
|
||||
"serde",
|
||||
"typeshare",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
|
||||
@@ -4172,7 +4166,6 @@ dependencies = [
|
||||
"log",
|
||||
"rusb",
|
||||
"serde",
|
||||
"typeshare",
|
||||
"udev 0.8.0",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
@@ -4184,7 +4177,6 @@ dependencies = [
|
||||
"log",
|
||||
"rog_platform",
|
||||
"serde",
|
||||
"typeshare",
|
||||
"udev 0.8.0",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
@@ -4196,7 +4188,6 @@ dependencies = [
|
||||
"ron",
|
||||
"serde",
|
||||
"sg",
|
||||
"typeshare",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
|
||||
@@ -4216,7 +4207,6 @@ version = "6.1.0-rc1"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"serde",
|
||||
"typeshare",
|
||||
"zbus 5.2.0",
|
||||
]
|
||||
|
||||
@@ -5320,28 +5310,6 @@ version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
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]]
|
||||
name = "udev"
|
||||
version = "0.8.0"
|
||||
|
||||
@@ -16,7 +16,6 @@ members = [
|
||||
"asusd",
|
||||
"asusd-user",
|
||||
"config-traits",
|
||||
"cpuctl",
|
||||
"dmi-id",
|
||||
"rog-platform",
|
||||
"rog-dbus",
|
||||
@@ -49,7 +48,6 @@ logind-zbus = { version = "5.0.0" } #, default-features = false, features = ["no
|
||||
|
||||
serde = { version = "^1.0", features = ["serde_derive"] }
|
||||
ron = "*"
|
||||
typeshare = "1.0.0"
|
||||
|
||||
log = "^0.4"
|
||||
env_logger = "^0.10.0"
|
||||
|
||||
6
Makefile
6
Makefile
@@ -122,12 +122,6 @@ vendor:
|
||||
tar pcfJ vendor_asusctl_$(VERSION).tar.xz 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:
|
||||
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
|
||||
|
||||
glam.workspace = true
|
||||
typeshare.workspace = true
|
||||
|
||||
zbus = { workspace = true, optional = true }
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use std::time::{Duration, Instant};
|
||||
use dmi_id::DMIID;
|
||||
use log::info;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
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
|
||||
pub const USB_PREFIX3: [u8; 7] = [0x5e, 0xc0, 0x02, 0xe7, 0x04, 0x73, 0x02];
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[typeshare]
|
||||
#[derive(Default, Deserialize, PartialEq, Eq, Clone, Copy, Serialize, Debug)]
|
||||
pub struct Animations {
|
||||
pub boot: AnimBooting,
|
||||
@@ -41,9 +38,7 @@ pub struct Animations {
|
||||
}
|
||||
|
||||
// TODO: move this out
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[typeshare]
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub struct DeviceState {
|
||||
pub display_enabled: bool,
|
||||
@@ -56,7 +51,6 @@ pub struct DeviceState {
|
||||
pub brightness_on_battery: Brightness,
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
|
||||
pub enum AnimeType {
|
||||
|
||||
@@ -12,7 +12,6 @@ use std::str::FromStr;
|
||||
|
||||
use dmi_id::DMIID;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -29,7 +28,6 @@ pub const PROD_ID: u16 = 0x193b;
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "u")
|
||||
)]
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
/// Base LED brightness of the display
|
||||
pub enum Brightness {
|
||||
@@ -82,7 +80,6 @@ impl From<Brightness> for i32 {
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
)]
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum AnimBooting {
|
||||
#[default]
|
||||
@@ -123,7 +120,6 @@ impl From<AnimBooting> for i32 {
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
)]
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum AnimAwake {
|
||||
#[default]
|
||||
@@ -164,7 +160,6 @@ impl From<AnimAwake> for i32 {
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
)]
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum AnimSleeping {
|
||||
#[default]
|
||||
@@ -205,7 +200,6 @@ impl From<AnimSleeping> for i32 {
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
)]
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum AnimShutdown {
|
||||
#[default]
|
||||
|
||||
@@ -23,6 +23,5 @@ dmi_id = { path = "../dmi-id" }
|
||||
|
||||
# cli and logging
|
||||
log.workspace = true
|
||||
typeshare.workspace = true
|
||||
|
||||
ron = { version = "*", optional = true }
|
||||
|
||||
@@ -2,14 +2,12 @@ use std::fmt::Display;
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::AURA_LAPTOP_LED_MSG_LEN;
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
@@ -79,7 +77,6 @@ impl From<i32> for LedBrightness {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
||||
pub struct Colour {
|
||||
@@ -140,7 +137,6 @@ impl From<Colour> for [u8; 3] {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -200,7 +196,6 @@ impl From<Speed> for u8 {
|
||||
/// Used for Rainbow mode.
|
||||
///
|
||||
/// Enum corresponds to the required integer value
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
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
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -360,7 +354,6 @@ impl From<AuraEffect> for AuraModeNum {
|
||||
}
|
||||
|
||||
/// Base effects have no zoning, while multizone is 1-4
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -432,7 +425,6 @@ impl From<AuraZone> for i32 {
|
||||
/// ```rust
|
||||
/// // let bytes: [u8; LED_MSG_LEN] = mode.into();
|
||||
/// ```
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct AuraEffect {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::Type;
|
||||
|
||||
@@ -194,7 +193,6 @@ impl LedCode {
|
||||
}
|
||||
|
||||
/// Represents the per-key raw USB packets
|
||||
#[typeshare]
|
||||
pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
||||
|
||||
/// 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
|
||||
/// necessarily all on the same row of the keyboard, with some splitting between
|
||||
/// two rows.
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct LedUsbPackets {
|
||||
|
||||
@@ -5,7 +5,6 @@ use std::ops::{BitAnd, BitOr};
|
||||
|
||||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -16,7 +15,6 @@ use crate::{AuraDeviceType, PowerZones};
|
||||
/// - 2021+, the struct is a single zone with 4 states
|
||||
/// - pre-2021, the struct is 1 or 2 zones and 3 states
|
||||
/// - Tuf, the struct is 1 zone and 3 states
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AuraPowerState {
|
||||
@@ -145,7 +143,6 @@ impl AuraPowerState {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct LaptopAuraPower {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
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];
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum AuraDeviceType {
|
||||
@@ -116,7 +114,6 @@ impl From<&str> for AuraDeviceType {
|
||||
}
|
||||
|
||||
/// The powerr zones this laptop supports
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
|
||||
@@ -15,6 +15,5 @@ zbus.workspace = true
|
||||
concat-idents.workspace = true
|
||||
udev.workspace = true
|
||||
inotify.workspace = true
|
||||
typeshare.workspace = true
|
||||
|
||||
rusb.workspace = true
|
||||
|
||||
@@ -2,7 +2,6 @@ use std::path::PathBuf;
|
||||
|
||||
use log::{info, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::{PlatformError, Result};
|
||||
@@ -147,7 +146,6 @@ impl CPUControl {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[repr(u8)]
|
||||
#[derive(
|
||||
Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy,
|
||||
@@ -179,7 +177,6 @@ impl From<CPUGovernor> for String {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[repr(u32)]
|
||||
#[derive(
|
||||
Deserialize,
|
||||
|
||||
@@ -3,7 +3,6 @@ use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::PlatformError;
|
||||
@@ -252,7 +251,6 @@ define_attribute_getters!(
|
||||
);
|
||||
|
||||
/// CamelCase names of the properties. Intended for use with DBUS
|
||||
#[typeshare]
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Serialize, Deserialize, Type, Value, OwnedValue, PartialEq, PartialOrd)]
|
||||
#[zvariant(signature = "s")]
|
||||
|
||||
@@ -4,7 +4,6 @@ use std::str::FromStr;
|
||||
|
||||
use log::{info, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::{PlatformError, Result};
|
||||
@@ -148,7 +147,6 @@ impl Default for RogPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[repr(u8)]
|
||||
#[derive(
|
||||
Serialize, Deserialize, Default, Type, Value, OwnedValue, Debug, PartialEq, Eq, Clone, Copy,
|
||||
@@ -245,7 +243,6 @@ impl Display for GpuMode {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[repr(u32)]
|
||||
#[derive(
|
||||
Deserialize,
|
||||
@@ -352,7 +349,6 @@ impl Display for ThrottlePolicy {
|
||||
}
|
||||
|
||||
/// CamelCase names of the properties. Intended for use with DBUS
|
||||
#[typeshare]
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, PartialEq, PartialOrd)]
|
||||
#[zvariant(signature = "s")]
|
||||
|
||||
@@ -16,7 +16,6 @@ dbus = ["zbus"]
|
||||
log.workspace = true
|
||||
udev.workspace = true
|
||||
serde.workspace = true
|
||||
typeshare.workspace = true
|
||||
rog_platform = { path = "../rog-platform" }
|
||||
|
||||
zbus = { workspace = true, optional = true }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use log::{error, trace};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
use udev::Device;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::Type;
|
||||
@@ -31,7 +30,6 @@ pub(crate) fn temp_str(fan: char, index: usize) -> String {
|
||||
string
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
|
||||
pub struct CurveData {
|
||||
|
||||
@@ -6,7 +6,6 @@ use fan_curve_set::CurveData;
|
||||
use log::debug;
|
||||
use rog_platform::platform::ThrottlePolicy;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
pub use udev::Device;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::Type;
|
||||
@@ -33,7 +32,6 @@ pub fn find_fan_curve_node() -> Result<Device, ProfileError> {
|
||||
Err(ProfileError::NotSupported)
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -105,7 +103,6 @@ impl Default for FanCurvePU {
|
||||
}
|
||||
|
||||
/// Main purpose of `FanCurves` is to enable restoring state on system boot
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[derive(Deserialize, Serialize, Debug, Default)]
|
||||
pub struct FanCurveProfiles {
|
||||
|
||||
@@ -20,6 +20,5 @@ serde.workspace = true
|
||||
zbus = { workspace = true, optional = true }
|
||||
|
||||
# cli and logging
|
||||
typeshare.workspace = true
|
||||
|
||||
ron = { version = "*", optional = true }
|
||||
|
||||
@@ -2,14 +2,12 @@ use std::fmt::Display;
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::scsi::{apply_task, dir_task, mode_task, rgb_task, save_task, speed_task};
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
||||
pub struct Colour {
|
||||
@@ -54,7 +52,6 @@ impl From<Colour> for [u8; 3] {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
@@ -95,7 +92,6 @@ impl From<Direction> for u8 {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
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
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -297,7 +292,6 @@ impl From<AuraEffect> for AuraMode {
|
||||
}
|
||||
|
||||
/// Default factory modes structure.
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct AuraEffect {
|
||||
|
||||
@@ -23,6 +23,5 @@ path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
typeshare.workspace = true
|
||||
zbus = { workspace = true, optional = true }
|
||||
dmi_id = { path = "../dmi-id", optional = true }
|
||||
|
||||
@@ -3,7 +3,6 @@ use std::str::FromStr;
|
||||
|
||||
use dmi_id::DMIID;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::Type;
|
||||
use zbus::zvariant::{OwnedValue, Value};
|
||||
@@ -66,7 +65,6 @@ impl FromStr for SlashType {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum SlashMode {
|
||||
@@ -158,9 +156,7 @@ impl SlashMode {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[typeshare]
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub struct DeviceState {
|
||||
pub slash_enabled: bool,
|
||||
|
||||
Reference in New Issue
Block a user