fuchsia.ui.policy

PROTOCOLS

DeviceListenerRegistry

Defined in fuchsia.ui.policy/device_listener.fidl

Service for exposing state and events of devices, such as media buttons.

RegisterMediaButtonsListener

Registers a listener to receive media button related events, such as changes from volume buttons and mute switches.

Request

NameType
listener MediaButtonsListener

KeyboardCaptureListenerHACK

Defined in fuchsia.ui.policy/presentation.fidl

Presentation.CaptureKeyboardEvent will consume this listener interface and call OnEvent when the registered keyboard event occurs.

OnEvent

Request

NameType
event fuchsia.ui.input/KeyboardEvent

PointerCaptureListenerHACK

Defined in fuchsia.ui.policy/presentation.fidl

Presentation.CapturePointerEvent will consume this listener interface and call OnEvent when a pointer event occurs.

OnPointerEvent

Request

NameType
event fuchsia.ui.input/PointerEvent

MediaButtonsListener

Defined in fuchsia.ui.policy/presentation.fidl

Presentation.RegisterMediaButtonsListener will consume this listener interface and call OnMediaButtonsEvent when the registered media buttons event occurs.

OnMediaButtonsEvent

Request

NameType
event fuchsia.ui.input/MediaButtonsEvent

Presentation

Defined in fuchsia.ui.policy/presentation.fidl

Allows clients of Presenter.Present() to control a presentation. Experimental.

EnableClipping

Enable or disable clipping for the Scenic renderer associated with the presentation.

Request

NameType
enabled bool

UseOrthographicView

Request

NameType

UsePerspectiveView

Request

NameType

SetRendererParams

Set parameters such as the shadow algorithm used to render the scene. NOTE: a single param would be better than an array; see TO-529.

Request

NameType
params vector<fuchsia.ui.gfx/RendererParam>

SetDisplayUsage

Override the intended usage of the display.

Request

NameType
usage DisplayUsage

SetDisplayRotation

Rotates the display.

Request

NameType
display_rotation_degrees float32
animate bool

SetDisplaySizeInMm

Override the dimensions of the display. Values must be less than the actual size of the display. If either of the values are 0, then they are ignored and the actual size of the display is used.

Request

NameType
width_in_mm float32
height_in_mm float32

CaptureKeyboardEventHACK

This call exists so that base shell can capture hotkeys and do special things with it (e.g., switch a session shell). Phase and modifiers are always matched, and valid (non-zero) code points are matched. If there is no valid code point, the filter will match against the hid usage value. The full KeyboardEvent is supplied to listener's OnEvent.

Request

NameType
event_to_capture fuchsia.ui.input/KeyboardEvent
listener KeyboardCaptureListenerHACK

CapturePointerEventsHACK

This call exists so that base shell can capture pointer events.

Request

NameType
listener PointerCaptureListenerHACK

GetPresentationMode

Request

NameType

Response

NameType
mode PresentationMode

SetPresentationModeListener

Request

NameType
listener PresentationModeListener

RegisterMediaButtonsListener

Registers a listener for media buttons events.

Request

NameType
listener MediaButtonsListener

InjectPointerEventHACK

EXPERIMENTAL. Inject pointer events into input stream. This WILL go away. Used exclusively by Session Shells to test focus navigation.

Request

NameType
event fuchsia.ui.input/PointerEvent

PresentationModeListener

Defined in fuchsia.ui.policy/presentation.fidl

Tell client that the screen mode has changed, according to sensors. N.B. There can be a race where the actual mode continues to change, after the listener has been notified. The client must call GetPresentationMode(), which will return the latest detected mode.

OnModeChanged

Request

NameType

Presenter

Defined in fuchsia.ui.policy/presenter.fidl

The Presenter service provides a way for applications to ask that a view be added to a view tree, leaving any window management concerns up to the discretion of the presenter implementation.

PresentView

Request that the View's contents be displayed on the screen as a Presentation.

Request

NameType
view_holder_token fuchsia.ui.views/ViewHolderToken
presentation_request request<Presentation>?

HACK_SetRendererParams

Sets new default renderer params and forces them on for the duration of the presenter's lifetime. Only applies to any subsequent calls to Present(). Used for testing.

Request

NameType
enable_clipping bool
params vector<fuchsia.ui.gfx/RendererParam>

ENUMS

DisplayUsage

Type: uint32

Defined in fuchsia.ui.policy/display_usage.fidl

Describes the intended usage of the display.

NameValueDescription
kUnknown 0
kHandheld 1 Display is held in one or both hands.
kClose 2 Display is used well within arm's reach.
kNear 3 Display is used at arm's reach.
kMidrange 4 Display is used beyond arm's reach.
kFar 5 Display is used well beyond arm's reach.

PresentationMode

Type: uint32

Defined in fuchsia.ui.policy/presentation.fidl

Screen modes that can be detected via sensor data. N.B. We use accelerometers to measure gravity when at rest, so detection is limited to earth-relative orientations.

NameValueDescription
CLOSED 0
LAPTOP 1
TABLET 2
TENT 3