Skip to main content

Crate inset_embedder

Crate inset_embedder 

Source
Expand description

Flutter’s dart:ui: host traits (Platform, View) and value types (Offset, Color, Canvas, Paint, Shadow).

The framework depends on this crate. This crate does not depend on the framework. Hosts implement Platform and View, and invoke EmbedderClient on the client the start closure returns. They do not name App.

Re-exports§

pub use valo;

Structs§

AppExitReply
The answer to one request to exit, which the host made through EmbedderClient::request_app_exit: Flutter’s reply to System.requestAppExit. It is answered once; dropped unanswered, it answers AppExitResponse::Exit, since an application that lets go of the question has nothing to keep.
ApplicationSwitcherDescription
Specifies a description of the application that is pertinent to the embedder’s application switcher (also known as “recent tasks”) user interface.
AutofillConfiguration
A collection of autofill related information that represents an AutofillClient.
Backdrop
Backdrop filters the sampled scene before a save layer’s children paint.
Color
An immutable color value in ARGB format.
DropData
One report of an external drag over a view.
FontCollection
FontCollection owns registered faces and sources for resolving missing fonts.
FontDemand
FontDemand describes font requests that no registered face could satisfy.
FontFeature
A feature tag and value that affect the selection of glyphs in a font.
FontId
FontId identifies a registered font within a FaceSet or FontCollection.
FontVariation
An axis tag and value that can be used to customize variable fonts.
FontWeight
The thickness of the glyphs used to draw the text.
Frame
A refresh of a screen, as the host delivers it.
GestureSettings
A null field indicates that the platform or view does not have a preference and the fallback constants should be used instead.
GlyphInfo
The measurements of a character (or a sequence of visually connected characters) within a paragraph.
Image
Image is a cheap-to-clone handle to an immutable GPU image.
ImageFrame
One decoded frame, prepared and ready to draw. Flutter dart:ui FrameInfo.
InertDispatcher
A dispatcher for tests, which pump the application by hand: it never wakes the application, and work runs at once on the calling thread, so its result is there at the next checkpoint.
InertPlatform
Platform for hand-pumped tests.
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
KeyData
Information about a key event.
LineMetrics
LineMetrics stores the measurements and statistics of a single line in the paragraph.
Locale
An identifier used to select a user’s language and formatting preferences.
MaskBlur
MaskBlur applies a Gaussian blur to a draw’s coverage mask.
Matrix4
Matrix is a full 4×4 column-major transform.
Offset
An immutable 2D floating-point offset.
Paint
Paint describes how a drawing operation produces and composites pixels.
Paragraph
A paragraph of text.
ParagraphBuilder
Builds a Paragraph containing text with the given styling information.
ParagraphConstraints
Layout constraints for Paragraph objects.
ParagraphStyle
An opaque object that determines the configuration used by ParagraphBuilder to position lines within a Paragraph of text.
Path
Path is an immutable collection of line and Bézier contours.
PathBuilder
PathBuilder records commands used to create an immutable Path.
PointerData
Information about the state of a pointer.
PointerDataPacket
A sequence of reports about the state of pointers.
Quaternion
A rotation as a unit quaternion.
RRect
An immutable rounded rectangle with the custom radii for all four corners.
RSuperellipse
An immutable rounded superellipse.
Radius
A radius for either circular or elliptical shapes.
RawFloatingCursorPoint
The current state and position of the floating cursor.
Rect
An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.
RequestId
The number of a request for a view, which the view carries when it arrives (View::request_id).
RestorationUpdate
What the host answers when the framework asks for the restoration data it stored.
Scene
Flutter Scene — what SceneBuilder::build produces and crate::View::present takes: the framework’s picture, and the native surfaces this frame places, bottom-most first. A host without a compositor uses the picture alone.
SceneBuilder
Builds a Scene containing the given visuals.
Screen
A monitor: where it is (the frames, for placing windows) and what drawing on it needs (Flutter’s Display: id, devicePixelRatio, refreshRate; Display.size is the frame’s size at scale).
ScreenId
Names a screen: Flutter’s Display.id, which the embedder API calls a FlutterEngineDisplayId. Each host numbers its screens its own way; a screen keeps its number while it stays connected.
Shadow
A representation of a shadow.
Size
Holds a 2D floating-point size.
Stroke
Stroke describes the width, ends, joins, and optional dash pattern of a line.
SurfacePlacement
Where one frame puts one native surface. The surface is its producer’s own handle, so a host reaches the native object behind it directly and moves it.
SystemFontSource
The engine’s font manager: the platform’s installed fonts through a FontManager, and the two family names Flutter’s engine defines for the platform’s own user-interface font.
SystemUiOverlayStyle
Specifies a system overlay style for a portion of the app.
TextBox
A rectangle enclosing a run of text.
TextDecoration
A linear decoration to draw near the text.
TextEditingValue
The current text, selection, and composing state for editing a run of text.
TextHeightBehavior
Defines how to apply TextStyle.height over and under text.
TextInputConfiguration
Controls the visual appearance of the text input control.
TextInputConfigurationBuilder
TextInputConfigurationBuilder collects a TextInputConfiguration’s values, as Dart’s constructor takes them, and fills in the ones left out when it builds.
TextInputType
The type of information for which to optimize the text input control.
TextPosition
A position in a string of text.
TextRange
A range of characters in a string of text.
TextSelection
A range of text that represents a selection.
TextStyle
An opaque object that determines the size, position, and rendering of text.
Typeface
Typeface is one face the platform matched: a font file, the face’s index in it, and how the platform names and styles that face.
Vector3
A three-dimensional vector.
ViewConstraints
Immutable layout constraints for a view (dart:ui ViewConstraints).
ViewFocusEvent
An event for the engine to communicate view focus changes to the app. Flutter counterpart: ViewFocusEvent in dart:ui/platform_dispatcher.dart.
ViewId
Opaque id for one View (FlutterView.viewId).
ViewMetrics
Per-view geometry the host reports (_ViewConfiguration fields we use).
ViewPadding
Physical padding on each side of a view (dart:ui ViewPadding).
ViewRequest
What an app asks for when it asks for a view.
WindowConfig
How a window is made. Sizes and positions are logical, in the host’s screen space with the origin at the top left of the primary screen.

Enums§

AppExitResponse
The possible responses to a request to exit the application.
AppExitType
The type of application exit to perform when calling ServicesBinding::exit_application.
AppLifecycleState
States that an application can be in once it is running.
BlendMode
BlendMode controls how source pixels combine with destination pixels.
BlurStyle
BlurStyle controls where blurred coverage appears relative to a shape.
BoxHeightStyle
Defines various ways to vertically bound the boxes returned by Paragraph::get_boxes_for_range.
BoxWidthStyle
Defines various ways to horizontally bound the boxes returned by Paragraph::get_boxes_for_range.
Brightness
Describes the contrast of a theme or color palette.
Buffer
A platform with no host that composites: no buffer can exist, so Surface::present cannot be called, and Platform::compositor answers None.
Clip
Different ways to clip content.
ClipOp
ClipOp controls how a clip shape changes the current clip.
ColorFilter
A description of a color filter to apply when drawing a shape or compositing a layer with a particular Paint. A color filter is a function that takes two colors, and outputs one color. When applied during compositing, it is independently applied to each pixel of the layer being drawn before the entire layer is merged with the destination.
ColorSpace
The color space describes the colors that are available to an Image.
DropChange
The four phases of an external drag, as every toolkit has them.
FillRule
FillRule determines which regions of overlapping contours are filled.
FloatingCursorDragState
The state of a “floating cursor” drag on an iOS soft keyboard.
FontStyle
Whether to use the italic type variation of glyphs in the font.
HapticFeedbackType
The kind of haptic feedback to play.
ImageDecodeError
Why an image could not be read. Flutter reports these as an exception on the codec future.
ImageFilter
A filter operation to apply to a raster image.
ImageRepetition
How an animation repeats once it has played through.
KeyEventDeviceType
The source device for the key event.
KeyEventType
The type of a key event.
MatrixKind
MatrixKind classifies the behavior relevant to two-dimensional rendering.
PaintStyle
PaintStyle selects filled geometry or a stroked outline.
PlaceholderAlignment
Where to vertically align the placeholder relative to the surrounding text.
PointerChange
How the pointer has changed since the last report.
PointerDeviceKind
The kind of pointer device.
PointerSignalKind
The kind of pointer signal event.
PopupMenuEntry
One line of a popup menu the host shows with its own menu system.
RawWindowHandle
A window handle for a particular windowing system.
RestorationData
One value in the restoration data, of the kinds StandardMessageCodec can carry.
SmartDashesType
Indicates how to handle the intelligent replacement of dashes in text input.
SmartQuotesType
Indicates how to handle the intelligent replacement of quotes in text input.
SystemContextMenuItem
A button to show in the system-rendered context menu.
SystemMouseCursorKind
A system cursor kind (SystemMouseCursor.kind). The host maps each to its native cursor and shows the basic arrow for one it lacks; None hides the cursor.
TargetPlatform
The platform that user interaction should adapt to target.
TextAffinity
A way to disambiguate a TextPosition when its offset could match two different locations in the rendered string.
TextAlign
Whether and how to align text horizontally.
TextBaseline
A horizontal line used for aligning text.
TextCapitalization
Configures how the platform keyboard will select an uppercase or lowercase keyboard.
TextDecorationStyle
The style in which to draw a text decoration
TextDirection
A direction in which text flows.
TextInputAction
An action the user has requested the text input control to perform.
TextLeadingDistribution
How the leading of the text is distributed over and under the text.
ViewError
Why a request for a view got no view.
ViewFocusDirection
Represents the direction in which focus transitioned across views.
ViewFocusState
Represents the focus state of a given view.
WindowBackground
What the window shows behind the app’s painting. Anything but Solid lets what is behind the window show where the app paints nothing.
WindowLevel

Constants§

K_TEXT_HEIGHT_NONE
A TextStyle.height value that indicates the text span should take the height defined by the font, which may not be exactly the height of fontSize.

Traits§

AppExit
The application quitting itself: the System.exitApplication message of Flutter’s SystemChannels.platform, for a required exit. A cancelable exit never reaches the host: the framework asks its own listeners first (ServicesBinding::exit_application), and quits here once they agree.
CanvasText
Paragraph drawing on a Canvas (Dart’s Canvas.drawParagraph).
Clipboard
The system clipboard: Flutter’s Clipboard over the platform channel. Every call answers later, as Flutter’s does: a host may have to ask its user, or another process, first.
Compositor
The host’s compositor, as an app reaches it.
Dispatcher
The host’s threads as any thread reaches them: the two things the framework asks of them. gpui’s PlatformDispatcher. Flutter’s embedder API has the first as post_task_callback, with its target time, and keeps the second — the engine’s own worker threads — to itself.
EmbedderClient
Complete frames and typed view lifecycle notifications.
FileOpening
The files the system asks the app to open: documents opened from the system’s file browser, or dropped on the app’s icon, at launch or while it runs. Flutter’s macOS embedder hands them to its plugins (FlutterAppLifecycleDelegate.handleOpenURLs:), outside the framework.
FontManager
FontManager is the platform’s font lookup, in the shape of Skia’s SkFontMgr.
FontSource
FontSource locates fonts that are not already registered.
Haptics
Flutter’s HapticFeedback.
HostWindow
The window around a view the host puts on screen in a window the app may manage.
ImageCodec
One encoded image, opened and ready to give up its frames. Flutter dart:ui Codec.
MouseCursor
Flutter’s mouse cursor channel.
Platform
The long-lived host object held by the application.
PopupMenus
A native pop-up menu shown at the pointer, answered with the index chosen.
Restoration
Flutter’s restoration channel: state kept across relaunches.
Screens
The screens the app’s views are on: what drawing on each needs, as Flutter’s PlatformDispatcher.displays lists them, and where each is, for an app that places a window against something on them, such as an edge or its own icon, which Flutter’s Display has no place for. Positions are in the coordinates of HostWindow::frame: logical points from the top-left corner of the main screen, y growing down.
Surface
One surface. Every method may be called from any thread.
SystemChrome
Flutter’s SystemChrome: the system UI around the app.
SystemContextMenu
Flutter’s SystemContextMenu: the system’s own menu over a text selection.
TextInputHost
The host side of Flutter’s text input connection for one view.
TextServices
The text services a selection toolbar offers: Flutter’s LookUp, SearchWeb and Share platform-channel calls.
View
A stable handle to one host-provided view.
VsyncObserver
What a VsyncWaiter calls at the refresh it was asked for.
VsyncWaiter
Flutter’s VsyncWaiter, for any screen.

Functions§

clamp_double
Same as f64::clamp but maps NaN to max.
compose
Composes a matrix from translation, rotation and scale.
decompose
Decomposes matrix into its translation, rotation and scale components.
default_font_families
Flutter txt::GetDefaultFontFamilies() of the engine built for os, from that OS’s file (txt/platform_mac.mm, platform_linux.cc, …): the families text is drawn in when its style names none, first match first.
flattened_ops
The picture’s operations in replay order with every embedded list’s following its embedding op, for a test or a diagnostic that asks what a scene draws regardless of how its layers nested it.
lerp_double
Linearly interpolate between two numbers, a and b, by an extrapolation factor t.
lerp_int
Linearly interpolate between two integers.
rrect_radii_elliptical
Per-corner elliptical radii in valo’s order (clockwise from top-left).
rsuperellipse_radii_elliptical
Per-corner elliptical radii in valo’s order (clockwise from top-left).
set_default_font_manager
Flutter skia::textlayout::FontCollection::setDefaultFontManager: register the faces of families, the platform’s default families, as the collection’s fallback chain, then keep source for later lookups.
transform3
Transforms a point as a 3-vector, with no perspective division.

Type Aliases§

Canvas
Flutter Canvas — valo records into a display list.
ClipboardHasStringsFuture
Whether the clipboard holds text, on its way. Flutter’s Future<bool>.
ClipboardSetTextFuture
The clipboard’s text being stored. Flutter’s Future<void> from Clipboard.setData.
ClipboardTextFuture
The clipboard’s text on its way. Flutter’s Future<ClipboardData?>.
EngineLayer
Flutter EngineLayer — the display list a layer’s subtree recorded when it was last added to a scene, which SceneBuilder::add_retained embeds again while nothing in it changed. The engine keeps a node of its layer tree; valo keeps a nested list.
ImageCodecFuture
A codec being opened. Flutter’s Future<ui.Codec>.
ImageFrameFuture
A frame being decoded. Flutter’s Future<ui.FrameInfo>.
OpenFilesHandler
A handler for the files the system asks the app to open.
Picture
Flutter Picture — a finished display list, what crate::View::present takes (Flutter FlutterView.render takes a Scene).
PlatformRef
PopupMenuFuture
A popup menu on screen: the index of the entry chosen, once it closes. Flutter’s Future<int?> from a platform call.
RestorationMap
Flutter’s Map<Object?, Object?> of restoration data: insertion-ordered, keyed by value.
ViewRef
WindowRef