mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-07 07:00:27 -04:00
manager: Improve module naming
This commit is contained in:
parent
dc7de16137
commit
6cccb333a2
6 changed files with 19 additions and 11 deletions
|
@ -14,7 +14,7 @@ use zbus::ConnectionBuilder;
|
||||||
|
|
||||||
use crate::daemon::Daemon;
|
use crate::daemon::Daemon;
|
||||||
use crate::ds_inhibit::Inhibitor;
|
use crate::ds_inhibit::Inhibitor;
|
||||||
use crate::manager;
|
use crate::manager::root::SteamOSManager;
|
||||||
use crate::sls::ftrace::Ftrace;
|
use crate::sls::ftrace::Ftrace;
|
||||||
|
|
||||||
async fn create_connection() -> Result<Connection> {
|
async fn create_connection() -> Result<Connection> {
|
||||||
|
@ -22,7 +22,7 @@ async fn create_connection() -> Result<Connection> {
|
||||||
.name("com.steampowered.SteamOSManager1")?
|
.name("com.steampowered.SteamOSManager1")?
|
||||||
.build()
|
.build()
|
||||||
.await?;
|
.await?;
|
||||||
let manager = manager::SteamOSManager::new(connection.clone()).await?;
|
let manager = SteamOSManager::new(connection.clone()).await?;
|
||||||
connection
|
connection
|
||||||
.object_server()
|
.object_server()
|
||||||
.at("/com/steampowered/SteamOSManager1", manager)
|
.at("/com/steampowered/SteamOSManager1", manager)
|
||||||
|
|
|
@ -13,7 +13,7 @@ use zbus::connection::Connection;
|
||||||
use zbus::ConnectionBuilder;
|
use zbus::ConnectionBuilder;
|
||||||
|
|
||||||
use crate::daemon::Daemon;
|
use crate::daemon::Daemon;
|
||||||
use crate::user_manager::SteamOSManagerUser;
|
use crate::manager::user::SteamOSManager;
|
||||||
|
|
||||||
async fn create_connections() -> Result<(Connection, Connection)> {
|
async fn create_connections() -> Result<(Connection, Connection)> {
|
||||||
let system = Connection::system().await?;
|
let system = Connection::system().await?;
|
||||||
|
@ -22,7 +22,7 @@ async fn create_connections() -> Result<(Connection, Connection)> {
|
||||||
.build()
|
.build()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let manager = SteamOSManagerUser::new(connection.clone(), &system).await?;
|
let manager = SteamOSManager::new(connection.clone(), &system).await?;
|
||||||
connection
|
connection
|
||||||
.object_server()
|
.object_server()
|
||||||
.at("/com/steampowered/SteamOSManager1", manager)
|
.at("/com/steampowered/SteamOSManager1", manager)
|
||||||
|
|
|
@ -23,7 +23,6 @@ mod power;
|
||||||
mod process;
|
mod process;
|
||||||
mod sls;
|
mod sls;
|
||||||
mod systemd;
|
mod systemd;
|
||||||
mod user_manager;
|
|
||||||
|
|
||||||
pub mod daemon;
|
pub mod daemon;
|
||||||
pub mod proxy;
|
pub mod proxy;
|
||||||
|
|
9
src/manager/mod.rs
Normal file
9
src/manager/mod.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2023 Collabora Ltd.
|
||||||
|
* Copyright © 2024 Valve Software
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
pub(crate) mod root;
|
||||||
|
pub(crate) mod user;
|
|
@ -51,14 +51,14 @@ macro_rules! setter {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SteamOSManagerUser {
|
pub struct SteamOSManager {
|
||||||
proxy: Proxy<'static>,
|
proxy: Proxy<'static>,
|
||||||
hdmi_cec: HdmiCecControl<'static>,
|
hdmi_cec: HdmiCecControl<'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SteamOSManagerUser {
|
impl SteamOSManager {
|
||||||
pub async fn new(connection: Connection, system_conn: &Connection) -> Result<Self> {
|
pub async fn new(connection: Connection, system_conn: &Connection) -> Result<Self> {
|
||||||
Ok(SteamOSManagerUser {
|
Ok(SteamOSManager {
|
||||||
hdmi_cec: HdmiCecControl::new(&connection).await?,
|
hdmi_cec: HdmiCecControl::new(&connection).await?,
|
||||||
proxy: Builder::new(system_conn)
|
proxy: Builder::new(system_conn)
|
||||||
.destination("com.steampowered.SteamOSManager1")?
|
.destination("com.steampowered.SteamOSManager1")?
|
||||||
|
@ -72,7 +72,7 @@ impl SteamOSManagerUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[interface(name = "com.steampowered.SteamOSManager1.Manager")]
|
#[interface(name = "com.steampowered.SteamOSManager1.Manager")]
|
||||||
impl SteamOSManagerUser {
|
impl SteamOSManager {
|
||||||
#[zbus(property(emits_changed_signal = "const"))]
|
#[zbus(property(emits_changed_signal = "const"))]
|
||||||
async fn version(&self) -> u32 {
|
async fn version(&self) -> u32 {
|
||||||
API_VERSION
|
API_VERSION
|
||||||
|
@ -269,7 +269,7 @@ mod test {
|
||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let manager = SteamOSManagerUser::new(connection.clone(), &connection)
|
let manager = SteamOSManager::new(connection.clone(), &connection)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
connection
|
connection
|
||||||
|
@ -307,7 +307,7 @@ mod test {
|
||||||
let manager_ref = test
|
let manager_ref = test
|
||||||
.connection
|
.connection
|
||||||
.object_server()
|
.object_server()
|
||||||
.interface::<_, SteamOSManagerUser>("/com/steampowered/SteamOSManager1")
|
.interface::<_, SteamOSManager>("/com/steampowered/SteamOSManager1")
|
||||||
.await
|
.await
|
||||||
.expect("interface");
|
.expect("interface");
|
||||||
let manager = manager_ref.get().await;
|
let manager = manager_ref.get().await;
|
Loading…
Add table
Add a link
Reference in a new issue