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§
Source§impl 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§
Source§impl ActorState for Application
impl ActorState for Application
Source§fn 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
Source§fn apply_event(self, e: Self::Event, time: Instant) -> Self
fn apply_event(self, e: Self::Event, time: Instant) -> Self
Source§fn get_outcome(&self, now: Instant) -> Outcome
fn get_outcome(&self, now: Instant) -> Outcome
Source§impl Clone for Application
impl Clone for Application
Source§fn clone(&self) -> Application
fn clone(&self) -> Application
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more