Struct rs::state::Application
source · [−]pub struct Application {
pub im: InputMethod,
pub visibility_override: State,
pub physical_keyboard: Presence,
pub debug_mode_enabled: bool,
pub preferred_output: Option<OutputId>,
pub outputs: HashMap<OutputId, OutputState>,
pub layout_choice: LayoutChoice,
pub overlay_layout: Option<LayoutId>,
}
Expand description
The actual logic of the program. At this moment, limited to calculating visibility and IM hints.
It keeps the panel visible for a short time period after each hide request. This prevents flickering on quick successive enable/disable events. It does not treat user-driven hiding in a special way.
This is the “functional core”. All state changes return the next state and the optimal time for the next check.
This state tracker can be driven by any event loop.
Fields
im: InputMethod
visibility_override: State
physical_keyboard: Presence
debug_mode_enabled: bool
preferred_output: Option<OutputId>
The output on which the panel should appear. This is stored as part of the state because it’s not clear how to derive the output from the rest of the state. It should probably follow the focused input, but not sure about being allowed on non-touch displays.
outputs: HashMap<OutputId, OutputState>
layout_choice: LayoutChoice
We presume that the system always has some preference, even though we receive the preference after init, and we might not receive one at all (gsettings missing). Then a default is used.
overlay_layout: Option<LayoutId>
Manual override of the system layout
Implementations
sourceimpl Application
impl Application
sourcepub fn new(now: Instant) -> Self
pub fn new(now: Instant) -> Self
A conservative default, ignoring the actual state of things. It will initially show the keyboard for a blink.
pub fn apply_event(self, event: Event, now: Instant) -> Self
fn get_preferred_height_and_arrangement(
output: &OutputState
) -> Option<(PixelSize, ArrangementKind)>
sourcefn get_layout_names(&self) -> (String, Option<String>)
fn get_layout_names(&self) -> (String, Option<String>)
Returns layout name, overlay name
Trait Implementations
sourceimpl ActorState for Application
impl ActorState for Application
sourcefn get_next_wake(&self, now: Instant) -> Option<Instant>
fn get_next_wake(&self, now: Instant) -> Option<Instant>
Returns the next time to update the outcome.
type Event = Event
type Outcome = Outcome
sourcefn apply_event(self, e: Self::Event, time: Instant) -> Self
fn apply_event(self, e: Self::Event, time: Instant) -> Self
Returns the new internal state after the event gets processed.
sourcefn get_outcome(&self, now: Instant) -> Outcome
fn get_outcome(&self, now: Instant) -> Outcome
Returns the observable state of the actor given this internal state.
sourceimpl Clone for Application
impl Clone for Application
sourcefn clone(&self) -> Application
fn clone(&self) -> Application
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Application
impl Send for Application
impl !Sync for Application
impl Unpin for Application
impl UnwindSafe for Application
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more