blob: 7f5fbbc0cbc64fa31f70a64dcd81284f3fd40af3 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.ui.scenic
<p><b>Added:7</b></p>
## **PROTOCOLS**
## Scenic {#Scenic}
*Defined in [fuchsia.ui.scenic/scenic.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/scenic.fidl;l=49)*
### CreateSession {#Scenic.CreateSession}
<p>Create a new Session, which is the primary way to interact with Scenic.</p>
#### Request {#Scenic.CreateSession_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>session</code></td>
<td>
<code>request&lt;<a class='link' href='#Session'>Session</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#SessionListener'>SessionListener</a>?</code>
</td>
</tr>
</table>
### CreateSession2 {#Scenic.CreateSession2}
<p>Create a new Session, which is the primary way to interact with Scenic.</p>
<p>In this variant, the caller may register a request for focus management.
The <code>view_focuser</code>'s client is coupled to the requested <code>session</code>, and
this coupling acts as a security boundary: the ViewRef used as the basis
for authority by <code>view_focuser</code> must come from <code>session</code>.</p>
#### Request {#Scenic.CreateSession2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>session</code></td>
<td>
<code>request&lt;<a class='link' href='#Session'>Session</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#SessionListener'>SessionListener</a>?</code>
</td>
</tr>
<tr>
<td><code>view_focuser</code></td>
<td>
<code>request&lt;<a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#Focuser'>Focuser</a>&gt;?</code>
</td>
</tr>
</table>
### CreateSessionT {#Scenic.CreateSessionT}
<p>Create a new Session, which is the primary way to interact with Scenic.</p>
<p>In this variant, the caller may submit a combination of protocols
that make sense for it. The Session protocol is the only required
protocol. The SessionEndpoints table may be extended with more protocol
fields, but these extensions should retain ABI and API compatibility
with existing (pre-compiled) clients.</p>
<p>The response acknowledges the request to create a Session, but actual
creation may happen later.</p>
#### Request {#Scenic.CreateSessionT_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>endpoints</code></td>
<td>
<code><a class='link' href='#SessionEndpoints'>SessionEndpoints</a></code>
</td>
</tr>
</table>
#### Response {#Scenic.CreateSessionT_Response}
&lt;EMPTY&gt;
### GetDisplayInfo {#Scenic.GetDisplayInfo}
<p>Get information about the Scenic's primary display.</p>
#### Request {#Scenic.GetDisplayInfo_Request}
&lt;EMPTY&gt;
#### Response {#Scenic.GetDisplayInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.gfx/'>fuchsia.ui.gfx</a>/<a class='link' href='../fuchsia.ui.gfx/#DisplayInfo'>DisplayInfo</a></code>
</td>
</tr>
</table>
### GetDisplayOwnershipEvent {#Scenic.GetDisplayOwnershipEvent}
<p>Gets an event signaled with displayOwnedSignal or displayNotOwnedSignal
when display ownership changes.</p>
#### Request {#Scenic.GetDisplayOwnershipEvent_Request}
&lt;EMPTY&gt;
#### Response {#Scenic.GetDisplayOwnershipEvent_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>ownership_event</code></td>
<td>
<code>handle&lt;event&gt;</code>
</td>
</tr>
</table>
### TakeScreenshot {#Scenic.TakeScreenshot}
<p>Take a screenshot and return the data in <code>img_data</code>. <code>img_data</code> will
not contain BGRA data if <code>success</code> is false.</p>
#### Request {#Scenic.TakeScreenshot_Request}
&lt;EMPTY&gt;
#### Response {#Scenic.TakeScreenshot_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>img_data</code></td>
<td>
<code><a class='link' href='#ScreenshotData'>ScreenshotData</a></code>
</td>
</tr>
<tr>
<td><code>success</code></td>
<td>
<code>bool</code>
</td>
</tr>
</table>
### UsesFlatland {#Scenic.UsesFlatland}
<p>Returns whether the clients should use <a class='link' href='../fuchsia.ui.composition/'>fuchsia.ui.composition</a>/<a class='link' href='../fuchsia.ui.composition/#Flatland'>Flatland</a> protocol to
interact with Scenic instead.</p>
#### Request {#Scenic.UsesFlatland_Request}
&lt;EMPTY&gt;
#### Response {#Scenic.UsesFlatland_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flatland_enabled</code></td>
<td>
<code>bool</code>
</td>
</tr>
</table>
## Session {#Session}
*Defined in [fuchsia.ui.scenic/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/session.fidl;l=53)*
<p>Client use Sessions to interact with a Scenic instance by enqueuing commands
that create or modify resources.</p>
### DeregisterBufferCollection {#Session.DeregisterBufferCollection}
<p>Deregisters the BufferCollection previously registered with the <code>buffer_id</code> and sets it
to be garbage collected as soon as it is no longer referenced by any resources.</p>
<p>Only <code>buffer_id</code> that have been previously registered and not yet deregistered are valid.</p>
#### Request {#Session.DeregisterBufferCollection_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
### Enqueue {#Session.Enqueue}
#### Request {#Session.Enqueue_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>cmds</code></td>
<td>
<code>vector&lt;<a class='link' href='#Command'>Command</a>&gt;</code>
</td>
</tr>
</table>
### OnFramePresented {#Session.OnFramePresented}
<p>This event is fired whenever a set of one or more Present2s are
presented simultaenously, and are therefore no longer in flight.</p>
#### Response {#Session.OnFramePresented_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>frame_presented_info</code></td>
<td>
<code><a class='link' href='../fuchsia.scenic.scheduling/'>fuchsia.scenic.scheduling</a>/<a class='link' href='../fuchsia.scenic.scheduling/#FramePresentedInfo'>FramePresentedInfo</a></code>
</td>
</tr>
</table>
### Present {#Session.Present}
<p>Present all previously enqueued operations. In order to pipeline the
preparation of the resources required to render the scene, two lists of
fences (implemented as events) are passed.</p>
<p>SCHEDULING PRESENTATION</p>
<p><code>presentation_time</code> specifies the time on or after which the
client would like the enqueued operations should take visible effect
(light up pixels on the screen), expressed in nanoseconds in the
<code>CLOCK_MONOTONIC</code> timebase. Desired presentation times must be
monotonically non-decreasing.</p>
<p>Using a desired presentation time in the present or past (such as 0)
schedules enqueued operations to take visible effect as soon as possible
(during the next frame to be prepared).</p>
<p>Using a desired presentation time in the future schedules the enqueued
operations to take visible effect as closely as possible to or after
the stated time (but no earlier).</p>
<p>Each rendered frame has a target presentation time. Before rendering
a frame, the scene manager applies all enqueued operations associated
with all prior calls to <code>Present()</code> whose desired presentation time
is on or before the frame's target presentation time.</p>
<p>The <code>Present()</code> method does not return until the scene manager begins
preparing the first frame which includes its presented content.
Upon return, the <code>PresentationInfo</code> provides timing information for the
frame which includes the presented content.</p>
<p>To present new content on each successive frame, wait for <code>Present()</code>
to return before calling <code>Present()</code> again with content for the next
frame.</p>
<p>It is also possible to enqueue and present successive frames of content
all at once with increasing desired presentation times, incrementing by
<code>PresentationInfo.presentation_interval</code> for each one.</p>
<p>Animation updates are also coordinated in terms of presentation time.</p>
<p>SYNCHRONIZATION</p>
<p><code>acquire_fences</code> are used by Scenic to wait until all of the session's
resources are ready to render (or to allow downstream components, such as
the Vulkan driver, to wait for these resources).</p>
<p>For example, Fuchsia's Vulkan driver allows an zx::event to be obtained
from a VkSemaphore. This allows a Scenic client to submit a Vulkan command
buffer to generate images/meshes/etc., and instructing Vulkan to signal a
VkSemaphore when it is done. By inserting the zx::event corresponding to
this semaphore into <code>acquire_fences</code>, the client allows Scenic to submit work
to the Vulkan driver without waiting on the CPU for the event to be
signalled.</p>
<p><code>release_fences</code> is a list of events that will be signalled by Scenic when
the updated session state has been fully committed: future frames will be
rendered using this state, and all frames generated using previous session
states have been fully-rendered and presented to the display.</p>
<p>Together, <code>acquire_fences</code> and <code>release_fences</code> are intended to allow clients
to implement strategies such as double-buffering. For example, a client
might do the following in the Scenic subsystem:</p>
<ol>
<li>create two Image with resource IDs #1 and #2.</li>
<li>create two Materials with resource IDs #3 and #4, which respectively
use Images #1 and #2 as their texture.</li>
<li>create a tree of Nodes and attach them to the scene.</li>
<li>set one of the nodes above, say #5, to use Material #3.</li>
<li>submit a Vulkan command-buffer which renders into Image #1, and
will signal a VkSemaphore.</li>
<li>call Present() with one acquire-fence (obtained from the VkSemaphore
above) and one newly-created release-fence.</li>
</ol>
<p>After the steps above, Scenic will use the committed session state to render
frames whenever necessary. When the client wants to display something
different than Image #1, it would do something similar to steps 4) to 6):
7) set Node #5 to use Material #4.
8) submit a Vulkan command-buffer which renders into Image #1, and
will signal a VkSemaphore.
9) call Present() with one acquire-fence (obtained from the VkSemaphore
above) and one newly-created release-fence.</p>
<p>Finally, to continually draw new content, the client could repeat steps
4) to 9), with one important difference: step 5) must wait on the event
signalled by step 9). Otherwise, it might render into Image #1 while that
image is still being used by Scenic to render a frame. Similarly, step 8)
must wait on the event signalled by step 6).</p>
<p>The scenario described above uses one acquire-fence and one release-fence,
but it is easy to imagine cases that require more. For example, in addition
to using Vulkan to render into Images #1 and #2, the client might also
upload other resources to Vulkan on a different VkQueue, which would
would signal a separate semaphore, and therefore require an additional
acquire-fence.</p>
<p>Note: <code>acquire_fences</code> and <code>release_fences</code> are only necessary to synchronize
access to memory (and other external resources). Any modification to
resources made via the Session API are automatically synchronized.</p>
#### Request {#Session.Present_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>presentation_time</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>acquire_fences</code></td>
<td>
<code>vector&lt;event&gt;</code>
</td>
</tr>
<tr>
<td><code>release_fences</code></td>
<td>
<code>vector&lt;event&gt;</code>
</td>
</tr>
</table>
#### Response {#Session.Present_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>presentation_info</code></td>
<td>
<code><a class='link' href='../fuchsia.images/'>fuchsia.images</a>/<a class='link' href='../fuchsia.images/#PresentationInfo'>PresentationInfo</a></code>
</td>
</tr>
</table>
### Present2 {#Session.Present2}
<p>Present all previously enqueued operations. In order to pipeline the
preparation of the resources required to render the scene, two lists of
fences, implemented as events, are passed.</p>
<p>When a client calls Present2, they receive an immediate callback
consisting of the same information they would get as if they had called
<code>RequestPresentationTimes</code> with the equivalent
<code>requested_prediction_span</code>. See its documentation below for more
information, as Present2's functionality is a superset of it.</p>
<p>Then, when the commands flushed by Present2 make it to display, an
<code>OnFramePresented</code> event is fired. This event includes information
pertaining to all Present2s that had content that were part of that
frame.</p>
<p>Clients may only use one of Present/Present2 per Session.
Switching between both is an error that will result in the Session being
closed.</p>
<p>See <code>Present2Args</code> documentation above for more detailed information on
what arguments are passed in and their role.</p>
#### Request {#Session.Present2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>args</code></td>
<td>
<code><a class='link' href='#Present2Args'>Present2Args</a></code>
</td>
</tr>
</table>
#### Response {#Session.Present2_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request_presentation_times_info</code></td>
<td>
<code><a class='link' href='../fuchsia.scenic.scheduling/'>fuchsia.scenic.scheduling</a>/<a class='link' href='../fuchsia.scenic.scheduling/#FuturePresentationTimes'>FuturePresentationTimes</a></code>
</td>
</tr>
</table>
### RegisterBufferCollection {#Session.RegisterBufferCollection}
<p>Registers BufferCollection referenced by the <code>token</code> and sets contraints on it.
It does not block on the buffers being allocated until content backed by one of the
collection's VMOs is created, e.g. an Image2.</p>
<p>A value of 0 for the <code>buffer_id</code> is invalid. All other values are valid as long as they
are not currently in use.</p>
#### Request {#Session.RegisterBufferCollection_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>token</code></td>
<td>
<code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#BufferCollectionToken'>BufferCollectionToken</a></code>
</td>
</tr>
</table>
### RequestPresentationTimes {#Session.RequestPresentationTimes}
<p>Returns information about future presentation times, and their
respective latch points. Clients can use the returned information to
make informed scheduling decisions: if a client wants their frame to be
displayed at a given <code>presentation_time</code>, they should aim to have all
<code>acquire_fences</code> fired before the associated <code>latch_point</code>.</p>
<p>Scenic will attempt to return predictions that span a duration equal to
<code>requested_prediction_span</code>, up to a limit.</p>
<p>A value of 0 is guaranteed to give at least one future presentation info.</p>
#### Request {#Session.RequestPresentationTimes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>requested_prediction_span</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code>
</td>
</tr>
</table>
#### Response {#Session.RequestPresentationTimes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request_presentation_times_info</code></td>
<td>
<code><a class='link' href='../fuchsia.scenic.scheduling/'>fuchsia.scenic.scheduling</a>/<a class='link' href='../fuchsia.scenic.scheduling/#FuturePresentationTimes'>FuturePresentationTimes</a></code>
</td>
</tr>
</table>
### SetDebugName {#Session.SetDebugName}
<p>Set an optional debug name for the session. The debug name will be
output in things such as logging and trace events.</p>
#### Request {#Session.SetDebugName_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>debug_name</code></td>
<td>
<code>string</code>
</td>
</tr>
</table>
## SessionListener {#SessionListener}
*Defined in [fuchsia.ui.scenic/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/session.fidl;l=252)*
<p>Listens for events which occur within the session.</p>
### OnScenicError {#SessionListener.OnScenicError}
<p>Called when an error has occurred and the session will be torn down.</p>
#### Request {#SessionListener.OnScenicError_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>error</code></td>
<td>
<code>string</code>
</td>
</tr>
</table>
### OnScenicEvent {#SessionListener.OnScenicEvent}
<p>Called to deliver a batch of one or more events to the listener.
Use <code>SetEventMaskCmd</code> to enable event delivery for a resource.</p>
#### Request {#SessionListener.OnScenicEvent_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>events</code></td>
<td>
<code>vector&lt;<a class='link' href='#Event'>Event</a>&gt;</code>
</td>
</tr>
</table>
## Snapshot {#Snapshot}
*Defined in [fuchsia.ui.scenic/snapshot.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/snapshot.fidl;l=8)*
<p>Defines an interface to take view snapshots.</p>
## **STRUCTS**
### ScreenshotData [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#ScreenshotData data-text="ScreenshotData"}
*Defined in [fuchsia.ui.scenic/scenic.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/scenic.fidl;l=16)*
<p>Scenic.TakeScreenshot() returns a raw BGRA formatted image in
sRGB color space and with a non-linear transfer function in this
struct.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="ScreenshotData.info">
<td><code>info</code></td>
<td>
<code><a class='link' href='../fuchsia.images/'>fuchsia.images</a>/<a class='link' href='../fuchsia.images/#ImageInfo'>ImageInfo</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="ScreenshotData.data">
<td><code>data</code></td>
<td>
<code><a class='link' href='../fuchsia.mem/'>fuchsia.mem</a>/<a class='link' href='../fuchsia.mem/#Buffer'>Buffer</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
## **TABLES**
### Present2Args [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Present2Args data-text="Present2Args"}
*Defined in [fuchsia.ui.scenic/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/session.fidl;l=12)*
<p>Arguments passed into Present2(). Note that every argument is mandatory.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Present2Args.requested_presentation_time">
<td><h3 id="Present2Args.requested_presentation_time" class="add-link hide-from-toc">1</h3></td>
<td><code>requested_presentation_time</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code>
</td>
<td><p><code>requested_presentation_time</code> specifies the time on or after which the
client would like the enqueued operations to take visible effect
(light up pixels on the screen), expressed in nanoseconds in the
<code>CLOCK_MONOTONIC</code> timebase.</p>
<p>Using a <code>requested_presentation_time</code> in the present or past (such as 0)
schedules enqueued operations to take visible effect as soon as
possible, during the next frame to be prepared. Requested presentation
times must be monotonically increasing.</p>
<p>Using a <code>requested_presentation_time</code> in the future schedules the enqueued
operations to take visible effect as closely as possible to or after
the stated time, but no earlier.</p>
<p>Each rendered frame has a target presentation time. This is when Scenic
aims to have the frame presented to the user. Before rendering a frame,
the scene manager applies all enqueued operations associated with all
prior calls to Present2 whose <code>requested_presentation_time</code> is on or
before the frame's target presentation time.</p>
</td>
</tr>
<tr id="Present2Args.acquire_fences">
<td><h3 id="Present2Args.acquire_fences" class="add-link hide-from-toc">2</h3></td>
<td><code>acquire_fences</code></td>
<td>
<code>vector&lt;event&gt;</code>
</td>
<td><p>Scenic will wait until all of a session's <code>acquire_fences</code> are ready
before it will execute the presented commands.</p>
</td>
</tr>
<tr id="Present2Args.release_fences">
<td><h3 id="Present2Args.release_fences" class="add-link hide-from-toc">3</h3></td>
<td><code>release_fences</code></td>
<td>
<code>vector&lt;event&gt;</code>
</td>
<td><p><code>release_fences</code> is the list of events that will be signalled by Scenic when
the following Present2 call's <code>acquire_fences</code> has been signalled, and
the updated session state has been fully committed: future frames will be
rendered using this state, and all frames generated using previous session
states have been fully-rendered and presented to the display.</p>
</td>
</tr>
<tr id="Present2Args.requested_prediction_span">
<td><h3 id="Present2Args.requested_prediction_span" class="add-link hide-from-toc">4</h3></td>
<td><code>requested_prediction_span</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code>
</td>
<td><p><code>requested_prediction_span</code> is the amount of time into the future Scenic
will provide predictions for. A span of 0 is guaranteed to provide at
least one future time.</p>
</td>
</tr>
</table>
### SessionEndpoints [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#SessionEndpoints data-text="SessionEndpoints"}
*Defined in [fuchsia.ui.scenic/scenic.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/scenic.fidl;l=22)*
<p>The protocol endpoints used in creating a Scenic Session.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="SessionEndpoints.session">
<td><h3 id="SessionEndpoints.session" class="add-link hide-from-toc">1</h3></td>
<td><code>session</code></td>
<td>
<code>request&lt;<a class='link' href='#Session'>Session</a>&gt;</code>
</td>
<td><p>Enqueue commands and present content.
Required.</p>
</td>
</tr>
<tr id="SessionEndpoints.session_listener">
<td><h3 id="SessionEndpoints.session_listener" class="add-link hide-from-toc">2</h3></td>
<td><code>session_listener</code></td>
<td>
<code><a class='link' href='#SessionListener'>SessionListener</a></code>
</td>
<td><p>Receive session-related events.
Optional.</p>
</td>
</tr>
<tr id="SessionEndpoints.view_focuser">
<td><h3 id="SessionEndpoints.view_focuser" class="add-link hide-from-toc">3</h3></td>
<td><code>view_focuser</code></td>
<td>
<code>request&lt;<a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#Focuser'>Focuser</a>&gt;</code>
</td>
<td><p>Change view focus, within the session view's subtree.
Optional.</p>
</td>
</tr>
<tr id="SessionEndpoints.view_ref_focused">
<td><h3 id="SessionEndpoints.view_ref_focused" class="add-link hide-from-toc">4</h3></td>
<td><code>view_ref_focused</code></td>
<td>
<code>request&lt;<a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#ViewRefFocused'>ViewRefFocused</a>&gt;</code>
</td>
<td><p>Learn when this session view receives or loses view focus.
Optional.</p>
</td>
</tr>
<tr id="SessionEndpoints.touch_source">
<td><h3 id="SessionEndpoints.touch_source" class="add-link hide-from-toc">5</h3></td>
<td><code>touch_source</code></td>
<td>
<code>request&lt;<a class='link' href='../fuchsia.ui.pointer/'>fuchsia.ui.pointer</a>/<a class='link' href='../fuchsia.ui.pointer/#TouchSource'>TouchSource</a>&gt;</code>
</td>
<td><p>Ask for touch events and negotiate for gesture ownership.
Optional.</p>
</td>
</tr>
<tr id="SessionEndpoints.mouse_source">
<td><h3 id="SessionEndpoints.mouse_source" class="add-link hide-from-toc">6</h3></td>
<td><code>mouse_source</code></td>
<td>
<code>request&lt;<a class='link' href='../fuchsia.ui.pointer/'>fuchsia.ui.pointer</a>/<a class='link' href='../fuchsia.ui.pointer/#MouseSource'>MouseSource</a>&gt;</code>
</td>
<td><p>Ask for mouse events.
Optional.</p>
</td>
</tr>
</table>
## **UNIONS**
### Command [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Command data-text="Command"}
*Defined in [fuchsia.ui.scenic/commands.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/commands.fidl;l=10)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Command.gfx">
<td><h3 id="Command.gfx" class="add-link hide-from-toc">1</h3></td>
<td><code>gfx</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.gfx/'>fuchsia.ui.gfx</a>/<a class='link' href='../fuchsia.ui.gfx/#Command'>Command</a></code>
</td>
<td></td>
</tr>
<tr id="Command.">
<td><h3 id="Command." class="add-link hide-from-toc">2</h3></td>
<td><code></code></td>
<td>
<code></code>
</td>
<td></td>
</tr>
<tr id="Command.views">
<td><h3 id="Command.views" class="add-link hide-from-toc">3</h3></td>
<td><code>views</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.views/'>fuchsia.ui.views</a>/<a class='link' href='../fuchsia.ui.views/#Command'>Command</a></code>
</td>
<td></td>
</tr>
<tr id="Command.input">
<td><h3 id="Command.input" class="add-link hide-from-toc">4</h3></td>
<td><code>input</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.input/'>fuchsia.ui.input</a>/<a class='link' href='../fuchsia.ui.input/#Command'>Command</a></code>
</td>
<td></td>
</tr>
</table>
### Event [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Event data-text="Event"}
*Defined in [fuchsia.ui.scenic/events.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/events.fidl;l=9)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Event.gfx">
<td><h3 id="Event.gfx" class="add-link hide-from-toc">1</h3></td>
<td><code>gfx</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.gfx/'>fuchsia.ui.gfx</a>/<a class='link' href='../fuchsia.ui.gfx/#Event'>Event</a></code>
</td>
<td></td>
</tr>
<tr id="Event.input">
<td><h3 id="Event.input" class="add-link hide-from-toc">2</h3></td>
<td><code>input</code></td>
<td>
<code><a class='link' href='../fuchsia.ui.input/'>fuchsia.ui.input</a>/<a class='link' href='../fuchsia.ui.input/#InputEvent'>InputEvent</a></code>
</td>
<td></td>
</tr>
<tr id="Event.unhandled">
<td><h3 id="Event.unhandled" class="add-link hide-from-toc">3</h3></td>
<td><code>unhandled</code></td>
<td>
<code><a class='link' href='#Command'>Command</a></code>
</td>
<td></td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="displayNotOwnedSignal">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/scenic.fidl;l=115">displayNotOwnedSignal</a></td>
<td>
<code>16777216</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="displayOwnedSignal">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.scenic/scenic.fidl;l=114">displayOwnedSignal</a></td>
<td>
<code>33554432</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
</table>