pub struct LayoutInfo {
pub logical_size: Option<SizeU>,
pub device_pixel_ratio: Option<VecF>,
pub inset: Option<Inset>,
/* private fields */
}
Expand description
The return type of [GetLayout
]. This table contains most of the information necessary
for a client to decide how to layout their content in a Flatland instance. This data may be
provided to the client before the command that creates the View is presented, so that the
client may lay out content properly before their first call to [Present
].
Fields§
§logical_size: Option<SizeU>
The layout size of a View in logical pixels, defined by the parent’s call to
[SetViewportProperties
].
The logical size also serves as the clip boundary of the View. Anything outside the clip boundary will not be rendered. Hence, the View’s Root Transform has a useful coordinate space of (0, 0) to (logical_size.width, logical_size.height).
Clients should re-layout their content when this value changes.
device_pixel_ratio: Option<VecF>
The ratio of display’s physical pixels to device independent pixels. Each logical pixel of a
View is displayed on-screen by one or more physical pixels, as determined by this scale.
Clients should not necessarily re-layout their content when this value changes, but
accommodate by reallocating their Image buffers to avoid sampling artifacts. The HiDPI-aware
client should allocate buffers that are sized (logical_size
*device_pixel_ratio
).
inset: Option<Inset>
The offsets between the edges and the visible rectangle of the View. The clients can assume
that the boundary region between the inset and the View edge is occluded, and should adjust
content layout to avoid this region. This inset is described in the view’s logical
coordinate system. The HiDPI-aware clients should scale this by device_pixel_ratio
.
Trait Implementations§
Source§impl Clone for LayoutInfo
impl Clone for LayoutInfo
Source§fn clone(&self) -> LayoutInfo
fn clone(&self) -> LayoutInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LayoutInfo
impl Debug for LayoutInfo
Source§impl<D> Decode<LayoutInfo, D> for LayoutInfowhere
D: ResourceDialect,
impl<D> Decode<LayoutInfo, D> for LayoutInfowhere
D: ResourceDialect,
Source§fn new_empty() -> LayoutInfo
fn new_empty() -> LayoutInfo
Self
. The specific value does not matter,
since it will be overwritten by decode
.Source§impl Default for LayoutInfo
impl Default for LayoutInfo
Source§fn default() -> LayoutInfo
fn default() -> LayoutInfo
Source§impl<D> Encode<LayoutInfo, D> for &LayoutInfowhere
D: ResourceDialect,
impl<D> Encode<LayoutInfo, D> for &LayoutInfowhere
D: ResourceDialect,
Source§impl PartialEq for LayoutInfo
impl PartialEq for LayoutInfo
Source§impl TypeMarker for LayoutInfo
impl TypeMarker for LayoutInfo
Source§type Owned = LayoutInfo
type Owned = LayoutInfo
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for LayoutInfo
impl ValueTypeMarker for LayoutInfo
Source§type Borrowed<'a> = &'a LayoutInfo
type Borrowed<'a> = &'a LayoutInfo
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreSource§fn borrow(
value: &<LayoutInfo as TypeMarker>::Owned,
) -> <LayoutInfo as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<LayoutInfo as TypeMarker>::Owned, ) -> <LayoutInfo as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.impl Persistable for LayoutInfo
impl StructuralPartialEq for LayoutInfo
Auto Trait Implementations§
impl Freeze for LayoutInfo
impl RefUnwindSafe for LayoutInfo
impl Send for LayoutInfo
impl Sync for LayoutInfo
impl Unpin for LayoutInfo
impl UnwindSafe for LayoutInfo
Blanket Implementations§
Source§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
Source§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
Source§type MarkerInResultUnion = T
type MarkerInResultUnion = T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)