diff --git a/Cargo.lock b/Cargo.lock index f7b5fa5e..5a6f3a58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Cargo.toml b/Cargo.toml index 221adac5..afe60cea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/Makefile b/Makefile index 7c04b1b1..9f3b58dc 100644 --- a/Makefile +++ b/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 diff --git a/cpuctl/Cargo.toml b/cpuctl/Cargo.toml deleted file mode 100644 index 2d00fb79..00000000 --- a/cpuctl/Cargo.toml +++ /dev/null @@ -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] diff --git a/cpuctl/src/lib.rs b/cpuctl/src/lib.rs deleted file mode 100644 index 7d12d9af..00000000 --- a/cpuctl/src/lib.rs +++ /dev/null @@ -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); - } -} diff --git a/rog-anime/Cargo.toml b/rog-anime/Cargo.toml index a5bd9aa9..3254a201 100644 --- a/rog-anime/Cargo.toml +++ b/rog-anime/Cargo.toml @@ -30,7 +30,6 @@ log.workspace = true serde.workspace = true glam.workspace = true -typeshare.workspace = true zbus = { workspace = true, optional = true } diff --git a/rog-anime/src/data.rs b/rog-anime/src/data.rs index 93074ab0..48ac3232 100644 --- a/rog-anime/src/data.rs +++ b/rog-anime/src/data.rs @@ -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 { diff --git a/rog-anime/src/usb.rs b/rog-anime/src/usb.rs index b9d3b3fa..fcf9fe0d 100644 --- a/rog-anime/src/usb.rs +++ b/rog-anime/src/usb.rs @@ -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 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 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 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 for i32 { derive(Type, Value, OwnedValue), zvariant(signature = "s") )] -#[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] pub enum AnimShutdown { #[default] diff --git a/rog-aura/Cargo.toml b/rog-aura/Cargo.toml index 6be41695..b42b42ed 100644 --- a/rog-aura/Cargo.toml +++ b/rog-aura/Cargo.toml @@ -23,6 +23,5 @@ dmi_id = { path = "../dmi-id" } # cli and logging log.workspace = true -typeshare.workspace = true ron = { version = "*", optional = true } diff --git a/rog-aura/src/builtin_modes.rs b/rog-aura/src/builtin_modes.rs index 3e10ebaa..d371ea40 100644 --- a/rog-aura/src/builtin_modes.rs +++ b/rog-aura/src/builtin_modes.rs @@ -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 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 for [u8; 3] { } } -#[typeshare] #[cfg_attr( feature = "dbus", derive(Type, Value, OwnedValue), @@ -200,7 +196,6 @@ impl From 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 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 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 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 { diff --git a/rog-aura/src/keyboard/advanced.rs b/rog-aura/src/keyboard/advanced.rs index e548493e..34a91bac 100644 --- a/rog-aura/src/keyboard/advanced.rs +++ b/rog-aura/src/keyboard/advanced.rs @@ -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>; /// A `UsbPackets` contains all data to change the full set of keyboard @@ -204,7 +202,6 @@ pub type AuraLaptopUsbPackets = Vec>; /// 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 { diff --git a/rog-aura/src/keyboard/power.rs b/rog-aura/src/keyboard/power.rs index ef65f5ab..af25a281 100644 --- a/rog-aura/src/keyboard/power.rs +++ b/rog-aura/src/keyboard/power.rs @@ -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 { diff --git a/rog-aura/src/lib.rs b/rog-aura/src/lib.rs index 0efb7f3b..bb7e155b 100644 --- a/rog-aura/src/lib.rs +++ b/rog-aura/src/lib.rs @@ -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), diff --git a/rog-platform/Cargo.toml b/rog-platform/Cargo.toml index 46b6b320..5cfe841e 100644 --- a/rog-platform/Cargo.toml +++ b/rog-platform/Cargo.toml @@ -15,6 +15,5 @@ zbus.workspace = true concat-idents.workspace = true udev.workspace = true inotify.workspace = true -typeshare.workspace = true rusb.workspace = true diff --git a/rog-platform/src/cpu.rs b/rog-platform/src/cpu.rs index 47369f16..067bf033 100644 --- a/rog-platform/src/cpu.rs +++ b/rog-platform/src/cpu.rs @@ -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 for String { } } -#[typeshare] #[repr(u32)] #[derive( Deserialize, diff --git a/rog-platform/src/firmware_attributes.rs b/rog-platform/src/firmware_attributes.rs index 3f0a1147..6f2cd8ea 100644 --- a/rog-platform/src/firmware_attributes.rs +++ b/rog-platform/src/firmware_attributes.rs @@ -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")] diff --git a/rog-platform/src/platform.rs b/rog-platform/src/platform.rs index f1f1aabd..9f4a9503 100644 --- a/rog-platform/src/platform.rs +++ b/rog-platform/src/platform.rs @@ -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")] diff --git a/rog-profiles/Cargo.toml b/rog-profiles/Cargo.toml index 01d84275..8949bb79 100644 --- a/rog-profiles/Cargo.toml +++ b/rog-profiles/Cargo.toml @@ -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 } diff --git a/rog-profiles/src/fan_curve_set.rs b/rog-profiles/src/fan_curve_set.rs index 11030ef2..7de8adc1 100644 --- a/rog-profiles/src/fan_curve_set.rs +++ b/rog-profiles/src/fan_curve_set.rs @@ -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 { diff --git a/rog-profiles/src/lib.rs b/rog-profiles/src/lib.rs index 2f9366ea..f85f5590 100644 --- a/rog-profiles/src/lib.rs +++ b/rog-profiles/src/lib.rs @@ -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 { 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 { diff --git a/rog-scsi/Cargo.toml b/rog-scsi/Cargo.toml index 37d8390a..736d3462 100644 --- a/rog-scsi/Cargo.toml +++ b/rog-scsi/Cargo.toml @@ -20,6 +20,5 @@ serde.workspace = true zbus = { workspace = true, optional = true } # cli and logging -typeshare.workspace = true ron = { version = "*", optional = true } diff --git a/rog-scsi/src/builtin_modes.rs b/rog-scsi/src/builtin_modes.rs index 79012b6d..d0f9645e 100644 --- a/rog-scsi/src/builtin_modes.rs +++ b/rog-scsi/src/builtin_modes.rs @@ -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 for [u8; 3] { } } -#[typeshare] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] #[cfg_attr( feature = "dbus", @@ -95,7 +92,6 @@ impl From for u8 { } } -#[typeshare] #[cfg_attr( feature = "dbus", derive(Type, Value, OwnedValue), @@ -152,7 +148,6 @@ impl From 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 for AuraMode { } /// Default factory modes structure. -#[typeshare] #[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct AuraEffect { diff --git a/rog-slash/Cargo.toml b/rog-slash/Cargo.toml index 638daa8b..39581dd4 100644 --- a/rog-slash/Cargo.toml +++ b/rog-slash/Cargo.toml @@ -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 } diff --git a/rog-slash/src/data.rs b/rog-slash/src/data.rs index 6ff95bf4..317f5c73 100644 --- a/rog-slash/src/data.rs +++ b/rog-slash/src/data.rs @@ -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,