Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
embedder.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  FlutterSemanticsFlags
 
struct  FlutterTransformation
 
struct  FlutterOpenGLTexture
 
struct  FlutterOpenGLFramebuffer
 
struct  FlutterOpenGLSurface
 
struct  FlutterSize
 A structure to represent the width and height. More...
 
struct  FlutterUIntSize
 
struct  FlutterRect
 A structure to represent a rectangle. More...
 
struct  FlutterPoint
 A structure to represent a 2D point. More...
 
struct  FlutterRoundedRect
 A structure to represent a rounded rectangle. More...
 
struct  FlutterDamage
 A structure to represent a damage region. More...
 
struct  FlutterFrameInfo
 
struct  FlutterPresentInfo
 
struct  FlutterOpenGLRendererConfig
 
struct  FlutterMetalExternalTexture
 
struct  FlutterMetalTexture
 
struct  FlutterMetalRendererConfig
 
struct  FlutterVulkanImage
 
struct  FlutterVulkanRendererConfig
 
struct  FlutterSoftwareRendererConfig
 
struct  FlutterRendererConfig
 
struct  FlutterWindowMetricsEvent
 
struct  FlutterAddViewResult
 
struct  FlutterAddViewInfo
 
struct  FlutterRemoveViewResult
 
struct  FlutterRemoveViewInfo
 
struct  FlutterViewFocusEvent
 
struct  FlutterViewFocusChangeRequest
 
struct  FlutterPointerEvent
 
struct  FlutterKeyEvent
 
struct  FlutterPlatformMessage
 
struct  FlutterSpellOutStringAttribute
 
struct  FlutterLocaleStringAttribute
 
struct  FlutterStringAttribute
 
struct  FlutterSemanticsNode
 
struct  FlutterSemanticsNode2
 
struct  FlutterSemanticsCustomAction
 
struct  FlutterSemanticsCustomAction2
 
struct  FlutterSemanticsUpdate
 
struct  FlutterSemanticsUpdate2
 A batch of updates to semantics nodes and custom actions. More...
 
struct  FlutterChannelUpdate
 An update to whether a message channel has a listener set or not. More...
 
struct  FlutterTask
 
struct  FlutterTaskRunnerDescription
 
struct  FlutterCustomTaskRunners
 
struct  FlutterOpenGLBackingStore
 
struct  FlutterSoftwareBackingStore
 
struct  FlutterSoftwareBackingStore2
 
struct  FlutterMetalBackingStore
 
struct  FlutterVulkanBackingStore
 
struct  FlutterPlatformViewMutation
 
struct  FlutterPlatformView
 
struct  FlutterBackingStore
 
struct  FlutterBackingStoreConfig
 
struct  FlutterRegion
 A region represented by a collection of non-overlapping rectangles. More...
 
struct  FlutterBackingStorePresentInfo
 
struct  FlutterLayer
 
struct  FlutterPresentViewInfo
 
struct  FlutterCompositor
 
struct  FlutterLocale
 
struct  FlutterEngineDisplay
 
struct  FlutterEngineDartBuffer
 
struct  FlutterEngineDartObject
 
struct  FlutterEngineAOTDataSource
 
struct  FlutterProjectArgs
 
struct  FlutterSendSemanticsActionInfo
 
struct  FlutterEngineProcTable
 Function-pointer-based versions of the APIs above. More...
 

Macros

#define FLUTTER_EXPORT
 
#define FLUTTER_API_SYMBOL(symbol)   symbol
 
#define FLUTTER_ENGINE_VERSION   1
 

Typedefs

typedef struct _FlutterEngineFLUTTER_API_SYMBOL(FlutterEngine)
 
typedef int64_t FlutterViewId
 
typedef void(* VoidCallback) (void *)
 
typedef bool(* FlutterOpenGLSurfaceCallback) (void *, bool *)
 
typedef bool(* BoolCallback) (void *)
 
typedef FlutterTransformation(* TransformationCallback) (void *)
 
typedef uint32_t(* UIntCallback) (void *)
 
typedef bool(* SoftwareSurfacePresentCallback) (void *, const void *, size_t, size_t)
 
typedef void *(* ProcResolver) (void *, const char *)
 
typedef bool(* TextureFrameCallback) (void *, int64_t, size_t, size_t, FlutterOpenGLTexture *)
 
typedef void(* VsyncCallback) (void *, intptr_t)
 
typedef void(* OnPreEngineRestartCallback) (void *)
 
typedef uint32_t(* UIntFrameInfoCallback) (void *, const FlutterFrameInfo *)
 Callback for when a frame buffer object is requested.
 
typedef void(* FlutterFrameBufferWithDamageCallback) (void *, const intptr_t, FlutterDamage *)
 
typedef bool(* BoolPresentInfoCallback) (void *, const FlutterPresentInfo *)
 Callback for when a surface is presented.
 
typedef const void * FlutterMetalDeviceHandle
 Alias for id<MTLDevice>.
 
typedef const void * FlutterMetalCommandQueueHandle
 Alias for id<MTLCommandQueue>.
 
typedef const void * FlutterMetalTextureHandle
 Alias for id<MTLTexture>.
 
typedef bool(* FlutterMetalTextureFrameCallback) (void *, int64_t, size_t, size_t, FlutterMetalExternalTexture *)
 
typedef FlutterMetalTexture(* FlutterMetalTextureCallback) (void *, const FlutterFrameInfo *)
 Callback for when a metal texture is requested.
 
typedef bool(* FlutterMetalPresentCallback) (void *, const FlutterMetalTexture *)
 
typedef void * FlutterVulkanInstanceHandle
 Alias for VkInstance.
 
typedef void * FlutterVulkanPhysicalDeviceHandle
 Alias for VkPhysicalDevice.
 
typedef void * FlutterVulkanDeviceHandle
 Alias for VkDevice.
 
typedef void * FlutterVulkanQueueHandle
 Alias for VkQueue.
 
typedef uint64_t FlutterVulkanImageHandle
 Alias for VkImage.
 
typedef void *(* FlutterVulkanInstanceProcAddressCallback) (void *, FlutterVulkanInstanceHandle, const char *)
 
typedef FlutterVulkanImage(* FlutterVulkanImageCallback) (void *, const FlutterFrameInfo *)
 Callback for when a VkImage is requested.
 
typedef bool(* FlutterVulkanPresentCallback) (void *, const FlutterVulkanImage *)
 
typedef uint64_t FlutterEngineDisplayId
 
typedef void(* FlutterAddViewCallback) (const FlutterAddViewResult *result)
 
typedef void(* FlutterRemoveViewCallback) (const FlutterRemoveViewResult *)
 
typedef void(* FlutterKeyEventCallback) (bool, void *)
 
typedef struct _FlutterPlatformMessageResponseHandle FlutterPlatformMessageResponseHandle
 
typedef void(* FlutterPlatformMessageCallback) (const FlutterPlatformMessage *, void *)
 
typedef void(* FlutterDataCallback) (const uint8_t *, size_t, void *)
 
typedef int64_t FlutterPlatformViewIdentifier
 
typedef void(* FlutterUpdateSemanticsNodeCallback) (const FlutterSemanticsNode *, void *)
 
typedef void(* FlutterUpdateSemanticsCustomActionCallback) (const FlutterSemanticsCustomAction *, void *)
 
typedef void(* FlutterUpdateSemanticsCallback) (const FlutterSemanticsUpdate *, void *)
 
typedef void(* FlutterUpdateSemanticsCallback2) (const FlutterSemanticsUpdate2 *, void *)
 
typedef void(* FlutterChannelUpdateCallback) (const FlutterChannelUpdate *, void *)
 
typedef void(* FlutterViewFocusChangeRequestCallback) (const FlutterViewFocusChangeRequest *, void *)
 
typedef struct _FlutterTaskRunner * FlutterTaskRunner
 
typedef void(* FlutterTaskRunnerPostTaskCallback) (FlutterTask, uint64_t, void *)
 
typedef bool(* FlutterBackingStoreCreateCallback) (const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)
 
typedef bool(* FlutterBackingStoreCollectCallback) (const FlutterBackingStore *renderer, void *user_data)
 
typedef bool(* FlutterLayersPresentCallback) (const FlutterLayer **layers, size_t layers_count, void *user_data)
 
typedef bool(* FlutterPresentViewCallback) (const FlutterPresentViewInfo *)
 
typedef const FlutterLocale *(* FlutterComputePlatformResolvedLocaleCallback) (const FlutterLocale **, size_t)
 
typedef int64_t FlutterEngineDartPort
 
typedef void(* FlutterNativeThreadCallback) (FlutterNativeThreadType type, void *user_data)
 
typedef void(* FlutterLogMessageCallback) (const char *, const char *, void *)
 
typedef struct _FlutterEngineAOTDataFlutterEngineAOTData
 
typedef FlutterEngineResult(* FlutterEngineCreateAOTDataFnPtr) (const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
 
typedef FlutterEngineResult(* FlutterEngineCollectAOTDataFnPtr) (FlutterEngineAOTData data)
 
typedef FlutterEngineResult(* FlutterEngineRunFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
 
typedef FlutterEngineResult(* FlutterEngineShutdownFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef FlutterEngineResult(* FlutterEngineInitializeFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
 
typedef FlutterEngineResult(* FlutterEngineDeinitializeFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef FlutterEngineResult(* FlutterEngineRunInitializedFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef FlutterEngineResult(* FlutterEngineSendWindowMetricsEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
 
typedef FlutterEngineResult(* FlutterEngineSendPointerEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
 
typedef FlutterEngineResult(* FlutterEngineSendKeyEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
 
typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
 
typedef FlutterEngineResult(* FlutterEnginePlatformMessageCreateResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
 
typedef FlutterEngineResult(* FlutterEnginePlatformMessageReleaseResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
 
typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageResponseFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
 
typedef FlutterEngineResult(* FlutterEngineRegisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 
typedef FlutterEngineResult(* FlutterEngineUnregisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 
typedef FlutterEngineResult(* FlutterEngineMarkExternalTextureFrameAvailableFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 
typedef FlutterEngineResult(* FlutterEngineUpdateSemanticsEnabledFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
 
typedef FlutterEngineResult(* FlutterEngineUpdateAccessibilityFeaturesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
 
typedef FlutterEngineResult(* FlutterEngineDispatchSemanticsActionFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
 
typedef FlutterEngineResult(* FlutterEngineSendSemanticsActionFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterSendSemanticsActionInfo *info)
 
typedef FlutterEngineResult(* FlutterEngineOnVsyncFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)
 
typedef FlutterEngineResult(* FlutterEngineReloadSystemFontsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef void(* FlutterEngineTraceEventDurationBeginFnPtr) (const char *name)
 
typedef void(* FlutterEngineTraceEventDurationEndFnPtr) (const char *name)
 
typedef void(* FlutterEngineTraceEventInstantFnPtr) (const char *name)
 
typedef FlutterEngineResult(* FlutterEnginePostRenderThreadTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data)
 
typedef uint64_t(* FlutterEngineGetCurrentTimeFnPtr) ()
 
typedef FlutterEngineResult(* FlutterEngineRunTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
 
typedef FlutterEngineResult(* FlutterEngineUpdateLocalesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
 
typedef bool(* FlutterEngineRunsAOTCompiledDartCodeFnPtr) (void)
 
typedef FlutterEngineResult(* FlutterEnginePostDartObjectFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
 
typedef FlutterEngineResult(* FlutterEngineNotifyLowMemoryWarningFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef FlutterEngineResult(* FlutterEnginePostCallbackOnAllNativeThreadsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
 
typedef FlutterEngineResult(* FlutterEngineNotifyDisplayUpdateFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count)
 
typedef FlutterEngineResult(* FlutterEngineScheduleFrameFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 
typedef FlutterEngineResult(* FlutterEngineSetNextFrameCallbackFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data)
 
typedef FlutterEngineResult(* FlutterEngineAddViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info)
 
typedef FlutterEngineResult(* FlutterEngineRemoveViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info)
 
typedef FlutterEngineResult(* FlutterEngineSendViewFocusEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterViewFocusEvent *event)
 

Enumerations

enum  FlutterEngineResult {
  kSuccess = 0 ,
  kInvalidLibraryVersion ,
  kInvalidArguments ,
  kInternalInconsistency
}
 
enum  FlutterRendererType {
  kOpenGL ,
  kSoftware ,
  kMetal ,
  kVulkan
}
 
enum  FlutterAccessibilityFeature {
  kFlutterAccessibilityFeatureAccessibleNavigation = 1 << 0 ,
  kFlutterAccessibilityFeatureInvertColors = 1 << 1 ,
  kFlutterAccessibilityFeatureDisableAnimations = 1 << 2 ,
  kFlutterAccessibilityFeatureBoldText = 1 << 3 ,
  kFlutterAccessibilityFeatureReduceMotion = 1 << 4 ,
  kFlutterAccessibilityFeatureHighContrast = 1 << 5 ,
  kFlutterAccessibilityFeatureOnOffSwitchLabels = 1 << 6 ,
  kFlutterAccessibilityFeatureNoAnnounce = 1 << 7 ,
  kFlutterAccessibilityFeatureNoAutoPlayAnimatedImages = 1 << 8 ,
  kFlutterAccessibilityFeatureNoAutoPlayVideos = 1 << 9 ,
  kFlutterAccessibilityFeatureDeterministicCursor = 1 << 10
}
 
enum  FlutterSemanticsAction {
  kFlutterSemanticsActionTap = 1 << 0 ,
  kFlutterSemanticsActionLongPress = 1 << 1 ,
  kFlutterSemanticsActionScrollLeft = 1 << 2 ,
  kFlutterSemanticsActionScrollRight = 1 << 3 ,
  kFlutterSemanticsActionScrollUp = 1 << 4 ,
  kFlutterSemanticsActionScrollDown = 1 << 5 ,
  kFlutterSemanticsActionIncrease = 1 << 6 ,
  kFlutterSemanticsActionDecrease = 1 << 7 ,
  kFlutterSemanticsActionShowOnScreen = 1 << 8 ,
  kFlutterSemanticsActionMoveCursorForwardByCharacter = 1 << 9 ,
  kFlutterSemanticsActionMoveCursorBackwardByCharacter = 1 << 10 ,
  kFlutterSemanticsActionSetSelection = 1 << 11 ,
  kFlutterSemanticsActionCopy = 1 << 12 ,
  kFlutterSemanticsActionCut = 1 << 13 ,
  kFlutterSemanticsActionPaste = 1 << 14 ,
  kFlutterSemanticsActionDidGainAccessibilityFocus = 1 << 15 ,
  kFlutterSemanticsActionDidLoseAccessibilityFocus = 1 << 16 ,
  kFlutterSemanticsActionCustomAction = 1 << 17 ,
  kFlutterSemanticsActionDismiss = 1 << 18 ,
  kFlutterSemanticsActionMoveCursorForwardByWord = 1 << 19 ,
  kFlutterSemanticsActionMoveCursorBackwardByWord = 1 << 20 ,
  kFlutterSemanticsActionSetText = 1 << 21 ,
  kFlutterSemanticsActionFocus = 1 << 22 ,
  kFlutterSemanticsActionScrollToOffset = 1 << 23 ,
  kFlutterSemanticsActionExpand = 1 << 24 ,
  kFlutterSemanticsActionCollapse = 1 << 25
}
 
enum  FlutterSemanticsFlag {
  kFlutterSemanticsFlagHasCheckedState = 1 << 0 ,
  kFlutterSemanticsFlagIsChecked = 1 << 1 ,
  kFlutterSemanticsFlagIsSelected = 1 << 2 ,
  kFlutterSemanticsFlagIsButton = 1 << 3 ,
  kFlutterSemanticsFlagIsTextField = 1 << 4 ,
  kFlutterSemanticsFlagIsFocused = 1 << 5 ,
  kFlutterSemanticsFlagHasEnabledState = 1 << 6 ,
  kFlutterSemanticsFlagIsEnabled = 1 << 7 ,
  kFlutterSemanticsFlagIsInMutuallyExclusiveGroup = 1 << 8 ,
  kFlutterSemanticsFlagIsHeader = 1 << 9 ,
  kFlutterSemanticsFlagIsObscured = 1 << 10 ,
  kFlutterSemanticsFlagScopesRoute = 1 << 11 ,
  kFlutterSemanticsFlagNamesRoute = 1 << 12 ,
  kFlutterSemanticsFlagIsHidden = 1 << 13 ,
  kFlutterSemanticsFlagIsImage = 1 << 14 ,
  kFlutterSemanticsFlagIsLiveRegion = 1 << 15 ,
  kFlutterSemanticsFlagHasToggledState = 1 << 16 ,
  kFlutterSemanticsFlagIsToggled = 1 << 17 ,
  kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18 ,
  kFlutterSemanticsFlagIsMultiline = 1 << 19 ,
  kFlutterSemanticsFlagIsReadOnly = 1 << 20 ,
  kFlutterSemanticsFlagIsFocusable = 1 << 21 ,
  kFlutterSemanticsFlagIsLink = 1 << 22 ,
  kFlutterSemanticsFlagIsSlider = 1 << 23 ,
  kFlutterSemanticsFlagIsKeyboardKey = 1 << 24 ,
  kFlutterSemanticsFlagIsCheckStateMixed = 1 << 25 ,
  kFlutterSemanticsFlagHasExpandedState = 1 << 26 ,
  kFlutterSemanticsFlagIsExpanded = 1 << 27 ,
  kFlutterSemanticsFlagHasSelectedState = 1 << 28 ,
  kFlutterSemanticsFlagHasRequiredState = 1 << 29 ,
  kFlutterSemanticsFlagIsRequired = 1 << 30
}
 
enum  FlutterTristate {
  kFlutterTristateNone ,
  kFlutterTristateTrue ,
  kFlutterTristateFalse
}
 
enum  FlutterCheckState {
  kFlutterCheckStateNone ,
  kFlutterCheckStateTrue ,
  kFlutterCheckStateFalse ,
  kFlutterCheckStateMixed
}
 
enum  FlutterTextDirection {
  kFlutterTextDirectionUnknown = 0 ,
  kFlutterTextDirectionRTL = 1 ,
  kFlutterTextDirectionLTR = 2
}
 
enum  FlutterThreadPriority {
  kBackground = 0 ,
  kNormal = 1 ,
  kDisplay = 2 ,
  kRaster = 3
}
 Valid values for priority of Thread. More...
 
enum  FlutterOpenGLTargetType {
  kFlutterOpenGLTargetTypeTexture ,
  kFlutterOpenGLTargetTypeFramebuffer ,
  kFlutterOpenGLTargetTypeSurface
}
 
enum  FlutterSoftwarePixelFormat {
  kFlutterSoftwarePixelFormatGray8 ,
  kFlutterSoftwarePixelFormatRGB565 ,
  kFlutterSoftwarePixelFormatRGBA4444 ,
  kFlutterSoftwarePixelFormatRGBA8888 ,
  kFlutterSoftwarePixelFormatRGBX8888 ,
  kFlutterSoftwarePixelFormatBGRA8888 ,
  kFlutterSoftwarePixelFormatNative32
}
 
enum  FlutterMetalExternalTexturePixelFormat {
  kYUVA ,
  kRGBA
}
 Pixel format for the external texture. More...
 
enum  FlutterMetalExternalTextureYUVColorSpace {
  kBT601FullRange ,
  kBT601LimitedRange
}
 YUV color space for the YUV external texture. More...
 
enum  FlutterViewFocusDirection {
  kUndefined ,
  kForward ,
  kBackward
}
 
enum  FlutterViewFocusState {
  kUnfocused ,
  kFocused
}
 Represents the focus state of a given [FlutterView]. More...
 
enum  FlutterPointerPhase {
  kCancel ,
  kUp ,
  kDown ,
  kMove ,
  kAdd ,
  kRemove ,
  kHover ,
  kPanZoomStart ,
  kPanZoomUpdate ,
  kPanZoomEnd
}
 The phase of the pointer event. More...
 
enum  FlutterPointerDeviceKind {
  kFlutterPointerDeviceKindMouse = 1 ,
  kFlutterPointerDeviceKindTouch ,
  kFlutterPointerDeviceKindStylus ,
  kFlutterPointerDeviceKindTrackpad
}
 The device type that created a pointer event. More...
 
enum  FlutterPointerMouseButtons {
  kFlutterPointerButtonMousePrimary = 1 << 0 ,
  kFlutterPointerButtonMouseSecondary = 1 << 1 ,
  kFlutterPointerButtonMouseMiddle = 1 << 2 ,
  kFlutterPointerButtonMouseBack = 1 << 3 ,
  kFlutterPointerButtonMouseForward = 1 << 4
}
 
enum  FlutterPointerSignalKind {
  kFlutterPointerSignalKindNone ,
  kFlutterPointerSignalKindScroll ,
  kFlutterPointerSignalKindScrollInertiaCancel ,
  kFlutterPointerSignalKindScale
}
 The type of a pointer signal. More...
 
enum  FlutterKeyEventType {
  kFlutterKeyEventTypeUp = 1 ,
  kFlutterKeyEventTypeDown ,
  kFlutterKeyEventTypeRepeat
}
 
enum  FlutterKeyEventDeviceType {
  kFlutterKeyEventDeviceTypeKeyboard = 1 ,
  kFlutterKeyEventDeviceTypeDirectionalPad ,
  kFlutterKeyEventDeviceTypeGamepad ,
  kFlutterKeyEventDeviceTypeJoystick ,
  kFlutterKeyEventDeviceTypeHdmi
}
 
enum  FlutterStringAttributeType {
  kSpellOut ,
  kLocale
}
 
enum  FlutterPlatformViewMutationType {
  kFlutterPlatformViewMutationTypeOpacity ,
  kFlutterPlatformViewMutationTypeClipRect ,
  kFlutterPlatformViewMutationTypeClipRoundedRect ,
  kFlutterPlatformViewMutationTypeTransformation
}
 
enum  FlutterBackingStoreType {
  kFlutterBackingStoreTypeOpenGL ,
  kFlutterBackingStoreTypeSoftware ,
  kFlutterBackingStoreTypeMetal ,
  kFlutterBackingStoreTypeVulkan ,
  kFlutterBackingStoreTypeSoftware2
}
 
enum  FlutterLayerContentType {
  kFlutterLayerContentTypeBackingStore ,
  kFlutterLayerContentTypePlatformView
}
 
enum  FlutterEngineDisplaysUpdateType {
  kFlutterEngineDisplaysUpdateTypeStartup ,
  kFlutterEngineDisplaysUpdateTypeCount
}
 
enum  FlutterEngineDartObjectType {
  kFlutterEngineDartObjectTypeNull ,
  kFlutterEngineDartObjectTypeBool ,
  kFlutterEngineDartObjectTypeInt32 ,
  kFlutterEngineDartObjectTypeInt64 ,
  kFlutterEngineDartObjectTypeDouble ,
  kFlutterEngineDartObjectTypeString ,
  kFlutterEngineDartObjectTypeBuffer
}
 
enum  FlutterNativeThreadType {
  kFlutterNativeThreadTypePlatform ,
  kFlutterNativeThreadTypeRender ,
  kFlutterNativeThreadTypeUI ,
  kFlutterNativeThreadTypeWorker
}
 
enum  FlutterEngineAOTDataSourceType { kFlutterEngineAOTDataSourceTypeElfPath }
 AOT data source type. More...
 

Functions

FLUTTER_EXPORT FlutterEngineResult FlutterEngineCreateAOTData (const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
 Creates the necessary data structures to launch a Flutter Dart application in AOT mode. The data may only be collected after all FlutterEngine instances launched using this data have been terminated.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineCollectAOTData (FlutterEngineAOTData data)
 Collects the AOT data.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRun (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
 Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method for the pair of calls to FlutterEngineInitialize and FlutterEngineRunInitialized.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineShutdown (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embedder API after this point. Making additional calls with this handle is undefined behavior.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineInitialize (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
 Initialize a Flutter engine instance. This does not run the Flutter application code till the FlutterEngineRunInitialized call is made. Besides Flutter application code, no tasks are scheduled on embedder managed task runners either. This allows embedders providing custom task runners to the Flutter engine to obtain a handle to the Flutter engine before the engine can post tasks on these task runners.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDeinitialize (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Stops running the Flutter engine instance. After this call, the embedder is also guaranteed that no more calls to post tasks onto custom task runners specified by the embedder are made. The Flutter engine handle still needs to be collected via a call to FlutterEngineShutdown.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRunInitialized (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize. An initialized instance can only be run once. During and after this call, custom task runners supplied by the embedder are expected to start servicing tasks.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineAddView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info)
 Adds a view.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRemoveView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info)
 Removes a view.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendViewFocusEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterViewFocusEvent *event)
 Notifies the engine that platform view focus state has changed.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendWindowMetricsEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPointerEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendKeyEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
 Sends a key event to the engine. The framework will decide whether to handle this event in a synchronous fashion, although due to technical limitation, the result is always reported asynchronously. The callback is guaranteed to be called exactly once.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessage (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
 
FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageCreateResponseHandle (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
 Creates a platform message response handle that allows the embedder to set a native callback for a response to a message. This handle may be set on the response_handle field of any FlutterPlatformMessage sent to the engine.
 
FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
 Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessageResponse (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
 Send a response from the native side to a platform message from the Dart Flutter application.
 
FLUTTER_EXPORT FlutterEngineResult __FlutterEngineFlushPendingTasksNow ()
 This API is only meant to be used by platforms that need to flush tasks on a message loop not controlled by the Flutter engine.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRegisterExternalTexture (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 Register an external texture with a unique (per engine) identifier. Only rendering backends that support external textures accept external texture registrations. After the external texture is registered, the application can mark that a frame is available by calling FlutterEngineMarkExternalTextureFrameAvailable.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUnregisterExternalTexture (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 Unregister a previous texture registration.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
 Mark that a new texture frame is available for a given texture identifier.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateSemanticsEnabled (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
 Enable or disable accessibility semantics.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
 Sets additional accessibility features.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDispatchSemanticsAction (FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t node_id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
 Dispatch a semantics action to the specified semantics node in the implicit view.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendSemanticsAction (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterSendSemanticsActionInfo *info)
 Dispatch a semantics action to the specified semantics node within a specific view.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineOnVsync (FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)
 Notify the engine that a vsync event occurred. A baton passed to the platform via the vsync callback must be returned. This call must be made on the thread on which the call to FlutterEngineRun was made.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineReloadSystemFonts (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Reloads the system fonts in engine.
 
FLUTTER_EXPORT void FlutterEngineTraceEventDurationBegin (const char *name)
 A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailable or disabled, this has no effect. Must be balanced with an duration end event (via FlutterEngineTraceEventDurationEnd) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
 
FLUTTER_EXPORT void FlutterEngineTraceEventDurationEnd (const char *name)
 A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable or disabled, this has no effect. This call must be preceded by a trace duration begin call (via FlutterEngineTraceEventDurationBegin) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
 
FLUTTER_EXPORT void FlutterEngineTraceEventInstant (const char *name)
 A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavailable or disabled, this has no effect. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostRenderThreadTask (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data)
 Posts a task onto the Flutter render thread. Typically, this may be called from any thread as long as a FlutterEngineShutdown on the specific engine has not already been initiated.
 
FLUTTER_EXPORT uint64_t FlutterEngineGetCurrentTime ()
 Get the current time in nanoseconds from the clock used by the flutter engine. This is the system monotonic clock.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRunTask (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
 Inform the engine to run the specified task. This task has been given to the embedder via the FlutterTaskRunnerDescription.post_task_callback. This call must only be made at the target time specified in that callback. Running the task before that time is undefined behavior.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateLocales (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
 Notify a running engine instance that the locale has been updated. The preferred locale must be the first item in the list of locales supplied. The other entries will be used as a fallback.
 
FLUTTER_EXPORT bool FlutterEngineRunsAOTCompiledDartCode (void)
 Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading restrictions.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostDartObject (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
 Posts a Dart object to specified send port. The corresponding receive port for send port can be in any isolate running in the VM. This isolate can also be the root isolate for an unrelated engine. The engine parameter is necessary only to ensure the call is not made when no engine (and hence no VM) is running.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineNotifyLowMemoryWarning (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Posts a low memory notification to a running engine instance. The engine will do its best to release non-critical resources in response. It is not guaranteed that the resource would have been collected by the time this call returns however. The notification is posted to engine subsystems that may be operating on other threads.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostCallbackOnAllNativeThreads (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
 Schedule a callback to be run on all engine managed threads. The engine will attempt to service this callback the next time the message loop for each managed thread is idle. Since the engine manages the entire lifecycle of multiple threads, there is no opportunity for the embedders to finely tune the priorities of threads directly, or, perform other thread specific configuration (for example, setting thread names for tracing). This callback gives embedders a chance to affect such tuning.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineNotifyDisplayUpdate (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count)
 Posts updates corresponding to display changes to a running engine instance.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineScheduleFrame (FLUTTER_API_SYMBOL(FlutterEngine) engine)
 Schedule a new frame to redraw the content.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSetNextFrameCallback (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data)
 Schedule a callback to be called after the next frame is drawn. This must be called from the platform thread. The callback is executed only once from the raster thread; embedders must re-thread if necessary. Performing blocking calls in this callback may introduce application jank.
 
FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses (FlutterEngineProcTable *table)
 Gets the table of engine function pointers.
 

Variables

FLUTTER_EXPORT const int32_t kFlutterSemanticsNodeIdBatchEnd
 
FLUTTER_EXPORT const int32_t kFlutterSemanticsCustomActionIdBatchEnd
 

Macro Definition Documentation

◆ FLUTTER_API_SYMBOL

#define FLUTTER_API_SYMBOL (   symbol)    symbol

Definition at line 67 of file embedder.h.

◆ FLUTTER_ENGINE_VERSION

#define FLUTTER_ENGINE_VERSION   1

Definition at line 70 of file embedder.h.

◆ FLUTTER_EXPORT

#define FLUTTER_EXPORT

Definition at line 57 of file embedder.h.

Typedef Documentation

◆ BoolCallback

typedef bool(* BoolCallback) (void *)

Definition at line 617 of file embedder.h.

◆ BoolPresentInfoCallback

typedef bool(* BoolPresentInfoCallback) (void *, const FlutterPresentInfo *)

Callback for when a surface is presented.

Definition at line 720 of file embedder.h.

◆ FLUTTER_API_SYMBOL

typedef struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine)

Definition at line 387 of file embedder.h.

◆ FlutterAddViewCallback

typedef void(* FlutterAddViewCallback) (const FlutterAddViewResult *result)

The callback invoked by the engine when the engine has attempted to add a view.

The |FlutterAddViewResult| is only guaranteed to be valid during this callback.

Definition at line 1119 of file embedder.h.

◆ FlutterBackingStoreCollectCallback

typedef bool(* FlutterBackingStoreCollectCallback) (const FlutterBackingStore *renderer, void *user_data)

Definition at line 2219 of file embedder.h.

◆ FlutterBackingStoreCreateCallback

typedef bool(* FlutterBackingStoreCreateCallback) (const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)

Definition at line 2214 of file embedder.h.

◆ FlutterChannelUpdateCallback

typedef void(* FlutterChannelUpdateCallback) (const FlutterChannelUpdate *, void *)

Definition at line 1876 of file embedder.h.

◆ FlutterComputePlatformResolvedLocaleCallback

typedef const FlutterLocale *(* FlutterComputePlatformResolvedLocaleCallback) (const FlutterLocale **, size_t)

Callback that returns the system locale.

Embedders that implement this callback should return the FlutterLocale from the supported_locales list that most closely matches the user/device's preferred locale.

This callback does not currently provide the user_data baton. https://github.com/flutter/flutter/issues/79826

Definition at line 2323 of file embedder.h.

◆ FlutterDataCallback

typedef void(* FlutterDataCallback) (const uint8_t *, size_t, void *)

Definition at line 1491 of file embedder.h.

◆ FlutterEngineAddViewFnPtr

typedef FlutterEngineResult(* FlutterEngineAddViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info)

Definition at line 3735 of file embedder.h.

◆ FlutterEngineAOTData

An opaque object that describes the AOT data that can be used to launch a FlutterEngine instance in AOT mode.

Definition at line 2492 of file embedder.h.

◆ FlutterEngineCollectAOTDataFnPtr

typedef FlutterEngineResult(* FlutterEngineCollectAOTDataFnPtr) (FlutterEngineAOTData data)

Definition at line 3616 of file embedder.h.

◆ FlutterEngineCreateAOTDataFnPtr

typedef FlutterEngineResult(* FlutterEngineCreateAOTDataFnPtr) (const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)

Definition at line 3613 of file embedder.h.

◆ FlutterEngineDartPort

typedef int64_t FlutterEngineDartPort

Definition at line 2366 of file embedder.h.

◆ FlutterEngineDeinitializeFnPtr

typedef FlutterEngineResult(* FlutterEngineDeinitializeFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3632 of file embedder.h.

◆ FlutterEngineDispatchSemanticsActionFnPtr

typedef FlutterEngineResult(* FlutterEngineDispatchSemanticsActionFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)

Definition at line 3682 of file embedder.h.

◆ FlutterEngineDisplayId

typedef uint64_t FlutterEngineDisplayId

Display refers to a graphics hardware system consisting of a framebuffer, typically a monitor or a screen. This ID is unique per display and is stable until the Flutter application restarts.

Definition at line 1050 of file embedder.h.

◆ FlutterEngineGetCurrentTimeFnPtr

typedef uint64_t(* FlutterEngineGetCurrentTimeFnPtr) ()

Definition at line 3705 of file embedder.h.

◆ FlutterEngineInitializeFnPtr

typedef FlutterEngineResult(* FlutterEngineInitializeFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)

Definition at line 3626 of file embedder.h.

◆ FlutterEngineMarkExternalTextureFrameAvailableFnPtr

typedef FlutterEngineResult( * FlutterEngineMarkExternalTextureFrameAvailableFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)

Definition at line 3672 of file embedder.h.

◆ FlutterEngineNotifyDisplayUpdateFnPtr

typedef FlutterEngineResult(* FlutterEngineNotifyDisplayUpdateFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count)

Definition at line 3724 of file embedder.h.

◆ FlutterEngineNotifyLowMemoryWarningFnPtr

typedef FlutterEngineResult(* FlutterEngineNotifyLowMemoryWarningFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3718 of file embedder.h.

◆ FlutterEngineOnVsyncFnPtr

typedef FlutterEngineResult(* FlutterEngineOnVsyncFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)

Definition at line 3691 of file embedder.h.

◆ FlutterEnginePlatformMessageCreateResponseHandleFnPtr

typedef FlutterEngineResult( * FlutterEnginePlatformMessageCreateResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)

Definition at line 3651 of file embedder.h.

◆ FlutterEnginePlatformMessageReleaseResponseHandleFnPtr

typedef FlutterEngineResult( * FlutterEnginePlatformMessageReleaseResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)

Definition at line 3657 of file embedder.h.

◆ FlutterEnginePostCallbackOnAllNativeThreadsFnPtr

typedef FlutterEngineResult(* FlutterEnginePostCallbackOnAllNativeThreadsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)

Definition at line 3720 of file embedder.h.

◆ FlutterEnginePostDartObjectFnPtr

typedef FlutterEngineResult(* FlutterEnginePostDartObjectFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)

Definition at line 3714 of file embedder.h.

◆ FlutterEnginePostRenderThreadTaskFnPtr

typedef FlutterEngineResult(* FlutterEnginePostRenderThreadTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data)

Definition at line 3701 of file embedder.h.

◆ FlutterEngineRegisterExternalTextureFnPtr

typedef FlutterEngineResult(* FlutterEngineRegisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)

Definition at line 3666 of file embedder.h.

◆ FlutterEngineReloadSystemFontsFnPtr

typedef FlutterEngineResult(* FlutterEngineReloadSystemFontsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3696 of file embedder.h.

◆ FlutterEngineRemoveViewFnPtr

typedef FlutterEngineResult(* FlutterEngineRemoveViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info)

Definition at line 3738 of file embedder.h.

◆ FlutterEngineRunFnPtr

typedef FlutterEngineResult(* FlutterEngineRunFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)

Definition at line 3618 of file embedder.h.

◆ FlutterEngineRunInitializedFnPtr

typedef FlutterEngineResult(* FlutterEngineRunInitializedFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3634 of file embedder.h.

◆ FlutterEngineRunsAOTCompiledDartCodeFnPtr

typedef bool(* FlutterEngineRunsAOTCompiledDartCodeFnPtr) (void)

Definition at line 3713 of file embedder.h.

◆ FlutterEngineRunTaskFnPtr

typedef FlutterEngineResult(* FlutterEngineRunTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)

Definition at line 3706 of file embedder.h.

◆ FlutterEngineScheduleFrameFnPtr

typedef FlutterEngineResult(* FlutterEngineScheduleFrameFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3729 of file embedder.h.

◆ FlutterEngineSendKeyEventFnPtr

typedef FlutterEngineResult(* FlutterEngineSendKeyEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)

Definition at line 3643 of file embedder.h.

◆ FlutterEngineSendPlatformMessageFnPtr

typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)

Definition at line 3648 of file embedder.h.

◆ FlutterEngineSendPlatformMessageResponseFnPtr

typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageResponseFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)

Definition at line 3661 of file embedder.h.

◆ FlutterEngineSendPointerEventFnPtr

typedef FlutterEngineResult(* FlutterEngineSendPointerEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)

Definition at line 3639 of file embedder.h.

◆ FlutterEngineSendSemanticsActionFnPtr

typedef FlutterEngineResult(* FlutterEngineSendSemanticsActionFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterSendSemanticsActionInfo *info)

Definition at line 3688 of file embedder.h.

◆ FlutterEngineSendViewFocusEventFnPtr

typedef FlutterEngineResult(* FlutterEngineSendViewFocusEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterViewFocusEvent *event)

Definition at line 3741 of file embedder.h.

◆ FlutterEngineSendWindowMetricsEventFnPtr

typedef FlutterEngineResult(* FlutterEngineSendWindowMetricsEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)

Definition at line 3636 of file embedder.h.

◆ FlutterEngineSetNextFrameCallbackFnPtr

typedef FlutterEngineResult(* FlutterEngineSetNextFrameCallbackFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data)

Definition at line 3731 of file embedder.h.

◆ FlutterEngineShutdownFnPtr

typedef FlutterEngineResult(* FlutterEngineShutdownFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine)

Definition at line 3624 of file embedder.h.

◆ FlutterEngineTraceEventDurationBeginFnPtr

typedef void(* FlutterEngineTraceEventDurationBeginFnPtr) (const char *name)

Definition at line 3698 of file embedder.h.

◆ FlutterEngineTraceEventDurationEndFnPtr

typedef void(* FlutterEngineTraceEventDurationEndFnPtr) (const char *name)

Definition at line 3699 of file embedder.h.

◆ FlutterEngineTraceEventInstantFnPtr

typedef void(* FlutterEngineTraceEventInstantFnPtr) (const char *name)

Definition at line 3700 of file embedder.h.

◆ FlutterEngineUnregisterExternalTextureFnPtr

typedef FlutterEngineResult(* FlutterEngineUnregisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)

Definition at line 3669 of file embedder.h.

◆ FlutterEngineUpdateAccessibilityFeaturesFnPtr

typedef FlutterEngineResult(* FlutterEngineUpdateAccessibilityFeaturesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)

Definition at line 3679 of file embedder.h.

◆ FlutterEngineUpdateLocalesFnPtr

typedef FlutterEngineResult(* FlutterEngineUpdateLocalesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)

Definition at line 3709 of file embedder.h.

◆ FlutterEngineUpdateSemanticsEnabledFnPtr

typedef FlutterEngineResult(* FlutterEngineUpdateSemanticsEnabledFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)

Definition at line 3676 of file embedder.h.

◆ FlutterFrameBufferWithDamageCallback

typedef void(* FlutterFrameBufferWithDamageCallback) (void *, const intptr_t, FlutterDamage *)

Callback for when a frame buffer object is requested with necessary information for partial repaint.

Definition at line 700 of file embedder.h.

◆ FlutterKeyEventCallback

typedef void(* FlutterKeyEventCallback) (bool, void *)

Definition at line 1465 of file embedder.h.

◆ FlutterLayersPresentCallback

typedef bool(* FlutterLayersPresentCallback) (const FlutterLayer **layers, size_t layers_count, void *user_data)

Definition at line 2223 of file embedder.h.

◆ FlutterLogMessageCallback

typedef void(* FlutterLogMessageCallback) (const char *, const char *, void *)

Definition at line 2486 of file embedder.h.

◆ FlutterMetalCommandQueueHandle

typedef const void* FlutterMetalCommandQueueHandle

Alias for id<MTLCommandQueue>.

Definition at line 810 of file embedder.h.

◆ FlutterMetalDeviceHandle

typedef const void* FlutterMetalDeviceHandle

Alias for id<MTLDevice>.

Definition at line 807 of file embedder.h.

◆ FlutterMetalPresentCallback

typedef bool(* FlutterMetalPresentCallback) (void *, const FlutterMetalTexture *)

Callback for when a metal texture is presented. The texture_id here corresponds to the texture_id provided by the embedder in the FlutterMetalTextureCallback callback.

Definition at line 890 of file embedder.h.

◆ FlutterMetalTextureCallback

typedef FlutterMetalTexture(* FlutterMetalTextureCallback) (void *, const FlutterFrameInfo *)

Callback for when a metal texture is requested.

Definition at line 883 of file embedder.h.

◆ FlutterMetalTextureFrameCallback

typedef bool(* FlutterMetalTextureFrameCallback) (void *, int64_t, size_t, size_t, FlutterMetalExternalTexture *)

Callback to provide an external texture for a given texture_id. See: external_texture_frame_callback.

Definition at line 853 of file embedder.h.

◆ FlutterMetalTextureHandle

typedef const void* FlutterMetalTextureHandle

Alias for id<MTLTexture>.

Definition at line 813 of file embedder.h.

◆ FlutterNativeThreadCallback

typedef void(* FlutterNativeThreadCallback) (FlutterNativeThreadType type, void *user_data)

A callback made by the engine in response to FlutterEnginePostCallbackOnAllNativeThreads on all internal thread.

Definition at line 2461 of file embedder.h.

◆ FlutterOpenGLSurfaceCallback

typedef bool(* FlutterOpenGLSurfaceCallback) (void *, bool *)

Definition at line 561 of file embedder.h.

◆ FlutterPlatformMessageCallback

typedef void(* FlutterPlatformMessageCallback) (const FlutterPlatformMessage *, void *)

Definition at line 1487 of file embedder.h.

◆ FlutterPlatformMessageResponseHandle

◆ FlutterPlatformViewIdentifier

The identifier of the platform view. This identifier is specified by the application when a platform view is added to the scene via the SceneBuilder.addPlatformView call.

Definition at line 1498 of file embedder.h.

◆ FlutterPresentViewCallback

typedef bool(* FlutterPresentViewCallback) (const FlutterPresentViewInfo *)

The callback invoked when the embedder should present to a view.

The |FlutterPresentViewInfo| will be deallocated once the callback returns.

Definition at line 2230 of file embedder.h.

◆ FlutterRemoveViewCallback

typedef void(* FlutterRemoveViewCallback) (const FlutterRemoveViewResult *)

The callback invoked by the engine when the engine has attempted to remove a view.

The |FlutterRemoveViewResult| is only guaranteed to be valid during this callback.

Definition at line 1167 of file embedder.h.

◆ FlutterTaskRunner

typedef struct _FlutterTaskRunner* FlutterTaskRunner

Definition at line 1884 of file embedder.h.

◆ FlutterTaskRunnerPostTaskCallback

typedef void(* FlutterTaskRunnerPostTaskCallback) (FlutterTask, uint64_t, void *)

Definition at line 1891 of file embedder.h.

◆ FlutterUpdateSemanticsCallback

typedef void(* FlutterUpdateSemanticsCallback) (const FlutterSemanticsUpdate *, void *)

Definition at line 1858 of file embedder.h.

◆ FlutterUpdateSemanticsCallback2

typedef void(* FlutterUpdateSemanticsCallback2) (const FlutterSemanticsUpdate2 *, void *)

Definition at line 1862 of file embedder.h.

◆ FlutterUpdateSemanticsCustomActionCallback

typedef void(* FlutterUpdateSemanticsCustomActionCallback) (const FlutterSemanticsCustomAction *, void *)

Definition at line 1854 of file embedder.h.

◆ FlutterUpdateSemanticsNodeCallback

typedef void(* FlutterUpdateSemanticsNodeCallback) (const FlutterSemanticsNode *, void *)

Definition at line 1850 of file embedder.h.

◆ FlutterViewFocusChangeRequestCallback

typedef void(* FlutterViewFocusChangeRequestCallback) (const FlutterViewFocusChangeRequest *, void *)

Definition at line 1880 of file embedder.h.

◆ FlutterViewId

typedef int64_t FlutterViewId

Unique identifier for views.

View IDs are generated by the embedder and are opaque to the engine; the engine does not interpret view IDs in any way.

Definition at line 393 of file embedder.h.

◆ FlutterVulkanDeviceHandle

Alias for VkDevice.

Definition at line 925 of file embedder.h.

◆ FlutterVulkanImageCallback

typedef FlutterVulkanImage(* FlutterVulkanImageCallback) (void *, const FlutterFrameInfo *)

Callback for when a VkImage is requested.

Definition at line 951 of file embedder.h.

◆ FlutterVulkanImageHandle

typedef uint64_t FlutterVulkanImageHandle

Alias for VkImage.

Definition at line 931 of file embedder.h.

◆ FlutterVulkanInstanceHandle

Alias for VkInstance.

Definition at line 919 of file embedder.h.

◆ FlutterVulkanInstanceProcAddressCallback

typedef void *(* FlutterVulkanInstanceProcAddressCallback) (void *, FlutterVulkanInstanceHandle, const char *)

Callback to fetch a Vulkan function pointer for a given instance. Normally, this should return the results of vkGetInstanceProcAddr.

Definition at line 945 of file embedder.h.

◆ FlutterVulkanPhysicalDeviceHandle

Alias for VkPhysicalDevice.

Definition at line 922 of file embedder.h.

◆ FlutterVulkanPresentCallback

typedef bool(* FlutterVulkanPresentCallback) (void *, const FlutterVulkanImage *)

Callback for when a VkImage has been written to and is ready for use by the embedder.

Definition at line 957 of file embedder.h.

◆ FlutterVulkanQueueHandle

typedef void* FlutterVulkanQueueHandle

Alias for VkQueue.

Definition at line 928 of file embedder.h.

◆ OnPreEngineRestartCallback

typedef void(* OnPreEngineRestartCallback) (void *)

Definition at line 631 of file embedder.h.

◆ ProcResolver

typedef void *(* ProcResolver) (void *, const char *)

Definition at line 624 of file embedder.h.

◆ SoftwareSurfacePresentCallback

typedef bool(* SoftwareSurfacePresentCallback) (void *, const void *, size_t, size_t)

Definition at line 620 of file embedder.h.

◆ TextureFrameCallback

typedef bool(* TextureFrameCallback) (void *, int64_t, size_t, size_t, FlutterOpenGLTexture *)

Definition at line 625 of file embedder.h.

◆ TransformationCallback

typedef FlutterTransformation(* TransformationCallback) (void *)

Definition at line 618 of file embedder.h.

◆ UIntCallback

typedef uint32_t(* UIntCallback) (void *)

Definition at line 619 of file embedder.h.

◆ UIntFrameInfoCallback

typedef uint32_t(* UIntFrameInfoCallback) (void *, const FlutterFrameInfo *)

Callback for when a frame buffer object is requested.

Definition at line 694 of file embedder.h.

◆ VoidCallback

typedef void(* VoidCallback) (void *)

Definition at line 416 of file embedder.h.

◆ VsyncCallback

typedef void(* VsyncCallback) (void *, intptr_t)

Definition at line 630 of file embedder.h.

Enumeration Type Documentation

◆ FlutterAccessibilityFeature

Additional accessibility features that may be enabled by the platform. Must match the AccessibilityFeatures enum in window.dart.

Enumerator
kFlutterAccessibilityFeatureAccessibleNavigation 

Indicate there is a running accessibility service which is changing the interaction model of the device.

kFlutterAccessibilityFeatureInvertColors 

Indicate the platform is inverting the colors of the application.

kFlutterAccessibilityFeatureDisableAnimations 

Request that animations be disabled or simplified.

kFlutterAccessibilityFeatureBoldText 

Request that text be rendered at a bold font weight.

kFlutterAccessibilityFeatureReduceMotion 

Request that certain animations be simplified and parallax effects removed.

kFlutterAccessibilityFeatureHighContrast 

Request that UI be rendered with darker colors.

kFlutterAccessibilityFeatureOnOffSwitchLabels 

Request to show on/off labels inside switches.

kFlutterAccessibilityFeatureNoAnnounce 

Indicate the platform does not support announcements.

kFlutterAccessibilityFeatureNoAutoPlayAnimatedImages 

Indicate the platform disallows auto-playing animated images.

kFlutterAccessibilityFeatureNoAutoPlayVideos 

Indicate the platform disallows auto-playing videos.

kFlutterAccessibilityFeatureDeterministicCursor 

Request to show deterministic (non-blinking) cursor in editable text fields.

Definition at line 91 of file embedder.h.

91 {
92 /// Indicate there is a running accessibility service which is changing the
93 /// interaction model of the device.
95 /// Indicate the platform is inverting the colors of the application.
97 /// Request that animations be disabled or simplified.
99 /// Request that text be rendered at a bold font weight.
101 /// Request that certain animations be simplified and parallax effects
102 /// removed.
104 /// Request that UI be rendered with darker colors.
106 /// Request to show on/off labels inside switches.
108 /// Indicate the platform does not support announcements.
110 /// Indicate the platform disallows auto-playing animated images.
112 /// Indicate the platform disallows auto-playing videos.
114 /// Request to show deterministic (non-blinking) cursor in editable text
115 /// fields.
FlutterAccessibilityFeature
Definition embedder.h:91
@ kFlutterAccessibilityFeatureNoAutoPlayVideos
Indicate the platform disallows auto-playing videos.
Definition embedder.h:113
@ kFlutterAccessibilityFeatureNoAnnounce
Indicate the platform does not support announcements.
Definition embedder.h:109
@ kFlutterAccessibilityFeatureOnOffSwitchLabels
Request to show on/off labels inside switches.
Definition embedder.h:107
@ kFlutterAccessibilityFeatureBoldText
Request that text be rendered at a bold font weight.
Definition embedder.h:100
@ kFlutterAccessibilityFeatureDeterministicCursor
Definition embedder.h:116
@ kFlutterAccessibilityFeatureHighContrast
Request that UI be rendered with darker colors.
Definition embedder.h:105
@ kFlutterAccessibilityFeatureNoAutoPlayAnimatedImages
Indicate the platform disallows auto-playing animated images.
Definition embedder.h:111
@ kFlutterAccessibilityFeatureReduceMotion
Definition embedder.h:103
@ kFlutterAccessibilityFeatureDisableAnimations
Request that animations be disabled or simplified.
Definition embedder.h:98
@ kFlutterAccessibilityFeatureInvertColors
Indicate the platform is inverting the colors of the application.
Definition embedder.h:96
@ kFlutterAccessibilityFeatureAccessibleNavigation
Definition embedder.h:94

◆ FlutterBackingStoreType

Enumerator
kFlutterBackingStoreTypeOpenGL 

Specifies an OpenGL backing store. Can either be an OpenGL texture or framebuffer.

kFlutterBackingStoreTypeSoftware 

Specified an software allocation for Flutter to render into using the CPU.

kFlutterBackingStoreTypeMetal 

Specifies a Metal backing store. This is backed by a Metal texture.

kFlutterBackingStoreTypeVulkan 

Specifies a Vulkan backing store. This is backed by a Vulkan VkImage.

kFlutterBackingStoreTypeSoftware2 

Specifies a allocation that the engine should render into using software rendering.

Definition at line 2086 of file embedder.h.

2086 {
2087 /// Specifies an OpenGL backing store. Can either be an OpenGL texture or
2088 /// framebuffer.
2090 /// Specified an software allocation for Flutter to render into using the CPU.
2092 /// Specifies a Metal backing store. This is backed by a Metal texture.
2094 /// Specifies a Vulkan backing store. This is backed by a Vulkan VkImage.
2096 /// Specifies a allocation that the engine should render into using
2097 /// software rendering.
FlutterBackingStoreType
Definition embedder.h:2086
@ kFlutterBackingStoreTypeSoftware2
Definition embedder.h:2098
@ kFlutterBackingStoreTypeMetal
Specifies a Metal backing store. This is backed by a Metal texture.
Definition embedder.h:2093
@ kFlutterBackingStoreTypeVulkan
Specifies a Vulkan backing store. This is backed by a Vulkan VkImage.
Definition embedder.h:2095
@ kFlutterBackingStoreTypeSoftware
Specified an software allocation for Flutter to render into using the CPU.
Definition embedder.h:2091
@ kFlutterBackingStoreTypeOpenGL
Definition embedder.h:2089

◆ FlutterCheckState

Enumerator
kFlutterCheckStateNone 

The semantics node does not have check state.

kFlutterCheckStateTrue 

The semantics node is checked.

kFlutterCheckStateFalse 

The semantics node is not checked.

kFlutterCheckStateMixed 

The semantics node represents a checkbox in mixed state.

Definition at line 287 of file embedder.h.

287 {
288 /// The semantics node does not have check state.
290 /// The semantics node is checked.
292 /// The semantics node is not checked.
294 /// The semantics node represents a checkbox in mixed state.
FlutterCheckState
Definition embedder.h:287
@ kFlutterCheckStateNone
The semantics node does not have check state.
Definition embedder.h:289
@ kFlutterCheckStateTrue
The semantics node is checked.
Definition embedder.h:291
@ kFlutterCheckStateFalse
The semantics node is not checked.
Definition embedder.h:293
@ kFlutterCheckStateMixed
The semantics node represents a checkbox in mixed state.
Definition embedder.h:295

◆ FlutterEngineAOTDataSourceType

AOT data source type.

Enumerator
kFlutterEngineAOTDataSourceTypeElfPath 

Definition at line 2465 of file embedder.h.

2465 {
FlutterEngineAOTDataSourceType
AOT data source type.
Definition embedder.h:2465
@ kFlutterEngineAOTDataSourceTypeElfPath
Definition embedder.h:2466

◆ FlutterEngineDartObjectType

Enumerator
kFlutterEngineDartObjectTypeNull 
kFlutterEngineDartObjectTypeBool 
kFlutterEngineDartObjectTypeInt32 
kFlutterEngineDartObjectTypeInt64 
kFlutterEngineDartObjectTypeDouble 
kFlutterEngineDartObjectTypeString 
kFlutterEngineDartObjectTypeBuffer 

The object will be made available to Dart code as an instance of Uint8List.

Definition at line 2368 of file embedder.h.

2368 {
2375 /// The object will be made available to Dart code as an instance of
2376 /// Uint8List.
FlutterEngineDartObjectType
Definition embedder.h:2368
@ kFlutterEngineDartObjectTypeString
Definition embedder.h:2374
@ kFlutterEngineDartObjectTypeBool
Definition embedder.h:2370
@ kFlutterEngineDartObjectTypeDouble
Definition embedder.h:2373
@ kFlutterEngineDartObjectTypeInt32
Definition embedder.h:2371
@ kFlutterEngineDartObjectTypeBuffer
Definition embedder.h:2377
@ kFlutterEngineDartObjectTypeInt64
Definition embedder.h:2372
@ kFlutterEngineDartObjectTypeNull
Definition embedder.h:2369

◆ FlutterEngineDisplaysUpdateType

The update type parameter that is passed to FlutterEngineNotifyDisplayUpdate.

Enumerator
kFlutterEngineDisplaysUpdateTypeStartup 

FlutterEngineDisplays that were active during start-up. A display is considered active if:

  1. The frame buffer hardware is connected.
  2. The display is drawable, e.g. it isn't being mirrored from another connected display or sleeping.
kFlutterEngineDisplaysUpdateTypeCount 

Definition at line 2356 of file embedder.h.

2356 {
2357 /// `FlutterEngineDisplay`s that were active during start-up. A display is
2358 /// considered active if:
2359 /// 1. The frame buffer hardware is connected.
2360 /// 2. The display is drawable, e.g. it isn't being mirrored from another
2361 /// connected display or sleeping.
FlutterEngineDisplaysUpdateType
Definition embedder.h:2356
@ kFlutterEngineDisplaysUpdateTypeStartup
Definition embedder.h:2362
@ kFlutterEngineDisplaysUpdateTypeCount
Definition embedder.h:2363

◆ FlutterEngineResult

Enumerator
kSuccess 
kInvalidLibraryVersion 
kInvalidArguments 
kInternalInconsistency 

Definition at line 72 of file embedder.h.

72 {
73 kSuccess = 0,
FlutterEngineResult
Definition embedder.h:72
@ kInternalInconsistency
Definition embedder.h:76
@ kInvalidLibraryVersion
Definition embedder.h:74
@ kInvalidArguments
Definition embedder.h:75
@ kSuccess
Definition embedder.h:73

◆ FlutterKeyEventDeviceType

Enumerator
kFlutterKeyEventDeviceTypeKeyboard 
kFlutterKeyEventDeviceTypeDirectionalPad 
kFlutterKeyEventDeviceTypeGamepad 
kFlutterKeyEventDeviceTypeJoystick 
kFlutterKeyEventDeviceTypeHdmi 

Definition at line 1390 of file embedder.h.

1390 {
FlutterKeyEventDeviceType
Definition embedder.h:1390
@ kFlutterKeyEventDeviceTypeKeyboard
Definition embedder.h:1391
@ kFlutterKeyEventDeviceTypeDirectionalPad
Definition embedder.h:1392
@ kFlutterKeyEventDeviceTypeHdmi
Definition embedder.h:1395
@ kFlutterKeyEventDeviceTypeJoystick
Definition embedder.h:1394
@ kFlutterKeyEventDeviceTypeGamepad
Definition embedder.h:1393

◆ FlutterKeyEventType

Enumerator
kFlutterKeyEventTypeUp 
kFlutterKeyEventTypeDown 
kFlutterKeyEventTypeRepeat 

Definition at line 1384 of file embedder.h.

1384 {
FlutterKeyEventType
Definition embedder.h:1384
@ kFlutterKeyEventTypeDown
Definition embedder.h:1386
@ kFlutterKeyEventTypeUp
Definition embedder.h:1385
@ kFlutterKeyEventTypeRepeat
Definition embedder.h:1387

◆ FlutterLayerContentType

Enumerator
kFlutterLayerContentTypeBackingStore 

Indicates that the contents of this layer are rendered by Flutter into a backing store.

kFlutterLayerContentTypePlatformView 

Indicates that the contents of this layer are determined by the embedder.

Definition at line 2137 of file embedder.h.

2137 {
2138 /// Indicates that the contents of this layer are rendered by Flutter into a
2139 /// backing store.
2141 /// Indicates that the contents of this layer are determined by the embedder.
FlutterLayerContentType
Definition embedder.h:2137
@ kFlutterLayerContentTypePlatformView
Indicates that the contents of this layer are determined by the embedder.
Definition embedder.h:2142
@ kFlutterLayerContentTypeBackingStore
Definition embedder.h:2140

◆ FlutterMetalExternalTexturePixelFormat

Pixel format for the external texture.

Enumerator
kYUVA 
kRGBA 

Definition at line 816 of file embedder.h.

816 {
817 kYUVA,
818 kRGBA,
FlutterMetalExternalTexturePixelFormat
Pixel format for the external texture.
Definition embedder.h:816
@ kRGBA
Definition embedder.h:818
@ kYUVA
Definition embedder.h:817

◆ FlutterMetalExternalTextureYUVColorSpace

YUV color space for the YUV external texture.

Enumerator
kBT601FullRange 
kBT601LimitedRange 

Definition at line 822 of file embedder.h.

822 {
FlutterMetalExternalTextureYUVColorSpace
YUV color space for the YUV external texture.
Definition embedder.h:822
@ kBT601LimitedRange
Definition embedder.h:824
@ kBT601FullRange
Definition embedder.h:823

◆ FlutterNativeThreadType

This enum allows embedders to determine the type of the engine thread in the FlutterNativeThreadCallback. Based on the thread type, the embedder may be able to tweak the thread priorities for optimum performance.

Enumerator
kFlutterNativeThreadTypePlatform 

The Flutter Engine considers the thread on which the FlutterEngineRun call is made to be the platform thread. There is only one such thread per engine instance.

kFlutterNativeThreadTypeRender 

This is the thread the Flutter Engine uses to execute rendering commands based on the selected client rendering API. There is only one such thread per engine instance.

kFlutterNativeThreadTypeUI 

This is a dedicated thread on which the root Dart isolate is serviced. There is only one such thread per engine instance.

kFlutterNativeThreadTypeWorker 

Multiple threads are used by the Flutter engine to perform long running background tasks.

Definition at line 2442 of file embedder.h.

2442 {
2443 /// The Flutter Engine considers the thread on which the FlutterEngineRun call
2444 /// is made to be the platform thread. There is only one such thread per
2445 /// engine instance.
2447 /// This is the thread the Flutter Engine uses to execute rendering commands
2448 /// based on the selected client rendering API. There is only one such thread
2449 /// per engine instance.
2451 /// This is a dedicated thread on which the root Dart isolate is serviced.
2452 /// There is only one such thread per engine instance.
2454 /// Multiple threads are used by the Flutter engine to perform long running
2455 /// background tasks.
FlutterNativeThreadType
Definition embedder.h:2442
@ kFlutterNativeThreadTypeWorker
Definition embedder.h:2456
@ kFlutterNativeThreadTypeUI
Definition embedder.h:2453
@ kFlutterNativeThreadTypePlatform
Definition embedder.h:2446
@ kFlutterNativeThreadTypeRender
Definition embedder.h:2450

◆ FlutterOpenGLTargetType

Enumerator
kFlutterOpenGLTargetTypeTexture 

Specifies an OpenGL texture target type. Textures are specified using the FlutterOpenGLTexture struct.

kFlutterOpenGLTargetTypeFramebuffer 

Specifies an OpenGL frame-buffer target type. Framebuffers are specified using the FlutterOpenGLFramebuffer struct.

kFlutterOpenGLTargetTypeSurface 

Specifies an OpenGL on-screen surface target type. Surfaces are specified using the FlutterOpenGLSurface struct.

Definition at line 418 of file embedder.h.

418 {
419 /// Specifies an OpenGL texture target type. Textures are specified using
420 /// the FlutterOpenGLTexture struct.
422 /// Specifies an OpenGL frame-buffer target type. Framebuffers are specified
423 /// using the FlutterOpenGLFramebuffer struct.
425 /// Specifies an OpenGL on-screen surface target type. Surfaces are specified
426 /// using the FlutterOpenGLSurface struct.
FlutterOpenGLTargetType
Definition embedder.h:418
@ kFlutterOpenGLTargetTypeFramebuffer
Definition embedder.h:424
@ kFlutterOpenGLTargetTypeSurface
Definition embedder.h:427
@ kFlutterOpenGLTargetTypeTexture
Definition embedder.h:421

◆ FlutterPlatformViewMutationType

Enumerator
kFlutterPlatformViewMutationTypeOpacity 

Indicates that the Flutter application requested that an opacity be applied to the platform view.

kFlutterPlatformViewMutationTypeClipRect 

Indicates that the Flutter application requested that the platform view be clipped using a rectangle.

kFlutterPlatformViewMutationTypeClipRoundedRect 

Indicates that the Flutter application requested that the platform view be clipped using a rounded rectangle.

kFlutterPlatformViewMutationTypeTransformation 

Indicates that the Flutter application requested that the platform view be transformed before composition.

Definition at line 2035 of file embedder.h.

2035 {
2036 /// Indicates that the Flutter application requested that an opacity be
2037 /// applied to the platform view.
2039 /// Indicates that the Flutter application requested that the platform view be
2040 /// clipped using a rectangle.
2042 /// Indicates that the Flutter application requested that the platform view be
2043 /// clipped using a rounded rectangle.
2045 /// Indicates that the Flutter application requested that the platform view be
2046 /// transformed before composition.
FlutterPlatformViewMutationType
Definition embedder.h:2035
@ kFlutterPlatformViewMutationTypeClipRoundedRect
Definition embedder.h:2044
@ kFlutterPlatformViewMutationTypeClipRect
Definition embedder.h:2041
@ kFlutterPlatformViewMutationTypeTransformation
Definition embedder.h:2047
@ kFlutterPlatformViewMutationTypeOpacity
Definition embedder.h:2038

◆ FlutterPointerDeviceKind

The device type that created a pointer event.

Enumerator
kFlutterPointerDeviceKindMouse 
kFlutterPointerDeviceKindTouch 
kFlutterPointerDeviceKindStylus 
kFlutterPointerDeviceKindTrackpad 

Definition at line 1309 of file embedder.h.

1309 {
FlutterPointerDeviceKind
The device type that created a pointer event.
Definition embedder.h:1309
@ kFlutterPointerDeviceKindTouch
Definition embedder.h:1311
@ kFlutterPointerDeviceKindTrackpad
Definition embedder.h:1313
@ kFlutterPointerDeviceKindStylus
Definition embedder.h:1312
@ kFlutterPointerDeviceKindMouse
Definition embedder.h:1310

◆ FlutterPointerMouseButtons

Flags for the buttons field of FlutterPointerEvent when device_kind is kFlutterPointerDeviceKindMouse.

Enumerator
kFlutterPointerButtonMousePrimary 
kFlutterPointerButtonMouseSecondary 
kFlutterPointerButtonMouseMiddle 
kFlutterPointerButtonMouseBack 
kFlutterPointerButtonMouseForward 

Definition at line 1318 of file embedder.h.

1318 {
1324 /// If a mouse has more than five buttons, send higher bit shifted values
1325 /// corresponding to the button number: 1 << 5 for the 6th, etc.
FlutterPointerMouseButtons
Definition embedder.h:1318
@ kFlutterPointerButtonMousePrimary
Definition embedder.h:1319
@ kFlutterPointerButtonMouseMiddle
Definition embedder.h:1321
@ kFlutterPointerButtonMouseForward
Definition embedder.h:1323
@ kFlutterPointerButtonMouseBack
Definition embedder.h:1322
@ kFlutterPointerButtonMouseSecondary
Definition embedder.h:1320

◆ FlutterPointerPhase

The phase of the pointer event.

Enumerator
kCancel 
kUp 

The pointer, which must have been down (see kDown), is now up.

For touch, this means that the pointer is no longer in contact with the screen. For a mouse, it means the last button was released. Note that if any other buttons are still pressed when one button is released, that should be sent as a kMove rather than a kUp.

kDown 

The pointer, which must have been up, is now down.

For touch, this means that the pointer has come into contact with the screen. For a mouse, it means a button is now pressed. Note that if any other buttons are already pressed when a new button is pressed, that should be sent as a kMove rather than a kDown.

kMove 

The pointer moved while down.

This is also used for changes in button state that don't cause a kDown or kUp, such as releasing one of two pressed buttons.

kAdd 

The pointer is now sending input to Flutter. For instance, a mouse has entered the area where the Flutter content is displayed.

A pointer should always be added before sending any other events.

kRemove 

The pointer is no longer sending input to Flutter. For instance, a mouse has left the area where the Flutter content is displayed.

A removed pointer should no longer send events until sending a new kAdd.

kHover 

The pointer moved while up.

kPanZoomStart 

A pan/zoom started on this pointer.

kPanZoomUpdate 

The pan/zoom updated.

kPanZoomEnd 

The pan/zoom ended.

Definition at line 1267 of file embedder.h.

1267 {
1268 kCancel,
1269 /// The pointer, which must have been down (see kDown), is now up.
1270 ///
1271 /// For touch, this means that the pointer is no longer in contact with the
1272 /// screen. For a mouse, it means the last button was released. Note that if
1273 /// any other buttons are still pressed when one button is released, that
1274 /// should be sent as a kMove rather than a kUp.
1275 kUp,
1276 /// The pointer, which must have been up, is now down.
1277 ///
1278 /// For touch, this means that the pointer has come into contact with the
1279 /// screen. For a mouse, it means a button is now pressed. Note that if any
1280 /// other buttons are already pressed when a new button is pressed, that
1281 /// should be sent as a kMove rather than a kDown.
1282 kDown,
1283 /// The pointer moved while down.
1284 ///
1285 /// This is also used for changes in button state that don't cause a kDown or
1286 /// kUp, such as releasing one of two pressed buttons.
1287 kMove,
1288 /// The pointer is now sending input to Flutter. For instance, a mouse has
1289 /// entered the area where the Flutter content is displayed.
1290 ///
1291 /// A pointer should always be added before sending any other events.
1292 kAdd,
1293 /// The pointer is no longer sending input to Flutter. For instance, a mouse
1294 /// has left the area where the Flutter content is displayed.
1295 ///
1296 /// A removed pointer should no longer send events until sending a new kAdd.
1297 kRemove,
1298 /// The pointer moved while up.
1299 kHover,
1300 /// A pan/zoom started on this pointer.
1302 /// The pan/zoom updated.
1304 /// The pan/zoom ended.
FlutterPointerPhase
The phase of the pointer event.
Definition embedder.h:1267
@ kPanZoomUpdate
The pan/zoom updated.
Definition embedder.h:1303
@ kHover
The pointer moved while up.
Definition embedder.h:1299
@ kUp
Definition embedder.h:1275
@ kPanZoomStart
A pan/zoom started on this pointer.
Definition embedder.h:1301
@ kRemove
Definition embedder.h:1297
@ kCancel
Definition embedder.h:1268
@ kDown
Definition embedder.h:1282
@ kAdd
Definition embedder.h:1292
@ kMove
Definition embedder.h:1287
@ kPanZoomEnd
The pan/zoom ended.
Definition embedder.h:1305

◆ FlutterPointerSignalKind

The type of a pointer signal.

Enumerator
kFlutterPointerSignalKindNone 
kFlutterPointerSignalKindScroll 
kFlutterPointerSignalKindScrollInertiaCancel 
kFlutterPointerSignalKindScale 

Definition at line 1329 of file embedder.h.

1329 {
FlutterPointerSignalKind
The type of a pointer signal.
Definition embedder.h:1329
@ kFlutterPointerSignalKindScale
Definition embedder.h:1333
@ kFlutterPointerSignalKindScrollInertiaCancel
Definition embedder.h:1332
@ kFlutterPointerSignalKindScroll
Definition embedder.h:1331
@ kFlutterPointerSignalKindNone
Definition embedder.h:1330

◆ FlutterRendererType

Enumerator
kOpenGL 
kSoftware 
kMetal 

Metal is only supported on Darwin platforms (macOS / iOS). iOS version >= 10.0 (device), 13.0 (simulator) macOS version >= 10.14

kVulkan 

Definition at line 79 of file embedder.h.

79 {
80 kOpenGL,
82 /// Metal is only supported on Darwin platforms (macOS / iOS).
83 /// iOS version >= 10.0 (device), 13.0 (simulator)
84 /// macOS version >= 10.14
85 kMetal,
86 kVulkan,
FlutterRendererType
Definition embedder.h:79
@ kVulkan
Definition embedder.h:86
@ kOpenGL
Definition embedder.h:80
@ kMetal
Definition embedder.h:85
@ kSoftware
Definition embedder.h:81

◆ FlutterSemanticsAction

The set of possible actions that can be conveyed to a semantics node.

Must match the SemanticsAction enum in semantics.dart.

Enumerator
kFlutterSemanticsActionTap 

The equivalent of a user briefly tapping the screen with the finger without moving it.

kFlutterSemanticsActionLongPress 

The equivalent of a user pressing and holding the screen with the finger for a few seconds without moving it.

kFlutterSemanticsActionScrollLeft 

The equivalent of a user moving their finger across the screen from right to left.

kFlutterSemanticsActionScrollRight 

The equivalent of a user moving their finger across the screen from left to right.

kFlutterSemanticsActionScrollUp 

The equivalent of a user moving their finger across the screen from bottom to top.

kFlutterSemanticsActionScrollDown 

The equivalent of a user moving their finger across the screen from top to bottom.

kFlutterSemanticsActionIncrease 

Increase the value represented by the semantics node.

kFlutterSemanticsActionDecrease 

Decrease the value represented by the semantics node.

kFlutterSemanticsActionShowOnScreen 

A request to fully show the semantics node on screen.

kFlutterSemanticsActionMoveCursorForwardByCharacter 

Move the cursor forward by one character.

kFlutterSemanticsActionMoveCursorBackwardByCharacter 

Move the cursor backward by one character.

kFlutterSemanticsActionSetSelection 

Set the text selection to the given range.

kFlutterSemanticsActionCopy 

Copy the current selection to the clipboard.

kFlutterSemanticsActionCut 

Cut the current selection and place it in the clipboard.

kFlutterSemanticsActionPaste 

Paste the current content of the clipboard.

kFlutterSemanticsActionDidGainAccessibilityFocus 

Indicate that the node has gained accessibility focus.

kFlutterSemanticsActionDidLoseAccessibilityFocus 

Indicate that the node has lost accessibility focus.

kFlutterSemanticsActionCustomAction 

Indicate that the user has invoked a custom accessibility action.

kFlutterSemanticsActionDismiss 

A request that the node should be dismissed.

kFlutterSemanticsActionMoveCursorForwardByWord 

Move the cursor forward by one word.

kFlutterSemanticsActionMoveCursorBackwardByWord 

Move the cursor backward by one word.

kFlutterSemanticsActionSetText 

Replace the current text in the text field.

kFlutterSemanticsActionFocus 

Request that the respective focusable widget gain input focus.

kFlutterSemanticsActionScrollToOffset 

Request that scrolls the current scrollable container to a given scroll offset.

kFlutterSemanticsActionExpand 

A request that the node should be expanded.

kFlutterSemanticsActionCollapse 

A request that the node should be collapsed.

Definition at line 122 of file embedder.h.

122 {
123 /// The equivalent of a user briefly tapping the screen with the finger
124 /// without moving it.
126 /// The equivalent of a user pressing and holding the screen with the finger
127 /// for a few seconds without moving it.
129 /// The equivalent of a user moving their finger across the screen from right
130 /// to left.
132 /// The equivalent of a user moving their finger across the screen from left
133 /// to
134 /// right.
136 /// The equivalent of a user moving their finger across the screen from bottom
137 /// to top.
139 /// The equivalent of a user moving their finger across the screen from top to
140 /// bottom.
142 /// Increase the value represented by the semantics node.
144 /// Decrease the value represented by the semantics node.
146 /// A request to fully show the semantics node on screen.
148 /// Move the cursor forward by one character.
150 /// Move the cursor backward by one character.
152 /// Set the text selection to the given range.
154 /// Copy the current selection to the clipboard.
156 /// Cut the current selection and place it in the clipboard.
158 /// Paste the current content of the clipboard.
160 /// Indicate that the node has gained accessibility focus.
162 /// Indicate that the node has lost accessibility focus.
164 /// Indicate that the user has invoked a custom accessibility action.
166 /// A request that the node should be dismissed.
168 /// Move the cursor forward by one word.
170 /// Move the cursor backward by one word.
172 /// Replace the current text in the text field.
174 /// Request that the respective focusable widget gain input focus.
176 /// Request that scrolls the current scrollable container to a given scroll
177 /// offset.
179 /// A request that the node should be expanded.
181 /// A request that the node should be collapsed.
FlutterSemanticsAction
Definition embedder.h:122
@ kFlutterSemanticsActionMoveCursorForwardByCharacter
Move the cursor forward by one character.
Definition embedder.h:149
@ kFlutterSemanticsActionDidLoseAccessibilityFocus
Indicate that the node has lost accessibility focus.
Definition embedder.h:163
@ kFlutterSemanticsActionExpand
A request that the node should be expanded.
Definition embedder.h:180
@ kFlutterSemanticsActionDecrease
Decrease the value represented by the semantics node.
Definition embedder.h:145
@ kFlutterSemanticsActionCollapse
A request that the node should be collapsed.
Definition embedder.h:182
@ kFlutterSemanticsActionScrollDown
Definition embedder.h:141
@ kFlutterSemanticsActionMoveCursorBackwardByCharacter
Move the cursor backward by one character.
Definition embedder.h:151
@ kFlutterSemanticsActionMoveCursorForwardByWord
Move the cursor forward by one word.
Definition embedder.h:169
@ kFlutterSemanticsActionLongPress
Definition embedder.h:128
@ kFlutterSemanticsActionScrollToOffset
Definition embedder.h:178
@ kFlutterSemanticsActionScrollRight
Definition embedder.h:135
@ kFlutterSemanticsActionShowOnScreen
A request to fully show the semantics node on screen.
Definition embedder.h:147
@ kFlutterSemanticsActionSetSelection
Set the text selection to the given range.
Definition embedder.h:153
@ kFlutterSemanticsActionDismiss
A request that the node should be dismissed.
Definition embedder.h:167
@ kFlutterSemanticsActionFocus
Request that the respective focusable widget gain input focus.
Definition embedder.h:175
@ kFlutterSemanticsActionPaste
Paste the current content of the clipboard.
Definition embedder.h:159
@ kFlutterSemanticsActionScrollUp
Definition embedder.h:138
@ kFlutterSemanticsActionCut
Cut the current selection and place it in the clipboard.
Definition embedder.h:157
@ kFlutterSemanticsActionCustomAction
Indicate that the user has invoked a custom accessibility action.
Definition embedder.h:165
@ kFlutterSemanticsActionCopy
Copy the current selection to the clipboard.
Definition embedder.h:155
@ kFlutterSemanticsActionMoveCursorBackwardByWord
Move the cursor backward by one word.
Definition embedder.h:171
@ kFlutterSemanticsActionIncrease
Increase the value represented by the semantics node.
Definition embedder.h:143
@ kFlutterSemanticsActionScrollLeft
Definition embedder.h:131
@ kFlutterSemanticsActionDidGainAccessibilityFocus
Indicate that the node has gained accessibility focus.
Definition embedder.h:161
@ kFlutterSemanticsActionSetText
Replace the current text in the text field.
Definition embedder.h:173
@ kFlutterSemanticsActionTap
Definition embedder.h:125

◆ FlutterSemanticsFlag

The set of properties that may be associated with a semantics node.

Must match the SemanticsFlag enum in semantics.dart.

Enumerator
kFlutterSemanticsFlagHasCheckedState 

The semantics node has the quality of either being "checked" or "unchecked".

kFlutterSemanticsFlagIsChecked 

Whether a semantics node is checked.

kFlutterSemanticsFlagIsSelected 

Whether a semantics node is selected.

kFlutterSemanticsFlagIsButton 

Whether the semantic node represents a button.

kFlutterSemanticsFlagIsTextField 

Whether the semantic node represents a text field.

kFlutterSemanticsFlagIsFocused 

Whether the semantic node currently holds the user's focus.

kFlutterSemanticsFlagHasEnabledState 

The semantics node has the quality of either being "enabled" or "disabled".

kFlutterSemanticsFlagIsEnabled 

Whether a semantic node that hasEnabledState is currently enabled.

kFlutterSemanticsFlagIsInMutuallyExclusiveGroup 

Whether a semantic node is in a mutually exclusive group.

kFlutterSemanticsFlagIsHeader 

Whether a semantic node is a header that divides content into sections.

kFlutterSemanticsFlagIsObscured 

Whether the value of the semantics node is obscured.

kFlutterSemanticsFlagScopesRoute 

Whether the semantics node is the root of a subtree for which a route name should be announced.

kFlutterSemanticsFlagNamesRoute 

Whether the semantics node label is the name of a visually distinct route.

kFlutterSemanticsFlagIsHidden 

Whether the semantics node is considered hidden.

kFlutterSemanticsFlagIsImage 

Whether the semantics node represents an image.

kFlutterSemanticsFlagIsLiveRegion 

Whether the semantics node is a live region.

kFlutterSemanticsFlagHasToggledState 

The semantics node has the quality of either being "on" or "off".

kFlutterSemanticsFlagIsToggled 

If true, the semantics node is "on". If false, the semantics node is "off".

kFlutterSemanticsFlagHasImplicitScrolling 

Whether the platform can scroll the semantics node when the user attempts to move the accessibility focus to an offscreen child.

For example, a ListView widget has implicit scrolling so that users can easily move the accessibility focus to the next set of children. A PageView widget does not have implicit scrolling, so that users don't navigate to the next page when reaching the end of the current one.

kFlutterSemanticsFlagIsMultiline 

Whether the value of the semantics node is coming from a multi-line text field.

This is used for text fields to distinguish single-line text fields from multi-line ones.

kFlutterSemanticsFlagIsReadOnly 

Whether the semantic node is read only.

Only applicable when kFlutterSemanticsFlagIsTextField flag is on.

kFlutterSemanticsFlagIsFocusable 

Whether the semantic node can hold the user's focus.

kFlutterSemanticsFlagIsLink 

Whether the semantics node represents a link.

kFlutterSemanticsFlagIsSlider 

Whether the semantics node represents a slider.

kFlutterSemanticsFlagIsKeyboardKey 

Whether the semantics node represents a keyboard key.

kFlutterSemanticsFlagIsCheckStateMixed 

Whether the semantics node represents a tristate checkbox in mixed state.

kFlutterSemanticsFlagHasExpandedState 

The semantics node has the quality of either being "expanded" or "collapsed".

kFlutterSemanticsFlagIsExpanded 

Whether a semantic node that hasExpandedState is currently expanded.

kFlutterSemanticsFlagHasSelectedState 

The semantics node has the quality of either being "selected" or "not selected".

kFlutterSemanticsFlagHasRequiredState 

Whether a semantics node has the quality of being required.

kFlutterSemanticsFlagIsRequired 

Whether user input is required on the semantics node before a form can be submitted.

Only applicable when kFlutterSemanticsFlagHasRequiredState flag is on.

Definition at line 192 of file embedder.h.

192 {
193 /// The semantics node has the quality of either being "checked" or
194 /// "unchecked".
196 /// Whether a semantics node is checked.
198 /// Whether a semantics node is selected.
200 /// Whether the semantic node represents a button.
202 /// Whether the semantic node represents a text field.
204 /// Whether the semantic node currently holds the user's focus.
206 /// The semantics node has the quality of either being "enabled" or
207 /// "disabled".
209 /// Whether a semantic node that hasEnabledState is currently enabled.
211 /// Whether a semantic node is in a mutually exclusive group.
213 /// Whether a semantic node is a header that divides content into sections.
215 /// Whether the value of the semantics node is obscured.
217 /// Whether the semantics node is the root of a subtree for which a route name
218 /// should be announced.
220 /// Whether the semantics node label is the name of a visually distinct route.
222 /// Whether the semantics node is considered hidden.
224 /// Whether the semantics node represents an image.
226 /// Whether the semantics node is a live region.
228 /// The semantics node has the quality of either being "on" or "off".
230 /// If true, the semantics node is "on". If false, the semantics node is
231 /// "off".
233 /// Whether the platform can scroll the semantics node when the user attempts
234 /// to move the accessibility focus to an offscreen child.
235 ///
236 /// For example, a `ListView` widget has implicit scrolling so that users can
237 /// easily move the accessibility focus to the next set of children. A
238 /// `PageView` widget does not have implicit scrolling, so that users don't
239 /// navigate to the next page when reaching the end of the current one.
241 /// Whether the value of the semantics node is coming from a multi-line text
242 /// field.
243 ///
244 /// This is used for text fields to distinguish single-line text fields from
245 /// multi-line ones.
247 /// Whether the semantic node is read only.
248 ///
249 /// Only applicable when kFlutterSemanticsFlagIsTextField flag is on.
251 /// Whether the semantic node can hold the user's focus.
253 /// Whether the semantics node represents a link.
255 /// Whether the semantics node represents a slider.
257 /// Whether the semantics node represents a keyboard key.
259 /// Whether the semantics node represents a tristate checkbox in mixed state.
261 /// The semantics node has the quality of either being "expanded" or
262 /// "collapsed".
264 /// Whether a semantic node that hasExpandedState is currently expanded.
266 /// The semantics node has the quality of either being "selected" or
267 /// "not selected".
269 /// Whether a semantics node has the quality of being required.
271 /// Whether user input is required on the semantics node before a form can be
272 /// submitted.
273 ///
274 /// Only applicable when kFlutterSemanticsFlagHasRequiredState flag is on.
FlutterSemanticsFlag
Definition embedder.h:192
@ kFlutterSemanticsFlagIsHidden
Whether the semantics node is considered hidden.
Definition embedder.h:223
@ kFlutterSemanticsFlagIsHeader
Whether a semantic node is a header that divides content into sections.
Definition embedder.h:214
@ kFlutterSemanticsFlagIsSlider
Whether the semantics node represents a slider.
Definition embedder.h:256
@ kFlutterSemanticsFlagHasToggledState
The semantics node has the quality of either being "on" or "off".
Definition embedder.h:229
@ kFlutterSemanticsFlagIsSelected
Whether a semantics node is selected.
Definition embedder.h:199
@ kFlutterSemanticsFlagIsRequired
Definition embedder.h:275
@ kFlutterSemanticsFlagIsInMutuallyExclusiveGroup
Whether a semantic node is in a mutually exclusive group.
Definition embedder.h:212
@ kFlutterSemanticsFlagHasRequiredState
Whether a semantics node has the quality of being required.
Definition embedder.h:270
@ kFlutterSemanticsFlagIsKeyboardKey
Whether the semantics node represents a keyboard key.
Definition embedder.h:258
@ kFlutterSemanticsFlagIsChecked
Whether a semantics node is checked.
Definition embedder.h:197
@ kFlutterSemanticsFlagScopesRoute
Definition embedder.h:219
@ kFlutterSemanticsFlagHasExpandedState
Definition embedder.h:263
@ kFlutterSemanticsFlagIsCheckStateMixed
Whether the semantics node represents a tristate checkbox in mixed state.
Definition embedder.h:260
@ kFlutterSemanticsFlagIsToggled
Definition embedder.h:232
@ kFlutterSemanticsFlagIsButton
Whether the semantic node represents a button.
Definition embedder.h:201
@ kFlutterSemanticsFlagIsMultiline
Definition embedder.h:246
@ kFlutterSemanticsFlagIsObscured
Whether the value of the semantics node is obscured.
Definition embedder.h:216
@ kFlutterSemanticsFlagIsReadOnly
Definition embedder.h:250
@ kFlutterSemanticsFlagHasSelectedState
Definition embedder.h:268
@ kFlutterSemanticsFlagIsLink
Whether the semantics node represents a link.
Definition embedder.h:254
@ kFlutterSemanticsFlagIsLiveRegion
Whether the semantics node is a live region.
Definition embedder.h:227
@ kFlutterSemanticsFlagIsFocused
Whether the semantic node currently holds the user's focus.
Definition embedder.h:205
@ kFlutterSemanticsFlagHasImplicitScrolling
Definition embedder.h:240
@ kFlutterSemanticsFlagIsEnabled
Whether a semantic node that hasEnabledState is currently enabled.
Definition embedder.h:210
@ kFlutterSemanticsFlagIsImage
Whether the semantics node represents an image.
Definition embedder.h:225
@ kFlutterSemanticsFlagNamesRoute
Whether the semantics node label is the name of a visually distinct route.
Definition embedder.h:221
@ kFlutterSemanticsFlagIsFocusable
Whether the semantic node can hold the user's focus.
Definition embedder.h:252
@ kFlutterSemanticsFlagIsTextField
Whether the semantic node represents a text field.
Definition embedder.h:203
@ kFlutterSemanticsFlagHasCheckedState
Definition embedder.h:195
@ kFlutterSemanticsFlagHasEnabledState
Definition embedder.h:208
@ kFlutterSemanticsFlagIsExpanded
Whether a semantic node that hasExpandedState is currently expanded.
Definition embedder.h:265

◆ FlutterSoftwarePixelFormat

A pixel format to be used for software rendering.

A single pixel always stored as a POT number of bytes. (so in practice either 1, 2, 4, 8, 16 bytes per pixel)

There are two kinds of pixel formats:

  • formats where all components are 8 bits, called array formats The component order as specified in the pixel format name is the order of the components' bytes in memory, with the leftmost component occupying the lowest memory address.
  • all other formats are called packed formats, and the component order as specified in the format name refers to the order from most significant to least significant bits in the native type. for example, for kFlutterSoftwarePixelFormatRGB565, R occupies the 5 most significant bits, G the middle 6 bits, and B the 5 least significant bits.

Each pixel format in this list is documented with an example on how to get the color components from the pixel.

  • for packed formats, p is the pixel value as a word. For example, you can get the pixel value for a RGB565 formatted buffer like this: uint16_t p = ((const uint16_t*) allocation)[row_bytes * y / bpp + x]; (with bpp being the bytes per pixel, so 2 for RGB565)
  • for array formats, p is a pointer to the pixel value. For example, you can get the p for a RGBA8888 formatted buffer like this: const uint8_t p = ((const uint8_t) allocation) + row_bytes*y + x*4;
Enumerator
kFlutterSoftwarePixelFormatGray8 

Pixel with 8 bit grayscale value. The grayscale value is the luma value calculated from r, g, b according to BT.709. (gray = r*0.2126 + g*0.7152 + b*0.0722)

kFlutterSoftwarePixelFormatRGB565 

Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word. r = (p >> 11) & 0x1F; g = (p >> 5) & 0x3F; b = p & 0x1F;

On most (== little-endian) systems, this is equivalent to wayland format RGB565 (WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565).

kFlutterSoftwarePixelFormatRGBA4444 

Pixel with 4 bits each for alpha, red, green, blue; in 16-bit word. r = (p >> 8) & 0xF; g = (p >> 4) & 0xF; b = p & 0xF; a = (p >> 12) & 0xF;

On most (== little-endian) systems, this is equivalent to wayland format RGBA4444 (WL_DRM_FORMAT_RGBA4444, WL_SHM_FORMAT_RGBA4444).

kFlutterSoftwarePixelFormatRGBA8888 

Pixel with 8 bits each for red, green, blue, alpha. r = p[0]; g = p[1]; b = p[2]; a = p[3];

This is equivalent to wayland format ABGR8888 (WL_DRM_FORMAT_ABGR8888, WL_SHM_FORMAT_ABGR8888).

kFlutterSoftwarePixelFormatRGBX8888 

Pixel with 8 bits each for red, green and blue and 8 unused bits. r = p[0]; g = p[1]; b = p[2];

This is equivalent to wayland format XBGR8888 (WL_DRM_FORMAT_XBGR8888, WL_SHM_FORMAT_XBGR8888).

kFlutterSoftwarePixelFormatBGRA8888 

Pixel with 8 bits each for blue, green, red and alpha. r = p[2]; g = p[1]; b = p[0]; a = p[3];

This is equivalent to wayland format ARGB8888 (WL_DRM_FORMAT_ARGB8888, WL_SHM_FORMAT_ARGB8888).

kFlutterSoftwarePixelFormatNative32 

Either kFlutterSoftwarePixelFormatBGRA8888 or kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS.

Definition at line 457 of file embedder.h.

457 {
458 /// Pixel with 8 bit grayscale value.
459 /// The grayscale value is the luma value calculated from r, g, b
460 /// according to BT.709. (gray = r*0.2126 + g*0.7152 + b*0.0722)
462
463 /// Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word.
464 /// r = (p >> 11) & 0x1F;
465 /// g = (p >> 5) & 0x3F;
466 /// b = p & 0x1F;
467 ///
468 /// On most (== little-endian) systems, this is equivalent to wayland format
469 /// RGB565 (WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565).
471
472 /// Pixel with 4 bits each for alpha, red, green, blue; in 16-bit word.
473 /// r = (p >> 8) & 0xF;
474 /// g = (p >> 4) & 0xF;
475 /// b = p & 0xF;
476 /// a = (p >> 12) & 0xF;
477 ///
478 /// On most (== little-endian) systems, this is equivalent to wayland format
479 /// RGBA4444 (WL_DRM_FORMAT_RGBA4444, WL_SHM_FORMAT_RGBA4444).
481
482 /// Pixel with 8 bits each for red, green, blue, alpha.
483 /// r = p[0];
484 /// g = p[1];
485 /// b = p[2];
486 /// a = p[3];
487 ///
488 /// This is equivalent to wayland format ABGR8888 (WL_DRM_FORMAT_ABGR8888,
489 /// WL_SHM_FORMAT_ABGR8888).
491
492 /// Pixel with 8 bits each for red, green and blue and 8 unused bits.
493 /// r = p[0];
494 /// g = p[1];
495 /// b = p[2];
496 ///
497 /// This is equivalent to wayland format XBGR8888 (WL_DRM_FORMAT_XBGR8888,
498 /// WL_SHM_FORMAT_XBGR8888).
500
501 /// Pixel with 8 bits each for blue, green, red and alpha.
502 /// r = p[2];
503 /// g = p[1];
504 /// b = p[0];
505 /// a = p[3];
506 ///
507 /// This is equivalent to wayland format ARGB8888 (WL_DRM_FORMAT_ARGB8888,
508 /// WL_SHM_FORMAT_ARGB8888).
510
511 /// Either kFlutterSoftwarePixelFormatBGRA8888 or
512 /// kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS.
FlutterSoftwarePixelFormat
Definition embedder.h:457
@ kFlutterSoftwarePixelFormatRGBA4444
Definition embedder.h:480
@ kFlutterSoftwarePixelFormatRGBA8888
Definition embedder.h:490
@ kFlutterSoftwarePixelFormatBGRA8888
Definition embedder.h:509
@ kFlutterSoftwarePixelFormatGray8
Definition embedder.h:461
@ kFlutterSoftwarePixelFormatNative32
Definition embedder.h:513
@ kFlutterSoftwarePixelFormatRGBX8888
Definition embedder.h:499
@ kFlutterSoftwarePixelFormatRGB565
Definition embedder.h:470

◆ FlutterStringAttributeType

Enumerator
kSpellOut 
kLocale 

Definition at line 1510 of file embedder.h.

1510 {
1511 // Indicates the string should be announced character by character.
1512 kSpellOut,
1513 // Indicates the string should be announced using the specified locale.
1514 kLocale,
FlutterStringAttributeType
Definition embedder.h:1510
@ kSpellOut
Definition embedder.h:1512
@ kLocale
Definition embedder.h:1514

◆ FlutterTextDirection

Enumerator
kFlutterTextDirectionUnknown 

Text has unknown text direction.

kFlutterTextDirectionRTL 

Text is read from right to left.

kFlutterTextDirectionLTR 

Text is read from left to right.

Definition at line 366 of file embedder.h.

366 {
367 /// Text has unknown text direction.
369 /// Text is read from right to left.
371 /// Text is read from left to right.
FlutterTextDirection
Definition embedder.h:366
@ kFlutterTextDirectionUnknown
Text has unknown text direction.
Definition embedder.h:368
@ kFlutterTextDirectionRTL
Text is read from right to left.
Definition embedder.h:370
@ kFlutterTextDirectionLTR
Text is read from left to right.
Definition embedder.h:372

◆ FlutterThreadPriority

Valid values for priority of Thread.

Enumerator
kBackground 

Suitable for threads that shouldn't disrupt high priority work.

kNormal 

Default priority level.

kDisplay 

Suitable for threads which generate data for the display.

kRaster 

Suitable for thread which raster data.

Definition at line 376 of file embedder.h.

376 {
377 /// Suitable for threads that shouldn't disrupt high priority work.
378 kBackground = 0,
379 /// Default priority level.
380 kNormal = 1,
381 /// Suitable for threads which generate data for the display.
382 kDisplay = 2,
383 /// Suitable for thread which raster data.
384 kRaster = 3,
FlutterThreadPriority
Valid values for priority of Thread.
Definition embedder.h:376
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
Definition embedder.h:378
@ kDisplay
Suitable for threads which generate data for the display.
Definition embedder.h:382
@ kNormal
Default priority level.
Definition embedder.h:380
@ kRaster
Suitable for thread which raster data.
Definition embedder.h:384

◆ FlutterTristate

Enumerator
kFlutterTristateNone 

The property is not applicable to this semantics node.

kFlutterTristateTrue 

The property is applicable and its state is "true" or "on".

kFlutterTristateFalse 

The property is applicable and its state is "false" or "off".

Definition at line 278 of file embedder.h.

278 {
279 /// The property is not applicable to this semantics node.
281 /// The property is applicable and its state is "true" or "on".
283 /// The property is applicable and its state is "false" or "off".
FlutterTristate
Definition embedder.h:278
@ kFlutterTristateTrue
The property is applicable and its state is "true" or "on".
Definition embedder.h:282
@ kFlutterTristateFalse
The property is applicable and its state is "false" or "off".
Definition embedder.h:284
@ kFlutterTristateNone
The property is not applicable to this semantics node.
Definition embedder.h:280

◆ FlutterViewFocusDirection

Represents the direction in which the focus transitioned across [FlutterView]s.

Enumerator
kUndefined 

Indicates the focus transition did not have a direction.

This is typically associated with focus being programmatically requested or when focus is lost.

kForward 

Indicates the focus transition was performed in a forward direction.

This is typically result of the user pressing tab.

kBackward 

Indicates the focus transition was performed in a backward direction.

This is typically result of the user pressing shift + tab.

Definition at line 1200 of file embedder.h.

1200 {
1201 /// Indicates the focus transition did not have a direction.
1202 ///
1203 /// This is typically associated with focus being programmatically requested
1204 /// or when focus is lost.
1205 kUndefined,
1206
1207 /// Indicates the focus transition was performed in a forward direction.
1208 ///
1209 /// This is typically result of the user pressing tab.
1210 kForward,
1211
1212 /// Indicates the focus transition was performed in a backward direction.
1213 ///
1214 /// This is typically result of the user pressing shift + tab.
1215 kBackward,
FlutterViewFocusDirection
Definition embedder.h:1200
@ kBackward
Definition embedder.h:1215
@ kForward
Definition embedder.h:1210
@ kUndefined
Definition embedder.h:1205

◆ FlutterViewFocusState

Represents the focus state of a given [FlutterView].

Enumerator
kUnfocused 

Specifies that a view does not have platform focus.

kFocused 

Specifies that a view has platform focus.

Definition at line 1219 of file embedder.h.

1219 {
1220 /// Specifies that a view does not have platform focus.
1221 kUnfocused,
1222
1223 /// Specifies that a view has platform focus.
1224 kFocused,
FlutterViewFocusState
Represents the focus state of a given [FlutterView].
Definition embedder.h:1219
@ kUnfocused
Specifies that a view does not have platform focus.
Definition embedder.h:1221
@ kFocused
Specifies that a view has platform focus.
Definition embedder.h:1224

Function Documentation

◆ __FlutterEngineFlushPendingTasksNow()

FLUTTER_EXPORT FlutterEngineResult __FlutterEngineFlushPendingTasksNow ( )

This API is only meant to be used by platforms that need to flush tasks on a message loop not controlled by the Flutter engine.

Returns
The result of the call.

Definition at line 3146 of file embedder.cc.

3146 {
3148 return kSuccess;
3149}
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
void RunExpiredTasksNow()

References fml::MessageLoop::GetCurrent(), kSuccess, and fml::MessageLoop::RunExpiredTasksNow().

◆ FlutterEngineAddView()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineAddView ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterAddViewInfo info 
)

Adds a view.

        This is an asynchronous operation. The view should not be used
        until the |info.add_view_callback| is invoked with an |added|
        value of true. The embedder should prepare resources in advance
        but be ready to clean up on failure.

        A frame is scheduled if the operation succeeds.

        The callback is invoked on a thread managed by the engine. The
        embedder should re-thread if needed.

        Attempting to add the implicit view will fail and will return
        kInvalidArguments. Attempting to add a view with an already
        existing view ID will fail, and |info.add_view_callback| will be
        invoked with an |added| value of false.
Parameters
[in]engineA running engine instance.
[in]infoThe add view arguments. This can be deallocated once |FlutterEngineAddView| returns, before |add_view_callback| is invoked.
Returns
The result of starting the asynchronous operation. If kSuccess, the |add_view_callback| will be invoked.

Definition at line 2538 of file embedder.cc.

2540 {
2541 if (!engine) {
2542 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2543 }
2544 if (!info || !info->view_metrics || !info->add_view_callback) {
2546 "Add view info handle was invalid.");
2547 }
2548
2551 return LOG_EMBEDDER_ERROR(
2553 "Add view info was invalid. The implicit view cannot be added.");
2554 }
2556 view_id) {
2559 "Add view info was invalid. The info and "
2560 "window metric view IDs must match.");
2561 }
2562 }
2563
2564 // TODO(loicsharma): Return an error if the engine was initialized with
2565 // callbacks that are incompatible with multiple views.
2566 // https://github.com/flutter/flutter/issues/144806
2567
2568 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2570
2571 if (const std::string* error = std::get_if<std::string>(&metrics_or_error)) {
2572 return LOG_EMBEDDER_ERROR(kInvalidArguments, error->c_str());
2573 }
2574
2575 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2576
2577 // The engine must be running to add a view.
2578 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2579 if (!embedder_engine->IsValid()) {
2580 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2581 }
2582
2584 [c_callback = info->add_view_callback,
2585 user_data = info->user_data](bool added) {
2586 FlutterAddViewResult result = {};
2587 result.struct_size = sizeof(FlutterAddViewResult);
2588 result.added = added;
2589 result.user_data = user_data;
2590 c_callback(&result);
2591 };
2592
2593 embedder_engine->GetShell().GetPlatformView()->AddView(view_id, metrics,
2594 callback);
2595 return kSuccess;
2596}
std::function< void(bool added)> AddViewCallback
#define LOG_EMBEDDER_ERROR(code, reason)
Definition embedder.cc:157
static constexpr FlutterViewId kFlutterImplicitViewId
Definition embedder.cc:112
static std::variant< flutter::ViewportMetrics, std::string > MakeViewportMetricsFromWindowMetrics(const FlutterWindowMetricsEvent *flutter_metrics)
Definition embedder.cc:1625
int64_t FlutterViewId
Definition embedder.h:393
#define SAFE_ACCESS(pointer, member, default_value)
FlutterEngine engine
Definition main.cc:84
const uint8_t uint32_t uint32_t GError ** error
G_BEGIN_DECLS FlutterViewId view_id
FlutterDesktopBinaryReply callback
FlutterAddViewCallback add_view_callback
Definition embedder.h:1147
FlutterViewId view_id
The identifier for the view to add. This must be unique.
Definition embedder.h:1127
const FlutterWindowMetricsEvent * view_metrics
Definition embedder.h:1132
void * user_data
The |FlutterAddViewInfo.user_data|.
Definition embedder.h:1111
bool added
True if the add view operation succeeded.
Definition embedder.h:1108

References FlutterAddViewInfo::add_view_callback, FlutterAddViewResult::added, callback, engine, error, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, MakeViewportMetricsFromWindowMetrics(), SAFE_ACCESS, FlutterAddViewResult::struct_size, user_data, FlutterAddViewResult::user_data, FlutterAddViewInfo::user_data, FlutterAddViewInfo::view_id, view_id, and FlutterAddViewInfo::view_metrics.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineCollectAOTData()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineCollectAOTData ( FlutterEngineAOTData  data)

Collects the AOT data.

Warning
The embedder must ensure that this call is made only after all FlutterEngine instances launched using this data have been terminated, and that all of those instances were launched with the FlutterProjectArgs::shutdown_dart_vm_when_done flag set to true.
Parameters
[in]dataThe data to collect.
Returns
Returns if the AOT data was successfully collected.

Definition at line 1769 of file embedder.cc.

1769 {
1770 if (!data) {
1771 // Deleting a null object should be a no-op.
1772 return kSuccess;
1773 }
1774
1775 // Created in a unique pointer in `FlutterEngineCreateAOTData`.
1776 delete data;
1777 return kSuccess;
1778}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switch_defs.h:36

References kSuccess.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::AOTDataDeleter::operator()(), AOTDataDeleter::operator()(), and flutter::testing::TEST_F().

◆ FlutterEngineCreateAOTData()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineCreateAOTData ( const FlutterEngineAOTDataSource source,
FlutterEngineAOTData data_out 
)

Creates the necessary data structures to launch a Flutter Dart application in AOT mode. The data may only be collected after all FlutterEngine instances launched using this data have been terminated.

Parameters
[in]sourceThe source of the AOT data.
[out]data_outThe AOT data on success. Unchanged on failure.
Returns
Returns if the AOT data could be successfully resolved.

Definition at line 1715 of file embedder.cc.

1717 {
1720 "AOT data can only be created in AOT mode.");
1721 } else if (!source) {
1722 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Null source specified.");
1723 } else if (!data_out) {
1724 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Null data_out specified.");
1725 }
1726
1727 switch (source->type) {
1729 if (!source->elf_path || !fml::IsFile(source->elf_path)) {
1731 "Invalid ELF path specified.");
1732 }
1733
1734 auto aot_data = std::make_unique<_FlutterEngineAOTData>();
1735 const char* error = nullptr;
1736
1737#if OS_FUCHSIA
1738 // TODO(gw280): https://github.com/flutter/flutter/issues/50285
1739 // Dart doesn't implement Dart_LoadELF on Fuchsia
1740 Dart_LoadedElf* loaded_elf = nullptr;
1741#else
1742 Dart_LoadedElf* loaded_elf = Dart_LoadELF(
1743 source->elf_path, // file path
1744 0, // file offset
1745 &error, // error (out)
1746 &aot_data->vm_snapshot_data, // vm snapshot data (out)
1747 &aot_data->vm_snapshot_instrs, // vm snapshot instr (out)
1748 &aot_data->vm_isolate_data, // vm isolate data (out)
1749 &aot_data->vm_isolate_instrs // vm isolate instr (out)
1750 );
1751#endif
1752
1753 if (loaded_elf == nullptr) {
1755 }
1756
1757 aot_data->loaded_elf.reset(loaded_elf);
1758
1759 *data_out = aot_data.release();
1760 return kSuccess;
1761 }
1762 }
1763
1764 return LOG_EMBEDDER_ERROR(
1766 "Invalid FlutterEngineAOTDataSourceType type specified.");
1767}
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
Definition dart_vm.cc:177
bool IsFile(const std::string &path)
FlutterEngineAOTDataSourceType type
Definition embedder.h:2472
const char * elf_path
Absolute path to an ELF library file.
Definition embedder.h:2475

References FlutterEngineAOTDataSource::elf_path, error, fml::IsFile(), flutter::DartVM::IsRunningPrecompiledCode(), kFlutterEngineAOTDataSourceTypeElfPath, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and FlutterEngineAOTDataSource::type.

Referenced by FlutterEngineGetProcAddresses(), LoadAotData(), flutter::testing::EmbedderTestContext::SetupAOTDataIfNecessary(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineDeinitialize()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineDeinitialize ( FLUTTER_API_SYMBOL(FlutterEngine engine)

Stops running the Flutter engine instance. After this call, the embedder is also guaranteed that no more calls to post tasks onto custom task runners specified by the embedder are made. The Flutter engine handle still needs to be collected via a call to FlutterEngineShutdown.

Parameters
[in]engineThe running engine instance to de-initialize.
Returns
The result of the call to de-initialize the Flutter engine.

Definition at line 2674 of file embedder.cc.

2675 {
2676 if (engine == nullptr) {
2677 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2678 }
2679
2680 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2681 embedder_engine->NotifyDestroyed();
2682 embedder_engine->CollectShell();
2683 embedder_engine->CollectThreadHost();
2684 return kSuccess;
2685}

References engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and flutter::EmbedderEngine::NotifyDestroyed().

Referenced by FlutterEngineGetProcAddresses(), FlutterEngineShutdown(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().

◆ FlutterEngineDispatchSemanticsAction()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineDispatchSemanticsAction ( FLUTTER_API_SYMBOL(FlutterEngine engine,
uint64_t  node_id,
FlutterSemanticsAction  action,
const uint8_t *  data,
size_t  data_length 
)

Dispatch a semantics action to the specified semantics node in the implicit view.

Parameters
[in]engineA running engine instance.
[in]node_idThe semantics node identifier.
[in]actionThe semantics action.
[in]dataData associated with the action.
[in]data_lengthThe data length.
Returns
The result of the call.

Definition at line 3237 of file embedder.cc.

3242 {
3246 .node_id = node_id,
3247 .action = action,
3248 .data = data,
3249 .data_length = data_length};
3251}
FlutterEngineResult FlutterEngineSendSemanticsAction(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterSendSemanticsActionInfo *info)
Dispatch a semantics action to the specified semantics node within a specific view.
Definition embedder.cc:3253

References action, engine, FlutterEngineSendSemanticsAction(), kFlutterImplicitViewId, FlutterSendSemanticsActionInfo::struct_size, and view_id.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineGetCurrentTime()

FLUTTER_EXPORT uint64_t FlutterEngineGetCurrentTime ( )

Get the current time in nanoseconds from the clock used by the flutter engine. This is the system monotonic clock.

Returns
The current time in nanoseconds.

Definition at line 3350 of file embedder.cc.

3350 {
3352}
constexpr int64_t ToNanoseconds() const
Definition time_delta.h:61
constexpr TimeDelta ToEpochDelta() const
Definition time_point.h:52
static TimePoint Now()
Definition time_point.cc:49

References fml::TimePoint::Now(), fml::TimePoint::ToEpochDelta(), and fml::TimeDelta::ToNanoseconds().

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST(), and flutter::EventLoop::TimePointFromFlutterTime().

◆ FlutterEngineGetProcAddresses()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses ( FlutterEngineProcTable table)

Gets the table of engine function pointers.

Parameters
[out]tableThe table to fill with pointers. This should be zero-initialized, except for struct_size.
Returns
Returns whether the table was successfully populated.

Definition at line 3737 of file embedder.cc.

3738 {
3739 if (!table) {
3740 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Null table specified.");
3741 }
3742#define SET_PROC(member, function) \
3743 if (STRUCT_HAS_MEMBER(table, member)) { \
3744 table->member = &function; \
3745 }
3746
3747 SET_PROC(CreateAOTData, FlutterEngineCreateAOTData);
3748 SET_PROC(CollectAOTData, FlutterEngineCollectAOTData);
3751 SET_PROC(Initialize, FlutterEngineInitialize);
3752 SET_PROC(Deinitialize, FlutterEngineDeinitialize);
3753 SET_PROC(RunInitialized, FlutterEngineRunInitialized);
3754 SET_PROC(SendWindowMetricsEvent, FlutterEngineSendWindowMetricsEvent);
3755 SET_PROC(SendPointerEvent, FlutterEngineSendPointerEvent);
3756 SET_PROC(SendKeyEvent, FlutterEngineSendKeyEvent);
3757 SET_PROC(SendPlatformMessage, FlutterEngineSendPlatformMessage);
3758 SET_PROC(PlatformMessageCreateResponseHandle,
3760 SET_PROC(PlatformMessageReleaseResponseHandle,
3762 SET_PROC(SendPlatformMessageResponse,
3764 SET_PROC(RegisterExternalTexture, FlutterEngineRegisterExternalTexture);
3765 SET_PROC(UnregisterExternalTexture, FlutterEngineUnregisterExternalTexture);
3766 SET_PROC(MarkExternalTextureFrameAvailable,
3768 SET_PROC(UpdateSemanticsEnabled, FlutterEngineUpdateSemanticsEnabled);
3769 SET_PROC(UpdateAccessibilityFeatures,
3771 SET_PROC(DispatchSemanticsAction, FlutterEngineDispatchSemanticsAction);
3772 SET_PROC(SendSemanticsAction, FlutterEngineSendSemanticsAction);
3774 SET_PROC(ReloadSystemFonts, FlutterEngineReloadSystemFonts);
3775 SET_PROC(TraceEventDurationBegin, FlutterEngineTraceEventDurationBegin);
3776 SET_PROC(TraceEventDurationEnd, FlutterEngineTraceEventDurationEnd);
3777 SET_PROC(TraceEventInstant, FlutterEngineTraceEventInstant);
3778 SET_PROC(PostRenderThreadTask, FlutterEnginePostRenderThreadTask);
3781 SET_PROC(UpdateLocales, FlutterEngineUpdateLocales);
3782 SET_PROC(RunsAOTCompiledDartCode, FlutterEngineRunsAOTCompiledDartCode);
3783 SET_PROC(PostDartObject, FlutterEnginePostDartObject);
3784 SET_PROC(NotifyLowMemoryWarning, FlutterEngineNotifyLowMemoryWarning);
3785 SET_PROC(PostCallbackOnAllNativeThreads,
3787 SET_PROC(NotifyDisplayUpdate, FlutterEngineNotifyDisplayUpdate);
3788 SET_PROC(ScheduleFrame, FlutterEngineScheduleFrame);
3789 SET_PROC(SetNextFrameCallback, FlutterEngineSetNextFrameCallback);
3791 SET_PROC(RemoveView, FlutterEngineRemoveView);
3792 SET_PROC(SendViewFocusEvent, FlutterEngineSendViewFocusEvent);
3793#undef SET_PROC
3794
3795 return kSuccess;
3796}
#define SET_PROC(member, function)
void FlutterEngineTraceEventInstant(const char *name)
A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavaila...
Definition embedder.cc:3323
FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Mark that a new texture frame is available for a given texture identifier.
Definition embedder.cc:3191
FlutterEngineResult FlutterEngineRunTask(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
Inform the engine to run the specified task. This task has been given to the embedder via the Flutter...
Definition embedder.cc:3354
FlutterEngineResult FlutterEngineOnVsync(FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)
Notify the engine that a vsync event occurred. A baton passed to the platform via the vsync callback ...
Definition embedder.cc:3270
FlutterEngineResult FlutterEngineRun(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method ...
Definition embedder.cc:2004
FlutterEngineResult FlutterEngineRegisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Register an external texture with a unique (per engine) identifier. Only rendering backends that supp...
Definition embedder.cc:3151
FlutterEngineResult FlutterEngineUpdateLocales(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Notify a running engine instance that the locale has been updated. The preferred locale must be the f...
Definition embedder.cc:3406
FlutterEngineResult FlutterEngineSendViewFocusEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterViewFocusEvent *event)
Notifies the engine that platform view focus state has changed.
Definition embedder.cc:2641
FlutterEngineResult FlutterEngineScheduleFrame(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Schedule a new frame to redraw the content.
Definition embedder.cc:3695
void FlutterEngineTraceEventDurationBegin(const char *name)
A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailabl...
Definition embedder.cc:3314
FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *flutter_metrics)
Definition embedder.cc:2698
uint64_t FlutterEngineGetCurrentTime()
Get the current time in nanoseconds from the clock used by the flutter engine. This is the system mon...
Definition embedder.cc:3350
FlutterEngineResult FlutterEngineSetNextFrameCallback(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data)
Schedule a callback to be called after the next frame is drawn. This must be called from the platform...
Definition embedder.cc:3707
FlutterEngineResult FlutterEnginePostRenderThreadTask(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *baton)
Posts a task onto the Flutter render thread. Typically, this may be called from any thread as long as...
Definition embedder.cc:3328
FlutterEngineResult FlutterEngineDispatchSemanticsAction(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t node_id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Dispatch a semantics action to the specified semantics node in the implicit view.
Definition embedder.cc:3237
FlutterEngineResult FlutterEnginePostDartObject(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
Posts a Dart object to specified send port. The corresponding receive port for send port can be in an...
Definition embedder.cc:3469
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDeinitialize(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Stops running the Flutter engine instance. After this call, the embedder is also guaranteed that no m...
Definition embedder.cc:2674
FlutterEngineResult FlutterEnginePostCallbackOnAllNativeThreads(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
Schedule a callback to be run on all engine managed threads. The engine will attempt to service this ...
Definition embedder.cc:3615
FLUTTER_EXPORT FlutterEngineResult FlutterEngineAddView(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info)
Adds a view.
Definition embedder.cc:2538
FlutterEngineResult FlutterEngineInitialize(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize a Flutter engine instance. This does not run the Flutter application code till the Flutter...
Definition embedder.cc:2020
FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature flags)
Sets additional accessibility features.
Definition embedder.cc:3223
FlutterEngineResult FlutterEngineShutdown(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embed...
Definition embedder.cc:2687
FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Creates a platform message response handle that allows the embedder to set a native callback for a re...
Definition embedder.cc:3069
FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
Definition embedder.cc:1769
FlutterEngineResult FlutterEngineNotifyDisplayUpdate(FLUTTER_API_SYMBOL(FlutterEngine) raw_engine, const FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *embedder_displays, size_t display_count)
Posts updates corresponding to display changes to a running engine instance.
Definition embedder.cc:3654
FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *flutter_message)
Definition embedder.cc:3018
bool FlutterEngineRunsAOTCompiledDartCode(void)
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading re...
Definition embedder.cc:3465
FlutterEngineResult FlutterEngineReloadSystemFonts(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Reloads the system fonts in engine.
Definition embedder.cc:3297
FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *pointers, size_t events_count)
Definition embedder.cc:2807
FlutterEngineResult FlutterEngineRunInitialized(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize....
Definition embedder.cc:2499
FlutterEngineResult FlutterEngineNotifyLowMemoryWarning(FLUTTER_API_SYMBOL(FlutterEngine) raw_engine)
Posts a low memory notification to a running engine instance. The engine will do its best to release ...
Definition embedder.cc:3593
FlutterEngineResult FlutterEngineUnregisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Unregister a previous texture registration.
Definition embedder.cc:3170
FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Enable or disable accessibility semantics.
Definition embedder.cc:3209
FlutterEngineResult FlutterEngineSendKeyEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Sends a key event to the engine. The framework will decide whether to handle this event in a synchron...
Definition embedder.cc:2962
void FlutterEngineTraceEventDurationEnd(const char *name)
A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable ...
Definition embedder.cc:3319
FlutterEngineResult FlutterEngineSendPlatformMessageResponse(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Send a response from the native side to a platform message from the Dart Flutter application.
Definition embedder.cc:3119
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRemoveView(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info)
Removes a view.
Definition embedder.cc:2599
FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
Definition embedder.cc:3104
FlutterEngineResult FlutterEngineCreateAOTData(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Creates the necessary data structures to launch a Flutter Dart application in AOT mode....
Definition embedder.cc:1715
#define GetCurrentTime()

References FlutterEngineProcTable::AddView, FlutterEngineProcTable::CollectAOTData, FlutterEngineProcTable::CreateAOTData, FlutterEngineProcTable::Deinitialize, FlutterEngineAddView(), FlutterEngineCollectAOTData(), FlutterEngineCreateAOTData(), FlutterEngineDeinitialize(), FlutterEngineDispatchSemanticsAction(), FlutterEngineGetCurrentTime(), FlutterEngineInitialize(), FlutterEngineMarkExternalTextureFrameAvailable(), FlutterEngineNotifyDisplayUpdate(), FlutterEngineNotifyLowMemoryWarning(), FlutterEngineOnVsync(), FlutterEnginePostCallbackOnAllNativeThreads(), FlutterEnginePostDartObject(), FlutterEnginePostRenderThreadTask(), FlutterEngineRegisterExternalTexture(), FlutterEngineReloadSystemFonts(), FlutterEngineRemoveView(), FlutterEngineRun(), FlutterEngineRunInitialized(), FlutterEngineRunsAOTCompiledDartCode(), FlutterEngineRunTask(), FlutterEngineScheduleFrame(), FlutterEngineSendKeyEvent(), FlutterEngineSendPlatformMessage(), FlutterEngineSendPlatformMessageResponse(), FlutterEngineSendPointerEvent(), FlutterEngineSendSemanticsAction(), FlutterEngineSendViewFocusEvent(), FlutterEngineSendWindowMetricsEvent(), FlutterEngineSetNextFrameCallback(), FlutterEngineShutdown(), FlutterEngineTraceEventDurationBegin(), FlutterEngineTraceEventDurationEnd(), FlutterEngineTraceEventInstant(), FlutterEngineUnregisterExternalTexture(), FlutterEngineUpdateAccessibilityFeatures(), FlutterEngineUpdateLocales(), FlutterEngineUpdateSemanticsEnabled(), FlutterPlatformMessageCreateResponseHandle(), FlutterPlatformMessageReleaseResponseHandle(), GetCurrentTime, FlutterEngineProcTable::Initialize, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterEngineProcTable::MarkExternalTextureFrameAvailable, FlutterEngineProcTable::NotifyDisplayUpdate, FlutterEngineProcTable::PlatformMessageCreateResponseHandle, FlutterEngineProcTable::PlatformMessageReleaseResponseHandle, FlutterEngineProcTable::RegisterExternalTexture, FlutterEngineProcTable::RemoveView, FlutterEngineProcTable::Run, FlutterEngineProcTable::RunInitialized, FlutterEngineProcTable::RunsAOTCompiledDartCode, FlutterEngineProcTable::RunTask, FlutterEngineProcTable::SendKeyEvent, FlutterEngineProcTable::SendPlatformMessage, FlutterEngineProcTable::SendPlatformMessageResponse, FlutterEngineProcTable::SendPointerEvent, FlutterEngineProcTable::SendSemanticsAction, FlutterEngineProcTable::SendWindowMetricsEvent, SET_PROC, FlutterEngineProcTable::Shutdown, FlutterEngineProcTable::UnregisterExternalTexture, FlutterEngineProcTable::UpdateAccessibilityFeatures, FlutterEngineProcTable::UpdateLocales, and FlutterEngineProcTable::UpdateSemanticsEnabled.

Referenced by fl_engine_init(), flutter::FlutterWindowsEngine::FlutterWindowsEngine(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().

◆ FlutterEngineInitialize()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineInitialize ( size_t  version,
const FlutterRendererConfig config,
const FlutterProjectArgs args,
void *  user_data,
FLUTTER_API_SYMBOL(FlutterEngine) *  engine_out 
)

Initialize a Flutter engine instance. This does not run the Flutter application code till the FlutterEngineRunInitialized call is made. Besides Flutter application code, no tasks are scheduled on embedder managed task runners either. This allows embedders providing custom task runners to the Flutter engine to obtain a handle to the Flutter engine before the engine can post tasks on these task runners.

Parameters
[in]versionThe Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION.
[in]configThe renderer configuration.
[in]argsThe Flutter project arguments.
user_dataA user data baton passed back to embedders in callbacks.
[out]engine_outThe engine handle on successful engine creation.
Returns
The result of the call to initialize the Flutter engine.

Definition at line 2020 of file embedder.cc.

2025 {
2026 // Step 0: Figure out arguments for shell creation.
2027 if (version != FLUTTER_ENGINE_VERSION) {
2028 return LOG_EMBEDDER_ERROR(
2030 "Flutter embedder version mismatch. There has been a breaking change. "
2031 "Please consult the changelog and update the embedder.");
2032 }
2033
2034 if (engine_out == nullptr) {
2036 "The engine out parameter was missing.");
2037 }
2038
2039 if (args == nullptr) {
2041 "The Flutter project arguments were missing.");
2042 }
2043
2044 if (SAFE_ACCESS(args, assets_path, nullptr) == nullptr) {
2045 return LOG_EMBEDDER_ERROR(
2047 "The assets path in the Flutter project arguments was missing.");
2048 }
2049
2050 if (SAFE_ACCESS(args, main_path__unused__, nullptr) != nullptr) {
2051 FML_LOG(WARNING)
2052 << "FlutterProjectArgs.main_path is deprecated and should be set null.";
2053 }
2054
2055 if (SAFE_ACCESS(args, packages_path__unused__, nullptr) != nullptr) {
2056 FML_LOG(WARNING) << "FlutterProjectArgs.packages_path is deprecated and "
2057 "should be set null.";
2058 }
2059
2060 if (!IsRendererValid(config)) {
2062 "The renderer configuration was invalid.");
2063 }
2064
2065 std::string icu_data_path;
2066 if (SAFE_ACCESS(args, icu_data_path, nullptr) != nullptr) {
2067 icu_data_path = SAFE_ACCESS(args, icu_data_path, nullptr);
2068 }
2069
2070#if !SLIMPELLER
2071 if (SAFE_ACCESS(args, persistent_cache_path, nullptr) != nullptr) {
2072 std::string persistent_cache_path =
2073 SAFE_ACCESS(args, persistent_cache_path, nullptr);
2075 }
2076
2077 if (SAFE_ACCESS(args, is_persistent_cache_read_only, false)) {
2079 }
2080#endif // !SLIMPELLER
2081
2082 fml::CommandLine command_line;
2083 if (SAFE_ACCESS(args, command_line_argc, 0) != 0 &&
2084 SAFE_ACCESS(args, command_line_argv, nullptr) != nullptr) {
2085 command_line = fml::CommandLineFromArgcArgv(
2086 SAFE_ACCESS(args, command_line_argc, 0),
2087 SAFE_ACCESS(args, command_line_argv, nullptr));
2088 }
2089
2090 flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
2091
2092 if (SAFE_ACCESS(args, aot_data, nullptr)) {
2093 if (SAFE_ACCESS(args, vm_snapshot_data, nullptr) ||
2094 SAFE_ACCESS(args, vm_snapshot_instructions, nullptr) ||
2095 SAFE_ACCESS(args, isolate_snapshot_data, nullptr) ||
2096 SAFE_ACCESS(args, isolate_snapshot_instructions, nullptr)) {
2097 return LOG_EMBEDDER_ERROR(
2099 "Multiple AOT sources specified. Embedders should provide either "
2100 "*_snapshot_* buffers or aot_data, not both.");
2101 }
2102 }
2103
2106 } else {
2108 }
2109
2110 settings.icu_data_path = icu_data_path;
2111 settings.assets_path = args->assets_path;
2112 settings.leak_vm = !SAFE_ACCESS(args, shutdown_dart_vm_when_done, false);
2113 settings.old_gen_heap_size = SAFE_ACCESS(args, dart_old_gen_heap_size, -1);
2114 settings.enable_wide_gamut = SAFE_ACCESS(args, enable_wide_gamut, false);
2115
2117 // Verify the assets path contains Dart 2 kernel assets.
2118 const std::string kApplicationKernelSnapshotFileName = "kernel_blob.bin";
2119 std::string application_kernel_path = fml::paths::JoinPaths(
2121 if (!fml::IsFile(application_kernel_path)) {
2122 return LOG_EMBEDDER_ERROR(
2124 "Not running in AOT mode but could not resolve the kernel binary.");
2125 }
2127 }
2128
2129 if (SAFE_ACCESS(args, root_isolate_create_callback, nullptr) != nullptr) {
2131 SAFE_ACCESS(args, root_isolate_create_callback, nullptr);
2133 [callback, user_data](const auto& isolate) { callback(user_data); };
2134 }
2135
2136 // Wire up callback for engine and print logging.
2137 if (SAFE_ACCESS(args, log_message_callback, nullptr) != nullptr) {
2139 SAFE_ACCESS(args, log_message_callback, nullptr);
2141 const std::string& tag,
2142 const std::string& message) {
2143 callback(tag.c_str(), message.c_str(), user_data);
2144 };
2145 } else {
2146 settings.log_message_callback = [](const std::string& tag,
2147 const std::string& message) {
2148 // Fall back to logging to stdout if unspecified.
2149 if (tag.empty()) {
2150 std::cout << tag << ": ";
2151 }
2152 std::cout << message << std::endl;
2153 };
2154 }
2155
2156 if (SAFE_ACCESS(args, log_tag, nullptr) != nullptr) {
2157 settings.log_tag = SAFE_ACCESS(args, log_tag, nullptr);
2158 }
2159
2160 bool has_update_semantics_2_callback =
2161 SAFE_ACCESS(args, update_semantics_callback2, nullptr) != nullptr;
2162 bool has_update_semantics_callback =
2163 SAFE_ACCESS(args, update_semantics_callback, nullptr) != nullptr;
2164 bool has_legacy_update_semantics_callback =
2165 SAFE_ACCESS(args, update_semantics_node_callback, nullptr) != nullptr ||
2166 SAFE_ACCESS(args, update_semantics_custom_action_callback, nullptr) !=
2167 nullptr;
2168
2169 int semantic_callback_count = (has_update_semantics_2_callback ? 1 : 0) +
2170 (has_update_semantics_callback ? 1 : 0) +
2171 (has_legacy_update_semantics_callback ? 1 : 0);
2172
2173 if (semantic_callback_count > 1) {
2174 return LOG_EMBEDDER_ERROR(
2176 "Multiple semantics update callbacks provided. "
2177 "Embedders should provide either `update_semantics_callback2`, "
2178 "`update_semantics_callback`, or both "
2179 "`update_semantics_node_callback` and "
2180 "`update_semantics_custom_action_callback`.");
2181 }
2182
2184 update_semantics_callback =
2186
2188 platform_message_response_callback = nullptr;
2189 if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) {
2190 platform_message_response_callback =
2191 [ptr = args->platform_message_callback,
2192 user_data](std::unique_ptr<flutter::PlatformMessage> message) {
2193 auto handle = new FlutterPlatformMessageResponseHandle();
2194 const FlutterPlatformMessage incoming_message = {
2195 sizeof(FlutterPlatformMessage), // struct_size
2196 message->channel().c_str(), // channel
2197 message->data().GetMapping(), // message
2198 message->data().GetSize(), // message_size
2199 handle, // response_handle
2200 };
2201 handle->message = std::move(message);
2202 return ptr(&incoming_message, user_data);
2203 };
2204 }
2205
2206 flutter::VsyncWaiterEmbedder::VsyncCallback vsync_callback = nullptr;
2207 if (SAFE_ACCESS(args, vsync_callback, nullptr) != nullptr) {
2208 vsync_callback = [ptr = args->vsync_callback, user_data](intptr_t baton) {
2209 return ptr(user_data, baton);
2210 };
2211 }
2212
2214 compute_platform_resolved_locale_callback = nullptr;
2215 if (SAFE_ACCESS(args, compute_platform_resolved_locale_callback, nullptr) !=
2216 nullptr) {
2217 compute_platform_resolved_locale_callback =
2218 [ptr = args->compute_platform_resolved_locale_callback](
2219 const std::vector<std::string>& supported_locales_data) {
2220 const size_t number_of_strings_per_locale = 3;
2221 size_t locale_count =
2222 supported_locales_data.size() / number_of_strings_per_locale;
2223 std::vector<FlutterLocale> supported_locales;
2224 std::vector<const FlutterLocale*> supported_locales_ptr;
2225 for (size_t i = 0; i < locale_count; ++i) {
2226 supported_locales.push_back(
2227 {.struct_size = sizeof(FlutterLocale),
2228 .language_code =
2229 supported_locales_data[i * number_of_strings_per_locale +
2230 0]
2231 .c_str(),
2232 .country_code =
2233 supported_locales_data[i * number_of_strings_per_locale +
2234 1]
2235 .c_str(),
2236 .script_code =
2237 supported_locales_data[i * number_of_strings_per_locale +
2238 2]
2239 .c_str(),
2240 .variant_code = nullptr});
2241 supported_locales_ptr.push_back(&supported_locales[i]);
2242 }
2243
2244 const FlutterLocale* result =
2245 ptr(supported_locales_ptr.data(), locale_count);
2246
2247 std::unique_ptr<std::vector<std::string>> out =
2248 std::make_unique<std::vector<std::string>>();
2249 if (result) {
2250 std::string language_code(SAFE_ACCESS(result, language_code, ""));
2251 if (language_code != "") {
2252 out->push_back(language_code);
2253 out->emplace_back(SAFE_ACCESS(result, country_code, ""));
2254 out->emplace_back(SAFE_ACCESS(result, script_code, ""));
2255 }
2256 }
2257 return out;
2258 };
2259 }
2260
2262 on_pre_engine_restart_callback = nullptr;
2263 if (SAFE_ACCESS(args, on_pre_engine_restart_callback, nullptr) != nullptr) {
2264 on_pre_engine_restart_callback = [ptr =
2265 args->on_pre_engine_restart_callback,
2266 user_data]() { return ptr(user_data); };
2267 }
2268
2270 nullptr;
2271 if (SAFE_ACCESS(args, channel_update_callback, nullptr) != nullptr) {
2272 channel_update_callback = [ptr = args->channel_update_callback, user_data](
2273 const std::string& name, bool listening) {
2274 FlutterChannelUpdate update{sizeof(FlutterChannelUpdate), name.c_str(),
2275 listening};
2276 ptr(&update, user_data);
2277 };
2278 }
2279
2281 view_focus_change_request_callback = nullptr;
2282 if (SAFE_ACCESS(args, view_focus_change_request_callback, nullptr) !=
2283 nullptr) {
2284 view_focus_change_request_callback =
2285 [ptr = args->view_focus_change_request_callback,
2287 FlutterViewFocusChangeRequest embedder_request{
2289 .view_id = request.view_id(),
2290 .state = static_cast<FlutterViewFocusState>(request.state()),
2291 .direction =
2292 static_cast<FlutterViewFocusDirection>(request.direction()),
2293 };
2294 ptr(&embedder_request, user_data);
2295 };
2296 }
2297
2298 auto external_view_embedder_result = InferExternalViewEmbedderFromArgs(
2299 SAFE_ACCESS(args, compositor, nullptr), settings.enable_impeller);
2300 if (!external_view_embedder_result.ok()) {
2301 FML_LOG(ERROR) << external_view_embedder_result.status().message();
2303 "Compositor arguments were invalid.");
2304 }
2305
2307 {
2308 update_semantics_callback, //
2309 platform_message_response_callback, //
2310 vsync_callback, //
2311 compute_platform_resolved_locale_callback, //
2312 on_pre_engine_restart_callback, //
2313 channel_update_callback, //
2314 view_focus_change_request_callback, //
2315 };
2316
2317 impeller::Flags impeller_flags;
2318 impeller_flags.use_sdfs = settings.impeller_use_sdfs;
2319 impeller_flags.antialiased_lines = settings.impeller_antialiased_lines;
2320
2321 auto on_create_platform_view = InferPlatformViewCreationCallback(
2322 config, user_data, platform_dispatch_table,
2323 std::move(external_view_embedder_result.value()),
2324 settings.enable_impeller, impeller_flags);
2325
2326 if (!on_create_platform_view) {
2327 return LOG_EMBEDDER_ERROR(
2329 "Could not infer platform view creation callback.");
2330 }
2331
2333 [](flutter::Shell& shell) {
2334 return std::make_unique<flutter::Rasterizer>(shell);
2335 };
2336
2337 using ExternalTextureResolver = flutter::EmbedderExternalTextureResolver;
2338 std::unique_ptr<ExternalTextureResolver> external_texture_resolver;
2339 external_texture_resolver = std::make_unique<ExternalTextureResolver>();
2340
2341#ifdef SHELL_ENABLE_GL
2343 external_texture_callback;
2344 if (config->type == kOpenGL) {
2345 const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl;
2346 if (SAFE_ACCESS(open_gl_config, gl_external_texture_frame_callback,
2347 nullptr) != nullptr) {
2348 external_texture_callback =
2349 [ptr = open_gl_config->gl_external_texture_frame_callback, user_data](
2350 int64_t texture_identifier, size_t width,
2351 size_t height) -> std::unique_ptr<FlutterOpenGLTexture> {
2352 std::unique_ptr<FlutterOpenGLTexture> texture =
2353 std::make_unique<FlutterOpenGLTexture>();
2354 if (!ptr(user_data, texture_identifier, width, height, texture.get())) {
2355 return nullptr;
2356 }
2357 return texture;
2358 };
2359 external_texture_resolver =
2360 std::make_unique<ExternalTextureResolver>(external_texture_callback);
2361 }
2362 }
2363#endif
2364#ifdef SHELL_ENABLE_METAL
2366 external_texture_metal_callback;
2367 if (config->type == kMetal) {
2368 const FlutterMetalRendererConfig* metal_config = &config->metal;
2369 if (SAFE_ACCESS(metal_config, external_texture_frame_callback, nullptr)) {
2370 external_texture_metal_callback =
2371 [ptr = metal_config->external_texture_frame_callback, user_data](
2372 int64_t texture_identifier, size_t width,
2373 size_t height) -> std::unique_ptr<FlutterMetalExternalTexture> {
2374 std::unique_ptr<FlutterMetalExternalTexture> texture =
2375 std::make_unique<FlutterMetalExternalTexture>();
2376 texture->struct_size = sizeof(FlutterMetalExternalTexture);
2377 if (!ptr(user_data, texture_identifier, width, height, texture.get())) {
2378 return nullptr;
2379 }
2380 return texture;
2381 };
2382 external_texture_resolver = std::make_unique<ExternalTextureResolver>(
2383 external_texture_metal_callback);
2384 }
2385 }
2386#endif
2387 auto custom_task_runners = SAFE_ACCESS(args, custom_task_runners, nullptr);
2388 auto thread_config_callback = [&custom_task_runners](
2389 const fml::Thread::ThreadConfig& config) {
2391 if (!custom_task_runners || !custom_task_runners->thread_priority_setter) {
2392 return;
2393 }
2395 switch (config.priority) {
2398 break;
2401 break;
2404 break;
2407 break;
2408 }
2409 custom_task_runners->thread_priority_setter(priority);
2410 };
2411 auto thread_host =
2413 custom_task_runners, thread_config_callback);
2414
2415 if (!thread_host || !thread_host->IsValid()) {
2417 "Could not set up or infer thread configuration "
2418 "to run the Flutter engine on.");
2419 }
2420
2421 auto task_runners = thread_host->GetTaskRunners();
2422
2423 if (!task_runners.IsValid()) {
2425 "Task runner configuration was invalid.");
2426 }
2427
2428 // Embedder supplied UI task runner runner does not have a message loop.
2429 bool has_ui_thread_message_loop =
2430 task_runners.GetUITaskRunner()->GetTaskQueueId().is_valid();
2431 // Message loop observers are used to flush the microtask queue.
2432 // If there is no message loop the queue is flushed from
2433 // EmbedderEngine::RunTask.
2434 settings.task_observer_add = [has_ui_thread_message_loop](
2435 intptr_t key, const fml::closure& callback) {
2436 if (has_ui_thread_message_loop) {
2438 }
2440 };
2441 settings.task_observer_remove = [has_ui_thread_message_loop](
2442 fml::TaskQueueId queue_id, intptr_t key) {
2443 if (has_ui_thread_message_loop) {
2445 }
2446 };
2447
2448 auto run_configuration =
2450
2451 if (SAFE_ACCESS(args, custom_dart_entrypoint, nullptr) != nullptr) {
2452 auto dart_entrypoint = std::string{args->custom_dart_entrypoint};
2453 if (!dart_entrypoint.empty()) {
2454 run_configuration.SetEntrypoint(std::move(dart_entrypoint));
2455 }
2456 }
2457
2458 if (SAFE_ACCESS(args, dart_entrypoint_argc, 0) > 0) {
2459 if (SAFE_ACCESS(args, dart_entrypoint_argv, nullptr) == nullptr) {
2461 "Could not determine Dart entrypoint arguments "
2462 "as dart_entrypoint_argc "
2463 "was set, but dart_entrypoint_argv was null.");
2464 }
2465 std::vector<std::string> arguments(args->dart_entrypoint_argc);
2466 for (int i = 0; i < args->dart_entrypoint_argc; ++i) {
2467 arguments[i] = std::string{args->dart_entrypoint_argv[i]};
2468 }
2469 run_configuration.SetEntrypointArgs(std::move(arguments));
2470 }
2471
2472 if (SAFE_ACCESS(args, engine_id, 0) != 0) {
2473 run_configuration.SetEngineId(args->engine_id);
2474 }
2475
2476 if (!run_configuration.IsValid()) {
2477 return LOG_EMBEDDER_ERROR(
2479 "Could not infer the Flutter project to run from given arguments.");
2480 }
2481
2482 // Create the engine but don't launch the shell or run the root isolate.
2483 auto embedder_engine = std::make_unique<flutter::EmbedderEngine>(
2484 std::move(thread_host), //
2485 std::move(task_runners), //
2486 std::move(settings), //
2487 std::move(run_configuration), //
2488 on_create_platform_view, //
2489 on_create_rasterizer, //
2490 std::move(external_texture_resolver) //
2491 );
2492
2493 // Release the ownership of the embedder engine to the caller.
2494 *engine_out = reinterpret_cast<FLUTTER_API_SYMBOL(FlutterEngine)>(
2495 embedder_engine.release());
2496 return kSuccess;
2497}
std::function< std::unique_ptr< FlutterOpenGLTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
std::function< std::unique_ptr< FlutterMetalExternalTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
static std::unique_ptr< EmbedderThreadHost > CreateEmbedderOrEngineManagedThreadHost(const FlutterCustomTaskRunners *custom_task_runners, const flutter::ThreadConfigSetter &config_setter=fml::Thread::SetCurrentThreadName)
static void SetCacheDirectoryPath(std::string path)
std::function< void()> OnPreEngineRestartCallback
std::function< void(int64_t view_id, flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions)> UpdateSemanticsCallback
std::function< void(std::unique_ptr< PlatformMessage >)> PlatformMessageResponseCallback
std::function< std::unique_ptr< std::vector< std::string > >(const std::vector< std::string > &supported_locale_data)> ComputePlatformResolvedLocaleCallback
std::function< void(const std::string &, bool)> ChanneUpdateCallback
std::function< void(const ViewFocusChangeRequest &)> ViewFocusChangeRequestCallback
static RunConfiguration InferFromSettings(const Settings &settings, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer a run configuration from the settings object. This tries to create a run configurat...
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
Definition shell.h:121
std::function< void(intptr_t)> VsyncCallback
void RemoveTaskObserver(intptr_t key)
void AddTaskObserver(intptr_t key, const fml::closure &callback)
static TaskQueueId Invalid()
@ kNormal
Default priority level.
@ kRaster
Suitable for thread which raster data.
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
@ kDisplay
Suitable for threads which generate data for the display.
static void SetCurrentThreadName(const ThreadConfig &config)
Definition thread.cc:135
static flutter::Shell::CreateCallback< flutter::PlatformView > InferPlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder, bool enable_impeller, impeller::Flags impeller_flags)
Definition embedder.cc:819
static bool IsRendererValid(const FlutterRendererConfig *config)
Definition embedder.cc:231
flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallback(const FlutterProjectArgs *args, void *user_data)
Definition embedder.cc:1958
static fml::StatusOr< std::unique_ptr< flutter::EmbedderExternalViewEmbedder > > InferExternalViewEmbedderFromArgs(const FlutterCompositor *compositor, bool enable_impeller)
Definition embedder.cc:1548
void PopulateJITSnapshotMappingCallbacks(const FlutterProjectArgs *args, flutter::Settings &settings)
Definition embedder.cc:1782
void PopulateAOTSnapshotMappingCallbacks(const FlutterProjectArgs *args, flutter::Settings &settings)
Definition embedder.cc:1825
#define FLUTTER_API_SYMBOL(symbol)
Definition embedder.h:67
struct _FlutterPlatformMessageResponseHandle FlutterPlatformMessageResponseHandle
Definition embedder.h:1469
void(* FlutterLogMessageCallback)(const char *, const char *, void *)
Definition embedder.h:2486
void(* VoidCallback)(void *)
Definition embedder.h:416
#define FLUTTER_ENGINE_VERSION
Definition embedder.h:70
const char * message
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_LOG(severity)
Definition logging.h:101
const char * name
Definition fuchsia.cc:50
static const char * kApplicationKernelSnapshotFileName
FlTexture * texture
Settings SettingsFromCommandLine(const fml::CommandLine &command_line, bool require_merged_platform_ui_thread)
Definition switches.cc:230
std::string JoinPaths(std::initializer_list< std::string > components)
Definition paths.cc:14
CommandLine CommandLineFromArgcArgv(int argc, const char *const *argv)
std::function< void()> closure
Definition closure.h:14
int32_t height
int32_t width
An update to whether a message channel has a listener set or not.
Definition embedder.h:1867
FlutterMetalTextureFrameCallback external_texture_frame_callback
Definition embedder.h:915
TextureFrameCallback gl_external_texture_frame_callback
Definition embedder.h:770
const char * channel
Definition embedder.h:1475
FlutterMetalRendererConfig metal
Definition embedder.h:1042
FlutterOpenGLRendererConfig open_gl
Definition embedder.h:1040
FlutterRendererType type
Definition embedder.h:1038
std::string application_kernel_asset
Definition settings.h:140
LogMessageCallback log_message_callback
Definition settings.h:319
std::function< void(const DartIsolate &)> root_isolate_create_callback
Definition settings.h:288
std::string assets_path
Definition settings.h:336
TaskObserverRemove task_observer_remove
Definition settings.h:285
TaskObserverAdd task_observer_add
Definition settings.h:284
std::string log_tag
Definition settings.h:323
bool impeller_antialiased_lines
Definition settings.h:242
std::string icu_data_path
Definition settings.h:330
int64_t old_gen_heap_size
Definition settings.h:355
The ThreadConfig is the thread info include thread name, thread priority.
Definition thread.h:35
bool antialiased_lines
When turned on DrawLine will use the experimental antialiased path.
Definition flags.h:11
bool use_sdfs
Use SDFs for rendering.
Definition flags.h:13

References fml::MessageLoop::AddTaskObserver(), impeller::Flags::antialiased_lines, flutter::Settings::application_kernel_asset, args, flutter::Settings::assets_path, callback, FlutterPlatformMessage::channel, fml::CommandLineFromArgcArgv(), flutter::EmbedderThreadHost::CreateEmbedderOrEngineManagedThreadHost(), CreateEmbedderSemanticsUpdateCallback(), flutter::Settings::enable_impeller, flutter::Settings::enable_wide_gamut, FlutterMetalRendererConfig::external_texture_frame_callback, FLUTTER_API_SYMBOL, FLUTTER_ENGINE_VERSION, FML_LOG, fml::MessageLoop::GetCurrent(), flutter::PersistentCache::gIsReadOnly, FlutterOpenGLRendererConfig::gl_external_texture_frame_callback, height, i, flutter::Settings::icu_data_path, flutter::Settings::impeller_antialiased_lines, flutter::Settings::impeller_use_sdfs, InferExternalViewEmbedderFromArgs(), flutter::RunConfiguration::InferFromSettings(), InferPlatformViewCreationCallback(), fml::TaskQueueId::Invalid(), fml::IsFile(), IsRendererValid(), flutter::DartVM::IsRunningPrecompiledCode(), fml::paths::JoinPaths(), kApplicationKernelSnapshotFileName, fml::Thread::kBackground, kBackground, fml::Thread::kDisplay, kDisplay, key, kInternalInconsistency, kInvalidArguments, kInvalidLibraryVersion, kMetal, fml::Thread::kNormal, kNormal, kOpenGL, fml::Thread::kRaster, kRaster, kSuccess, flutter::Settings::leak_vm, LOG_EMBEDDER_ERROR, flutter::Settings::log_message_callback, flutter::Settings::log_tag, message, FlutterRendererConfig::metal, name, flutter::Settings::old_gen_heap_size, FlutterRendererConfig::open_gl, PopulateAOTSnapshotMappingCallbacks(), PopulateJITSnapshotMappingCallbacks(), fml::MessageLoop::RemoveTaskObserver(), flutter::Settings::root_isolate_create_callback, SAFE_ACCESS, flutter::PersistentCache::SetCacheDirectoryPath(), fml::Thread::SetCurrentThreadName(), flutter::SettingsFromCommandLine(), FlutterViewFocusChangeRequest::struct_size, flutter::Settings::task_observer_add, flutter::Settings::task_observer_remove, texture, FlutterRendererConfig::type, impeller::Flags::use_sdfs, user_data, view_id, and width.

Referenced by FlutterEngineGetProcAddresses(), and FlutterEngineRun().

◆ FlutterEngineMarkExternalTextureFrameAvailable()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable ( FLUTTER_API_SYMBOL(FlutterEngine engine,
int64_t  texture_identifier 
)

Mark that a new texture frame is available for a given texture identifier.

See also
FlutterEngineRegisterExternalTexture()
FlutterEngineUnregisterExternalTexture()
Parameters
[in]engineA running engine instance.
[in]texture_identifierThe identifier of the texture whose frame has been updated.
Returns
The result of the call.

Definition at line 3191 of file embedder.cc.

3193 {
3194 if (engine == nullptr) {
3195 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3196 }
3197 if (texture_identifier == 0) {
3198 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid texture identifier.");
3199 }
3200 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)
3201 ->MarkTextureFrameAvailable(texture_identifier)) {
3202 return LOG_EMBEDDER_ERROR(
3204 "Could not mark the texture frame as being available.");
3205 }
3206 return kSuccess;
3207}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineNotifyDisplayUpdate()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineNotifyDisplayUpdate ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterEngineDisplaysUpdateType  update_type,
const FlutterEngineDisplay displays,
size_t  display_count 
)

Posts updates corresponding to display changes to a running engine instance.

Parameters
[in]update_typeThe type of update pushed to the engine.
[in]displaysThe displays affected by this update.
[in]display_countSize of the displays array, must be at least 1.
Returns
the result of the call made to the engine.

Definition at line 3654 of file embedder.cc.

3658 {
3659 if (raw_engine == nullptr) {
3660 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3661 }
3662
3663 if (!ValidDisplayConfiguration(embedder_displays, display_count)) {
3664 return LOG_EMBEDDER_ERROR(
3666 "Invalid FlutterEngineDisplay configuration specified.");
3667 }
3668
3669 auto engine = reinterpret_cast<flutter::EmbedderEngine*>(raw_engine);
3670
3671 switch (update_type) {
3673 std::vector<std::unique_ptr<flutter::Display>> displays;
3674 const auto* display = embedder_displays;
3675 for (size_t i = 0; i < display_count; i++) {
3676 displays.push_back(std::make_unique<flutter::Display>(
3677 SAFE_ACCESS(display, display_id, i), //
3678 SAFE_ACCESS(display, refresh_rate, 0), //
3679 SAFE_ACCESS(display, width, 0), //
3680 SAFE_ACCESS(display, height, 0), //
3681 SAFE_ACCESS(display, device_pixel_ratio, 1)));
3682 display = reinterpret_cast<const FlutterEngineDisplay*>(
3683 reinterpret_cast<const uint8_t*>(display) + display->struct_size);
3684 }
3685 engine->GetShell().OnDisplayUpdates(std::move(displays));
3686 return kSuccess;
3687 }
3688 default:
3689 return LOG_EMBEDDER_ERROR(
3691 "Invalid FlutterEngineDisplaysUpdateType type specified.");
3692 }
3693}
std::vector< FlutterEngineDisplay > * displays

References displays, engine, height, i, kFlutterEngineDisplaysUpdateTypeStartup, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, SAFE_ACCESS, and width.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineNotifyLowMemoryWarning()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineNotifyLowMemoryWarning ( FLUTTER_API_SYMBOL(FlutterEngine engine)

Posts a low memory notification to a running engine instance. The engine will do its best to release non-critical resources in response. It is not guaranteed that the resource would have been collected by the time this call returns however. The notification is posted to engine subsystems that may be operating on other threads.

Flutter applications can respond to these notifications by setting WidgetsBindingObserver.didHaveMemoryPressure observers.

Parameters
[in]engineA running engine instance.
Returns
If the low memory notification was sent to the running engine instance.

Definition at line 3593 of file embedder.cc.

3594 {
3595 auto engine = reinterpret_cast<flutter::EmbedderEngine*>(raw_engine);
3596 if (engine == nullptr || !engine->IsValid()) {
3597 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine was invalid.");
3598 }
3599
3600 engine->GetShell().NotifyLowMemoryWarning();
3601
3602 rapidjson::Document document;
3603 auto& allocator = document.GetAllocator();
3604
3605 document.SetObject();
3606 document.AddMember("type", "memoryPressure", allocator);
3607
3608 return DispatchJSONPlatformMessage(raw_engine, document, "flutter/system")
3609 ? kSuccess
3612 "Could not dispatch the low memory notification message.");
3613}
static bool DispatchJSONPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const rapidjson::Document &document, const std::string &channel_name)
Definition embedder.cc:3374
std::shared_ptr< ImpellerAllocator > allocator

References allocator, DispatchJSONPlatformMessage(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineOnVsync()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineOnVsync ( FLUTTER_API_SYMBOL(FlutterEngine engine,
intptr_t  baton,
uint64_t  frame_start_time_nanos,
uint64_t  frame_target_time_nanos 
)

Notify the engine that a vsync event occurred. A baton passed to the platform via the vsync callback must be returned. This call must be made on the thread on which the call to FlutterEngineRun was made.

See also
FlutterEngineGetCurrentTime()
Attention
That frame timepoints are in nanoseconds.
The system monotonic clock is used as the timebase.
Parameters
[in]engine.A running engine instance.
[in]batonThe baton supplied by the engine.
[in]frame_start_time_nanosThe point at which the vsync event occurred or will occur. If the time point is in the future, the engine will wait till that point to begin its frame workload.
[in]frame_target_time_nanosThe point at which the embedder anticipates the next vsync to occur. This is a hint the engine uses to schedule Dart VM garbage collection in periods in which the various threads are most likely to be idle. For example, for a 60Hz display, embedders should add 16.6 * 1e6 to the frame time field.
Returns
The result of the call.

Definition at line 3270 of file embedder.cc.

3274 {
3275 if (engine == nullptr) {
3276 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3277 }
3278
3279 TRACE_EVENT0("flutter", "FlutterEngineOnVsync");
3280
3281 auto start_time = fml::TimePoint::FromEpochDelta(
3282 fml::TimeDelta::FromNanoseconds(frame_start_time_nanos));
3283
3284 auto target_time = fml::TimePoint::FromEpochDelta(
3285 fml::TimeDelta::FromNanoseconds(frame_target_time_nanos));
3286
3287 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)->OnVsyncEvent(
3288 baton, start_time, target_time)) {
3289 return LOG_EMBEDDER_ERROR(
3291 "Could not notify the running engine instance of a Vsync event.");
3292 }
3293
3294 return kSuccess;
3295}
static constexpr TimeDelta FromNanoseconds(int64_t nanos)
Definition time_delta.h:40
static constexpr TimePoint FromEpochDelta(TimeDelta ticks)
Definition time_point.h:43
#define TRACE_EVENT0(category_group, name)

References engine, fml::TimePoint::FromEpochDelta(), fml::TimeDelta::FromNanoseconds(), kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and TRACE_EVENT0.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEnginePostCallbackOnAllNativeThreads()

FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostCallbackOnAllNativeThreads ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterNativeThreadCallback  callback,
void *  user_data 
)

Schedule a callback to be run on all engine managed threads. The engine will attempt to service this callback the next time the message loop for each managed thread is idle. Since the engine manages the entire lifecycle of multiple threads, there is no opportunity for the embedders to finely tune the priorities of threads directly, or, perform other thread specific configuration (for example, setting thread names for tracing). This callback gives embedders a chance to affect such tuning.

Attention
This call is expensive and must be made as few times as possible. The callback must also return immediately as not doing so may risk performance issues (especially for callbacks of type kFlutterNativeThreadTypeUI and kFlutterNativeThreadTypeRender).
Some callbacks (especially the ones of type kFlutterNativeThreadTypeWorker) may be called after the FlutterEngine instance has shut down. Embedders must be careful in handling the lifecycle of objects associated with the user data baton.
In case there are multiple running Flutter engine instances, their workers are shared.
Parameters
[in]engineA running engine instance.
[in]callbackThe callback that will get called multiple times on each engine managed thread.
[in]user_dataA baton passed by the engine to the callback. This baton is not interpreted by the engine in any way.
Returns
Returns if the callback was successfully posted to all threads.

Definition at line 3615 of file embedder.cc.

3618 {
3619 if (engine == nullptr) {
3620 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3621 }
3622
3623 if (callback == nullptr) {
3625 "Invalid native thread callback.");
3626 }
3627
3628 return reinterpret_cast<flutter::EmbedderEngine*>(engine)
3629 ->PostTaskOnEngineManagedNativeThreads(
3632 })
3633 ? kSuccess
3635 "Internal error while attempting to post "
3636 "tasks to all threads.");
3637}
impeller::ShaderType type

References callback, engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, type, and user_data.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEnginePostDartObject()

FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostDartObject ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterEngineDartPort  port,
const FlutterEngineDartObject object 
)

Posts a Dart object to specified send port. The corresponding receive port for send port can be in any isolate running in the VM. This isolate can also be the root isolate for an unrelated engine. The engine parameter is necessary only to ensure the call is not made when no engine (and hence no VM) is running.

Unlike the platform messages mechanism, there are no threading restrictions when using this API. Message can be posted on any thread and they will be made available to isolate on which the corresponding send port is listening.

However, it is the embedders responsibility to ensure that the call is not made during an ongoing call the FlutterEngineDeinitialize or FlutterEngineShutdown on another thread.

Parameters
[in]engineA running engine instance.
[in]portThe send port to send the object to.
[in]objectThe object to send to the isolate with the corresponding receive port.
Returns
If the message was posted to the send port.

Definition at line 3469 of file embedder.cc.

3472 {
3473 if (engine == nullptr) {
3474 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3475 }
3476
3477 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)->IsValid()) {
3478 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine not running.");
3479 }
3480
3481 if (port == ILLEGAL_PORT) {
3483 "Attempted to post to an illegal port.");
3484 }
3485
3486 if (object == nullptr) {
3488 "Invalid Dart object to post.");
3489 }
3490
3491 Dart_CObject dart_object = {};
3492 fml::ScopedCleanupClosure typed_data_finalizer;
3493
3494 switch (object->type) {
3496 dart_object.type = Dart_CObject_kNull;
3497 break;
3499 dart_object.type = Dart_CObject_kBool;
3500 dart_object.value.as_bool = object->bool_value;
3501 break;
3503 dart_object.type = Dart_CObject_kInt32;
3504 dart_object.value.as_int32 = object->int32_value;
3505 break;
3507 dart_object.type = Dart_CObject_kInt64;
3508 dart_object.value.as_int64 = object->int64_value;
3509 break;
3511 dart_object.type = Dart_CObject_kDouble;
3512 dart_object.value.as_double = object->double_value;
3513 break;
3515 if (object->string_value == nullptr) {
3517 "kFlutterEngineDartObjectTypeString must be "
3518 "a null terminated string but was null.");
3519 }
3520 dart_object.type = Dart_CObject_kString;
3521 dart_object.value.as_string = const_cast<char*>(object->string_value);
3522 break;
3524 auto* buffer = SAFE_ACCESS(object->buffer_value, buffer, nullptr);
3525 if (buffer == nullptr) {
3527 "kFlutterEngineDartObjectTypeBuffer must "
3528 "specify a buffer but found nullptr.");
3529 }
3530 auto buffer_size = SAFE_ACCESS(object->buffer_value, buffer_size, 0);
3531 auto callback =
3532 SAFE_ACCESS(object->buffer_value, buffer_collect_callback, nullptr);
3533 auto user_data = SAFE_ACCESS(object->buffer_value, user_data, nullptr);
3534
3535 // The user has provided a callback, let them manage the lifecycle of
3536 // the underlying data. If not, copy it out from the provided buffer.
3537
3538 if (callback == nullptr) {
3539 dart_object.type = Dart_CObject_kTypedData;
3540 dart_object.value.as_typed_data.type = Dart_TypedData_kUint8;
3541 dart_object.value.as_typed_data.length = buffer_size;
3542 dart_object.value.as_typed_data.values = buffer;
3543 } else {
3544 struct ExternalTypedDataPeer {
3545 void* user_data = nullptr;
3546 VoidCallback trampoline = nullptr;
3547 };
3548 auto peer = new ExternalTypedDataPeer();
3549 peer->user_data = user_data;
3550 peer->trampoline = callback;
3551 // This finalizer is set so that in case of failure of the
3552 // Dart_PostCObject below, we collect the peer. The embedder is still
3553 // responsible for collecting the buffer in case of non-kSuccess
3554 // returns from this method. This finalizer must be released in case
3555 // of kSuccess returns from this method.
3556 typed_data_finalizer.SetClosure([peer]() {
3557 // This is the tiny object we use as the peer to the Dart call so
3558 // that we can attach the a trampoline to the embedder supplied
3559 // callback. In case of error, we need to collect this object lest
3560 // we introduce a tiny leak.
3561 delete peer;
3562 });
3563 dart_object.type = Dart_CObject_kExternalTypedData;
3564 dart_object.value.as_external_typed_data.type = Dart_TypedData_kUint8;
3565 dart_object.value.as_external_typed_data.length = buffer_size;
3566 dart_object.value.as_external_typed_data.data = buffer;
3567 dart_object.value.as_external_typed_data.peer = peer;
3568 dart_object.value.as_external_typed_data.callback =
3569 +[](void* unused_isolate_callback_data, void* peer) {
3570 auto typed_peer = reinterpret_cast<ExternalTypedDataPeer*>(peer);
3571 typed_peer->trampoline(typed_peer->user_data);
3572 delete typed_peer;
3573 };
3574 }
3575 } break;
3576 default:
3577 return LOG_EMBEDDER_ERROR(
3579 "Invalid FlutterEngineDartObjectType type specified.");
3580 }
3581
3582 if (!Dart_PostCObject(port, &dart_object)) {
3584 "Could not post the object to the Dart VM.");
3585 }
3586
3587 // On a successful call, the VM takes ownership of and is responsible for
3588 // invoking the finalizer.
3589 typed_data_finalizer.Release();
3590 return kSuccess;
3591}
Wraps a closure that is invoked in the destructor unless released by the caller.
Definition closure.h:32
fml::closure SetClosure(const fml::closure &closure)
Definition closure.h:52
fml::closure Release()
Definition closure.h:58
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
FlutterEngineDartObjectType type
Definition embedder.h:2425
const char * string_value
Definition embedder.h:2434
const FlutterEngineDartBuffer * buffer_value
Definition embedder.h:2435

References FlutterEngineDartObject::buffer_value, callback, engine, kFlutterEngineDartObjectTypeBool, kFlutterEngineDartObjectTypeBuffer, kFlutterEngineDartObjectTypeDouble, kFlutterEngineDartObjectTypeInt32, kFlutterEngineDartObjectTypeInt64, kFlutterEngineDartObjectTypeNull, kFlutterEngineDartObjectTypeString, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, fml::ScopedCleanupClosure::Release(), SAFE_ACCESS, fml::ScopedCleanupClosure::SetClosure(), FlutterEngineDartObject::string_value, FlutterEngineDartObject::type, and user_data.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEnginePostRenderThreadTask()

FLUTTER_EXPORT FlutterEngineResult FlutterEnginePostRenderThreadTask ( FLUTTER_API_SYMBOL(FlutterEngine engine,
VoidCallback  callback,
void *  callback_data 
)

Posts a task onto the Flutter render thread. Typically, this may be called from any thread as long as a FlutterEngineShutdown on the specific engine has not already been initiated.

Parameters
[in]engineA running engine instance.
[in]callbackThe callback to execute on the render thread.
callback_dataThe callback context.
Returns
The result of the call.

Definition at line 3328 of file embedder.cc.

3331 {
3332 if (engine == nullptr) {
3333 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3334 }
3335
3336 if (callback == nullptr) {
3338 "Render thread callback was null.");
3339 }
3340
3341 auto task = [callback, baton]() { callback(baton); };
3342
3343 return reinterpret_cast<flutter::EmbedderEngine*>(engine)
3344 ->PostRenderThreadTask(task)
3345 ? kSuccess
3347 "Could not post the render thread task.");
3348}

References callback, engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineRegisterExternalTexture()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineRegisterExternalTexture ( FLUTTER_API_SYMBOL(FlutterEngine engine,
int64_t  texture_identifier 
)

Register an external texture with a unique (per engine) identifier. Only rendering backends that support external textures accept external texture registrations. After the external texture is registered, the application can mark that a frame is available by calling FlutterEngineMarkExternalTextureFrameAvailable.

See also
FlutterEngineUnregisterExternalTexture()
FlutterEngineMarkExternalTextureFrameAvailable()
Parameters
[in]engineA running engine instance.
[in]texture_identifierThe identifier of the texture to register with the engine. The embedder may supply new frames to this texture using the same identifier.
Returns
The result of the call.

Definition at line 3151 of file embedder.cc.

3153 {
3154 if (engine == nullptr) {
3155 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
3156 }
3157
3158 if (texture_identifier == 0) {
3160 "Texture identifier was invalid.");
3161 }
3162 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)->RegisterTexture(
3163 texture_identifier)) {
3165 "Could not register the specified texture.");
3166 }
3167 return kSuccess;
3168}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineReloadSystemFonts()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineReloadSystemFonts ( FLUTTER_API_SYMBOL(FlutterEngine engine)

Reloads the system fonts in engine.

Parameters
[in]engine.A running engine instance.
Returns
The result of the call.

Definition at line 3297 of file embedder.cc.

3298 {
3299 if (engine == nullptr) {
3300 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3301 }
3302
3303 TRACE_EVENT0("flutter", "FlutterEngineReloadSystemFonts");
3304
3305 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)
3306 ->ReloadSystemFonts()) {
3308 "Could not reload system fonts.");
3309 }
3310
3311 return kSuccess;
3312}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and TRACE_EVENT0.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineRemoveView()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineRemoveView ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterRemoveViewInfo info 
)

Removes a view.

        This is an asynchronous operation. The view's resources must not
        be cleaned up until |info.remove_view_callback| is invoked with
        a |removed| value of true.

        The callback is invoked on a thread managed by the engine. The
        embedder should re-thread if needed.

        Attempting to remove the implicit view will fail and will return
        kInvalidArguments. Attempting to remove a view with a
        non-existent view ID will fail, and |info.remove_view_callback|
        will be invoked with a |removed| value of false.
Parameters
[in]engineA running engine instance.
[in]infoThe remove view arguments. This can be deallocated once |FlutterEngineRemoveView| returns, before |remove_view_callback| is invoked.
Returns
The result of starting the asynchronous operation. If kSuccess, the |remove_view_callback| will be invoked.

Definition at line 2599 of file embedder.cc.

2601 {
2602 if (!engine) {
2603 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2604 }
2605 if (!info || !info->remove_view_callback) {
2607 "Remove view info handle was invalid.");
2608 }
2609
2610 if (info->view_id == kFlutterImplicitViewId) {
2611 return LOG_EMBEDDER_ERROR(
2613 "Remove view info was invalid. The implicit view cannot be removed.");
2614 }
2615
2616 // TODO(loicsharma): Return an error if the engine was initialized with
2617 // callbacks that are incompatible with multiple views.
2618 // https://github.com/flutter/flutter/issues/144806
2619
2620 // The engine must be running to remove a view.
2621 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2622 if (!embedder_engine->IsValid()) {
2623 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2624 }
2625
2627 [c_callback = info->remove_view_callback,
2628 user_data = info->user_data](bool removed) {
2629 FlutterRemoveViewResult result = {};
2630 result.struct_size = sizeof(FlutterRemoveViewResult);
2631 result.removed = removed;
2632 result.user_data = user_data;
2633 c_callback(&result);
2634 };
2635
2636 embedder_engine->GetShell().GetPlatformView()->RemoveView(info->view_id,
2637 callback);
2638 return kSuccess;
2639}
std::function< void(bool removed)> RemoveViewCallback
FlutterRemoveViewCallback remove_view_callback
Definition embedder.h:1195
FlutterViewId view_id
Definition embedder.h:1178
void * user_data
The |FlutterRemoveViewInfo.user_data|.
Definition embedder.h:1159
bool removed
True if the remove view operation succeeded.
Definition embedder.h:1156

References callback, engine, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterRemoveViewInfo::remove_view_callback, FlutterRemoveViewResult::removed, FlutterRemoveViewResult::struct_size, user_data, FlutterRemoveViewResult::user_data, FlutterRemoveViewInfo::user_data, and FlutterRemoveViewInfo::view_id.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineRun()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineRun ( size_t  version,
const FlutterRendererConfig config,
const FlutterProjectArgs args,
void *  user_data,
FLUTTER_API_SYMBOL(FlutterEngine) *  engine_out 
)

Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method for the pair of calls to FlutterEngineInitialize and FlutterEngineRunInitialized.

Note
This method of running a Flutter engine works well except in cases where the embedder specifies custom task runners via FlutterProjectArgs::custom_task_runners. In such cases, the engine may need the embedder to post tasks back to it before FlutterEngineRun has returned. Embedders can only post tasks to the engine if they have a handle to the engine. In such cases, embedders are advised to get the engine handle by calling FlutterEngineInitialize. Then they can call FlutterEngineRunInitialized knowing that they will be able to service custom tasks on other threads with the engine handle.
Parameters
[in]versionThe Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION.
[in]configThe renderer configuration.
[in]argsThe Flutter project arguments.
user_dataA user data baton passed back to embedders in callbacks.
[out]engine_outThe engine handle on successful engine creation.
Returns
The result of the call to run the Flutter engine.

Definition at line 2004 of file embedder.cc.

2009 {
2010 auto result =
2011 FlutterEngineInitialize(version, config, args, user_data, engine_out);
2012
2013 if (result != kSuccess) {
2014 return result;
2015 }
2016
2017 return FlutterEngineRunInitialized(*engine_out);
2018}

References args, FlutterEngineInitialize(), FlutterEngineRunInitialized(), kSuccess, and user_data.

Referenced by FlutterEngineGetProcAddresses(), main(), RunFlutter(), and RunFlutterEngine().

◆ FlutterEngineRunInitialized()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineRunInitialized ( FLUTTER_API_SYMBOL(FlutterEngine engine)

Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize. An initialized instance can only be run once. During and after this call, custom task runners supplied by the embedder are expected to start servicing tasks.

Parameters
[in]engineAn initialized engine instance that has not previously been run.
Returns
The result of the call to run the initialized Flutter engine instance.

Definition at line 2499 of file embedder.cc.

2500 {
2501 if (!engine) {
2502 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2503 }
2504
2505 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2506
2507 // The engine must not already be running. Initialize may only be called
2508 // once on an engine instance.
2509 if (embedder_engine->IsValid()) {
2510 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2511 }
2512
2513 // Step 1: Launch the shell.
2514 if (!embedder_engine->LaunchShell()) {
2516 "Could not launch the engine using supplied "
2517 "initialization arguments.");
2518 }
2519
2520 // Step 2: Tell the platform view to initialize itself.
2521 if (!embedder_engine->NotifyCreated()) {
2523 "Could not create platform view components.");
2524 }
2525
2526 // Step 3: Launch the root isolate.
2527 if (!embedder_engine->RunRootIsolate()) {
2528 return LOG_EMBEDDER_ERROR(
2530 "Could not run the root isolate of the Flutter application using the "
2531 "project arguments specified.");
2532 }
2533
2534 return kSuccess;
2535}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), FlutterEngineRun(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().

◆ FlutterEngineRunsAOTCompiledDartCode()

FLUTTER_EXPORT bool FlutterEngineRunsAOTCompiledDartCode ( void  )

Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading restrictions.

For embedder code that is configured for both AOT and JIT mode Dart execution based on the Flutter engine being linked to, this runtime check may be used to appropriately configure the FlutterProjectArgs. In JIT mode execution, the kernel snapshots must be present in the Flutter assets directory specified in the FlutterProjectArgs. For AOT execution, the fields vm_snapshot_data, vm_snapshot_instructions, isolate_snapshot_data and isolate_snapshot_instructions (along with their size fields) must be specified in FlutterProjectArgs.

Returns
True, if AOT Dart code is run. JIT otherwise.

Definition at line 3465 of file embedder.cc.

3465 {
3467}

References flutter::DartVM::IsRunningPrecompiledCode().

Referenced by FlutterEngineGetProcAddresses(), RunFlutterEngine(), and flutter::testing::TEST_F().

◆ FlutterEngineRunTask()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineRunTask ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterTask task 
)

Inform the engine to run the specified task. This task has been given to the embedder via the FlutterTaskRunnerDescription.post_task_callback. This call must only be made at the target time specified in that callback. Running the task before that time is undefined behavior.

Parameters
[in]engineA running engine instance.
[in]taskthe task handle.
Returns
The result of the call.

Definition at line 3354 of file embedder.cc.

3356 {
3357 if (engine == nullptr) {
3358 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3359 }
3360
3362 reinterpret_cast<intptr_t>(task->runner))) {
3363 // This task came too late, the embedder has already been destroyed.
3364 // This is not an error, just ignore the task.
3365 return kSuccess;
3366 }
3367
3368 return reinterpret_cast<flutter::EmbedderEngine*>(engine)->RunTask(task)
3369 ? kSuccess
3371 "Could not run the specified task.");
3372}
static bool RunnerIsValid(intptr_t runner)
FlutterTaskRunner runner
Definition embedder.h:1887

References engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterTask::runner, and flutter::EmbedderThreadHost::RunnerIsValid().

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().

◆ FlutterEngineScheduleFrame()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineScheduleFrame ( FLUTTER_API_SYMBOL(FlutterEngine engine)

Schedule a new frame to redraw the content.

Parameters
[in]engineA running engine instance.
Returns
the result of the call made to the engine.

Definition at line 3695 of file embedder.cc.

3696 {
3697 if (engine == nullptr) {
3698 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3699 }
3700
3701 return reinterpret_cast<flutter::EmbedderEngine*>(engine)->ScheduleFrame()
3702 ? kSuccess
3704 "Could not schedule frame.");
3705}

References engine, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineSendKeyEvent()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendKeyEvent ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterKeyEvent event,
FlutterKeyEventCallback  callback,
void *  user_data 
)

Sends a key event to the engine. The framework will decide whether to handle this event in a synchronous fashion, although due to technical limitation, the result is always reported asynchronously. The callback is guaranteed to be called exactly once.

Parameters
[in]engineA running engine instance.
[in]eventThe event data to be sent. This function will no longer access event after returning.
[in]callbackThe callback invoked by the engine when the Flutter application has decided whether it handles this event. Accepts nullptr.
[in]user_dataThe context associated with the callback. The exact same value will used to invoke callback. Accepts nullptr.
Returns
The result of the call.

Definition at line 2962 of file embedder.cc.

2966 {
2967 if (engine == nullptr) {
2968 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2969 }
2970
2971 if (event == nullptr) {
2972 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid key event.");
2973 }
2974
2975 const char* character = SAFE_ACCESS(event, character, nullptr);
2976
2977 flutter::KeyData key_data;
2978 key_data.Clear();
2979 key_data.timestamp = static_cast<uint64_t>(SAFE_ACCESS(event, timestamp, 0));
2980 key_data.type = MapKeyEventType(
2982 key_data.physical = SAFE_ACCESS(event, physical, 0);
2983 key_data.logical = SAFE_ACCESS(event, logical, 0);
2984 key_data.synthesized = SAFE_ACCESS(event, synthesized, false);
2986 event, device_type,
2988
2989 auto packet = std::make_unique<flutter::KeyDataPacket>(key_data, character);
2990
2991 struct MessageData {
2993 void* user_data;
2994 };
2995
2996 MessageData* message_data =
2997 new MessageData{.callback = callback, .user_data = user_data};
2998
2999 // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
3001 engine, kFlutterKeyDataChannel, packet->data().data(),
3002 packet->data().size(),
3003 [](const uint8_t* data, size_t size, void* user_data) {
3004 auto message_data = std::unique_ptr<MessageData>(
3005 reinterpret_cast<MessageData*>(user_data));
3006 if (message_data->callback == nullptr) {
3007 return;
3008 }
3009 bool handled = false;
3010 if (size == 1) {
3011 handled = *data != 0;
3012 }
3013 message_data->callback(handled, message_data->user_data);
3014 },
3015 message_data);
3016}
static FlutterEngineResult InternalSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const char *channel, const uint8_t *data, size_t size, FlutterDataCallback data_callback, void *user_data)
Definition embedder.cc:2926
static flutter::KeyEventDeviceType MapKeyEventDeviceType(FlutterKeyEventDeviceType event_kind)
Definition embedder.cc:2906
static flutter::KeyEventType MapKeyEventType(FlutterKeyEventType event_kind)
Definition embedder.cc:2893
const char * kFlutterKeyDataChannel
Definition embedder.cc:134
void(* FlutterKeyEventCallback)(bool, void *)
Definition embedder.h:1465
uint64_t synthesized
Definition key_data.h:70
KeyEventDeviceType device_type
Definition key_data.h:71
uint64_t logical
Definition key_data.h:66
uint64_t physical
Definition key_data.h:65
KeyEventType type
Definition key_data.h:64
uint64_t timestamp
Definition key_data.h:63

References callback, character, flutter::KeyData::Clear(), flutter::KeyData::device_type, engine, InternalSendPlatformMessage(), kFlutterKeyDataChannel, kFlutterKeyEventDeviceTypeKeyboard, kFlutterKeyEventTypeUp, kInvalidArguments, LOG_EMBEDDER_ERROR, flutter::KeyData::logical, MapKeyEventDeviceType(), MapKeyEventType(), flutter::KeyData::physical, SAFE_ACCESS, flutter::KeyData::synthesized, flutter::KeyData::timestamp, type, flutter::KeyData::type, and user_data.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineSendPlatformMessage()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessage ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterPlatformMessage message 
)

Definition at line 3018 of file embedder.cc.

3020 {
3021 if (engine == nullptr) {
3022 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3023 }
3024
3025 if (flutter_message == nullptr) {
3026 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid message argument.");
3027 }
3028
3029 if (SAFE_ACCESS(flutter_message, channel, nullptr) == nullptr) {
3030 return LOG_EMBEDDER_ERROR(
3031 kInvalidArguments, "Message argument did not specify a valid channel.");
3032 }
3033
3034 size_t message_size = SAFE_ACCESS(flutter_message, message_size, 0);
3035 const uint8_t* message_data = SAFE_ACCESS(flutter_message, message, nullptr);
3036
3037 if (message_size != 0 && message_data == nullptr) {
3038 return LOG_EMBEDDER_ERROR(
3040 "Message size was non-zero but the message data was nullptr.");
3041 }
3042
3043 const FlutterPlatformMessageResponseHandle* response_handle =
3044 SAFE_ACCESS(flutter_message, response_handle, nullptr);
3045
3047 if (response_handle && response_handle->message) {
3048 response = response_handle->message->response();
3049 }
3050
3051 std::unique_ptr<flutter::PlatformMessage> message;
3052 if (message_size == 0) {
3053 message = std::make_unique<flutter::PlatformMessage>(
3054 flutter_message->channel, response);
3055 } else {
3056 message = std::make_unique<flutter::PlatformMessage>(
3057 flutter_message->channel,
3058 fml::MallocMapping::Copy(message_data, message_size), response);
3059 }
3060
3061 return reinterpret_cast<flutter::EmbedderEngine*>(engine)
3062 ->SendPlatformMessage(std::move(message))
3063 ? kSuccess
3065 "Could not send a message to the running "
3066 "Flutter application.");
3067}
static MallocMapping Copy(const T *begin, const T *end)
Definition mapping.h:162
const gchar * channel
std::unique_ptr< flutter::PlatformMessage > message
Definition embedder.cc:1694

References FlutterPlatformMessage::channel, channel, fml::MallocMapping::Copy(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, _FlutterPlatformMessageResponseHandle::message, message, and SAFE_ACCESS.

Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineSendPlatformMessageResponse()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessageResponse ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterPlatformMessageResponseHandle handle,
const uint8_t *  data,
size_t  data_length 
)

Send a response from the native side to a platform message from the Dart Flutter application.

Parameters
[in]engineThe running engine instance.
[in]handleThe platform message response handle.
[in]dataThe data to associate with the platform message response.
[in]data_lengthThe length of the platform message response data.
Returns
The result of the call.

Definition at line 3119 of file embedder.cc.

3123 {
3124 if (data_length != 0 && data == nullptr) {
3125 return LOG_EMBEDDER_ERROR(
3127 "Data size was non zero but the pointer to the data was null.");
3128 }
3129
3130 auto response = handle->message->response();
3131
3132 if (response) {
3133 if (data_length == 0) {
3134 response->CompleteEmpty();
3135 } else {
3136 response->Complete(std::make_unique<fml::DataMapping>(
3137 std::vector<uint8_t>({data, data + data_length})));
3138 }
3139 }
3140
3141 delete handle;
3142
3143 return kSuccess;
3144}

References kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and _FlutterPlatformMessageResponseHandle::message.

Referenced by FlutterDesktopMessengerSendResponse(), FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineSendPointerEvent()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPointerEvent ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterPointerEvent events,
size_t  events_count 
)

Definition at line 2807 of file embedder.cc.

2810 {
2811 if (engine == nullptr) {
2812 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2813 }
2814
2815 if (pointers == nullptr || events_count == 0) {
2816 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid pointer events.");
2817 }
2818
2819 auto packet = std::make_unique<flutter::PointerDataPacket>(events_count);
2820
2821 const FlutterPointerEvent* current = pointers;
2822
2823 for (size_t i = 0; i < events_count; ++i) {
2824 flutter::PointerData pointer_data;
2825 pointer_data.Clear();
2826 // this is currely in use only on android embedding.
2827 pointer_data.embedder_id = 0;
2828 pointer_data.time_stamp = SAFE_ACCESS(current, timestamp, 0);
2829 pointer_data.change = ToPointerDataChange(
2830 SAFE_ACCESS(current, phase, FlutterPointerPhase::kCancel));
2831 pointer_data.physical_x = SAFE_ACCESS(current, x, 0.0);
2832 pointer_data.physical_y = SAFE_ACCESS(current, y, 0.0);
2833 // Delta will be generated in pointer_data_packet_converter.cc.
2834 pointer_data.physical_delta_x = 0.0;
2835 pointer_data.physical_delta_y = 0.0;
2836 pointer_data.device = SAFE_ACCESS(current, device, 0);
2837 // Pointer identifier will be generated in
2838 // pointer_data_packet_converter.cc.
2839 pointer_data.pointer_identifier = 0;
2840 pointer_data.signal_kind = ToPointerDataSignalKind(
2841 SAFE_ACCESS(current, signal_kind, kFlutterPointerSignalKindNone));
2842 pointer_data.scroll_delta_x = SAFE_ACCESS(current, scroll_delta_x, 0.0);
2843 pointer_data.scroll_delta_y = SAFE_ACCESS(current, scroll_delta_y, 0.0);
2844 FlutterPointerDeviceKind device_kind =
2845 SAFE_ACCESS(current, device_kind, kFlutterPointerDeviceKindMouse);
2846 // For backwards compatibility with embedders written before the device
2847 // kind and buttons were exposed, if the device kind is not set treat it
2848 // as a mouse, with a synthesized primary button state based on the phase.
2849 if (device_kind == 0) {
2851 pointer_data.buttons =
2853
2854 } else {
2855 pointer_data.kind = ToPointerDataKind(device_kind);
2856 if (pointer_data.kind == flutter::PointerData::DeviceKind::kTouch) {
2857 // For touch events, set the button internally rather than requiring
2858 // it at the API level, since it's a confusing construction to expose.
2859 if (pointer_data.change == flutter::PointerData::Change::kDown ||
2862 }
2863 } else {
2864 // Buttons use the same mask values, so pass them through directly.
2865 pointer_data.buttons = SAFE_ACCESS(current, buttons, 0);
2866 }
2867 }
2868 pointer_data.pan_x = SAFE_ACCESS(current, pan_x, 0.0);
2869 pointer_data.pan_y = SAFE_ACCESS(current, pan_y, 0.0);
2870 // Delta will be generated in pointer_data_packet_converter.cc.
2871 pointer_data.pan_delta_x = 0.0;
2872 pointer_data.pan_delta_y = 0.0;
2873 pointer_data.scale = SAFE_ACCESS(current, scale, 0.0);
2874 pointer_data.rotation = SAFE_ACCESS(current, rotation, 0.0);
2875 pointer_data.pressure = SAFE_ACCESS(current, pressure, 0.0);
2876 pointer_data.pressure_min = SAFE_ACCESS(current, pressure_min, 0.0);
2877 pointer_data.pressure_max = SAFE_ACCESS(current, pressure_max, 0.0);
2878 pointer_data.view_id =
2880 packet->SetPointerData(i, pointer_data);
2881 current = reinterpret_cast<const FlutterPointerEvent*>(
2882 reinterpret_cast<const uint8_t*>(current) + current->struct_size);
2883 }
2884
2885 return reinterpret_cast<flutter::EmbedderEngine*>(engine)
2886 ->DispatchPointerDataPacket(std::move(packet))
2887 ? kSuccess
2889 "Could not dispatch pointer events to the "
2890 "running Flutter application.");
2891}
int32_t x
flutter::PointerData::SignalKind ToPointerDataSignalKind(FlutterPointerSignalKind kind)
Definition embedder.cc:2769
flutter::PointerData::DeviceKind ToPointerDataKind(FlutterPointerDeviceKind device_kind)
Definition embedder.cc:2752
flutter::PointerData::Change ToPointerDataChange(FlutterPointerPhase phase)
Definition embedder.cc:2723
int64_t PointerDataButtonsForLegacyEvent(flutter::PointerData::Change change)
Definition embedder.cc:2786
VkDevice device
Definition main.cc:69
double y
@ kPointerButtonTouchContact
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
Definition embedder.h:1338

References flutter::PointerData::buttons, flutter::PointerData::change, flutter::PointerData::Clear(), device, flutter::PointerData::device, flutter::PointerData::embedder_id, engine, i, kCancel, flutter::PointerData::kDown, kFlutterImplicitViewId, kFlutterPointerDeviceKindMouse, kFlutterPointerSignalKindNone, flutter::PointerData::kind, kInternalInconsistency, kInvalidArguments, flutter::PointerData::kMouse, flutter::PointerData::kMove, flutter::kPointerButtonTouchContact, kSuccess, flutter::PointerData::kTouch, LOG_EMBEDDER_ERROR, flutter::PointerData::pan_delta_x, flutter::PointerData::pan_delta_y, flutter::PointerData::pan_x, flutter::PointerData::pan_y, flutter::PointerData::physical_delta_x, flutter::PointerData::physical_delta_y, flutter::PointerData::physical_x, flutter::PointerData::physical_y, flutter::PointerData::pointer_identifier, PointerDataButtonsForLegacyEvent(), flutter::PointerData::pressure, flutter::PointerData::pressure_max, flutter::PointerData::pressure_min, flutter::PointerData::rotation, SAFE_ACCESS, flutter::PointerData::scale, flutter::PointerData::scroll_delta_x, flutter::PointerData::scroll_delta_y, flutter::PointerData::signal_kind, FlutterPointerEvent::struct_size, flutter::PointerData::time_stamp, ToPointerDataChange(), ToPointerDataKind(), ToPointerDataSignalKind(), flutter::PointerData::view_id, view_id, x, and y.

Referenced by FlutterEngineGetProcAddresses(), GLFWcursorPositionCallbackAtPhase(), SendPointerEventWithData(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineSendSemanticsAction()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendSemanticsAction ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterSendSemanticsActionInfo info 
)

Dispatch a semantics action to the specified semantics node within a specific view.

Parameters
[in]engineA running engine instance.
[in]infoThe dispatch semantics on view arguments. This can be deallocated once |FlutterEngineSendSemanticsAction| returns.
Returns
The result of the call.

Definition at line 3253 of file embedder.cc.

3255 {
3256 if (engine == nullptr) {
3257 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3258 }
3259 auto engine_action = static_cast<flutter::SemanticsAction>(info->action);
3260 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)
3262 info->view_id, info->node_id, engine_action,
3263 fml::MallocMapping::Copy(info->data, info->data_length))) {
3265 "Could not dispatch semantics action.");
3266 }
3267 return kSuccess;
3268}
bool DispatchSemanticsAction(int64_t view_id, int node_id, flutter::SemanticsAction action, fml::MallocMapping args)
FlutterViewId view_id
The ID of the view that includes the node.
Definition embedder.h:2816
FlutterSemanticsAction action
The semantics action.
Definition embedder.h:2822
size_t data_length
The data length.
Definition embedder.h:2828
uint64_t node_id
The semantics node identifier.
Definition embedder.h:2819
const uint8_t * data
Data associated with the action.
Definition embedder.h:2825

References FlutterSendSemanticsActionInfo::action, fml::MallocMapping::Copy(), FlutterSendSemanticsActionInfo::data, FlutterSendSemanticsActionInfo::data_length, flutter::EmbedderEngine::DispatchSemanticsAction(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterSendSemanticsActionInfo::node_id, and FlutterSendSemanticsActionInfo::view_id.

Referenced by FlutterEngineDispatchSemanticsAction(), and FlutterEngineGetProcAddresses().

◆ FlutterEngineSendViewFocusEvent()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendViewFocusEvent ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterViewFocusEvent event 
)

Notifies the engine that platform view focus state has changed.

Parameters
[in]engineA running engine instance
[in]eventThe focus event data describing the change.

Definition at line 2641 of file embedder.cc.

2643 {
2644 if (!engine) {
2645 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2646 }
2647 if (!event) {
2649 "View focus event must not be null.");
2650 }
2651 // The engine must be running to focus a view.
2652 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2653 if (!embedder_engine->IsValid()) {
2654 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2655 }
2656
2657 if (!STRUCT_HAS_MEMBER(event, direction)) {
2659 "The event struct has invalid size.");
2660 }
2661
2662 flutter::ViewFocusEvent flutter_event(
2663 event->view_id, //
2664 static_cast<flutter::ViewFocusState>(event->state),
2665 static_cast<flutter::ViewFocusDirection>(event->direction));
2666
2667 embedder_engine->GetShell().GetPlatformView()->SendViewFocusEvent(
2668 flutter_event);
2669
2670 return kSuccess;
2671}
#define STRUCT_HAS_MEMBER(pointer, member)
ViewFocusDirection
Definition view_focus.h:22
FlutterViewFocusState state
The focus state of the view.
Definition embedder.h:1240
FlutterViewFocusDirection direction
The direction in which the focus transitioned across [FlutterView]s.
Definition embedder.h:1243
FlutterViewId view_id
The identifier of the view that received the focus event.
Definition embedder.h:1237

References FlutterViewFocusEvent::direction, engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterViewFocusEvent::state, STRUCT_HAS_MEMBER, and FlutterViewFocusEvent::view_id.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineSendWindowMetricsEvent()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendWindowMetricsEvent ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterWindowMetricsEvent event 
)

Definition at line 2698 of file embedder.cc.

2700 {
2701 if (engine == nullptr || flutter_metrics == nullptr) {
2702 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
2703 }
2705 SAFE_ACCESS(flutter_metrics, view_id, kFlutterImplicitViewId);
2706
2707 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2708 MakeViewportMetricsFromWindowMetrics(flutter_metrics);
2709 if (const std::string* error = std::get_if<std::string>(&metrics_or_error)) {
2710 return LOG_EMBEDDER_ERROR(kInvalidArguments, error->c_str());
2711 }
2712
2713 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2714
2715 return reinterpret_cast<flutter::EmbedderEngine*>(engine)->SetViewportMetrics(
2716 view_id, metrics)
2717 ? kSuccess
2719 "Viewport metrics were invalid.");
2720}

References engine, error, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, MakeViewportMetricsFromWindowMetrics(), SAFE_ACCESS, and view_id.

Referenced by flutter::testing::expectSoftwareRenderingOutputMatches(), FlutterEngineGetProcAddresses(), GLFWframebufferSizeCallback(), GLFWwindowSizeCallback(), SendWindowMetrics(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().

◆ FlutterEngineSetNextFrameCallback()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineSetNextFrameCallback ( FLUTTER_API_SYMBOL(FlutterEngine engine,
VoidCallback  callback,
void *  user_data 
)

Schedule a callback to be called after the next frame is drawn. This must be called from the platform thread. The callback is executed only once from the raster thread; embedders must re-thread if necessary. Performing blocking calls in this callback may introduce application jank.

Parameters
[in]engineA running engine instance.
[in]callbackThe callback to execute.
[in]user_dataA baton passed by the engine to the callback. This baton is not interpreted by the engine in any way.
Returns
The result of the call.

Definition at line 3707 of file embedder.cc.

3710 {
3711 if (engine == nullptr) {
3712 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3713 }
3714
3715 if (callback == nullptr) {
3717 "Next frame callback was null.");
3718 }
3719
3720 flutter::EmbedderEngine* embedder_engine =
3721 reinterpret_cast<flutter::EmbedderEngine*>(engine);
3722
3723 fml::WeakPtr<flutter::PlatformView> weak_platform_view =
3724 embedder_engine->GetShell().GetPlatformView();
3725
3726 if (!weak_platform_view) {
3728 "Platform view unavailable.");
3729 }
3730
3731 weak_platform_view->SetNextFrameCallback(
3733
3734 return kSuccess;
3735}
fml::WeakPtr< PlatformView > GetPlatformView()
Platform views may only be accessed on the platform task runner.
Definition shell.cc:935

References callback, engine, flutter::Shell::GetPlatformView(), flutter::EmbedderEngine::GetShell(), kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and user_data.

Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().

◆ FlutterEngineShutdown()

Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embedder API after this point. Making additional calls with this handle is undefined behavior.

Note
This de-initializes the Flutter engine instance (via an implicit call to FlutterEngineDeinitialize) if necessary.
Parameters
[in]engineThe Flutter engine instance to collect.
Returns
The result of the call to shutdown the Flutter engine instance.

Definition at line 2687 of file embedder.cc.

2688 {
2689 auto result = FlutterEngineDeinitialize(engine);
2690 if (result != kSuccess) {
2691 return result;
2692 }
2693 auto embedder_engine = reinterpret_cast<flutter::EmbedderEngine*>(engine);
2694 delete embedder_engine;
2695 return kSuccess;
2696}

References engine, FlutterEngineDeinitialize(), and kSuccess.

Referenced by FlutterDesktopDestroyWindow(), FlutterDesktopShutDownEngine(), FlutterEngineGetProcAddresses(), flutter::testing::UniqueEngineTraits::Free(), main(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineTraceEventDurationBegin()

FLUTTER_EXPORT void FlutterEngineTraceEventDurationBegin ( const char *  name)

A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailable or disabled, this has no effect. Must be balanced with an duration end event (via FlutterEngineTraceEventDurationEnd) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.

Parameters
[in]nameThe name of the trace event.

Definition at line 3314 of file embedder.cc.

3314 {
3315 fml::tracing::TraceEvent0("flutter", name, /*flow_id_count=*/0,
3316 /*flow_ids=*/nullptr);
3317}
void TraceEvent0(TraceArg category_group, TraceArg name, size_t flow_id_count, const uint64_t *flow_ids)

References name, and fml::tracing::TraceEvent0().

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineTraceEventDurationEnd()

FLUTTER_EXPORT void FlutterEngineTraceEventDurationEnd ( const char *  name)

A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable or disabled, this has no effect. This call must be preceded by a trace duration begin call (via FlutterEngineTraceEventDurationBegin) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.

Parameters
[in]nameThe name of the trace event.

Definition at line 3319 of file embedder.cc.

3319 {
3321}
void TraceEventEnd(TraceArg name)

References name, and fml::tracing::TraceEventEnd().

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineTraceEventInstant()

FLUTTER_EXPORT void FlutterEngineTraceEventInstant ( const char *  name)

A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavailable or disabled, this has no effect. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.

Parameters
[in]nameThe name of the trace event.

Definition at line 3323 of file embedder.cc.

3323 {
3324 fml::tracing::TraceEventInstant0("flutter", name, /*flow_id_count=*/0,
3325 /*flow_ids=*/nullptr);
3326}
void TraceEventInstant0(TraceArg category_group, TraceArg name, size_t flow_id_count, const uint64_t *flow_ids)

References name, and fml::tracing::TraceEventInstant0().

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineUnregisterExternalTexture()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineUnregisterExternalTexture ( FLUTTER_API_SYMBOL(FlutterEngine engine,
int64_t  texture_identifier 
)

Unregister a previous texture registration.

See also
FlutterEngineRegisterExternalTexture()
FlutterEngineMarkExternalTextureFrameAvailable()
Parameters
[in]engineA running engine instance.
[in]texture_identifierThe identifier of the texture for which new frame will not be available.
Returns
The result of the call.

Definition at line 3170 of file embedder.cc.

3172 {
3173 if (engine == nullptr) {
3174 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
3175 }
3176
3177 if (texture_identifier == 0) {
3179 "Texture identifier was invalid.");
3180 }
3181
3182 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)->UnregisterTexture(
3183 texture_identifier)) {
3185 "Could not un-register the specified texture.");
3186 }
3187
3188 return kSuccess;
3189}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses().

◆ FlutterEngineUpdateAccessibilityFeatures()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterAccessibilityFeature  features 
)

Sets additional accessibility features.

Parameters
[in]engineA running engine instance
[in]featuresThe accessibility features to set.
Returns
The result of the call.

Definition at line 3223 of file embedder.cc.

3225 {
3226 if (engine == nullptr) {
3227 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3228 }
3229 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)
3230 ->SetAccessibilityFeatures(flags)) {
3232 "Could not update accessibility features.");
3233 }
3234 return kSuccess;
3235}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterEngineUpdateLocales()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateLocales ( FLUTTER_API_SYMBOL(FlutterEngine engine,
const FlutterLocale **  locales,
size_t  locales_count 
)

Notify a running engine instance that the locale has been updated. The preferred locale must be the first item in the list of locales supplied. The other entries will be used as a fallback.

Parameters
[in]engineA running engine instance.
[in]localesThe updated locales in the order of preference.
[in]locales_countThe count of locales supplied.
Returns
Whether the locale updates were applied.

Definition at line 3406 of file embedder.cc.

3409 {
3410 if (engine == nullptr) {
3411 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3412 }
3413
3414 if (locales_count == 0) {
3415 return kSuccess;
3416 }
3417
3418 if (locales == nullptr) {
3419 return LOG_EMBEDDER_ERROR(kInvalidArguments, "No locales were specified.");
3420 }
3421
3422 rapidjson::Document document;
3423 auto& allocator = document.GetAllocator();
3424
3425 document.SetObject();
3426 document.AddMember("method", "setLocale", allocator);
3427
3428 rapidjson::Value args(rapidjson::kArrayType);
3429 args.Reserve(locales_count * 4, allocator);
3430 for (size_t i = 0; i < locales_count; ++i) {
3431 const FlutterLocale* locale = locales[i];
3432 const char* language_code_str = SAFE_ACCESS(locale, language_code, nullptr);
3433 if (language_code_str == nullptr || ::strlen(language_code_str) == 0) {
3434 return LOG_EMBEDDER_ERROR(
3436 "Language code is required but not present in FlutterLocale.");
3437 }
3438
3439 const char* country_code_str = SAFE_ACCESS(locale, country_code, "");
3440 const char* script_code_str = SAFE_ACCESS(locale, script_code, "");
3441 const char* variant_code_str = SAFE_ACCESS(locale, variant_code, "");
3442
3443 rapidjson::Value language_code, country_code, script_code, variant_code;
3444
3445 language_code.SetString(language_code_str, allocator);
3446 country_code.SetString(country_code_str ? country_code_str : "", allocator);
3447 script_code.SetString(script_code_str ? script_code_str : "", allocator);
3448 variant_code.SetString(variant_code_str ? variant_code_str : "", allocator);
3449
3450 // Required.
3451 args.PushBack(language_code, allocator);
3452 args.PushBack(country_code, allocator);
3453 args.PushBack(script_code, allocator);
3454 args.PushBack(variant_code, allocator);
3455 }
3456 document.AddMember("args", args, allocator);
3457
3458 return DispatchJSONPlatformMessage(engine, document, "flutter/localization")
3459 ? kSuccess
3461 "Could not send message to update locale of "
3462 "a running Flutter application.");
3463}

References allocator, args, DispatchJSONPlatformMessage(), engine, i, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and SAFE_ACCESS.

Referenced by FlutterEngineGetProcAddresses(), SetUpLocales(), and flutter::testing::TEST_F().

◆ FlutterEngineUpdateSemanticsEnabled()

FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateSemanticsEnabled ( FLUTTER_API_SYMBOL(FlutterEngine engine,
bool  enabled 
)

Enable or disable accessibility semantics.

Parameters
[in]engineA running engine instance.
[in]enabledWhen enabled, changes to the semantic contents of the window are sent via the FlutterUpdateSemanticsCallback2 registered to update_semantics_callback2 in FlutterProjectArgs.
Returns
The result of the call.

Definition at line 3209 of file embedder.cc.

3211 {
3212 if (engine == nullptr) {
3213 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3214 }
3215 if (!reinterpret_cast<flutter::EmbedderEngine*>(engine)->SetSemanticsEnabled(
3216 enabled)) {
3218 "Could not update semantics state.");
3219 }
3220 return kSuccess;
3221}

References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterPlatformMessageCreateResponseHandle()

FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageCreateResponseHandle ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterDataCallback  data_callback,
void *  user_data,
FlutterPlatformMessageResponseHandle **  response_out 
)

Creates a platform message response handle that allows the embedder to set a native callback for a response to a message. This handle may be set on the response_handle field of any FlutterPlatformMessage sent to the engine.

The handle must be collected via a call to FlutterPlatformMessageReleaseResponseHandle. This may be done immediately after a call to FlutterEngineSendPlatformMessage with a platform message whose response handle contains the handle created using this call. In case a handle is created but never sent in a message, the release call must still be made. Not calling release on the handle results in a small memory leak.

The user data baton passed to the data callback is the one specified in this call as the third argument.

See also
FlutterPlatformMessageReleaseResponseHandle()
Parameters
[in]engineA running engine instance.
[in]data_callbackThe callback invoked by the engine when the Flutter application send a response on the handle.
[in]user_dataThe user data associated with the data callback.
[out]response_outThe response handle created when this call is successful.
Returns
The result of the call.

Definition at line 3069 of file embedder.cc.

3073 {
3074 if (engine == nullptr) {
3075 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Engine handle was invalid.");
3076 }
3077
3078 if (data_callback == nullptr || response_out == nullptr) {
3079 return LOG_EMBEDDER_ERROR(
3080 kInvalidArguments, "Data callback or the response handle was invalid.");
3081 }
3082
3084 [user_data, data_callback](const uint8_t* data, size_t size) {
3085 data_callback(data, size, user_data);
3086 };
3087
3088 auto platform_task_runner = reinterpret_cast<flutter::EmbedderEngine*>(engine)
3089 ->GetTaskRunners()
3090 .GetPlatformTaskRunner();
3091
3092 auto handle = new FlutterPlatformMessageResponseHandle();
3093
3094 handle->message = std::make_unique<flutter::PlatformMessage>(
3095 "", // The channel is empty and unused as the response handle is going
3096 // to referenced directly in the |FlutterEngineSendPlatformMessage|
3097 // with the container message discarded.
3098 fml::MakeRefCounted<flutter::EmbedderPlatformMessageResponse>(
3099 std::move(platform_task_runner), response_callback));
3100 *response_out = handle;
3101 return kSuccess;
3102}
std::function< void(const uint8_t *data, size_t size)> Callback
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size

References engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and user_data.

Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ FlutterPlatformMessageReleaseResponseHandle()

FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle ( FLUTTER_API_SYMBOL(FlutterEngine engine,
FlutterPlatformMessageResponseHandle response 
)

Collects the handle created using FlutterPlatformMessageCreateResponseHandle.

See also
FlutterPlatformMessageCreateResponseHandle()
Parameters
[in]engineA running engine instance.
[in]responseThe platform message response handle to collect. These handles are created using FlutterPlatformMessageCreateResponseHandle().
Returns
The result of the call.

Definition at line 3104 of file embedder.cc.

3106 {
3107 if (engine == nullptr) {
3108 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid engine handle.");
3109 }
3110
3111 if (response == nullptr) {
3112 return LOG_EMBEDDER_ERROR(kInvalidArguments, "Invalid response handle.");
3113 }
3114 delete response;
3115 return kSuccess;
3116}

References engine, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.

Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

Variable Documentation

◆ kFlutterSemanticsCustomActionIdBatchEnd

FLUTTER_EXPORT const int32_t kFlutterSemanticsCustomActionIdBatchEnd
extern

FlutterSemanticsCustomAction ID used as a sentinel to signal the end of a batch of semantics custom action updates. This is unused if using FlutterUpdateSemanticsCallback2.

Definition at line 110 of file embedder.cc.

Referenced by CreateEmbedderSemanticsUpdateCallbackV1(), and flutter::testing::TEST_F().

◆ kFlutterSemanticsNodeIdBatchEnd

FLUTTER_EXPORT const int32_t kFlutterSemanticsNodeIdBatchEnd
extern

FlutterSemanticsNode ID used as a sentinel to signal the end of a batch of semantics node updates. This is unused if using FlutterUpdateSemanticsCallback2.

Definition at line 109 of file embedder.cc.

Referenced by CreateEmbedderSemanticsUpdateCallbackV1(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().