GuiApiLight

Struct GuiApiLight 

Source
pub struct GuiApiLight<P: CheckedPermissions> { /* private fields */ }
Expand description

Reduced GUI API, usable by non-gui daemons

Implementations§

Source§

impl<P: CheckedPermissions> GuiApiLight<P>

Source

pub fn show_modal( &self, app_id: AppId, modal_style: ModalStyle, args: &[u8], ) -> Result<NavigationResult, GuiServerError>

Permission: os/gui-server / ShowModal

Groups: ui-and-input.app-surface

Sender policy: signed

Grant timing: install-review

Shows a modal of the app, giving it a navigation object

Source

pub fn navigate_to( &self, app_id: AppId, args: &[u8], ) -> Result<NavigationResult, GuiServerError>

Permission: os/gui-server / NavigateTo

Groups: ui-and-input.navigation

Sender policy: signed

Grant timing: install-review

Source

pub fn run_app(&self, app_id: AppId) -> Result<RunAppResponse, GuiServerError>

Permission: os/gui-server / RunApp

Groups: ui-and-input.privileged-navigation

Sender policy: static-server

Grant timing: policy-only

Source

pub fn check_user_presence( &self, options: UserPresenceOptions, ) -> Result<Option<UserPresenceResult>, GuiServerError>

Permission: os/gui-server / NavigateTo

Groups: ui-and-input.navigation

Sender policy: signed

Grant timing: install-review

Source

pub fn invoke_alert( &self, alert: InvokeAlert, ) -> Result<AlertResult, GuiServerError>

Permission: os/gui-server / ShowModal

Groups: ui-and-input.app-surface

Sender policy: signed

Grant timing: install-review

Source§

impl<P: CheckedPermissions> GuiApiLight<P>

Source

pub fn connect() -> Self

Permission: none

Blocking connect: waits until gui-server has registered its name. gui-server is a mandatory system service, so callers wait for it instead of timing out and failing.

Source

pub fn switch_to( &self, next_pid: PID, x: usize, y: usize, ) -> Result<(), GuiServerError>

Permission: os/gui-server / SwitchTo

Groups: ui-and-input.navigation

Sender policy: signed

Grant timing: install-review

Switches the focus to the app window of the given PID and the app zoom-in start position. Used by the app launcher, app switcher, and usb-debug protocol.

Source

pub fn switch_to_launcher(&self) -> Result<bool, GuiServerError>

Permission: os/gui-server / SwitchToLauncher

Groups: ui-and-input.navigation

Sender policy: signed

Grant timing: install-review

Switches the focus to the launcher app window. Used by apps.

Source

pub fn is_locked(&self) -> Result<bool, GuiServerError>

Permission: os/gui-server / IsLocked

Groups: TBD

Sender policy: TBD

Grant timing: TBD

Source

pub fn shutdown(&self) -> Result<(), GuiServerError>

Permission: os/gui-server / Shutdown

Groups: ui-and-input.capture-and-injection

Sender policy: static-server

Grant timing: policy-only

Source

pub fn reboot(&self) -> Result<(), GuiServerError>

Permission: os/gui-server / Shutdown

Groups: ui-and-input.capture-and-injection

Sender policy: static-server

Grant timing: policy-only

Source

pub fn close_app(&self, pid: PID) -> Result<(), GuiServerError>

Permission: os/gui-server / CloseApp

Groups: ui-and-input.navigation

Sender policy: signed

Grant timing: install-review

Closes the app window of the given PID. Used by the launcher, switcher, and usb-debug protocol to gracefully close apps.

Source

pub fn capture_screen(&self) -> Result<DropDeallocate, GuiServerError>

Permission: os/gui-server / CaptureScreen

Groups: ui-and-input.capture-and-injection

Sender policy: static-server

Grant timing: policy-only

Captures the current composited screen as raw pixel data. Returns a DropDeallocate of length FB_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT * 4) that auto-unmaps on drop. Dereferences to MemoryRange / &[u8].

Source

pub fn inject_touch(&self, touch: Touch) -> Result<(), GuiServerError>

Permission: os/gui-server / InjectTouch

Groups: ui-and-input.capture-and-injection

Sender policy: static-server

Grant timing: policy-only

Injects a touch event as if it came from the hardware touch controller.

Source

pub fn inject_key( &self, is_pressed: bool, key: Key, ) -> Result<(), GuiServerError>

Permission: os/gui-server / InjectKey

Groups: ui-and-input.capture-and-injection

Sender policy: static-server

Grant timing: policy-only

Injects a key press or release event into the active app.

Source

pub fn inject_power_button( &self, is_pressed: bool, ) -> Result<(), GuiServerError>

Permission: os/gui-server / InjectPowerButton

Groups: TBD

Sender policy: TBD

Grant timing: TBD

Injects a power button press or release into gui-server’s power-button state machine.

Source

pub fn update_kiosk_policy( &self, policy: UpdateKioskPolicy, ) -> Result<(), GuiServerError>

Permission: os/gui-server / UpdateKioskPolicy

Groups: TBD

Sender policy: TBD

Grant timing: TBD

Trait Implementations§

Source§

impl<P: Clone + CheckedPermissions> Clone for GuiApiLight<P>

Source§

fn clone(&self) -> GuiApiLight<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + CheckedPermissions> Debug for GuiApiLight<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Default + CheckedPermissions> Default for GuiApiLight<P>

Source§

fn default() -> GuiApiLight<P>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<P> Freeze for GuiApiLight<P>

§

impl<P> RefUnwindSafe for GuiApiLight<P>

§

impl<P> Send for GuiApiLight<P>

§

impl<P> Sync for GuiApiLight<P>

§

impl<P> Unpin for GuiApiLight<P>

§

impl<P> UnwindSafe for GuiApiLight<P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.