Flutter Engine
The Flutter Engine
|
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | FLUTTER_EXPORT |
#define | FLUTTER_API_SYMBOL(symbol) symbol |
#define | FLUTTER_ENGINE_VERSION 1 |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineCollectAOTData (FlutterEngineAOTData data) |
Collects the AOT data. More... | |
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 . More... | |
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. More... | |
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. More... | |
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 . More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineAddView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info) |
Adds a view. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineRemoveView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info) |
Removes a view. More... | |
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. More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterPlatformMessageReleaseResponseHandle (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response) |
Collects the handle created using FlutterPlatformMessageCreateResponseHandle . More... | |
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. More... | |
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. More... | |
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 . More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineUnregisterExternalTexture (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier) |
Unregister a previous texture registration. More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineUpdateSemanticsEnabled (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled) |
Enable or disable accessibility semantics. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineUpdateAccessibilityFeatures (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features) |
Sets additional accessibility features. More... | |
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. More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineReloadSystemFonts (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Reloads the system fonts in engine. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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 engine 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. More... | |
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. More... | |
FLUTTER_EXPORT bool | FlutterEngineRunsAOTCompiledDartCode (void) |
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading restrictions. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineScheduleFrame (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Schedule a new frame to redraw the content. More... | |
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. More... | |
FLUTTER_EXPORT FlutterEngineResult | FlutterEngineGetProcAddresses (FlutterEngineProcTable *table) |
Gets the table of engine function pointers. More... | |
Variables | |
FLUTTER_EXPORT const int32_t | kFlutterSemanticsNodeIdBatchEnd |
FLUTTER_EXPORT const int32_t | kFlutterSemanticsCustomActionIdBatchEnd |
#define FLUTTER_API_SYMBOL | ( | symbol | ) | symbol |
Definition at line 67 of file embedder.h.
#define FLUTTER_ENGINE_VERSION 1 |
Definition at line 70 of file embedder.h.
#define FLUTTER_EXPORT |
Definition at line 57 of file embedder.h.
typedef bool(* BoolCallback) (void *) |
Definition at line 406 of file embedder.h.
typedef bool(* BoolPresentInfoCallback) (void *, const FlutterPresentInfo *) |
Callback for when a surface is presented.
Definition at line 509 of file embedder.h.
typedef struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine) |
Definition at line 269 of file embedder.h.
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 885 of file embedder.h.
typedef bool(* FlutterBackingStoreCollectCallback) (const FlutterBackingStore *renderer, void *user_data) |
Definition at line 1871 of file embedder.h.
typedef bool(* FlutterBackingStoreCreateCallback) (const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data) |
Definition at line 1866 of file embedder.h.
typedef void(* FlutterChannelUpdateCallback) (const FlutterChannelUpdate *, void *) |
Definition at line 1544 of file embedder.h.
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 1967 of file embedder.h.
typedef void(* FlutterDataCallback) (const uint8_t *, size_t, void *) |
Definition at line 1181 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineAddViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info) |
Definition at line 3311 of file embedder.h.
typedef struct _FlutterEngineAOTData* FlutterEngineAOTData |
An opaque object that describes the AOT data that can be used to launch a FlutterEngine instance in AOT mode.
Definition at line 2136 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineCollectAOTDataFnPtr) (FlutterEngineAOTData data) |
Definition at line 3195 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineCreateAOTDataFnPtr) (const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out) |
Definition at line 3192 of file embedder.h.
typedef int64_t FlutterEngineDartPort |
Definition at line 2010 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineDeinitializeFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3211 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineDispatchSemanticsActionFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length) |
Definition at line 3261 of file embedder.h.
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 839 of file embedder.h.
typedef uint64_t(* FlutterEngineGetCurrentTimeFnPtr) () |
Definition at line 3281 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineInitializeFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out) |
Definition at line 3205 of file embedder.h.
typedef FlutterEngineResult( * FlutterEngineMarkExternalTextureFrameAvailableFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier) |
Definition at line 3251 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineNotifyDisplayUpdateFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count) |
Definition at line 3300 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineNotifyLowMemoryWarningFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3294 of file embedder.h.
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 3267 of file embedder.h.
typedef FlutterEngineResult( * FlutterEnginePlatformMessageCreateResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out) |
Definition at line 3230 of file embedder.h.
typedef FlutterEngineResult( * FlutterEnginePlatformMessageReleaseResponseHandleFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response) |
Definition at line 3236 of file embedder.h.
typedef FlutterEngineResult(* FlutterEnginePostCallbackOnAllNativeThreadsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data) |
Definition at line 3296 of file embedder.h.
typedef FlutterEngineResult(* FlutterEnginePostDartObjectFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object) |
Definition at line 3290 of file embedder.h.
typedef FlutterEngineResult(* FlutterEnginePostRenderThreadTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data) |
Definition at line 3277 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineRegisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier) |
Definition at line 3245 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineReloadSystemFontsFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3272 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineRemoveViewFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info) |
Definition at line 3314 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineRunFnPtr) (size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out) |
Definition at line 3197 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineRunInitializedFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3213 of file embedder.h.
typedef bool(* FlutterEngineRunsAOTCompiledDartCodeFnPtr) (void) |
Definition at line 3289 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineRunTaskFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task) |
Definition at line 3282 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineScheduleFrameFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3305 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSendKeyEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data) |
Definition at line 3222 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message) |
Definition at line 3227 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSendPlatformMessageResponseFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length) |
Definition at line 3240 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSendPointerEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count) |
Definition at line 3218 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSendWindowMetricsEventFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event) |
Definition at line 3215 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineSetNextFrameCallbackFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data) |
Definition at line 3307 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineShutdownFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Definition at line 3203 of file embedder.h.
typedef void(* FlutterEngineTraceEventDurationBeginFnPtr) (const char *name) |
Definition at line 3274 of file embedder.h.
typedef void(* FlutterEngineTraceEventDurationEndFnPtr) (const char *name) |
Definition at line 3275 of file embedder.h.
typedef void(* FlutterEngineTraceEventInstantFnPtr) (const char *name) |
Definition at line 3276 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineUnregisterExternalTextureFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier) |
Definition at line 3248 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineUpdateAccessibilityFeaturesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features) |
Definition at line 3258 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineUpdateLocalesFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count) |
Definition at line 3285 of file embedder.h.
typedef FlutterEngineResult(* FlutterEngineUpdateSemanticsEnabledFnPtr) (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled) |
Definition at line 3255 of file embedder.h.
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 489 of file embedder.h.
typedef void(* FlutterKeyEventCallback) (bool, void *) |
Definition at line 1155 of file embedder.h.
typedef bool(* FlutterLayersPresentCallback) (const FlutterLayer **layers, size_t layers_count, void *user_data) |
Definition at line 1875 of file embedder.h.
typedef void(* FlutterLogMessageCallback) (const char *, const char *, void *) |
Definition at line 2130 of file embedder.h.
typedef const void* FlutterMetalCommandQueueHandle |
Alias for id<MTLCommandQueue>.
Definition at line 599 of file embedder.h.
typedef const void* FlutterMetalDeviceHandle |
Alias for id<MTLDevice>.
Definition at line 596 of file embedder.h.
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 679 of file embedder.h.
typedef FlutterMetalTexture(* FlutterMetalTextureCallback) (void *, const FlutterFrameInfo *) |
Callback for when a metal texture is requested.
Definition at line 672 of file embedder.h.
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 642 of file embedder.h.
typedef const void* FlutterMetalTextureHandle |
Alias for id<MTLTexture>.
Definition at line 602 of file embedder.h.
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 2105 of file embedder.h.
typedef void(* FlutterPlatformMessageCallback) (const FlutterPlatformMessage *, void *) |
Definition at line 1177 of file embedder.h.
Definition at line 1160 of file embedder.h.
typedef int64_t 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 1188 of file embedder.h.
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 1882 of file embedder.h.
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 933 of file embedder.h.
typedef struct _FlutterTaskRunner* FlutterTaskRunner |
Definition at line 1548 of file embedder.h.
typedef void(* FlutterTaskRunnerPostTaskCallback) (FlutterTask, uint64_t, void *) |
Definition at line 1555 of file embedder.h.
typedef void(* FlutterUpdateSemanticsCallback) (const FlutterSemanticsUpdate *, void *) |
Definition at line 1526 of file embedder.h.
typedef void(* FlutterUpdateSemanticsCallback2) (const FlutterSemanticsUpdate2 *, void *) |
Definition at line 1530 of file embedder.h.
typedef void(* FlutterUpdateSemanticsCustomActionCallback) (const FlutterSemanticsCustomAction *, void *) |
Definition at line 1522 of file embedder.h.
typedef void(* FlutterUpdateSemanticsNodeCallback) (const FlutterSemanticsNode *, void *) |
Definition at line 1518 of file embedder.h.
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 275 of file embedder.h.
typedef void* FlutterVulkanDeviceHandle |
Alias for VkDevice.
Definition at line 714 of file embedder.h.
typedef FlutterVulkanImage(* FlutterVulkanImageCallback) (void *, const FlutterFrameInfo *) |
Callback for when a VkImage is requested.
Definition at line 740 of file embedder.h.
typedef uint64_t FlutterVulkanImageHandle |
Alias for VkImage.
Definition at line 720 of file embedder.h.
typedef void* FlutterVulkanInstanceHandle |
Alias for VkInstance.
Definition at line 708 of file embedder.h.
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 734 of file embedder.h.
typedef void* FlutterVulkanPhysicalDeviceHandle |
Alias for VkPhysicalDevice.
Definition at line 711 of file embedder.h.
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 746 of file embedder.h.
typedef void* FlutterVulkanQueueHandle |
Alias for VkQueue.
Definition at line 717 of file embedder.h.
typedef void(* OnPreEngineRestartCallback) (void *) |
Definition at line 420 of file embedder.h.
typedef void *(* ProcResolver) (void *, const char *) |
Definition at line 413 of file embedder.h.
typedef bool(* SoftwareSurfacePresentCallback) (void *, const void *, size_t, size_t) |
Definition at line 409 of file embedder.h.
typedef bool(* TextureFrameCallback) (void *, int64_t, size_t, size_t, FlutterOpenGLTexture *) |
Definition at line 414 of file embedder.h.
typedef FlutterTransformation(* TransformationCallback) (void *) |
Definition at line 407 of file embedder.h.
typedef uint32_t(* UIntCallback) (void *) |
Definition at line 408 of file embedder.h.
typedef uint32_t(* UIntFrameInfoCallback) (void *, const FlutterFrameInfo *) |
Callback for when a frame buffer object is requested.
Definition at line 483 of file embedder.h.
typedef void(* VoidCallback) (void *) |
Definition at line 298 of file embedder.h.
typedef void(* VsyncCallback) (void *, intptr_t) |
Definition at line 419 of file embedder.h.
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. |
Definition at line 91 of file embedder.h.
Definition at line 1739 of file embedder.h.
AOT data source type.
Enumerator | |
---|---|
kFlutterEngineAOTDataSourceTypeElfPath |
Definition at line 2109 of file embedder.h.
Definition at line 2012 of file embedder.h.
The update type parameter that is passed to FlutterEngineNotifyDisplayUpdate
.
Enumerator | |
---|---|
kFlutterEngineDisplaysUpdateTypeStartup |
|
kFlutterEngineDisplaysUpdateTypeCount |
Definition at line 2000 of file embedder.h.
enum FlutterEngineResult |
Enumerator | |
---|---|
kSuccess | |
kInvalidLibraryVersion | |
kInvalidArguments | |
kInternalInconsistency |
Definition at line 72 of file embedder.h.
Enumerator | |
---|---|
kFlutterKeyEventDeviceTypeKeyboard | |
kFlutterKeyEventDeviceTypeDirectionalPad | |
kFlutterKeyEventDeviceTypeGamepad | |
kFlutterKeyEventDeviceTypeJoystick | |
kFlutterKeyEventDeviceTypeHdmi |
Definition at line 1080 of file embedder.h.
enum FlutterKeyEventType |
Enumerator | |
---|---|
kFlutterKeyEventTypeUp | |
kFlutterKeyEventTypeDown | |
kFlutterKeyEventTypeRepeat |
Definition at line 1074 of file embedder.h.
Definition at line 1790 of file embedder.h.
Pixel format for the external texture.
Enumerator | |
---|---|
kYUVA | |
kRGBA |
Definition at line 605 of file embedder.h.
YUV color space for the YUV external texture.
Enumerator | |
---|---|
kBT601FullRange | |
kBT601LimitedRange |
Definition at line 611 of file embedder.h.
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.
Definition at line 2086 of file embedder.h.
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. |
Definition at line 300 of file embedder.h.
Definition at line 1688 of file embedder.h.
The device type that created a pointer event.
Enumerator | |
---|---|
kFlutterPointerDeviceKindMouse | |
kFlutterPointerDeviceKindTouch | |
kFlutterPointerDeviceKindStylus | |
kFlutterPointerDeviceKindTrackpad |
Definition at line 1007 of file embedder.h.
Flags for the buttons
field of FlutterPointerEvent
when device_kind
is kFlutterPointerDeviceKindMouse
.
Enumerator | |
---|---|
kFlutterPointerButtonMousePrimary | |
kFlutterPointerButtonMouseSecondary | |
kFlutterPointerButtonMouseMiddle | |
kFlutterPointerButtonMouseBack | |
kFlutterPointerButtonMouseForward |
Definition at line 1016 of file embedder.h.
enum 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 965 of file embedder.h.
The type of a pointer signal.
Enumerator | |
---|---|
kFlutterPointerSignalKindNone | |
kFlutterPointerSignalKindScroll | |
kFlutterPointerSignalKindScrollInertiaCancel | |
kFlutterPointerSignalKindScale |
Definition at line 1027 of file embedder.h.
enum 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.
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. |
Definition at line 113 of file embedder.h.
enum 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 |
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. |
Definition at line 172 of file embedder.h.
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:
Each pixel format in this list is documented with an example on how to get the color components from the pixel.
Definition at line 335 of file embedder.h.
Enumerator | |
---|---|
kSpellOut | |
kLocale |
Definition at line 1200 of file embedder.h.
enum 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 248 of file embedder.h.
Valid values for priority of Thread.
Definition at line 258 of file embedder.h.
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.
FlutterProjectArgs::custom_task_runners
interface. This will yield better performance and the interface is stable.Definition at line 2764 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | info | The add view arguments. This can be deallocated once |FlutterEngineAddView| returns, before |add_view_callback| is invoked. |
kSuccess
, the |add_view_callback| will be invoked. Definition at line 2193 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineCollectAOTData | ( | FlutterEngineAOTData | data | ) |
Collects the AOT data.
[in] | data | The data to collect. |
Definition at line 1480 of file embedder.cc.
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.
[in] | source | The source of the AOT data. |
[out] | data_out | The AOT data on success. Unchanged on failure. |
Definition at line 1426 of file embedder.cc.
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
.
[in] | engine | The running engine instance to de-initialize. |
Definition at line 2297 of file embedder.cc.
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] | engine | A running engine instance. |
[in] | node_id | The semantics node identifier. |
[in] | action | The semantics action. |
[in] | data | Data associated with the action. |
[in] | data_length | The data length. |
Definition at line 2855 of file embedder.cc.
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.
Definition at line 2955 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses | ( | FlutterEngineProcTable * | table | ) |
Gets the table of engine function pointers.
[out] | table | The table to fill with pointers. This should be zero-initialized, except for struct_size. |
Definition at line 3335 of file embedder.cc.
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.
[in] | version | The Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION. |
[in] | config | The renderer configuration. |
[in] | args | The Flutter project arguments. |
user_data | A user data baton passed back to embedders in callbacks. | |
[out] | engine_out | The engine handle on successful engine creation. |
Definition at line 1731 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | texture_identifier | The identifier of the texture whose frame has been updated. |
Definition at line 2809 of file embedder.cc.
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.
[in] | update_type | The type of update pushed to the engine. |
[in] | displays | The displays affected by this update. |
[in] | display_count | Size of the displays array, must be at least 1. |
Definition at line 3252 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
Definition at line 3191 of file embedder.cc.
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.
[in] | engine. | A running engine instance. |
[in] | baton | The baton supplied by the engine. |
[in] | frame_start_time_nanos | The 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_nanos | The 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. |
Definition at line 2875 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | callback | The callback that will get called multiple times on each engine managed thread. |
[in] | user_data | A baton passed by the engine to the callback. This baton is not interpreted by the engine in any way. |
Definition at line 3213 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | port | The send port to send the object to. |
[in] | object | The object to send to the isolate with the corresponding receive port. |
Definition at line 3067 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | callback | The callback to execute on the render thread. |
callback_data | The callback context. |
Definition at line 2933 of file embedder.cc.
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
.
[in] | engine | A running engine instance. |
[in] | texture_identifier | The identifier of the texture to register with the engine. The embedder may supply new frames to this texture using the same identifier. |
Definition at line 2769 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineReloadSystemFonts | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Reloads the system fonts in engine.
[in] | engine. | A running engine instance. |
Definition at line 2902 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | info | The remove view arguments. This can be deallocated once |FlutterEngineRemoveView| returns, before |remove_view_callback| is invoked. |
kSuccess
, the |remove_view_callback| will be invoked. Definition at line 2254 of file embedder.cc.
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
.
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 via the FlutterInitializeCall
. Then they can call FlutterEngineRunInitialized
knowing that they will be able to service custom tasks on other threads with the engine handle.[in] | version | The Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION. |
[in] | config | The renderer configuration. |
[in] | args | The Flutter project arguments. |
user_data | A user data baton passed back to embedders in callbacks. | |
[out] | engine_out | The engine handle on successful engine creation. |
Definition at line 1715 of file embedder.cc.
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.
[in] | engine | An initialized engine instance that has not previously been run. |
Definition at line 2154 of file embedder.cc.
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
.
Definition at line 3063 of file embedder.cc.
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 engine 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.
[in] | engine | A running engine instance. |
[in] | task | the task handle. |
Definition at line 2959 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineScheduleFrame | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Schedule a new frame to redraw the content.
[in] | engine | A running engine instance. |
Definition at line 3293 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | event | The event data to be sent. This function will no longer access event after returning. |
[in] | callback | The callback invoked by the engine when the Flutter application has decided whether it handles this event. Accepts nullptr. |
[in] | user_data | The context associated with the callback. The exact same value will used to invoke callback . Accepts nullptr. |
Definition at line 2581 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessage | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
const FlutterPlatformMessage * | message | ||
) |
Definition at line 2636 of file embedder.cc.
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.
[in] | engine | The running engine instance. |
[in] | handle | The platform message response handle. |
[in] | data | The data to associate with the platform message response. |
[in] | data_length | The length of the platform message response data. |
Definition at line 2737 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPointerEvent | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
const FlutterPointerEvent * | events, | ||
size_t | events_count | ||
) |
Definition at line 2429 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendWindowMetricsEvent | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
const FlutterWindowMetricsEvent * | event | ||
) |
Definition at line 2320 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | callback | The callback to execute. |
[in] | user_data | A baton passed by the engine to the callback. This baton is not interpreted by the engine in any way. |
Definition at line 3305 of file embedder.cc.
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.
FlutterEngineDeinitialize
) if necessary.[in] | engine | The Flutter engine instance to collect. |
Definition at line 2309 of file embedder.cc.
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.
[in] | name | The name of the trace event. |
Definition at line 2919 of file embedder.cc.
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.
[in] | name | The name of the trace event. |
Definition at line 2924 of file embedder.cc.
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.
[in] | name | The name of the trace event. |
Definition at line 2928 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUnregisterExternalTexture | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
int64_t | texture_identifier | ||
) |
Unregister a previous texture registration.
[in] | engine | A running engine instance. |
[in] | texture_identifier | The identifier of the texture for which new frame will not be available. |
Definition at line 2788 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
FlutterAccessibilityFeature | features | ||
) |
Sets additional accessibility features.
[in] | engine | A running engine instance |
[in] | features | The accessibility features to set. |
Definition at line 2841 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | locales | The updated locales in the order of preference. |
[in] | locales_count | The count of locales supplied. |
Definition at line 3004 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateSemanticsEnabled | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
bool | enabled | ||
) |
Enable or disable accessibility semantics.
[in] | engine | A running engine instance. |
[in] | enabled | When enabled, changes to the semantic contents of the window are sent via the FlutterUpdateSemanticsCallback2 registered to update_semantics_callback2 in FlutterProjectArgs . |
Definition at line 2827 of file embedder.cc.
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.
[in] | engine | A running engine instance. |
[in] | data_callback | The callback invoked by the engine when the Flutter application send a response on the handle. |
[in] | user_data | The user data associated with the data callback. |
[out] | response_out | The response handle created when this call is successful. |
Definition at line 2687 of file embedder.cc.
FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
FlutterPlatformMessageResponseHandle * | response | ||
) |
Collects the handle created using FlutterPlatformMessageCreateResponseHandle
.
[in] | engine | A running engine instance. |
[in] | response | The platform message response handle to collect. These handles are created using FlutterPlatformMessageCreateResponseHandle() . |
Definition at line 2722 of file embedder.cc.
|
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 106 of file embedder.cc.
|
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 105 of file embedder.cc.