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: InputMethodvisibility_override: Statephysical_keyboard: Presencedebug_mode_enabled: boolpreferred_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

A conservative default, ignoring the actual state of things. It will initially show the keyboard for a blink.

Returns layout name, overlay name

Trait Implementations

Returns the next time to update the outcome.

Returns the new internal state after the event gets processed.

Returns the observable state of the actor given this internal state.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.