pub struct WearablePlatform { /* private fields */ }Expand description
Unified smartwatch host backend smoothing Wear OS, watchOS, HarmonyOS Watch, HyperOS/Vela, OPPO, vivo, Garmin, and ZeppOS.
Implementations§
Source§impl WearablePlatform
Vendor constructors, rotary crown translation, AOD lifecycle, and wrist/palm gesture handling for WearablePlatform.
impl WearablePlatform
Vendor constructors, rotary crown translation, AOD lifecycle, and wrist/palm gesture handling for WearablePlatform.
Sourcepub fn for_vendor(vendor: WearableVendor) -> Self
pub fn for_vendor(vendor: WearableVendor) -> Self
Sourcepub fn vivo_blueos() -> Self
pub fn vivo_blueos() -> Self
Creates a WearablePlatform preconfigured for vivo BlueOS Watch (466x466 round dial).
§Returns
Self- Configured vivo BlueOS Watch platform backend.
Sourcepub fn from_profile(profile: WearableProfile) -> Self
pub fn from_profile(profile: WearableProfile) -> Self
Sourcepub fn with_capture_last_frame(self, enabled: bool) -> Self
pub fn with_capture_last_frame(self, enabled: bool) -> Self
Sourcepub fn last_framebuffer(&self, id: WindowId) -> Option<&Framebuffer>
pub fn last_framebuffer(&self, id: WindowId) -> Option<&Framebuffer>
Sourcepub fn primary_window_id(&self) -> Option<WindowId>
pub fn primary_window_id(&self) -> Option<WindowId>
Sourcepub fn handle_crown_input(
&mut self,
input: WearableCrownInput,
) -> Vec<WindowEvent>
pub fn handle_crown_input( &mut self, input: WearableCrownInput, ) -> Vec<WindowEvent>
Translates a rotary crown or rotating bezel rotation event into standard EUV scroll or focus WindowEvents.
§Arguments
&Self- Mutable wearable platform.WearableCrownInput- Raw vendor crown/bezel detent delta and mode.
§Returns
Vec<WindowEvent>- Normalized standard EUV events also enqueued forpoll_events().
Sourcepub fn enter_ambient(&mut self) -> Vec<WindowEvent>
pub fn enter_ambient(&mut self) -> Vec<WindowEvent>
Sourcepub fn pulse_ambient_tick(&mut self) -> Option<WindowEvent>
pub fn pulse_ambient_tick(&mut self) -> Option<WindowEvent>
Sourcepub fn enter_screen_off(&mut self) -> Vec<WindowEvent>
pub fn enter_screen_off(&mut self) -> Vec<WindowEvent>
Sourcepub fn exit_ambient(&mut self) -> Vec<WindowEvent>
pub fn exit_ambient(&mut self) -> Vec<WindowEvent>
Sourcepub fn handle_hardware_gesture(
&mut self,
gesture: WearableHardwareGesture,
) -> Vec<WindowEvent>
pub fn handle_hardware_gesture( &mut self, gesture: WearableHardwareGesture, ) -> Vec<WindowEvent>
Translates physical wrist, palm-cover, double-pinch, and side-button hardware gestures into standard EUV events.
§Arguments
&Self- Mutable wearable platform.WearableHardwareGesture- Hardware gesture detected by the watch OS.
§Returns
Vec<WindowEvent>- Normalized standard EUV window/system events.
Source§impl WearablePlatform
impl WearablePlatform
pub fn get_profile(&self) -> WearableProfile
pub fn get_mut_profile(&mut self) -> &mut WearableProfile
pub fn set_profile(&mut self, val: WearableProfile) -> &mut Self
pub fn get_ambient_mode(&self) -> WearableAmbientMode
pub fn get_mut_ambient_mode(&mut self) -> &mut WearableAmbientMode
pub fn set_ambient_mode(&mut self, val: WearableAmbientMode) -> &mut Self
pub fn get_compact_scale(&self) -> f32
pub fn get_mut_compact_scale(&mut self) -> &mut f32
pub fn set_compact_scale(&mut self, val: f32) -> &mut Self
pub fn get_safe_area(&self) -> SafeAreaInsets
pub fn get_mut_safe_area(&mut self) -> &mut SafeAreaInsets
pub fn set_safe_area(&mut self, val: SafeAreaInsets) -> &mut Self
pub fn get_crown_accumulator(&self) -> f32
pub fn get_mut_crown_accumulator(&mut self) -> &mut f32
pub fn set_crown_accumulator(&mut self, val: f32) -> &mut Self
pub fn get_crown_scroll_step(&self) -> f32
pub fn get_mut_crown_scroll_step(&mut self) -> &mut f32
pub fn set_crown_scroll_step(&mut self, val: f32) -> &mut Self
pub fn get_mut_primary_window(&mut self) -> &mut Option<WindowId>
pub fn set_primary_window(&mut self, val: Option<WindowId>) -> &mut Self
pub fn get_windows(&self) -> &HashMap<WindowId, WearableWindowRecord>
pub fn get_mut_windows( &mut self, ) -> &mut HashMap<WindowId, WearableWindowRecord>
pub fn set_windows( &mut self, val: HashMap<WindowId, WearableWindowRecord>, ) -> &mut Self
pub fn get_touch_tracker(&self) -> &TouchPointerTracker
pub fn get_mut_touch_tracker(&mut self) -> &mut TouchPointerTracker
pub fn set_touch_tracker(&mut self, val: TouchPointerTracker) -> &mut Self
pub fn get_pending_events(&self) -> &Vec<WindowEvent>
pub fn get_mut_pending_events(&mut self) -> &mut Vec<WindowEvent>
pub fn set_pending_events(&mut self, val: Vec<WindowEvent>) -> &mut Self
pub fn get_storage(&self) -> &HashMap<String, String>
pub fn get_mut_storage(&mut self) -> &mut HashMap<String, String>
pub fn set_storage(&mut self, val: HashMap<String, String>) -> &mut Self
pub fn get_route_stack(&self) -> &Vec<String>
pub fn get_mut_route_stack(&mut self) -> &mut Vec<String>
pub fn set_route_stack(&mut self, val: Vec<String>) -> &mut Self
pub fn get_theme(&self) -> ThemeMode
pub fn get_mut_theme(&mut self) -> &mut ThemeMode
pub fn set_theme(&mut self, val: ThemeMode) -> &mut Self
pub fn get_pump_paused(&self) -> bool
pub fn get_mut_pump_paused(&mut self) -> &mut bool
pub fn set_pump_paused(&mut self, val: bool) -> &mut Self
pub fn get_haptic_detent_count(&self) -> u64
pub fn get_mut_haptic_detent_count(&mut self) -> &mut u64
pub fn set_haptic_detent_count(&mut self, val: u64) -> &mut Self
pub fn get_capture_last_frame(&self) -> bool
pub fn get_mut_capture_last_frame(&mut self) -> &mut bool
pub fn set_capture_last_frame(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for WearablePlatform
impl Clone for WearablePlatform
Source§impl Debug for WearablePlatform
impl Debug for WearablePlatform
Source§impl Default for WearablePlatform
Default WearablePlatform configured for WearableVendor::WearOs.
impl Default for WearablePlatform
Default WearablePlatform configured for WearableVendor::WearOs.
Source§impl PlatformBackend for WearablePlatform
PlatformBackend implementation for WearablePlatform.
impl PlatformBackend for WearablePlatform
PlatformBackend implementation for WearablePlatform.
Source§fn kind(&self) -> PlatformKind
fn kind(&self) -> PlatformKind
Source§fn capabilities(&self) -> PlatformCapabilities
fn capabilities(&self) -> PlatformCapabilities
Source§fn create_window(
&mut self,
config: &WindowConfig,
) -> Result<WindowState, PlatformError>
fn create_window( &mut self, config: &WindowConfig, ) -> Result<WindowState, PlatformError>
Source§fn window_state(&self, id: WindowId) -> Option<WindowState>
fn window_state(&self, id: WindowId) -> Option<WindowState>
Source§fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle
fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle
Source§fn poll_events(&mut self) -> Vec<WindowEvent>
fn poll_events(&mut self) -> Vec<WindowEvent>
Source§fn set_frame_pump_paused(&mut self, paused: bool)
fn set_frame_pump_paused(&mut self, paused: bool)
Updates frame pump pause state for AOD / screen-off freeze.
§Arguments
&Self- Mutable wearable platform.bool-trueto pause frame pumping.
Source§fn is_frame_pump_paused(&self) -> bool
fn is_frame_pump_paused(&self) -> bool
Source§fn present_framebuffer(
&mut self,
id: WindowId,
framebuffer: &Framebuffer,
) -> Result<(), PlatformError>
fn present_framebuffer( &mut self, id: WindowId, framebuffer: &Framebuffer, ) -> Result<(), PlatformError>
Source§fn read_clipboard(&self) -> Option<String>
fn read_clipboard(&self) -> Option<String>
Source§fn write_clipboard(&mut self, _text: &str) -> Result<(), PlatformError>
fn write_clipboard(&mut self, _text: &str) -> Result<(), PlatformError>
Source§fn system_theme(&self) -> ThemeMode
fn system_theme(&self) -> ThemeMode
Source§fn display_refresh_rate_hz(&self) -> f32
fn display_refresh_rate_hz(&self) -> f32
Source§fn wait_for_events(&mut self) -> Vec<WindowEvent>
fn wait_for_events(&mut self) -> Vec<WindowEvent>
Source§fn present_framebuffer_region(
&mut self,
id: WindowId,
framebuffer: &Framebuffer,
_damage: DamageRegion,
) -> Result<(), PlatformError>
fn present_framebuffer_region( &mut self, id: WindowId, framebuffer: &Framebuffer, _damage: DamageRegion, ) -> Result<(), PlatformError>
Framebuffer when supported by the backend. Read moreSource§impl PlatformHostAdapter for WearablePlatform
PlatformHostAdapter implementation for WearablePlatform.
impl PlatformHostAdapter for WearablePlatform
PlatformHostAdapter implementation for WearablePlatform.
Source§fn device_form_factor(&self) -> DeviceFormFactor
fn device_form_factor(&self) -> DeviceFormFactor
Source§impl PlatformLifecycleBridge for WearablePlatform
PlatformLifecycleBridge implementation for WearablePlatform.
impl PlatformLifecycleBridge for WearablePlatform
PlatformLifecycleBridge implementation for WearablePlatform.
Source§fn freeze_surface(&mut self) -> Vec<WindowEvent>
fn freeze_surface(&mut self) -> Vec<WindowEvent>
Source§fn resume_surface(&mut self) -> Vec<WindowEvent>
fn resume_surface(&mut self) -> Vec<WindowEvent>
Source§fn destroy_surface(&mut self) -> Vec<WindowEvent>
fn destroy_surface(&mut self) -> Vec<WindowEvent>
Source§impl PlatformStorage for WearablePlatform
PlatformStorage implementation for WearablePlatform.
impl PlatformStorage for WearablePlatform
PlatformStorage implementation for WearablePlatform.
Source§fn storage_set(&mut self, key: &str, value: &str) -> Result<(), PlatformError>
fn storage_set(&mut self, key: &str, value: &str) -> Result<(), PlatformError>
Source§fn storage_remove(&mut self, key: &str) -> Result<(), PlatformError>
fn storage_remove(&mut self, key: &str) -> Result<(), PlatformError>
Source§fn storage_clear(&mut self) -> Result<(), PlatformError>
fn storage_clear(&mut self) -> Result<(), PlatformError>
Source§impl WindowController for WearablePlatform
WindowController implementation for WearablePlatform.
impl WindowController for WearablePlatform
WindowController implementation for WearablePlatform.