mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-15 10:46:41 -04:00
Merge branch 'work/whiting/usestrings' into 'master'
Draft: Bump from ScreenReader0 to ScreenReader1. See merge request holo/steamos-manager!21
This commit is contained in:
commit
e5e3fcbaf1
5 changed files with 50 additions and 50 deletions
|
@ -305,7 +305,7 @@
|
|||
This interface is considered unstable and may change between verisons.
|
||||
Once it is considered stable it will be renamed to ScreenReader1
|
||||
-->
|
||||
<interface name="com.steampowered.SteamOSManager1.ScreenReader0">
|
||||
<interface name="com.steampowered.SteamOSManager1.ScreenReader1">
|
||||
<!--
|
||||
Enabled
|
||||
|
||||
|
@ -339,9 +339,9 @@
|
|||
|
||||
Which mode the screen reader should operate in.
|
||||
|
||||
Valid modes: 0 - Browse mode, 1 - Focus mode.
|
||||
Valid modes: browse - Browse mode, focus - Focus mode.
|
||||
-->
|
||||
<property name="Mode" type="u" access="readwrite"/>
|
||||
<property name="Mode" type="s" access="readwrite"/>
|
||||
|
||||
<!--
|
||||
Voice
|
||||
|
@ -370,16 +370,16 @@
|
|||
Forward a user interaction event to the screen reader service.
|
||||
|
||||
@action: The action genereated via user input. Valid values:
|
||||
0 = Stop Talking
|
||||
1 = Read Next Word,
|
||||
2 = Read Previous Word,
|
||||
3 = Read Next Item,
|
||||
4 = Read Previous Item,
|
||||
5 = Move To Next Landmark,
|
||||
6 = Move To Previous Landmark,
|
||||
7 = Move To Next Heading,
|
||||
8 = Move To Previous Heading,
|
||||
9 = Toggle between Browse mode and Focus mode,
|
||||
stop_talking = Stop Talking
|
||||
read_next_word = Read Next Word,
|
||||
read_previous_word = Read Previous Word,
|
||||
read_next_item = Read Next Item,
|
||||
read_previous_item = Read Previous Item,
|
||||
move_to_next_landmark = Move To Next Landmark,
|
||||
move_to_previous_landmark = Move To Previous Landmark,
|
||||
move_to_next_heading = Move To Next Heading,
|
||||
move_to_previous_heading = Move To Previous Heading,
|
||||
toggle_mode = Toggle between Browse mode and Focus mode,
|
||||
|
||||
@timestamp: refers to the time the user interaction event
|
||||
that triggered this event happened. E.g. when the user pressed
|
||||
|
@ -387,7 +387,7 @@
|
|||
start of CLOCK_MONOTONIC_RAW).
|
||||
-->
|
||||
<method name="TriggerAction">
|
||||
<arg type="u" name="action" direction="in"/>
|
||||
<arg type="s" name="action" direction="in"/>
|
||||
<arg type="t" name="timestamp" direction="in"/>
|
||||
</method>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ mod hdmi_cec1;
|
|||
mod low_power_mode1;
|
||||
mod manager2;
|
||||
mod performance_profile1;
|
||||
mod screenreader0;
|
||||
mod screenreader1;
|
||||
mod storage1;
|
||||
mod tdp_limit1;
|
||||
mod update_bios1;
|
||||
|
@ -44,7 +44,7 @@ pub use crate::hdmi_cec1::HdmiCec1Proxy;
|
|||
pub use crate::low_power_mode1::LowPowerMode1Proxy;
|
||||
pub use crate::manager2::Manager2Proxy;
|
||||
pub use crate::performance_profile1::PerformanceProfile1Proxy;
|
||||
pub use crate::screenreader0::ScreenReader0Proxy;
|
||||
pub use crate::screenreader1::ScreenReader1Proxy;
|
||||
pub use crate::storage1::Storage1Proxy;
|
||||
pub use crate::tdp_limit1::TdpLimit1Proxy;
|
||||
pub use crate::update_bios1::UpdateBios1Proxy;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! # D-Bus interface proxy for: `com.steampowered.SteamOSManager1.ScreenReader0`
|
||||
//! # D-Bus interface proxy for: `com.steampowered.SteamOSManager1.ScreenReader1`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `5.1.0` from D-Bus introspection data.
|
||||
//! Source: `com.steampowered.SteamOSManager1.xml`.
|
||||
|
@ -13,14 +13,14 @@
|
|||
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
|
||||
use zbus::proxy;
|
||||
#[proxy(
|
||||
interface = "com.steampowered.SteamOSManager1.ScreenReader0",
|
||||
interface = "com.steampowered.SteamOSManager1.ScreenReader1",
|
||||
default_service = "com.steampowered.SteamOSManager1",
|
||||
default_path = "/com/steampowered/SteamOSManager1",
|
||||
assume_defaults = true
|
||||
)]
|
||||
pub trait ScreenReader0 {
|
||||
pub trait ScreenReader1 {
|
||||
/// TriggerAction method
|
||||
fn trigger_action(&self, action: u32, timestamp: u64) -> zbus::Result<()>;
|
||||
fn trigger_action(&self, action: &str, timestamp: u64) -> zbus::Result<()>;
|
||||
|
||||
/// Enabled property
|
||||
#[zbus(property)]
|
||||
|
@ -30,9 +30,9 @@ pub trait ScreenReader0 {
|
|||
|
||||
/// Mode property
|
||||
#[zbus(property)]
|
||||
fn mode(&self) -> zbus::Result<u32>;
|
||||
fn mode(&self) -> zbus::Result<String>;
|
||||
#[zbus(property)]
|
||||
fn set_mode(&self, value: u32) -> zbus::Result<()>;
|
||||
fn set_mode(&self, value: &str) -> zbus::Result<()>;
|
||||
|
||||
/// Pitch property
|
||||
#[zbus(property)]
|
|
@ -17,7 +17,7 @@ use steamos_manager::power::{CPUScalingGovernor, GPUPerformanceLevel, GPUPowerPr
|
|||
use steamos_manager::proxy::{
|
||||
AmbientLightSensor1Proxy, BatteryChargeLimit1Proxy, CpuScaling1Proxy, FactoryReset1Proxy,
|
||||
FanControl1Proxy, GpuPerformanceLevel1Proxy, GpuPowerProfile1Proxy, HdmiCec1Proxy,
|
||||
LowPowerMode1Proxy, Manager2Proxy, PerformanceProfile1Proxy, ScreenReader0Proxy, Storage1Proxy,
|
||||
LowPowerMode1Proxy, Manager2Proxy, PerformanceProfile1Proxy, ScreenReader1Proxy, Storage1Proxy,
|
||||
TdpLimit1Proxy, UpdateBios1Proxy, UpdateDock1Proxy, WifiDebug1Proxy, WifiDebugDump1Proxy,
|
||||
WifiPowerManagement1Proxy,
|
||||
};
|
||||
|
@ -601,72 +601,72 @@ async fn main() -> Result<()> {
|
|||
println!("Variant: {variant}");
|
||||
}
|
||||
Commands::GetScreenReaderEnabled => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let enabled = proxy.enabled().await?;
|
||||
println!("Enabled: {enabled}");
|
||||
}
|
||||
Commands::SetScreenReaderEnabled { enable } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_enabled(*enable).await?;
|
||||
}
|
||||
Commands::GetScreenReaderRate => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let rate = proxy.rate().await?;
|
||||
println!("Rate: {rate}");
|
||||
}
|
||||
Commands::SetScreenReaderRate { rate } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_rate(*rate).await?;
|
||||
}
|
||||
Commands::GetScreenReaderPitch => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let pitch = proxy.pitch().await?;
|
||||
println!("Pitch: {pitch}");
|
||||
}
|
||||
Commands::SetScreenReaderPitch { pitch } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_pitch(*pitch).await?;
|
||||
}
|
||||
Commands::GetScreenReaderVolume => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let volume = proxy.volume().await?;
|
||||
println!("Volume: {volume}");
|
||||
}
|
||||
Commands::SetScreenReaderVolume { volume } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_volume(*volume).await?;
|
||||
}
|
||||
Commands::GetScreenReaderMode => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let mode = proxy.mode().await?;
|
||||
match ScreenReaderMode::try_from(mode) {
|
||||
match ScreenReaderMode::try_from(mode.as_str()) {
|
||||
Ok(s) => println!("Screen Reader Mode: {s}"),
|
||||
Err(_) => println!("Got unknown screen reader mode value {mode} from backend"),
|
||||
}
|
||||
}
|
||||
Commands::SetScreenReaderMode { mode } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
proxy.set_mode(*mode as u32).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_mode(mode.to_string().as_str()).await?;
|
||||
}
|
||||
Commands::TriggerScreenReaderAction { action } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let timestamp = clock_gettime(ClockId::CLOCK_MONOTONIC_RAW)?;
|
||||
let now = timestamp.tv_sec() * 1000000000 + timestamp.tv_nsec();
|
||||
proxy
|
||||
.trigger_action(*action as u32, now.try_into()?)
|
||||
.trigger_action(action.to_string().as_str(), now.try_into()?)
|
||||
.await?;
|
||||
}
|
||||
Commands::GetScreenReaderVoice => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let voice = proxy.voice().await?;
|
||||
println!("Voice: {voice}");
|
||||
}
|
||||
Commands::SetScreenReaderVoice { voice } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
proxy.set_voice(voice).await?;
|
||||
}
|
||||
Commands::GetScreenReaderLocales => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let locales = proxy.voice_locales().await?;
|
||||
println!("Locales:\n");
|
||||
for locale in locales.into_iter().sorted() {
|
||||
|
@ -674,7 +674,7 @@ async fn main() -> Result<()> {
|
|||
}
|
||||
}
|
||||
Commands::GetScreenReaderVoicesForLocale { locale } => {
|
||||
let proxy = ScreenReader0Proxy::new(&conn).await?;
|
||||
let proxy = ScreenReader1Proxy::new(&conn).await?;
|
||||
let voice_list = proxy.voices_for_locale().await?;
|
||||
let voices = voice_list
|
||||
.get(locale)
|
||||
|
|
|
@ -157,7 +157,7 @@ struct PerformanceProfile1 {
|
|||
tdp_limit_manager: Option<UnboundedSender<TdpManagerCommand>>,
|
||||
}
|
||||
|
||||
struct ScreenReader0 {
|
||||
struct ScreenReader1 {
|
||||
screen_reader: OrcaManager<'static>,
|
||||
}
|
||||
|
||||
|
@ -624,15 +624,15 @@ impl PerformanceProfile1 {
|
|||
}
|
||||
}
|
||||
|
||||
impl ScreenReader0 {
|
||||
async fn new(connection: &Connection) -> Result<ScreenReader0> {
|
||||
impl ScreenReader1 {
|
||||
async fn new(connection: &Connection) -> Result<ScreenReader1> {
|
||||
let screen_reader = OrcaManager::new(connection).await?;
|
||||
Ok(ScreenReader0 { screen_reader })
|
||||
Ok(ScreenReader1 { screen_reader })
|
||||
}
|
||||
}
|
||||
|
||||
#[interface(name = "com.steampowered.SteamOSManager1.ScreenReader0")]
|
||||
impl ScreenReader0 {
|
||||
#[interface(name = "com.steampowered.SteamOSManager1.ScreenReader1")]
|
||||
impl ScreenReader1 {
|
||||
#[zbus(property)]
|
||||
async fn enabled(&self) -> bool {
|
||||
self.screen_reader.enabled()
|
||||
|
@ -693,7 +693,7 @@ impl ScreenReader0 {
|
|||
#[zbus(property)]
|
||||
async fn set_mode(
|
||||
&mut self,
|
||||
m: u32,
|
||||
m: &str,
|
||||
#[zbus(signal_emitter)] ctx: SignalEmitter<'_>,
|
||||
) -> fdo::Result<()> {
|
||||
let mode = match ScreenReaderMode::try_from(m) {
|
||||
|
@ -735,7 +735,7 @@ impl ScreenReader0 {
|
|||
self.screen_reader.get_voices().clone()
|
||||
}
|
||||
|
||||
async fn trigger_action(&mut self, a: u32, timestamp: u64) -> fdo::Result<()> {
|
||||
async fn trigger_action(&mut self, a: &str, timestamp: u64) -> fdo::Result<()> {
|
||||
let action = match ScreenReaderAction::try_from(a) {
|
||||
Ok(action) => action,
|
||||
Err(err) => return Err(fdo::Error::InvalidArgs(err.to_string())),
|
||||
|
@ -1110,7 +1110,7 @@ pub(crate) async fn create_interfaces(
|
|||
proxy: proxy.clone(),
|
||||
channel: daemon,
|
||||
};
|
||||
let screen_reader = ScreenReader0::new(&session).await?;
|
||||
let screen_reader = ScreenReader1::new(&session).await?;
|
||||
let wifi_power_management = WifiPowerManagement1 {
|
||||
proxy: proxy.clone(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue