Flutter Engine
embedder.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_EMBEDDER_H_
6 #define FLUTTER_EMBEDDER_H_
7 
8 #include <stdbool.h>
9 #include <stddef.h>
10 #include <stdint.h>
11 
12 // This file defines an Application Binary Interface (ABI), which requires more
13 // stability than regular code to remain functional for exchanging messages
14 // between different versions of the embedding and the engine, to allow for both
15 // forward and backward compatibility.
16 //
17 // Specifically,
18 // - The order, type, and size of the struct members below must remain the same,
19 // and members should not be removed.
20 // - New structures that are part of the ABI must be defined with "size_t
21 // struct_size;" as their first member, which should be initialized using
22 // "sizeof(Type)".
23 // - Enum values must not change or be removed.
24 // - Enum members without explicit values must not be reordered.
25 // - Function signatures (names, argument counts, argument order, and argument
26 // type) cannot change.
27 // - The core behavior of existing functions cannot change.
28 //
29 // These changes are allowed:
30 // - Adding new struct members at the end of a structure.
31 // - Adding new enum members with a new value.
32 // - Renaming a struct member as long as its type, size, and intent remain the
33 // same.
34 // - Renaming an enum member as long as its value and intent remains the same.
35 //
36 // It is expected that struct members and implicitly-valued enums will not
37 // always be declared in an order that is optimal for the reader, since members
38 // will be added over time, and they can't be reordered.
39 //
40 // Existing functions should continue to appear from the caller's point of view
41 // to operate as they did when they were first introduced, so introduce a new
42 // function instead of modifying the core behavior of a function (and continue
43 // to support the existing function with the previous behavior).
44 
45 #if defined(__cplusplus)
46 extern "C" {
47 #endif
48 
49 #ifndef FLUTTER_EXPORT
50 #define FLUTTER_EXPORT
51 #endif // FLUTTER_EXPORT
52 
53 #ifdef FLUTTER_API_SYMBOL_PREFIX
54 #define FLUTTER_EMBEDDING_CONCAT(a, b) a##b
55 #define FLUTTER_EMBEDDING_ADD_PREFIX(symbol, prefix) \
56  FLUTTER_EMBEDDING_CONCAT(prefix, symbol)
57 #define FLUTTER_API_SYMBOL(symbol) \
58  FLUTTER_EMBEDDING_ADD_PREFIX(symbol, FLUTTER_API_SYMBOL_PREFIX)
59 #else
60 #define FLUTTER_API_SYMBOL(symbol) symbol
61 #endif
62 
63 #define FLUTTER_ENGINE_VERSION 1
64 
65 typedef enum {
66  kSuccess = 0,
71 
72 typedef enum {
75  /// Metal is only supported on Darwin platforms (macOS / iOS).
76  /// iOS version >= 10.0 (device), 13.0 (simulator)
77  /// macOS version >= 10.14
80 
81 /// Additional accessibility features that may be enabled by the platform.
82 /// Must match the `AccessibilityFeatures` enum in window.dart.
83 typedef enum {
84  /// Indicate there is a running accessibility service which is changing the
85  /// interaction model of the device.
87  /// Indicate the platform is inverting the colors of the application.
89  /// Request that animations be disabled or simplified.
91  /// Request that text be rendered at a bold font weight.
93  /// Request that certain animations be simplified and parallax effects
94  // removed.
97 
98 /// The set of possible actions that can be conveyed to a semantics node.
99 ///
100 /// Must match the `SemanticsAction` enum in semantics.dart.
101 typedef enum {
102  /// The equivalent of a user briefly tapping the screen with the finger
103  /// without moving it.
105  /// The equivalent of a user pressing and holding the screen with the finger
106  /// for a few seconds without moving it.
108  /// The equivalent of a user moving their finger across the screen from right
109  /// to left.
111  /// The equivalent of a user moving their finger across the screen from left
112  /// to
113  /// right.
115  /// The equivalent of a user moving their finger across the screen from bottom
116  /// to top.
118  /// The equivalent of a user moving their finger across the screen from top to
119  /// bottom.
121  /// Increase the value represented by the semantics node.
123  /// Decrease the value represented by the semantics node.
125  /// A request to fully show the semantics node on screen.
127  /// Move the cursor forward by one character.
129  /// Move the cursor backward by one character.
131  /// Set the text selection to the given range.
133  /// Copy the current selection to the clipboard.
135  /// Cut the current selection and place it in the clipboard.
137  /// Paste the current content of the clipboard.
139  /// Indicate that the node has gained accessibility focus.
141  /// Indicate that the node has lost accessibility focus.
143  /// Indicate that the user has invoked a custom accessibility action.
145  /// A request that the node should be dismissed.
147  /// Move the cursor forward by one word.
149  /// Move the cursor backward by one word.
152 
153 /// The set of properties that may be associated with a semantics node.
154 ///
155 /// Must match the `SemanticsFlag` enum in semantics.dart.
156 typedef enum {
157  /// The semantics node has the quality of either being "checked" or
158  /// "unchecked".
160  /// Whether a semantics node is checked.
162  /// Whether a semantics node is selected.
164  /// Whether the semantic node represents a button.
166  /// Whether the semantic node represents a text field.
168  /// Whether the semantic node currently holds the user's focus.
170  /// The semantics node has the quality of either being "enabled" or
171  /// "disabled".
173  /// Whether a semantic node that hasEnabledState is currently enabled.
175  /// Whether a semantic node is in a mutually exclusive group.
177  /// Whether a semantic node is a header that divides content into sections.
179  /// Whether the value of the semantics node is obscured.
181  /// Whether the semantics node is the root of a subtree for which a route name
182  /// should be announced.
184  /// Whether the semantics node label is the name of a visually distinct route.
186  /// Whether the semantics node is considered hidden.
188  /// Whether the semantics node represents an image.
190  /// Whether the semantics node is a live region.
192  /// The semantics node has the quality of either being "on" or "off".
194  /// If true, the semantics node is "on". If false, the semantics node is
195  /// "off".
197  /// Whether the platform can scroll the semantics node when the user attempts
198  /// to move the accessibility focus to an offscreen child.
199  ///
200  /// For example, a `ListView` widget has implicit scrolling so that users can
201  /// easily move the accessibility focus to the next set of children. A
202  /// `PageView` widget does not have implicit scrolling, so that users don't
203  /// navigate to the next page when reaching the end of the current one.
205  /// Whether the semantic node is read only.
206  ///
207  /// Only applicable when kFlutterSemanticsFlagIsTextField flag is on.
209  /// Whether the semantic node can hold the user's focus.
211  /// Whether the semantics node represents a link.
213  /// Whether the semantics node represents a slider.
215  /// Whether the semantics node represents a keyboard key.
218 
219 typedef enum {
220  /// Text has unknown text direction.
222  /// Text is read from right to left.
224  /// Text is read from left to right.
227 
229 
230 typedef struct {
231  /// horizontal scale factor
232  double scaleX;
233  /// horizontal skew factor
234  double skewX;
235  /// horizontal translation
236  double transX;
237  /// vertical skew factor
238  double skewY;
239  /// vertical scale factor
240  double scaleY;
241  /// vertical translation
242  double transY;
243  /// input x-axis perspective factor
244  double pers0;
245  /// input y-axis perspective factor
246  double pers1;
247  /// perspective scale factor
248  double pers2;
250 
251 typedef void (*VoidCallback)(void* /* user data */);
252 
253 typedef enum {
254  /// Specifies an OpenGL texture target type. Textures are specified using
255  /// the FlutterOpenGLTexture struct.
257  /// Specifies an OpenGL frame-buffer target type. Framebuffers are specified
258  /// using the FlutterOpenGLFramebuffer struct.
261 
262 typedef struct {
263  /// Target texture of the active texture unit (example GL_TEXTURE_2D or
264  /// GL_TEXTURE_RECTANGLE).
265  uint32_t target;
266  /// The name of the texture.
267  uint32_t name;
268  /// The texture format (example GL_RGBA8).
269  uint32_t format;
270  /// User data to be returned on the invocation of the destruction callback.
271  void* user_data;
272  /// Callback invoked (on an engine managed thread) that asks the embedder to
273  /// collect the texture.
275  /// Optional parameters for texture height/width, default is 0, non-zero means
276  /// the texture has the specified width/height. Usually, when the texture type
277  /// is GL_TEXTURE_RECTANGLE, we need to specify the texture width/height to
278  /// tell the embedder to scale when rendering.
279  /// Width of the texture.
280  size_t width;
281  /// Height of the texture.
282  size_t height;
284 
285 typedef struct {
286  /// The target of the color attachment of the frame-buffer. For example,
287  /// GL_TEXTURE_2D or GL_RENDERBUFFER. In case of ambiguity when dealing with
288  /// Window bound frame-buffers, 0 may be used.
289  uint32_t target;
290 
291  /// The name of the framebuffer.
292  uint32_t name;
293 
294  /// User data to be returned on the invocation of the destruction callback.
295  void* user_data;
296 
297  /// Callback invoked (on an engine managed thread) that asks the embedder to
298  /// collect the framebuffer.
301 
302 typedef bool (*BoolCallback)(void* /* user data */);
303 typedef FlutterTransformation (*TransformationCallback)(void* /* user data */);
304 typedef uint32_t (*UIntCallback)(void* /* user data */);
305 typedef bool (*SoftwareSurfacePresentCallback)(void* /* user data */,
306  const void* /* allocation */,
307  size_t /* row bytes */,
308  size_t /* height */);
309 typedef void* (*ProcResolver)(void* /* user data */, const char* /* name */);
310 typedef bool (*TextureFrameCallback)(void* /* user data */,
311  int64_t /* texture identifier */,
312  size_t /* width */,
313  size_t /* height */,
314  FlutterOpenGLTexture* /* texture out */);
315 typedef void (*VsyncCallback)(void* /* user data */, intptr_t /* baton */);
316 typedef void (*OnPreEngineRestartCallback)(void* /* user data */);
317 
318 /// A structure to represent the width and height.
319 typedef struct {
320  double width;
321  double height;
322 } FlutterSize;
323 
324 /// A structure to represent the width and height.
325 ///
326 /// See: \ref FlutterSize when the value are not integers.
327 typedef struct {
328  uint32_t width;
329  uint32_t height;
331 
332 /// A structure to represent a rectangle.
333 typedef struct {
334  double left;
335  double top;
336  double right;
337  double bottom;
338 } FlutterRect;
339 
340 /// A structure to represent a 2D point.
341 typedef struct {
342  double x;
343  double y;
344 } FlutterPoint;
345 
346 /// A structure to represent a rounded rectangle.
347 typedef struct {
354 
355 /// This information is passed to the embedder when requesting a frame buffer
356 /// object.
357 ///
358 /// See: \ref FlutterOpenGLRendererConfig.fbo_with_frame_info_callback.
359 typedef struct {
360  /// The size of this struct. Must be sizeof(FlutterFrameInfo).
361  size_t struct_size;
362  /// The size of the surface that will be backed by the fbo.
365 
366 /// Callback for when a frame buffer object is requested.
367 typedef uint32_t (*UIntFrameInfoCallback)(
368  void* /* user data */,
369  const FlutterFrameInfo* /* frame info */);
370 
371 /// This information is passed to the embedder when a surface is presented.
372 ///
373 /// See: \ref FlutterOpenGLRendererConfig.present_with_info.
374 typedef struct {
375  /// The size of this struct. Must be sizeof(FlutterPresentInfo).
376  size_t struct_size;
377  /// Id of the fbo backing the surface that was presented.
378  uint32_t fbo_id;
380 
381 /// Callback for when a surface is presented.
382 typedef bool (*BoolPresentInfoCallback)(
383  void* /* user data */,
384  const FlutterPresentInfo* /* present info */);
385 
386 typedef struct {
387  /// The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
388  size_t struct_size;
391  /// Specifying one (and only one) of `present` or `present_with_info` is
392  /// required. Specifying both is an error and engine initialization will be
393  /// terminated. The return value indicates success of the present call.
395  /// Specifying one (and only one) of the `fbo_callback` or
396  /// `fbo_with_frame_info_callback` is required. Specifying both is an error
397  /// and engine intialization will be terminated. The return value indicates
398  /// the id of the frame buffer object that flutter will obtain the gl surface
399  /// from.
401  /// This is an optional callback. Flutter will ask the emebdder to create a GL
402  /// context current on a background thread. If the embedder is able to do so,
403  /// Flutter will assume that this context is in the same sharegroup as the
404  /// main rendering context and use this context for asynchronous texture
405  /// uploads. Though optional, it is recommended that all embedders set this
406  /// callback as it will lead to better performance in texture handling.
408  /// By default, the renderer config assumes that the FBO does not change for
409  /// the duration of the engine run. If this argument is true, the
410  /// engine will ask the embedder for an updated FBO target (via an
411  /// fbo_callback invocation) after a present call.
413  /// The transformation to apply to the render target before any rendering
414  /// operations. This callback is optional.
415  /// @attention When using a custom compositor, the layer offset and sizes
416  /// will be affected by this transformation. It will be
417  /// embedder responsibility to render contents at the
418  /// transformed offset and size. This is useful for embedders
419  /// that want to render transformed contents directly into
420  /// hardware overlay planes without having to apply extra
421  /// transformations to layer contents (which may necessitate
422  /// an expensive off-screen render pass).
425  /// When the embedder specifies that a texture has a frame available, the
426  /// engine will call this method (on an internal engine managed thread) so
427  /// that external texture details can be supplied to the engine for subsequent
428  /// composition.
430  /// Specifying one (and only one) of the `fbo_callback` or
431  /// `fbo_with_frame_info_callback` is required. Specifying both is an error
432  /// and engine intialization will be terminated. The return value indicates
433  /// the id of the frame buffer object (fbo) that flutter will obtain the gl
434  /// surface from. When using this variant, the embedder is passed a
435  /// `FlutterFrameInfo` struct that indicates the properties of the surface
436  /// that flutter will acquire from the returned fbo.
438  /// Specifying one (and only one) of `present` or `present_with_info` is
439  /// required. Specifying both is an error and engine initialization will be
440  /// terminated. When using this variant, the embedder is passed a
441  /// `FlutterPresentInfo` struct that the embedder can use to release any
442  /// resources. The return value indicates success of the present call.
445 
446 /// Alias for id<MTLDevice>.
447 typedef const void* FlutterMetalDeviceHandle;
448 
449 /// Alias for id<MTLCommandQueue>.
450 typedef const void* FlutterMetalCommandQueueHandle;
451 
452 /// Alias for id<MTLTexture>.
453 typedef const void* FlutterMetalTextureHandle;
454 
455 /// Pixel format for the external texture.
456 typedef enum {
460 
461 typedef struct {
462  /// The size of this struct. Must be sizeof(FlutterMetalExternalTexture).
463  size_t struct_size;
464  /// Height of the texture.
465  size_t width;
466  /// Height of the texture.
467  size_t height;
468  /// The pixel format type of the external.
469  FlutterMetalExternalTexturePixelFormat pixel_format;
470  /// Represents the size of the `textures` array.
471  size_t num_textures;
472  /// Supported textures are YUVA and RGBA, in case of YUVA we expect 2 texture
473  /// handles to be provided by the embedder, Y first and UV next. In case of
474  /// RGBA only one should be passed.
475  /// These are individually aliases for id<MTLTexture>. These textures are
476  /// retained by the engine for the period of the composition. Once these
477  /// textures have been unregistered via the
478  /// `FlutterEngineUnregisterExternalTexture`, the embedder has to release
479  /// these textures.
480  FlutterMetalTextureHandle* textures;
482 
483 /// Callback to provide an external texture for a given texture_id.
484 /// See: external_texture_frame_callback.
486  void* /* user data */,
487  int64_t /* texture identifier */,
488  size_t /* width */,
489  size_t /* height */,
490  FlutterMetalExternalTexture* /* texture out */);
491 
492 typedef struct {
493  /// The size of this struct. Must be sizeof(FlutterMetalTexture).
494  size_t struct_size;
495  /// Embedder provided unique identifier to the texture buffer. Given that the
496  /// `texture` handle is passed to the engine to render to, the texture buffer
497  /// is itseld owned by the embedder. This `texture_id` is then also given to
498  /// the embedder in the present callback.
499  int64_t texture_id;
500  /// Handle to the MTLTexture that is owned by the embedder. Engine will render
501  /// the frame into this texture.
502  FlutterMetalTextureHandle texture;
503  /// A baton that is not interpreted by the engine in any way. It will be given
504  /// back to the embedder in the destruction callback below. Embedder resources
505  /// may be associated with this baton.
506  void* user_data;
507  /// The callback invoked by the engine when it no longer needs this backing
508  /// store.
511 
512 /// Callback for when a metal texture is requested.
514  void* /* user data */,
515  const FlutterFrameInfo* /* frame info */);
516 
517 /// Callback for when a metal texture is presented. The texture_id here
518 /// corresponds to the texture_id provided by the embedder in the
519 /// `FlutterMetalTextureCallback` callback.
521  void* /* user data */,
522  const FlutterMetalTexture* /* texture */);
523 
524 typedef struct {
525  /// The size of this struct. Must be sizeof(FlutterMetalRendererConfig).
526  size_t struct_size;
527  /// Alias for id<MTLDevice>.
528  FlutterMetalDeviceHandle device;
529  /// Alias for id<MTLCommandQueue>.
530  FlutterMetalCommandQueueHandle present_command_queue;
531  /// The callback that gets invoked when the engine requests the embedder for a
532  /// texture to render to.
534  /// The callback presented to the embedder to present a fully populated metal
535  /// texture to the user.
537  /// When the embedder specifies that a texture has a frame available, the
538  /// engine will call this method (on an internal engine managed thread) so
539  /// that external texture details can be supplied to the engine for subsequent
540  /// composition.
543 
544 typedef struct {
545  /// The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
546  size_t struct_size;
547  /// The callback presented to the embedder to present a fully populated buffer
548  /// to the user. The pixel format of the buffer is the native 32-bit RGBA
549  /// format. The buffer is owned by the Flutter engine and must be copied in
550  /// this callback if needed.
553 
554 typedef struct {
555  FlutterRendererType type;
556  union {
560  };
562 
563 typedef struct {
564  /// The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
565  size_t struct_size;
566  /// Physical width of the window.
567  size_t width;
568  /// Physical height of the window.
569  size_t height;
570  /// Scale factor for the physical screen.
571  double pixel_ratio;
572  /// Horizontal physical location of the left side of the window on the screen.
573  size_t left;
574  /// Vertical physical location of the top of the window on the screen.
575  size_t top;
576  /// Top inset of window.
578  /// Right inset of window.
580  /// Bottom inset of window.
582  /// Left inset of window.
585 
586 /// The phase of the pointer event.
587 typedef enum {
589  /// The pointer, which must have been down (see kDown), is now up.
590  ///
591  /// For touch, this means that the pointer is no longer in contact with the
592  /// screen. For a mouse, it means the last button was released. Note that if
593  /// any other buttons are still pressed when one button is released, that
594  /// should be sent as a kMove rather than a kUp.
596  /// The pointer, which must have been been up, is now down.
597  ///
598  /// For touch, this means that the pointer has come into contact with the
599  /// screen. For a mouse, it means a button is now pressed. Note that if any
600  /// other buttons are already pressed when a new button is pressed, that
601  /// should be sent as a kMove rather than a kDown.
603  /// The pointer moved while down.
604  ///
605  /// This is also used for changes in button state that don't cause a kDown or
606  /// kUp, such as releasing one of two pressed buttons.
608  /// The pointer is now sending input to Flutter. For instance, a mouse has
609  /// entered the area where the Flutter content is displayed.
610  ///
611  /// A pointer should always be added before sending any other events.
613  /// The pointer is no longer sending input to Flutter. For instance, a mouse
614  /// has left the area where the Flutter content is displayed.
615  ///
616  /// A removed pointer should no longer send events until sending a new kAdd.
618  /// The pointer moved while up.
621 
622 /// The device type that created a pointer event.
623 typedef enum {
628 
629 /// Flags for the `buttons` field of `FlutterPointerEvent` when `device_kind`
630 /// is `kFlutterPointerDeviceKindMouse`.
631 typedef enum {
637  /// If a mouse has more than five buttons, send higher bit shifted values
638  /// corresponding to the button number: 1 << 5 for the 6th, etc.
640 
641 /// The type of a pointer signal.
642 typedef enum {
646 
647 typedef struct {
648  /// The size of this struct. Must be sizeof(FlutterPointerEvent).
649  size_t struct_size;
650  FlutterPointerPhase phase;
651  /// The timestamp at which the pointer event was generated. The timestamp
652  /// should be specified in microseconds and the clock should be the same as
653  /// that used by `FlutterEngineGetCurrentTime`.
654  size_t timestamp;
655  /// The x coordinate of the pointer event in physical pixels.
656  double x;
657  /// The y coordinate of the pointer event in physical pixels.
658  double y;
659  /// An optional device identifier. If this is not specified, it is assumed
660  /// that the embedder has no multi-touch capability.
661  int32_t device;
662  FlutterPointerSignalKind signal_kind;
663  /// The x offset of the scroll in physical pixels.
665  /// The y offset of the scroll in physical pixels.
667  /// The type of the device generating this event.
668  /// Backwards compatibility note: If this is not set, the device will be
669  /// treated as a mouse, with the primary button set for `kDown` and `kMove`.
670  /// If set explicitly to `kFlutterPointerDeviceKindMouse`, you must set the
671  /// correct buttons.
672  FlutterPointerDeviceKind device_kind;
673  /// The buttons currently pressed, if any.
674  int64_t buttons;
676 
677 typedef enum {
682 
683 /// A structure to represent a key event.
684 ///
685 /// Sending `FlutterKeyEvent` via `FlutterEngineSendKeyEvent` results in a
686 /// corresponding `FlutterKeyEvent` to be dispatched in the framework. It is
687 /// embedder's responsibility to ensure the regularity of sent events, since the
688 /// framework only performs simple one-to-one mapping. The events must conform
689 /// the following rules:
690 ///
691 /// * Each key press sequence shall consist of one key down event (`kind` being
692 /// `kFlutterKeyEventTypeDown`), zero or more repeat events, and one key up
693 /// event, representing a physical key button being pressed, held, and
694 /// released.
695 /// * All events throughout a key press sequence shall have the same `physical`
696 /// and `logical`. Having different `character`s is allowed.
697 ///
698 /// A `FlutterKeyEvent` with `physical` 0 and `logical` 0 is an empty event.
699 /// This is the only case either `physical` or `logical` can be 0. An empty
700 /// event must be sent if a key message should be converted to no
701 /// `FlutterKeyEvent`s, for example, when a key down message is received for a
702 /// key that has already been pressed according to the record. This is to ensure
703 /// some `FlutterKeyEvent` arrives at the framework before raw key message.
704 /// See https://github.com/flutter/flutter/issues/87230.
705 typedef struct {
706  /// The size of this struct. Must be sizeof(FlutterKeyEvent).
707  size_t struct_size;
708  /// The timestamp at which the key event was generated. The timestamp should
709  /// be specified in microseconds and the clock should be the same as that used
710  /// by `FlutterEngineGetCurrentTime`.
711  double timestamp;
712  /// The event kind.
713  FlutterKeyEventType type;
714  /// The USB HID code for the physical key of the event.
715  ///
716  /// For the full definition and list of pre-defined physical keys, see
717  /// `PhysicalKeyboardKey` from the framework.
718  ///
719  /// The only case that `physical` might be 0 is when this is an empty event.
720  /// See `FlutterKeyEvent` for introduction.
721  uint64_t physical;
722  /// The key ID for the logical key of this event.
723  ///
724  /// For the full definition and a list of pre-defined logical keys, see
725  /// `LogicalKeyboardKey` from the framework.
726  ///
727  /// The only case that `logical` might be 0 is when this is an empty event.
728  /// See `FlutterKeyEvent` for introduction.
729  uint64_t logical;
730  /// Null-terminated character input from the event. Can be null. Ignored for
731  /// up events.
732  const char* character;
733  /// True if this event does not correspond to a native event.
734  ///
735  /// The embedder is likely to skip events and/or construct new events that do
736  /// not correspond to any native events in order to conform the regularity
737  /// of events (as documented in `FlutterKeyEvent`). An example is when a key
738  /// up is missed due to loss of window focus, on a platform that provides
739  /// query to key pressing status, the embedder might realize that the key has
740  /// been released at the next key event, and should construct a synthesized up
741  /// event immediately before the actual event.
742  ///
743  /// An event being synthesized means that the `timestamp` might greatly
744  /// deviate from the actual time when the event occurs physically.
747 
748 typedef void (*FlutterKeyEventCallback)(bool /* handled */,
749  void* /* user_data */);
750 
754 
755 typedef struct {
756  /// The size of this struct. Must be sizeof(FlutterPlatformMessage).
757  size_t struct_size;
758  const char* channel;
759  const uint8_t* message;
760  size_t message_size;
761  /// The response handle on which to invoke
762  /// `FlutterEngineSendPlatformMessageResponse` when the response is ready.
763  /// `FlutterEngineSendPlatformMessageResponse` must be called for all messages
764  /// received by the embedder. Failure to call
765  /// `FlutterEngineSendPlatformMessageResponse` will cause a memory leak. It is
766  /// not safe to send multiple responses on a single response object.
769 
771  const FlutterPlatformMessage* /* message*/,
772  void* /* user data */);
773 
774 typedef void (*FlutterDataCallback)(const uint8_t* /* data */,
775  size_t /* size */,
776  void* /* user data */);
777 
778 /// The identifier of the platform view. This identifier is specified by the
779 /// application when a platform view is added to the scene via the
780 /// `SceneBuilder.addPlatformView` call.
782 
783 /// `FlutterSemanticsNode` ID used as a sentinel to signal the end of a batch of
784 /// semantics node updates.
786 extern const int32_t kFlutterSemanticsNodeIdBatchEnd;
787 
788 /// A node that represents some semantic data.
789 ///
790 /// The semantics tree is maintained during the semantics phase of the pipeline
791 /// (i.e., during PipelineOwner.flushSemantics), which happens after
792 /// compositing. Updates are then pushed to embedders via the registered
793 /// `FlutterUpdateSemanticsNodeCallback`.
794 typedef struct {
795  /// The size of this struct. Must be sizeof(FlutterSemanticsNode).
796  size_t struct_size;
797  /// The unique identifier for this node.
798  int32_t id;
799  /// The set of semantics flags associated with this node.
801  /// The set of semantics actions applicable to this node.
803  /// The position at which the text selection originates.
805  /// The position at which the text selection terminates.
807  /// The total number of scrollable children that contribute to semantics.
809  /// The index of the first visible semantic child of a scroll node.
810  int32_t scroll_index;
811  /// The current scrolling position in logical pixels if the node is
812  /// scrollable.
814  /// The maximum in-range value for `scrollPosition` if the node is scrollable.
816  /// The minimum in-range value for `scrollPosition` if the node is scrollable.
818  /// The elevation along the z-axis at which the rect of this semantics node is
819  /// located above its parent.
820  double elevation;
821  /// Describes how much space the semantics node takes up along the z-axis.
822  double thickness;
823  /// A textual description of the node.
824  const char* label;
825  /// A brief description of the result of performing an action on the node.
826  const char* hint;
827  /// A textual description of the current value of the node.
828  const char* value;
829  /// A value that `value` will have after a kFlutterSemanticsActionIncrease`
830  /// action has been performed.
831  const char* increased_value;
832  /// A value that `value` will have after a kFlutterSemanticsActionDecrease`
833  /// action has been performed.
834  const char* decreased_value;
835  /// The reading direction for `label`, `value`, `hint`, `increasedValue`, and
836  /// `decreasedValue`.
838  /// The bounding box for this node in its coordinate system.
840  /// The transform from this node's coordinate system to its parent's
841  /// coordinate system.
843  /// The number of children this node has.
844  size_t child_count;
845  /// Array of child node IDs in traversal order. Has length `child_count`.
847  /// Array of child node IDs in hit test order. Has length `child_count`.
849  /// The number of custom accessibility action associated with this node.
851  /// Array of `FlutterSemanticsCustomAction` IDs associated with this node.
852  /// Has length `custom_accessibility_actions_count`.
854  /// Identifier of the platform view associated with this semantics node, or
855  /// -1 if none.
856  FlutterPlatformViewIdentifier platform_view_id;
858 
859 /// `FlutterSemanticsCustomAction` ID used as a sentinel to signal the end of a
860 /// batch of semantics custom action updates.
862 extern const int32_t kFlutterSemanticsCustomActionIdBatchEnd;
863 
864 /// A custom semantics action, or action override.
865 ///
866 /// Custom actions can be registered by applications in order to provide
867 /// semantic actions other than the standard actions available through the
868 /// `FlutterSemanticsAction` enum.
869 ///
870 /// Action overrides are custom actions that the application developer requests
871 /// to be used in place of the standard actions in the `FlutterSemanticsAction`
872 /// enum.
873 typedef struct {
874  /// The size of the struct. Must be sizeof(FlutterSemanticsCustomAction).
875  size_t struct_size;
876  /// The unique custom action or action override ID.
877  int32_t id;
878  /// For overridden standard actions, corresponds to the
879  /// `FlutterSemanticsAction` to override.
881  /// The user-readable name of this custom semantics action.
882  const char* label;
883  /// The hint description of this custom semantics action.
884  const char* hint;
886 
888  const FlutterSemanticsNode* /* semantics node */,
889  void* /* user data */);
890 
892  const FlutterSemanticsCustomAction* /* semantics custom action */,
893  void* /* user data */);
894 
896 
897 typedef struct {
898  FlutterTaskRunner runner;
899  uint64_t task;
900 } FlutterTask;
901 
903  FlutterTask /* task */,
904  uint64_t /* target time nanos */,
905  void* /* user data */);
906 
907 /// An interface used by the Flutter engine to execute tasks at the target time
908 /// on a specified thread. There should be a 1-1 relationship between a thread
909 /// and a task runner. It is undefined behavior to run a task on a thread that
910 /// is not associated with its task runner.
911 typedef struct {
912  /// The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
913  size_t struct_size;
914  void* user_data;
915  /// May be called from any thread. Should return true if tasks posted on the
916  /// calling thread will be run on that same thread.
917  ///
918  /// @attention This field is required.
920  /// May be called from any thread. The given task should be executed by the
921  /// embedder on the thread associated with that task runner by calling
922  /// `FlutterEngineRunTask` at the given target time. The system monotonic
923  /// clock should be used for the target time. The target time is the absolute
924  /// time from epoch (NOT a delta) at which the task must be returned back to
925  /// the engine on the correct thread. If the embedder needs to calculate a
926  /// delta, `FlutterEngineGetCurrentTime` may be called and the difference used
927  /// as the delta.
928  ///
929  /// @attention This field is required.
931  /// A unique identifier for the task runner. If multiple task runners service
932  /// tasks on the same thread, their identifiers must match.
933  size_t identifier;
935 
936 typedef struct {
937  /// The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
938  size_t struct_size;
939  /// Specify the task runner for the thread on which the `FlutterEngineRun`
940  /// call is made. The same task runner description can be specified for both
941  /// the render and platform task runners. This makes the Flutter engine use
942  /// the same thread for both task runners.
944  /// Specify the task runner for the thread on which the render tasks will be
945  /// run. The same task runner description can be specified for both the render
946  /// and platform task runners. This makes the Flutter engine use the same
947  /// thread for both task runners.
950 
951 typedef struct {
952  /// The type of the OpenGL backing store. Currently, it can either be a
953  /// texture or a framebuffer.
954  FlutterOpenGLTargetType type;
955  union {
956  /// A texture for Flutter to render into.
958  /// A framebuffer for Flutter to render into. The embedder must ensure that
959  /// the framebuffer is complete.
961  };
963 
964 typedef struct {
965  /// A pointer to the raw bytes of the allocation described by this software
966  /// backing store.
967  const void* allocation;
968  /// The number of bytes in a single row of the allocation.
969  size_t row_bytes;
970  /// The number of rows in the allocation.
971  size_t height;
972  /// A baton that is not interpreted by the engine in any way. It will be given
973  /// back to the embedder in the destruction callback below. Embedder resources
974  /// may be associated with this baton.
975  void* user_data;
976  /// The callback invoked by the engine when it no longer needs this backing
977  /// store.
980 
981 typedef struct {
982  /// The size of this struct. Must be sizeof(FlutterMetalBackingStore).
983  size_t struct_size;
984  union {
985  // A Metal texture for Flutter to render into. Ownership is not transferred
986  // to Flutter; the texture is CFRetained on successfully being passed in and
987  // CFReleased when no longer used.
989  };
991 
992 typedef enum {
993  /// Indicates that the Flutter application requested that an opacity be
994  /// applied to the platform view.
996  /// Indicates that the Flutter application requested that the platform view be
997  /// clipped using a rectangle.
999  /// Indicates that the Flutter application requested that the platform view be
1000  /// clipped using a rounded rectangle.
1002  /// Indicates that the Flutter application requested that the platform view be
1003  /// transformed before composition.
1006 
1007 typedef struct {
1008  /// The type of the mutation described by the subsequent union.
1009  FlutterPlatformViewMutationType type;
1010  union {
1011  double opacity;
1015  };
1017 
1018 typedef struct {
1019  /// The size of this struct. Must be sizeof(FlutterPlatformView).
1020  size_t struct_size;
1021  /// The identifier of this platform view. This identifier is specified by the
1022  /// application when a platform view is added to the scene via the
1023  /// `SceneBuilder.addPlatformView` call.
1024  FlutterPlatformViewIdentifier identifier;
1025  /// The number of mutations to be applied to the platform view by the embedder
1026  /// before on-screen composition.
1028  /// The mutations to be applied by this platform view before it is composited
1029  /// on-screen. The Flutter application may transform the platform view but
1030  /// these transformations cannot be affected by the Flutter compositor because
1031  /// it does not render platform views. Since the embedder is responsible for
1032  /// composition of these views, it is also the embedder's responsibility to
1033  /// affect the appropriate transformation.
1034  ///
1035  /// The mutations must be applied in order. The mutations done in the
1036  /// collection don't take into account the device pixel ratio or the root
1037  /// surface transformation. If these exist, the first mutation in the list
1038  /// will be a transformation mutation to make sure subsequent mutations are in
1039  /// the correct coordinate space.
1042 
1043 typedef enum {
1044  /// Specifies an OpenGL backing store. Can either be an OpenGL texture or
1045  /// framebuffer.
1047  /// Specified an software allocation for Flutter to render into using the CPU.
1049  /// Specifies a Metal backing store. This is backed by a Metal texture.
1052 
1053 typedef struct {
1054  /// The size of this struct. Must be sizeof(FlutterBackingStore).
1055  size_t struct_size;
1056  /// A baton that is not interpreted by the engine in any way. The embedder may
1057  /// use this to associate resources that are tied to the lifecycle of the
1058  /// `FlutterBackingStore`.
1059  void* user_data;
1060  /// Specifies the type of backing store.
1061  FlutterBackingStoreType type;
1062  /// Indicates if this backing store was updated since the last time it was
1063  /// associated with a presented layer.
1065  union {
1066  /// The description of the OpenGL backing store.
1068  /// The description of the software backing store.
1070  // The description of the Metal backing store.
1072  };
1074 
1075 typedef struct {
1076  /// The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
1077  size_t struct_size;
1078  /// The size of the render target the engine expects to render into.
1081 
1082 typedef enum {
1083  /// Indicates that the contents of this layer are rendered by Flutter into a
1084  /// backing store.
1086  /// Indicates that the contents of this layer are determined by the embedder.
1089 
1090 typedef struct {
1091  /// This size of this struct. Must be sizeof(FlutterLayer).
1092  size_t struct_size;
1093  /// Each layer displays contents in one way or another. The type indicates
1094  /// whether those contents are specified by Flutter or the embedder.
1095  FlutterLayerContentType type;
1096  union {
1097  /// Indicates that the contents of this layer are rendered by Flutter into a
1098  /// backing store.
1100  /// Indicates that the contents of this layer are determined by the
1101  /// embedder.
1103  };
1104  /// The offset of this layer (in physical pixels) relative to the top left of
1105  /// the root surface used by the engine.
1107  /// The size of the layer (in physical pixels).
1109 } FlutterLayer;
1110 
1112  const FlutterBackingStoreConfig* config,
1113  FlutterBackingStore* backing_store_out,
1114  void* user_data);
1115 
1117  const FlutterBackingStore* renderer,
1118  void* user_data);
1119 
1120 typedef bool (*FlutterLayersPresentCallback)(const FlutterLayer** layers,
1121  size_t layers_count,
1122  void* user_data);
1123 
1124 typedef struct {
1125  /// This size of this struct. Must be sizeof(FlutterCompositor).
1126  size_t struct_size;
1127  /// A baton that in not interpreted by the engine in any way. If it passed
1128  /// back to the embedder in `FlutterCompositor.create_backing_store_callback`,
1129  /// `FlutterCompositor.collect_backing_store_callback` and
1130  /// `FlutterCompositor.present_layers_callback`
1131  void* user_data;
1132  /// A callback invoked by the engine to obtain a backing store for a specific
1133  /// `FlutterLayer`.
1134  ///
1135  /// On ABI stability: Callers must take care to restrict access within
1136  /// `FlutterBackingStore::struct_size` when specifying a new backing store to
1137  /// the engine. This only matters if the embedder expects to be used with
1138  /// engines older than the version whose headers it used during compilation.
1140  /// A callback invoked by the engine to release the backing store. The
1141  /// embedder may collect any resources associated with the backing store.
1143  /// Callback invoked by the engine to composite the contents of each layer
1144  /// onto the screen.
1146  /// Avoid caching backing stores provided by this compositor.
1149 
1150 typedef struct {
1151  /// This size of this struct. Must be sizeof(FlutterLocale).
1152  size_t struct_size;
1153  /// The language code of the locale. For example, "en". This is a required
1154  /// field. The string must be null terminated. It may be collected after the
1155  /// call to `FlutterEngineUpdateLocales`.
1156  const char* language_code;
1157  /// The country code of the locale. For example, "US". This is a an optional
1158  /// field. The string must be null terminated if present. It may be collected
1159  /// after the call to `FlutterEngineUpdateLocales`. If not present, a
1160  /// `nullptr` may be specified.
1161  const char* country_code;
1162  /// The script code of the locale. This is a an optional field. The string
1163  /// must be null terminated if present. It may be collected after the call to
1164  /// `FlutterEngineUpdateLocales`. If not present, a `nullptr` may be
1165  /// specified.
1166  const char* script_code;
1167  /// The variant code of the locale. This is a an optional field. The string
1168  /// must be null terminated if present. It may be collected after the call to
1169  /// `FlutterEngineUpdateLocales`. If not present, a `nullptr` may be
1170  /// specified.
1171  const char* variant_code;
1172 } FlutterLocale;
1173 
1174 /// Callback that returns the system locale.
1175 ///
1176 /// Embedders that implement this callback should return the `FlutterLocale`
1177 /// from the `supported_locales` list that most closely matches the
1178 /// user/device's preferred locale.
1179 ///
1180 /// This callback does not currently provide the user_data baton.
1181 /// https://github.com/flutter/flutter/issues/79826
1182 typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)(
1183  const FlutterLocale** /* supported_locales*/,
1184  size_t /* Number of locales*/);
1185 
1186 /// Display refers to a graphics hardware system consisting of a framebuffer,
1187 /// typically a monitor or a screen. This ID is unique per display and is
1188 /// stable until the Flutter application restarts.
1189 typedef uint64_t FlutterEngineDisplayId;
1190 
1191 typedef struct {
1192  /// This size of this struct. Must be sizeof(FlutterDisplay).
1193  size_t struct_size;
1194 
1195  FlutterEngineDisplayId display_id;
1196 
1197  /// This is set to true if the embedder only has one display. In cases where
1198  /// this is set to true, the value of display_id is ignored. In cases where
1199  /// this is not set to true, it is expected that a valid display_id be
1200  /// provided.
1202 
1203  /// This represents the refresh period in frames per second. This value may be
1204  /// zero if the device is not running or unavailable or unknown.
1207 
1208 /// The update type parameter that is passed to
1209 /// `FlutterEngineNotifyDisplayUpdate`.
1210 typedef enum {
1211  /// `FlutterEngineDisplay`s that were active during start-up. A display is
1212  /// considered active if:
1213  /// 1. The frame buffer hardware is connected.
1214  /// 2. The display is drawable, e.g. it isn't being mirrored from another
1215  /// connected display or sleeping.
1219 
1220 typedef int64_t FlutterEngineDartPort;
1221 
1222 typedef enum {
1229  /// The object will be made available to Dart code as an instance of
1230  /// Uint8List.
1233 
1234 typedef struct {
1235  /// The size of this struct. Must be sizeof(FlutterEngineDartBuffer).
1236  size_t struct_size;
1237  /// An opaque baton passed back to the embedder when the
1238  /// buffer_collect_callback is invoked. The engine does not interpret this
1239  /// field in any way.
1240  void* user_data;
1241  /// This is an optional field.
1242  ///
1243  /// When specified, the engine will assume that the buffer is owned by the
1244  /// embedder. When the data is no longer needed by any isolate, this callback
1245  /// will be made on an internal engine managed thread. The embedder is free to
1246  /// collect the buffer here. When this field is specified, it is the embedders
1247  /// responsibility to keep the buffer alive and not modify it till this
1248  /// callback is invoked by the engine. The user data specified in the callback
1249  /// is the value of `user_data` field in this struct.
1250  ///
1251  /// When NOT specified, the VM creates an internal copy of the buffer. The
1252  /// caller is free to modify the buffer as necessary or collect it immediately
1253  /// after the call to `FlutterEnginePostDartObject`.
1254  ///
1255  /// @attention The buffer_collect_callback is will only be invoked by the
1256  /// engine when the `FlutterEnginePostDartObject` method
1257  /// returns kSuccess. In case of non-successful calls to this
1258  /// method, it is the embedders responsibility to collect the
1259  /// buffer.
1261  /// A pointer to the bytes of the buffer. When the buffer is owned by the
1262  /// embedder (by specifying the `buffer_collect_callback`), Dart code may
1263  /// modify that embedder owned buffer. For this reason, it is important that
1264  /// this buffer not have page protections that restrict writing to this
1265  /// buffer.
1266  uint8_t* buffer;
1267  /// The size of the buffer.
1268  size_t buffer_size;
1270 
1271 /// This struct specifies the native representation of a Dart object that can be
1272 /// sent via a send port to any isolate in the VM that has the corresponding
1273 /// receive port.
1274 ///
1275 /// All fields in this struct are copied out in the call to
1276 /// `FlutterEnginePostDartObject` and the caller is free to reuse or collect
1277 /// this struct after that call.
1278 typedef struct {
1279  FlutterEngineDartObjectType type;
1280  union {
1282  int32_t int32_value;
1283  int64_t int64_value;
1285  /// A null terminated string. This string will be copied by the VM in the
1286  /// call to `FlutterEnginePostDartObject` and must be collected by the
1287  /// embedder after that call is made.
1288  const char* string_value;
1290  };
1292 
1293 /// This enum allows embedders to determine the type of the engine thread in the
1294 /// FlutterNativeThreadCallback. Based on the thread type, the embedder may be
1295 /// able to tweak the thread priorities for optimum performance.
1296 typedef enum {
1297  /// The Flutter Engine considers the thread on which the FlutterEngineRun call
1298  /// is made to be the platform thread. There is only one such thread per
1299  /// engine instance.
1301  /// This is the thread the Flutter Engine uses to execute rendering commands
1302  /// based on the selected client rendering API. There is only one such thread
1303  /// per engine instance.
1305  /// This is a dedicated thread on which the root Dart isolate is serviced.
1306  /// There is only one such thread per engine instance.
1308  /// Multiple threads are used by the Flutter engine to perform long running
1309  /// background tasks.
1312 
1313 /// A callback made by the engine in response to
1314 /// `FlutterEnginePostCallbackOnAllNativeThreads` on all internal thread.
1315 typedef void (*FlutterNativeThreadCallback)(FlutterNativeThreadType type,
1316  void* user_data);
1317 
1318 /// AOT data source type.
1319 typedef enum {
1322 
1323 /// This struct specifies one of the various locations the engine can look for
1324 /// AOT data sources.
1325 typedef struct {
1326  FlutterEngineAOTDataSourceType type;
1327  union {
1328  /// Absolute path to an ELF library file.
1329  const char* elf_path;
1330  };
1332 
1333 // Logging callback for Dart application messages.
1334 //
1335 // The `tag` parameter contains a null-terminated string containing a logging
1336 // tag or component name that can be used to identify system log messages from
1337 // the app. The `message` parameter contains a null-terminated string
1338 // containing the message to be logged. `user_data` is a user data baton passed
1339 // in `FlutterEngineRun`.
1340 typedef void (*FlutterLogMessageCallback)(const char* /* tag */,
1341  const char* /* message */,
1342  void* /* user_data */);
1343 
1344 /// An opaque object that describes the AOT data that can be used to launch a
1345 /// FlutterEngine instance in AOT mode.
1347 
1348 typedef struct {
1349  /// The size of this struct. Must be sizeof(FlutterProjectArgs).
1350  size_t struct_size;
1351  /// The path to the Flutter assets directory containing project assets. The
1352  /// string can be collected after the call to `FlutterEngineRun` returns. The
1353  /// string must be NULL terminated.
1354  const char* assets_path;
1355  /// The path to the Dart file containing the `main` entry point.
1356  /// The string can be collected after the call to `FlutterEngineRun` returns.
1357  /// The string must be NULL terminated.
1358  ///
1359  /// @deprecated As of Dart 2, running from Dart source is no longer
1360  /// supported. Dart code should now be compiled to kernel form
1361  /// and will be loaded by from `kernel_blob.bin` in the assets
1362  /// directory. This struct member is retained for ABI
1363  /// stability.
1364  const char* main_path__unused__;
1365  /// The path to the `.packages` file for the project. The string can be
1366  /// collected after the call to `FlutterEngineRun` returns. The string must be
1367  /// NULL terminated.
1368  ///
1369  /// @deprecated As of Dart 2, running from Dart source is no longer
1370  /// supported. Dart code should now be compiled to kernel form
1371  /// and will be loaded by from `kernel_blob.bin` in the assets
1372  /// directory. This struct member is retained for ABI
1373  /// stability.
1375  /// The path to the `icudtl.dat` file for the project. The string can be
1376  /// collected after the call to `FlutterEngineRun` returns. The string must
1377  /// be NULL terminated.
1378  const char* icu_data_path;
1379  /// The command line argument count used to initialize the project.
1381  /// The command line arguments used to initialize the project. The strings can
1382  /// be collected after the call to `FlutterEngineRun` returns. The strings
1383  /// must be `NULL` terminated.
1384  ///
1385  /// @attention The first item in the command line (if specified at all) is
1386  /// interpreted as the executable name. So if an engine flag
1387  /// needs to be passed into the same, it needs to not be the
1388  /// very first item in the list.
1389  ///
1390  /// The set of engine flags are only meant to control
1391  /// unstable features in the engine. Deployed applications should not pass any
1392  /// command line arguments at all as they may affect engine stability at
1393  /// runtime in the presence of un-sanitized input. The list of currently
1394  /// recognized engine flags and their descriptions can be retrieved from the
1395  /// `switches.h` engine source file.
1396  const char* const* command_line_argv;
1397  /// The callback invoked by the engine in order to give the embedder the
1398  /// chance to respond to platform messages from the Dart application.
1399  /// The callback will be invoked on the thread on which the `FlutterEngineRun`
1400  /// call is made. The second parameter, `user_data`, is supplied when
1401  /// `FlutterEngineRun` or `FlutterEngineInitialize` is called.
1403  /// The VM snapshot data buffer used in AOT operation. This buffer must be
1404  /// mapped in as read-only. For more information refer to the documentation on
1405  /// the Wiki at
1406  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1407  const uint8_t* vm_snapshot_data;
1408  /// The size of the VM snapshot data buffer. If vm_snapshot_data is a symbol
1409  /// reference, 0 may be passed here.
1411  /// The VM snapshot instructions buffer used in AOT operation. This buffer
1412  /// must be mapped in as read-execute. For more information refer to the
1413  /// documentation on the Wiki at
1414  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1416  /// The size of the VM snapshot instructions buffer. If
1417  /// vm_snapshot_instructions is a symbol reference, 0 may be passed here.
1419  /// The isolate snapshot data buffer used in AOT operation. This buffer must
1420  /// be mapped in as read-only. For more information refer to the documentation
1421  /// on the Wiki at
1422  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1423  const uint8_t* isolate_snapshot_data;
1424  /// The size of the isolate snapshot data buffer. If isolate_snapshot_data is
1425  /// a symbol reference, 0 may be passed here.
1427  /// The isolate snapshot instructions buffer used in AOT operation. This
1428  /// buffer must be mapped in as read-execute. For more information refer to
1429  /// the documentation on the Wiki at
1430  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1432  /// The size of the isolate snapshot instructions buffer. If
1433  /// isolate_snapshot_instructions is a symbol reference, 0 may be passed here.
1435  /// The callback invoked by the engine in root isolate scope. Called
1436  /// immediately after the root isolate has been created and marked runnable.
1438  /// The callback invoked by the engine in order to give the embedder the
1439  /// chance to respond to semantics node updates from the Dart application.
1440  /// Semantics node updates are sent in batches terminated by a 'batch end'
1441  /// callback that is passed a sentinel `FlutterSemanticsNode` whose `id` field
1442  /// has the value `kFlutterSemanticsNodeIdBatchEnd`.
1443  ///
1444  /// The callback will be invoked on the thread on which the `FlutterEngineRun`
1445  /// call is made.
1447  /// The callback invoked by the engine in order to give the embedder the
1448  /// chance to respond to updates to semantics custom actions from the Dart
1449  /// application. Custom action updates are sent in batches terminated by a
1450  /// 'batch end' callback that is passed a sentinel
1451  /// `FlutterSemanticsCustomAction` whose `id` field has the value
1452  /// `kFlutterSemanticsCustomActionIdBatchEnd`.
1453  ///
1454  /// The callback will be invoked on the thread on which the `FlutterEngineRun`
1455  /// call is made.
1458  /// Path to a directory used to store data that is cached across runs of a
1459  /// Flutter application (such as compiled shader programs used by Skia).
1460  /// This is optional. The string must be NULL terminated.
1461  ///
1462  // This is different from the cache-path-dir argument defined in switches.h,
1463  // which is used in `flutter::Settings` as `temp_directory_path`.
1465 
1466  /// If true, the engine would only read the existing cache, but not write new
1467  /// ones.
1469 
1470  /// A callback that gets invoked by the engine when it attempts to wait for a
1471  /// platform vsync event. The engine will give the platform a baton that needs
1472  /// to be returned back to the engine via `FlutterEngineOnVsync`. All batons
1473  /// must be retured to the engine before initializing a
1474  /// `FlutterEngineShutdown`. Not doing the same will result in a memory leak.
1475  /// While the call to `FlutterEngineOnVsync` must occur on the thread that
1476  /// made the call to `FlutterEngineRun`, the engine will make this callback on
1477  /// an internal engine-managed thread. If the components accessed on the
1478  /// embedder are not thread safe, the appropriate re-threading must be done.
1480 
1481  /// The name of a custom Dart entrypoint. This is optional and specifying a
1482  /// null or empty entrypoint makes the engine look for a method named "main"
1483  /// in the root library of the application.
1484  ///
1485  /// Care must be taken to ensure that the custom entrypoint is not tree-shaken
1486  /// away. Usually, this is done using the `@pragma('vm:entry-point')`
1487  /// decoration.
1489 
1490  /// Typically the Flutter engine create and manages its internal threads. This
1491  /// optional argument allows for the specification of task runner interfaces
1492  /// to event loops managed by the embedder on threads it creates.
1494 
1495  /// All `FlutterEngine` instances in the process share the same Dart VM. When
1496  /// the first engine is launched, it starts the Dart VM as well. It used to be
1497  /// the case that it was not possible to shutdown the Dart VM cleanly and
1498  /// start it back up in the process in a safe manner. This issue has since
1499  /// been patched. Unfortunately, applications already began to make use of the
1500  /// fact that shutting down the Flutter engine instance left a running VM in
1501  /// the process. Since a Flutter engine could be launched on any thread,
1502  /// applications would "warm up" the VM on another thread by launching
1503  /// an engine with no isolates and then shutting it down immediately. The main
1504  /// Flutter application could then be started on the main thread without
1505  /// having to incur the Dart VM startup costs at that time. With the new
1506  /// behavior, this "optimization" immediately becomes massive performance
1507  /// pessimization as the VM would be started up in the "warm up" phase, shut
1508  /// down there and then started again on the main thread. Changing this
1509  /// behavior was deemed to be an unacceptable breaking change. Embedders that
1510  /// wish to shutdown the Dart VM when the last engine is terminated in the
1511  /// process should opt into this behavior by setting this flag to true.
1513 
1514  /// Typically, Flutter renders the layer hierarchy into a single root surface.
1515  /// However, when embedders need to interleave their own contents within the
1516  /// Flutter layer hierarchy, their applications can push platform views within
1517  /// the Flutter scene. This is done using the `SceneBuilder.addPlatformView`
1518  /// call. When this happens, the Flutter rasterizer divides the effective view
1519  /// hierarchy into multiple layers. Each layer gets its own backing store and
1520  /// Flutter renders into the same. Once the layers contents have been
1521  /// fulfilled, the embedder is asked to composite these layers on-screen. At
1522  /// this point, it can interleave its own contents within the effective
1523  /// hierarchy. The interface for the specification of these layer backing
1524  /// stores and the hooks to listen for the composition of layers on-screen can
1525  /// be controlled using this field. This field is completely optional. In its
1526  /// absence, platforms views in the scene are ignored and Flutter renders to
1527  /// the root surface as normal.
1529 
1530  /// Max size of the old gen heap for the Dart VM in MB, or 0 for unlimited, -1
1531  /// for default value.
1532  ///
1533  /// See also:
1534  /// https://github.com/dart-lang/sdk/blob/ca64509108b3e7219c50d6c52877c85ab6a35ff2/runtime/vm/flag_list.h#L150
1536 
1537  /// The AOT data to be used in AOT operation.
1538  ///
1539  /// Embedders should instantiate and destroy this object via the
1540  /// FlutterEngineCreateAOTData and FlutterEngineCollectAOTData methods.
1541  ///
1542  /// Embedders can provide either snapshot buffers or aot_data, but not both.
1543  FlutterEngineAOTData aot_data;
1544 
1545  /// A callback that computes the locale the platform would natively resolve
1546  /// to.
1547  ///
1548  /// The input parameter is an array of FlutterLocales which represent the
1549  /// locales supported by the app. One of the input supported locales should
1550  /// be selected and returned to best match with the user/device's preferred
1551  /// locale. The implementation should produce a result that as closely
1552  /// matches what the platform would natively resolve to as possible.
1555 
1556  /// The command line argument count for arguments passed through to the Dart
1557  /// entrypoint.
1559 
1560  /// The command line arguments passed through to the Dart entrypoint. The
1561  /// strings must be `NULL` terminated.
1562  ///
1563  /// The strings will be copied out and so any strings passed in here can
1564  /// be safely collected after initializing the engine with
1565  /// `FlutterProjectArgs`.
1566  const char* const* dart_entrypoint_argv;
1567 
1568  // Logging callback for Dart application messages.
1569  //
1570  // This callback is used by embedder to log print messages from the running
1571  // Flutter application. This callback is made on an internal engine managed
1572  // thread and embedders must re-thread if necessary. Performing blocking calls
1573  // in this callback may introduce application jank.
1575 
1576  // A tag string associated with application log messages.
1577  //
1578  // A log message tag string that can be used convey application, subsystem,
1579  // or component name to embedder's logger. This string will be passed to to
1580  // callbacks on `log_message_callback`. Defaults to "flutter" if unspecified.
1581  const char* log_tag;
1582 
1583  // A callback that is invoked right before the engine is restarted.
1584  //
1585  // This optional callback is typically used to reset states to as if the
1586  // engine has just been started, and usually indicates the user has requested
1587  // a hot restart (Shift-R in the Flutter CLI.) It is not called the first time
1588  // the engine starts.
1589  //
1590  // The first argument is the `user_data` from `FlutterEngineInitialize`.
1593 
1594 #ifndef FLUTTER_ENGINE_NO_PROTOTYPES
1595 
1596 //------------------------------------------------------------------------------
1597 /// @brief Creates the necessary data structures to launch a Flutter Dart
1598 /// application in AOT mode. The data may only be collected after
1599 /// all FlutterEngine instances launched using this data have been
1600 /// terminated.
1601 ///
1602 /// @param[in] source The source of the AOT data.
1603 /// @param[out] data_out The AOT data on success. Unchanged on failure.
1604 ///
1605 /// @return Returns if the AOT data could be successfully resolved.
1606 ///
1608 FlutterEngineResult FlutterEngineCreateAOTData(
1609  const FlutterEngineAOTDataSource* source,
1610  FlutterEngineAOTData* data_out);
1611 
1612 //------------------------------------------------------------------------------
1613 /// @brief Collects the AOT data.
1614 ///
1615 /// @warning The embedder must ensure that this call is made only after all
1616 /// FlutterEngine instances launched using this data have been
1617 /// terminated, and that all of those instances were launched with
1618 /// the FlutterProjectArgs::shutdown_dart_vm_when_done flag set to
1619 /// true.
1620 ///
1621 /// @param[in] data The data to collect.
1622 ///
1623 /// @return Returns if the AOT data was successfully collected.
1624 ///
1626 FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data);
1627 
1628 //------------------------------------------------------------------------------
1629 /// @brief Initialize and run a Flutter engine instance and return a handle
1630 /// to it. This is a convenience method for the pair of calls to
1631 /// `FlutterEngineInitialize` and `FlutterEngineRunInitialized`.
1632 ///
1633 /// @note This method of running a Flutter engine works well except in
1634 /// cases where the embedder specifies custom task runners via
1635 /// `FlutterProjectArgs::custom_task_runners`. In such cases, the
1636 /// engine may need the embedder to post tasks back to it before
1637 /// `FlutterEngineRun` has returned. Embedders can only post tasks
1638 /// to the engine if they have a handle to the engine. In such
1639 /// cases, embedders are advised to get the engine handle via the
1640 /// `FlutterInitializeCall`. Then they can call
1641 /// `FlutterEngineRunInitialized` knowing that they will be able to
1642 /// service custom tasks on other threads with the engine handle.
1643 ///
1644 /// @param[in] version The Flutter embedder API version. Must be
1645 /// FLUTTER_ENGINE_VERSION.
1646 /// @param[in] config The renderer configuration.
1647 /// @param[in] args The Flutter project arguments.
1648 /// @param user_data A user data baton passed back to embedders in
1649 /// callbacks.
1650 /// @param[out] engine_out The engine handle on successful engine creation.
1651 ///
1652 /// @return The result of the call to run the Flutter engine.
1653 ///
1655 FlutterEngineResult FlutterEngineRun(size_t version,
1656  const FlutterRendererConfig* config,
1657  const FlutterProjectArgs* args,
1658  void* user_data,
1660  engine_out);
1661 
1662 //------------------------------------------------------------------------------
1663 /// @brief Shuts down a Flutter engine instance. The engine handle is no
1664 /// longer valid for any calls in the embedder API after this point.
1665 /// Making additional calls with this handle is undefined behavior.
1666 ///
1667 /// @note This de-initializes the Flutter engine instance (via an implicit
1668 /// call to `FlutterEngineDeinitialize`) if necessary.
1669 ///
1670 /// @param[in] engine The Flutter engine instance to collect.
1671 ///
1672 /// @return The result of the call to shutdown the Flutter engine instance.
1673 ///
1676  engine);
1677 
1678 //------------------------------------------------------------------------------
1679 /// @brief Initialize a Flutter engine instance. This does not run the
1680 /// Flutter application code till the `FlutterEngineRunInitialized`
1681 /// call is made. Besides Flutter application code, no tasks are
1682 /// scheduled on embedder managed task runners either. This allows
1683 /// embedders providing custom task runners to the Flutter engine to
1684 /// obtain a handle to the Flutter engine before the engine can post
1685 /// tasks on these task runners.
1686 ///
1687 /// @param[in] version The Flutter embedder API version. Must be
1688 /// FLUTTER_ENGINE_VERSION.
1689 /// @param[in] config The renderer configuration.
1690 /// @param[in] args The Flutter project arguments.
1691 /// @param user_data A user data baton passed back to embedders in
1692 /// callbacks.
1693 /// @param[out] engine_out The engine handle on successful engine creation.
1694 ///
1695 /// @return The result of the call to initialize the Flutter engine.
1696 ///
1698 FlutterEngineResult FlutterEngineInitialize(size_t version,
1699  const FlutterRendererConfig* config,
1700  const FlutterProjectArgs* args,
1701  void* user_data,
1703  engine_out);
1704 
1705 //------------------------------------------------------------------------------
1706 /// @brief Stops running the Flutter engine instance. After this call, the
1707 /// embedder is also guaranteed that no more calls to post tasks
1708 /// onto custom task runners specified by the embedder are made. The
1709 /// Flutter engine handle still needs to be collected via a call to
1710 /// `FlutterEngineShutdown`.
1711 ///
1712 /// @param[in] engine The running engine instance to de-initialize.
1713 ///
1714 /// @return The result of the call to de-initialize the Flutter engine.
1715 ///
1718  engine);
1719 
1720 //------------------------------------------------------------------------------
1721 /// @brief Runs an initialized engine instance. An engine can be
1722 /// initialized via `FlutterEngineInitialize`. An initialized
1723 /// instance can only be run once. During and after this call,
1724 /// custom task runners supplied by the embedder are expected to
1725 /// start servicing tasks.
1726 ///
1727 /// @param[in] engine An initialized engine instance that has not previously
1728 /// been run.
1729 ///
1730 /// @return The result of the call to run the initialized Flutter
1731 /// engine instance.
1732 ///
1734 FlutterEngineResult FlutterEngineRunInitialized(
1736 
1738 FlutterEngineResult FlutterEngineSendWindowMetricsEvent(
1741 
1743 FlutterEngineResult FlutterEngineSendPointerEvent(
1745  const FlutterPointerEvent* events,
1746  size_t events_count);
1747 
1748 //------------------------------------------------------------------------------
1749 /// @brief Sends a key event to the engine. The framework will decide
1750 /// whether to handle this event in a synchronous fashion, although
1751 /// due to technical limitation, the result is always reported
1752 /// asynchronously. The `callback` is guaranteed to be called
1753 /// exactly once.
1754 ///
1755 /// @param[in] engine A running engine instance.
1756 /// @param[in] event The event data to be sent. This function will no
1757 /// longer access `event` after returning.
1758 /// @param[in] callback The callback invoked by the engine when the
1759 /// Flutter application has decided whether it
1760 /// handles this event. Accepts nullptr.
1761 /// @param[in] user_data The context associated with the callback. The
1762 /// exact same value will used to invoke `callback`.
1763 /// Accepts nullptr.
1764 ///
1765 /// @return The result of the call.
1766 ///
1769  engine,
1770  const FlutterKeyEvent* event,
1772  void* user_data);
1773 
1775 FlutterEngineResult FlutterEngineSendPlatformMessage(
1777  const FlutterPlatformMessage* message);
1778 
1779 //------------------------------------------------------------------------------
1780 /// @brief Creates a platform message response handle that allows the
1781 /// embedder to set a native callback for a response to a message.
1782 /// This handle may be set on the `response_handle` field of any
1783 /// `FlutterPlatformMessage` sent to the engine.
1784 ///
1785 /// The handle must be collected via a call to
1786 /// `FlutterPlatformMessageReleaseResponseHandle`. This may be done
1787 /// immediately after a call to `FlutterEngineSendPlatformMessage`
1788 /// with a platform message whose response handle contains the handle
1789 /// created using this call. In case a handle is created but never
1790 /// sent in a message, the release call must still be made. Not
1791 /// calling release on the handle results in a small memory leak.
1792 ///
1793 /// The user data baton passed to the data callback is the one
1794 /// specified in this call as the third argument.
1795 ///
1796 /// @see FlutterPlatformMessageReleaseResponseHandle()
1797 ///
1798 /// @param[in] engine A running engine instance.
1799 /// @param[in] data_callback The callback invoked by the engine when the
1800 /// Flutter application send a response on the
1801 /// handle.
1802 /// @param[in] user_data The user data associated with the data callback.
1803 /// @param[out] response_out The response handle created when this call is
1804 /// successful.
1805 ///
1806 /// @return The result of the call.
1807 ///
1809 FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(
1811  FlutterDataCallback data_callback,
1812  void* user_data,
1813  FlutterPlatformMessageResponseHandle** response_out);
1814 
1815 //------------------------------------------------------------------------------
1816 /// @brief Collects the handle created using
1817 /// `FlutterPlatformMessageCreateResponseHandle`.
1818 ///
1819 /// @see FlutterPlatformMessageCreateResponseHandle()
1820 ///
1821 /// @param[in] engine A running engine instance.
1822 /// @param[in] response The platform message response handle to collect.
1823 /// These handles are created using
1824 /// `FlutterPlatformMessageCreateResponseHandle()`.
1825 ///
1826 /// @return The result of the call.
1827 ///
1832 
1833 //------------------------------------------------------------------------------
1834 /// @brief Send a response from the native side to a platform message from
1835 /// the Dart Flutter application.
1836 ///
1837 /// @param[in] engine The running engine instance.
1838 /// @param[in] handle The platform message response handle.
1839 /// @param[in] data The data to associate with the platform message
1840 /// response.
1841 /// @param[in] data_length The length of the platform message response data.
1842 ///
1843 /// @return The result of the call.
1844 ///
1846 FlutterEngineResult FlutterEngineSendPlatformMessageResponse(
1849  const uint8_t* data,
1850  size_t data_length);
1851 
1852 //------------------------------------------------------------------------------
1853 /// @brief This API is only meant to be used by platforms that need to
1854 /// flush tasks on a message loop not controlled by the Flutter
1855 /// engine.
1856 ///
1857 /// @deprecated This API will be deprecated and is not part of the stable API.
1858 /// Please use the custom task runners API by setting an
1859 /// appropriate `FlutterProjectArgs::custom_task_runners`
1860 /// interface. This will yield better performance and the
1861 /// interface is stable.
1862 ///
1863 /// @return The result of the call.
1864 ///
1866 FlutterEngineResult __FlutterEngineFlushPendingTasksNow();
1867 
1868 //------------------------------------------------------------------------------
1869 /// @brief Register an external texture with a unique (per engine)
1870 /// identifier. Only rendering backends that support external
1871 /// textures accept external texture registrations. After the
1872 /// external texture is registered, the application can mark that a
1873 /// frame is available by calling
1874 /// `FlutterEngineMarkExternalTextureFrameAvailable`.
1875 ///
1876 /// @see FlutterEngineUnregisterExternalTexture()
1877 /// @see FlutterEngineMarkExternalTextureFrameAvailable()
1878 ///
1879 /// @param[in] engine A running engine instance.
1880 /// @param[in] texture_identifier The identifier of the texture to register
1881 /// with the engine. The embedder may supply new
1882 /// frames to this texture using the same
1883 /// identifier.
1884 ///
1885 /// @return The result of the call.
1886 ///
1888 FlutterEngineResult FlutterEngineRegisterExternalTexture(
1890  int64_t texture_identifier);
1891 
1892 //------------------------------------------------------------------------------
1893 /// @brief Unregister a previous texture registration.
1894 ///
1895 /// @see FlutterEngineRegisterExternalTexture()
1896 /// @see FlutterEngineMarkExternalTextureFrameAvailable()
1897 ///
1898 /// @param[in] engine A running engine instance.
1899 /// @param[in] texture_identifier The identifier of the texture for which new
1900 /// frame will not be available.
1901 ///
1902 /// @return The result of the call.
1903 ///
1905 FlutterEngineResult FlutterEngineUnregisterExternalTexture(
1907  int64_t texture_identifier);
1908 
1909 //------------------------------------------------------------------------------
1910 /// @brief Mark that a new texture frame is available for a given texture
1911 /// identifier.
1912 ///
1913 /// @see FlutterEngineRegisterExternalTexture()
1914 /// @see FlutterEngineUnregisterExternalTexture()
1915 ///
1916 /// @param[in] engine A running engine instance.
1917 /// @param[in] texture_identifier The identifier of the texture whose frame
1918 /// has been updated.
1919 ///
1920 /// @return The result of the call.
1921 ///
1925  int64_t texture_identifier);
1926 
1927 //------------------------------------------------------------------------------
1928 /// @brief Enable or disable accessibility semantics.
1929 ///
1930 /// @param[in] engine A running engine instance.
1931 /// @param[in] enabled When enabled, changes to the semantic contents of the
1932 /// window are sent via the
1933 /// `FlutterUpdateSemanticsNodeCallback` registered to
1934 /// `update_semantics_node_callback` in
1935 /// `FlutterProjectArgs`.
1936 ///
1937 /// @return The result of the call.
1938 ///
1940 FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(
1942  bool enabled);
1943 
1944 //------------------------------------------------------------------------------
1945 /// @brief Sets additional accessibility features.
1946 ///
1947 /// @param[in] engine A running engine instance
1948 /// @param[in] features The accessibility features to set.
1949 ///
1950 /// @return The result of the call.
1951 ///
1953 FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(
1955  FlutterAccessibilityFeature features);
1956 
1957 //------------------------------------------------------------------------------
1958 /// @brief Dispatch a semantics action to the specified semantics node.
1959 ///
1960 /// @param[in] engine A running engine instance.
1961 /// @param[in] identifier The semantics action identifier.
1962 /// @param[in] action The semantics action.
1963 /// @param[in] data Data associated with the action.
1964 /// @param[in] data_length The data length.
1965 ///
1966 /// @return The result of the call.
1967 ///
1969 FlutterEngineResult FlutterEngineDispatchSemanticsAction(
1971  uint64_t id,
1973  const uint8_t* data,
1974  size_t data_length);
1975 
1976 //------------------------------------------------------------------------------
1977 /// @brief Notify the engine that a vsync event occurred. A baton passed to
1978 /// the platform via the vsync callback must be returned. This call
1979 /// must be made on the thread on which the call to
1980 /// `FlutterEngineRun` was made.
1981 ///
1982 /// @see FlutterEngineGetCurrentTime()
1983 ///
1984 /// @attention That frame timepoints are in nanoseconds.
1985 ///
1986 /// @attention The system monotonic clock is used as the timebase.
1987 ///
1988 /// @param[in] engine. A running engine instance.
1989 /// @param[in] baton The baton supplied by the engine.
1990 /// @param[in] frame_start_time_nanos The point at which the vsync event
1991 /// occurred or will occur. If the time
1992 /// point is in the future, the engine will
1993 /// wait till that point to begin its frame
1994 /// workload.
1995 /// @param[in] frame_target_time_nanos The point at which the embedder
1996 /// anticipates the next vsync to occur.
1997 /// This is a hint the engine uses to
1998 /// schedule Dart VM garbage collection in
1999 /// periods in which the various threads
2000 /// are most likely to be idle. For
2001 /// example, for a 60Hz display, embedders
2002 /// should add 16.6 * 1e6 to the frame time
2003 /// field.
2004 ///
2005 /// @return The result of the call.
2006 ///
2009  engine,
2010  intptr_t baton,
2011  uint64_t frame_start_time_nanos,
2012  uint64_t frame_target_time_nanos);
2013 
2014 //------------------------------------------------------------------------------
2015 /// @brief Reloads the system fonts in engine.
2016 ///
2017 /// @param[in] engine. A running engine instance.
2018 ///
2019 /// @return The result of the call.
2020 ///
2022 FlutterEngineResult FlutterEngineReloadSystemFonts(
2024 
2025 //------------------------------------------------------------------------------
2026 /// @brief A profiling utility. Logs a trace duration begin event to the
2027 /// timeline. If the timeline is unavailable or disabled, this has
2028 /// no effect. Must be balanced with an duration end event (via
2029 /// `FlutterEngineTraceEventDurationEnd`) with the same name on the
2030 /// same thread. Can be called on any thread. Strings passed into
2031 /// the function will NOT be copied when added to the timeline. Only
2032 /// string literals may be passed in.
2033 ///
2034 /// @param[in] name The name of the trace event.
2035 ///
2037 void FlutterEngineTraceEventDurationBegin(const char* name);
2038 
2039 //-----------------------------------------------------------------------------
2040 /// @brief A profiling utility. Logs a trace duration end event to the
2041 /// timeline. If the timeline is unavailable or disabled, this has
2042 /// no effect. This call must be preceded by a trace duration begin
2043 /// call (via `FlutterEngineTraceEventDurationBegin`) with the same
2044 /// name on the same thread. Can be called on any thread. Strings
2045 /// passed into the function will NOT be copied when added to the
2046 /// timeline. Only string literals may be passed in.
2047 ///
2048 /// @param[in] name The name of the trace event.
2049 ///
2051 void FlutterEngineTraceEventDurationEnd(const char* name);
2052 
2053 //-----------------------------------------------------------------------------
2054 /// @brief A profiling utility. Logs a trace duration instant event to the
2055 /// timeline. If the timeline is unavailable or disabled, this has
2056 /// no effect. Can be called on any thread. Strings passed into the
2057 /// function will NOT be copied when added to the timeline. Only
2058 /// string literals may be passed in.
2059 ///
2060 /// @param[in] name The name of the trace event.
2061 ///
2063 void FlutterEngineTraceEventInstant(const char* name);
2064 
2065 //------------------------------------------------------------------------------
2066 /// @brief Posts a task onto the Flutter render thread. Typically, this may
2067 /// be called from any thread as long as a `FlutterEngineShutdown`
2068 /// on the specific engine has not already been initiated.
2069 ///
2070 /// @param[in] engine A running engine instance.
2071 /// @param[in] callback The callback to execute on the render thread.
2072 /// @param callback_data The callback context.
2073 ///
2074 /// @return The result of the call.
2075 ///
2077 FlutterEngineResult FlutterEnginePostRenderThreadTask(
2080  void* callback_data);
2081 
2082 //------------------------------------------------------------------------------
2083 /// @brief Get the current time in nanoseconds from the clock used by the
2084 /// flutter engine. This is the system monotonic clock.
2085 ///
2086 /// @return The current time in nanoseconds.
2087 ///
2089 uint64_t FlutterEngineGetCurrentTime();
2090 
2091 //------------------------------------------------------------------------------
2092 /// @brief Inform the engine to run the specified task. This task has been
2093 /// given to the engine via the
2094 /// `FlutterTaskRunnerDescription.post_task_callback`. This call
2095 /// must only be made at the target time specified in that callback.
2096 /// Running the task before that time is undefined behavior.
2097 ///
2098 /// @param[in] engine A running engine instance.
2099 /// @param[in] task the task handle.
2100 ///
2101 /// @return The result of the call.
2102 ///
2105  engine,
2106  const FlutterTask* task);
2107 
2108 //------------------------------------------------------------------------------
2109 /// @brief Notify a running engine instance that the locale has been
2110 /// updated. The preferred locale must be the first item in the list
2111 /// of locales supplied. The other entries will be used as a
2112 /// fallback.
2113 ///
2114 /// @param[in] engine A running engine instance.
2115 /// @param[in] locales The updated locales in the order of preference.
2116 /// @param[in] locales_count The count of locales supplied.
2117 ///
2118 /// @return Whether the locale updates were applied.
2119 ///
2122  engine,
2123  const FlutterLocale** locales,
2124  size_t locales_count);
2125 
2126 //------------------------------------------------------------------------------
2127 /// @brief Returns if the Flutter engine instance will run AOT compiled
2128 /// Dart code. This call has no threading restrictions.
2129 ///
2130 /// For embedder code that is configured for both AOT and JIT mode
2131 /// Dart execution based on the Flutter engine being linked to, this
2132 /// runtime check may be used to appropriately configure the
2133 /// `FlutterProjectArgs`. In JIT mode execution, the kernel
2134 /// snapshots must be present in the Flutter assets directory
2135 /// specified in the `FlutterProjectArgs`. For AOT execution, the
2136 /// fields `vm_snapshot_data`, `vm_snapshot_instructions`,
2137 /// `isolate_snapshot_data` and `isolate_snapshot_instructions`
2138 /// (along with their size fields) must be specified in
2139 /// `FlutterProjectArgs`.
2140 ///
2141 /// @return True, if AOT Dart code is run. JIT otherwise.
2142 ///
2145 
2146 //------------------------------------------------------------------------------
2147 /// @brief Posts a Dart object to specified send port. The corresponding
2148 /// receive port for send port can be in any isolate running in the
2149 /// VM. This isolate can also be the root isolate for an
2150 /// unrelated engine. The engine parameter is necessary only to
2151 /// ensure the call is not made when no engine (and hence no VM) is
2152 /// running.
2153 ///
2154 /// Unlike the platform messages mechanism, there are no threading
2155 /// restrictions when using this API. Message can be posted on any
2156 /// thread and they will be made available to isolate on which the
2157 /// corresponding send port is listening.
2158 ///
2159 /// However, it is the embedders responsibility to ensure that the
2160 /// call is not made during an ongoing call the
2161 /// `FlutterEngineDeinitialize` or `FlutterEngineShutdown` on
2162 /// another thread.
2163 ///
2164 /// @param[in] engine A running engine instance.
2165 /// @param[in] port The send port to send the object to.
2166 /// @param[in] object The object to send to the isolate with the
2167 /// corresponding receive port.
2168 ///
2169 /// @return If the message was posted to the send port.
2170 ///
2172 FlutterEngineResult FlutterEnginePostDartObject(
2174  FlutterEngineDartPort port,
2175  const FlutterEngineDartObject* object);
2176 
2177 //------------------------------------------------------------------------------
2178 /// @brief Posts a low memory notification to a running engine instance.
2179 /// The engine will do its best to release non-critical resources in
2180 /// response. It is not guaranteed that the resource would have been
2181 /// collected by the time this call returns however. The
2182 /// notification is posted to engine subsystems that may be
2183 /// operating on other threads.
2184 ///
2185 /// Flutter applications can respond to these notifications by
2186 /// setting `WidgetsBindingObserver.didHaveMemoryPressure`
2187 /// observers.
2188 ///
2189 /// @param[in] engine A running engine instance.
2190 ///
2191 /// @return If the low memory notification was sent to the running engine
2192 /// instance.
2193 ///
2195 FlutterEngineResult FlutterEngineNotifyLowMemoryWarning(
2197 
2198 //------------------------------------------------------------------------------
2199 /// @brief Schedule a callback to be run on all engine managed threads.
2200 /// The engine will attempt to service this callback the next time
2201 /// the message loop for each managed thread is idle. Since the
2202 /// engine manages the entire lifecycle of multiple threads, there
2203 /// is no opportunity for the embedders to finely tune the
2204 /// priorities of threads directly, or, perform other thread
2205 /// specific configuration (for example, setting thread names for
2206 /// tracing). This callback gives embedders a chance to affect such
2207 /// tuning.
2208 ///
2209 /// @attention This call is expensive and must be made as few times as
2210 /// possible. The callback must also return immediately as not doing
2211 /// so may risk performance issues (especially for callbacks of type
2212 /// kFlutterNativeThreadTypeUI and kFlutterNativeThreadTypeRender).
2213 ///
2214 /// @attention Some callbacks (especially the ones of type
2215 /// kFlutterNativeThreadTypeWorker) may be called after the
2216 /// FlutterEngine instance has shut down. Embedders must be careful
2217 /// in handling the lifecycle of objects associated with the user
2218 /// data baton.
2219 ///
2220 /// @attention In case there are multiple running Flutter engine instances,
2221 /// their workers are shared.
2222 ///
2223 /// @param[in] engine A running engine instance.
2224 /// @param[in] callback The callback that will get called multiple times on
2225 /// each engine managed thread.
2226 /// @param[in] user_data A baton passed by the engine to the callback. This
2227 /// baton is not interpreted by the engine in any way.
2228 ///
2229 /// @return Returns if the callback was successfully posted to all threads.
2230 ///
2235  void* user_data);
2236 
2237 //------------------------------------------------------------------------------
2238 /// @brief Posts updates corresponding to display changes to a running engine
2239 /// instance.
2240 ///
2241 /// @param[in] update_type The type of update pushed to the engine.
2242 /// @param[in] displays The displays affected by this update.
2243 /// @param[in] display_count Size of the displays array, must be at least 1.
2244 ///
2245 /// @return the result of the call made to the engine.
2246 ///
2248 FlutterEngineResult FlutterEngineNotifyDisplayUpdate(
2250  FlutterEngineDisplaysUpdateType update_type,
2251  const FlutterEngineDisplay* displays,
2252  size_t display_count);
2253 
2254 #endif // !FLUTTER_ENGINE_NO_PROTOTYPES
2255 
2256 // Typedefs for the function pointers in FlutterEngineProcTable.
2258  const FlutterEngineAOTDataSource* source,
2259  FlutterEngineAOTData* data_out);
2261  FlutterEngineAOTData data);
2263  size_t version,
2264  const FlutterRendererConfig* config,
2265  const FlutterProjectArgs* args,
2266  void* user_data,
2267  FLUTTER_API_SYMBOL(FlutterEngine) * engine_out);
2271  size_t version,
2272  const FlutterRendererConfig* config,
2273  const FlutterProjectArgs* args,
2274  void* user_data,
2275  FLUTTER_API_SYMBOL(FlutterEngine) * engine_out);
2285  const FlutterPointerEvent* events,
2286  size_t events_count);
2289  const FlutterKeyEvent* event,
2291  void* user_data);
2294  const FlutterPlatformMessage* message);
2295 typedef FlutterEngineResult (
2298  FlutterDataCallback data_callback,
2299  void* user_data,
2300  FlutterPlatformMessageResponseHandle** response_out);
2301 typedef FlutterEngineResult (
2308  const uint8_t* data,
2309  size_t data_length);
2312  int64_t texture_identifier);
2315  int64_t texture_identifier);
2316 typedef FlutterEngineResult (
2319  int64_t texture_identifier);
2322  bool enabled);
2325  FlutterAccessibilityFeature features);
2328  uint64_t id,
2330  const uint8_t* data,
2331  size_t data_length);
2334  intptr_t baton,
2335  uint64_t frame_start_time_nanos,
2336  uint64_t frame_target_time_nanos);
2340 typedef void (*FlutterEngineTraceEventDurationEndFnPtr)(const char* name);
2341 typedef void (*FlutterEngineTraceEventInstantFnPtr)(const char* name);
2345  void* callback_data);
2346 typedef uint64_t (*FlutterEngineGetCurrentTimeFnPtr)();
2349  const FlutterTask* task);
2352  const FlutterLocale** locales,
2353  size_t locales_count);
2357  FlutterEngineDartPort port,
2358  const FlutterEngineDartObject* object);
2364  void* user_data);
2367  FlutterEngineDisplaysUpdateType update_type,
2368  const FlutterEngineDisplay* displays,
2369  size_t display_count);
2370 
2371 /// Function-pointer-based versions of the APIs above.
2372 typedef struct {
2373  /// The size of this struct. Must be sizeof(FlutterEngineProcs).
2374  size_t struct_size;
2375 
2415 
2416 //------------------------------------------------------------------------------
2417 /// @brief Gets the table of engine function pointers.
2418 ///
2419 /// @param[out] table The table to fill with pointers. This should be
2420 /// zero-initialized, except for struct_size.
2421 ///
2422 /// @return Returns whether the table was successfully populated.
2423 ///
2425 FlutterEngineResult FlutterEngineGetProcAddresses(
2426  FlutterEngineProcTable* table);
2427 
2428 #if defined(__cplusplus)
2429 } // extern "C"
2430 #endif
2431 
2432 #endif // FLUTTER_EMBEDDER_H_
FlutterPointerMouseButtons
Definition: embedder.h:631
FLUTTER_EXPORT 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:2023
double skewY
vertical skew factor
Definition: embedder.h:238
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition: embedder.h:1152
uint32_t fbo_id
Id of the fbo backing the surface that was presented.
Definition: embedder.h:378
FlutterAccessibilityFeature
Definition: embedder.h:83
G_BEGIN_DECLS FlValue * args
FlutterEngineResult(* FlutterEnginePostRenderThreadTaskFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data)
Definition: embedder.h:2342
const FlutterCompositor * compositor
Definition: embedder.h:1528
struct _FlutterTaskRunner * FlutterTaskRunner
Definition: embedder.h:895
FlutterSoftwareRendererConfig software
Definition: embedder.h:558
TransformationCallback surface_transformation
Definition: embedder.h:423
FlutterPlatformViewMutationType
Definition: embedder.h:992
Definition: embedder.h:595
int32_t text_selection_extent
The position at which the text selection terminates.
Definition: embedder.h:806
FLUTTER_EXPORT FlutterEngineResult __FlutterEngineFlushPendingTasksNow()
This API is only meant to be used by platforms that need to flush tasks on a message loop not control...
Definition: embedder.cc:1834
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:1048
double pixel_ratio
Scale factor for the physical screen.
Definition: embedder.h:571
bool(* BoolCallback)(void *)
Definition: embedder.h:302
const char * channel
Definition: embedder.h:758
double skewX
horizontal skew factor
Definition: embedder.h:234
double pers1
input y-axis perspective factor
Definition: embedder.h:246
double scroll_delta_y
The y offset of the scroll in physical pixels.
Definition: embedder.h:666
FlutterEngineResult(* FlutterEngineSendWindowMetricsEventFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
Definition: embedder.h:2280
A structure to represent a 2D point.
Definition: embedder.h:341
Request that text be rendered at a bold font weight.
Definition: embedder.h:92
const void * FlutterMetalDeviceHandle
Alias for id<MTLDevice>.
Definition: embedder.h:447
FlutterSize upper_left_corner_radius
Definition: embedder.h:349
int64_t texture_id
Definition: embedder.h:499
int32_t scroll_index
The index of the first visible semantic child of a scroll node.
Definition: embedder.h:810
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 f...
Definition: embedder.cc:2072
FlutterEngineRunsAOTCompiledDartCodeFnPtr RunsAOTCompiledDartCode
Definition: embedder.h:2408
const char * persistent_cache_path
Definition: embedder.h:1464
const uint8_t * isolate_snapshot_data
Definition: embedder.h:1423
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 ...
Definition: embedder.cc:2283
FlutterEnginePostDartObjectFnPtr PostDartObject
Definition: embedder.h:2409
FlutterSize upper_right_corner_radius
Definition: embedder.h:350
A request to fully show the semantics node on screen.
Definition: embedder.h:126
double pers2
perspective scale factor
Definition: embedder.h:248
size_t top
Vertical physical location of the top of the window on the screen.
Definition: embedder.h:575
FlutterEngineUpdateSemanticsEnabledFnPtr UpdateSemanticsEnabled
Definition: embedder.h:2396
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalTexture).
Definition: embedder.h:494
FlutterComputePlatformResolvedLocaleCallback compute_platform_resolved_locale_callback
Definition: embedder.h:1554
Whether the semantics node is considered hidden.
Definition: embedder.h:187
Text is read from left to right.
Definition: embedder.h:225
uint32_t width
Definition: embedder.h:328
FlutterMetalTexture(* FlutterMetalTextureCallback)(void *, const FlutterFrameInfo *)
Callback for when a metal texture is requested.
Definition: embedder.h:513
FlutterEngineGetCurrentTimeFnPtr GetCurrentTime
Definition: embedder.h:2405
double y
Definition: embedder.h:343
Whether a semantics node is selected.
Definition: embedder.h:163
FlutterMetalTextureFrameCallback external_texture_frame_callback
Definition: embedder.h:541
FlutterEngineResult(* FlutterEngineRunFnPtr)(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Definition: embedder.h:2262
FlutterMetalExternalTexturePixelFormat pixel_format
The pixel format type of the external.
Definition: embedder.h:469
const FlutterTaskRunnerDescription * render_task_runner
Definition: embedder.h:948
size_t width
Height of the texture.
Definition: embedder.h:465
FlutterEngineResult(* FlutterEngineInitializeFnPtr)(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Definition: embedder.h:2270
FlutterEngineRegisterExternalTextureFnPtr RegisterExternalTexture
Definition: embedder.h:2392
int64_t FlutterEngineDartPort
Definition: embedder.h:1220
int32_t id
The unique custom action or action override ID.
Definition: embedder.h:877
FlutterEngineUpdateAccessibilityFeaturesFnPtr UpdateAccessibilityFeatures
Definition: embedder.h:2397
FlutterKeyEventType
Definition: embedder.h:677
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
Definition: embedder.cc:1408
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:960
void * user_data
Definition: mock_engine.cc:32
const char * icu_data_path
Definition: embedder.h:1378
FlutterEngineRunTaskFnPtr RunTask
Definition: embedder.h:2406
FlutterMetalCommandQueueHandle present_command_queue
Alias for id<MTLCommandQueue>.
Definition: embedder.h:530
bool(* SoftwareSurfacePresentCallback)(void *, const void *, size_t, size_t)
Definition: embedder.h:305
FlutterEngineAOTDataSourceType
AOT data source type.
Definition: embedder.h:1319
double y
The y coordinate of the pointer event in physical pixels.
Definition: embedder.h:658
FlutterEngineCollectAOTDataFnPtr CollectAOTData
Definition: embedder.h:2377
const FlutterBackingStore * backing_store
Definition: embedder.h:1099
FLUTTER_EXPORT FlutterEngineResult FlutterEngineReloadSystemFonts(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Reloads the system fonts in engine.
Definition: embedder.cc:1972
bool avoid_backing_store_cache
Avoid caching backing stores provided by this compositor.
Definition: embedder.h:1147
FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
Definition: embedder.cc:1793
const FlutterPlatformMessageResponseHandle * response_handle
Definition: embedder.h:767
size_t struct_size
The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
Definition: embedder.h:913
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.
Definition: embedder.cc:2322
const FlutterCustomTaskRunners * custom_task_runners
Definition: embedder.h:1493
FlutterEngineDisplaysUpdateType
Definition: embedder.h:1210
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalBackingStore).
Definition: embedder.h:983
size_t vm_snapshot_instructions_size
Definition: embedder.h:1418
FlutterPlatformViewIdentifier platform_view_id
Definition: embedder.h:856
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:1024
Text is read from right to left.
Definition: embedder.h:223
FlutterPointerPhase
The phase of the pointer event.
Definition: embedder.h:587
const char * character
Definition: embedder.h:732
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 an...
Definition: embedder.cc:2136
FlutterRect rect
The bounding box for this node in its coordinate system.
Definition: embedder.h:839
FlutterTaskRunner runner
Definition: embedder.h:898
Indicate that the user has invoked a custom accessibility action.
Definition: embedder.h:144
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:1108
Function-pointer-based versions of the APIs above.
Definition: embedder.h:2372
Whether the semantics node label is the name of a visually distinct route.
Definition: embedder.h:185
FlutterEngineResult(* FlutterEngineUpdateLocalesFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Definition: embedder.h:2350
double scroll_position
Definition: embedder.h:813
OnPreEngineRestartCallback on_pre_engine_restart_callback
Definition: embedder.h:1591
FlutterTransformation transformation
Definition: embedder.h:1014
FlutterTextDirection text_direction
Definition: embedder.h:837
Whether the semantics node represents an image.
Definition: embedder.h:189
double pers0
input x-axis perspective factor
Definition: embedder.h:244
FlutterEngineResult(* FlutterEngineMarkExternalTextureFrameAvailableFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2317
FLUTTER_EXPORT 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:1989
void(* FlutterLogMessageCallback)(const char *, const char *, void *)
Definition: embedder.h:1340
double scroll_delta_x
The x offset of the scroll in physical pixels.
Definition: embedder.h:664
bool(* TextureFrameCallback)(void *, int64_t, size_t, size_t, FlutterOpenGLTexture *)
Definition: embedder.h:310
FlutterEngineDeinitializeFnPtr Deinitialize
Definition: embedder.h:2381
FlutterEngineResult(* FlutterEngineNotifyDisplayUpdateFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count)
Definition: embedder.h:2365
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalRendererConfig).
Definition: embedder.h:526
Move the cursor backward by one character.
Definition: embedder.h:130
FlutterEngineSendKeyEventFnPtr SendKeyEvent
Definition: embedder.h:2385
FlutterEngineSendPlatformMessageFnPtr SendPlatformMessage
Definition: embedder.h:2386
BoolPresentInfoCallback present_with_info
Definition: embedder.h:443
const char * variant_code
Definition: embedder.h:1171
Cut the current selection and place it in the clipboard.
Definition: embedder.h:136
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
FlutterEngineResult(* FlutterEngineSendPointerEventFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
Definition: embedder.h:2283
double right
Definition: embedder.h:336
size_t struct_size
The size of the struct. Must be sizeof(FlutterSemanticsCustomAction).
Definition: embedder.h:875
FlutterEngineSendPlatformMessageResponseFnPtr SendPlatformMessageResponse
Definition: embedder.h:2391
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.
Definition: embedder.cc:1807
Specifies a Metal backing store. This is backed by a Metal texture.
Definition: embedder.h:1050
Whether the semantic node can hold the user&#39;s focus.
Definition: embedder.h:210
Whether the semantics node represents a slider.
Definition: embedder.h:214
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:1385
#define FLUTTER_EXPORT
Definition: embedder.h:50
FlutterLayerContentType
Definition: embedder.h:1082
void(* FlutterUpdateSemanticsNodeCallback)(const FlutterSemanticsNode *, void *)
Definition: embedder.h:887
FlutterEngineUnregisterExternalTextureFnPtr UnregisterExternalTexture
Definition: embedder.h:2393
size_t custom_accessibility_actions_count
The number of custom accessibility action associated with this node.
Definition: embedder.h:850
FlutterPointerDeviceKind
The device type that created a pointer event.
Definition: embedder.h:623
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Enable or disable accessibility semantics.
Definition: embedder.cc:1897
UIntFrameInfoCallback fbo_with_frame_info_callback
Definition: embedder.h:437
FlutterPoint offset
Definition: embedder.h:1106
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 FlutterTa...
Definition: embedder.cc:2027
bool(* FlutterBackingStoreCreateCallback)(const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)
Definition: embedder.h:1111
size_t struct_size
This size of this struct. Must be sizeof(FlutterDisplay).
Definition: embedder.h:1193
FLUTTER_EXPORT FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
Definition: embedder.cc:822
FlutterPlatformMessageCallback platform_message_callback
Definition: embedder.h:1402
FlutterLogMessageCallback log_message_callback
Definition: embedder.h:1574
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDispatchSemanticsAction(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Dispatch a semantics action to the specified semantics node.
Definition: embedder.cc:1925
FlutterSize lower_right_corner_radius
Definition: embedder.h:351
double top
Definition: embedder.h:335
Whether a semantic node is in a mutually exclusive group.
Definition: embedder.h:176
A structure to represent a rectangle.
Definition: embedder.h:333
bool is_persistent_cache_read_only
Definition: embedder.h:1468
FlutterEnginePostRenderThreadTaskFnPtr PostRenderThreadTask
Definition: embedder.h:2404
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 synchron...
Definition: embedder.cc:1655
uint64_t task
Definition: embedder.h:899
Move the cursor forward by one word.
Definition: embedder.h:148
Indicate the platform is inverting the colors of the application.
Definition: embedder.h:88
FlutterMetalPresentCallback present_drawable_callback
Definition: embedder.h:536
void(* FlutterUpdateSemanticsCustomActionCallback)(const FlutterSemanticsCustomAction *, void *)
Definition: embedder.h:891
int32_t scroll_child_count
The total number of scrollable children that contribute to semantics.
Definition: embedder.h:808
Set the text selection to the given range.
Definition: embedder.h:132
FLUTTER_EXPORT const int32_t kFlutterSemanticsCustomActionIdBatchEnd
Definition: embedder.cc:70
FlKeyEvent FlKeyResponderAsyncCallback callback
FlutterEngineUpdateLocalesFnPtr UpdateLocales
Definition: embedder.h:2407
FlutterEngineRunInitializedFnPtr RunInitialized
Definition: embedder.h:2382
const char *const * command_line_argv
Definition: embedder.h:1396
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
Sets additional accessibility features.
Definition: embedder.cc:1911
FlutterEngineResult(* FlutterEngineOnVsyncFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)
Definition: embedder.h:2332
uint64_t logical
Definition: embedder.h:729
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 Flutter...
Definition: embedder.cc:905
const char * log_tag
Definition: embedder.h:1581
FlutterEngineResult(* FlutterEngineRunTaskFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
Definition: embedder.h:2347
Copy the current selection to the clipboard.
Definition: embedder.h:134
FlutterEngineRunFnPtr Run
Definition: embedder.h:2378
FlutterSemanticsAction
Definition: embedder.h:101
FlutterEngineResult(* FlutterEngineRegisterExternalTextureFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2310
size_t struct_size
The size of this struct. Must be sizeof(FlutterEngineProcs).
Definition: embedder.h:2374
FlutterEngineTraceEventDurationBeginFnPtr TraceEventDurationBegin
Definition: embedder.h:2401
const FlutterLocale *(* FlutterComputePlatformResolvedLocaleCallback)(const FlutterLocale **, size_t)
Definition: embedder.h:1182
Whether a semantic node is a header that divides content into sections.
Definition: embedder.h:178
FlKeyEvent * event
const char * script_code
Definition: embedder.h:1166
const char * country_code
Definition: embedder.h:1161
uint32_t height
Definition: embedder.h:329
uint64_t physical
Definition: embedder.h:721
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
Definition: embedder.cc:1530
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalExternalTexture).
Definition: embedder.h:463
void(* OnPreEngineRestartCallback)(void *)
Definition: embedder.h:316
void(* FlutterTaskRunnerPostTaskCallback)(FlutterTask, uint64_t, void *)
Definition: embedder.h:902
bool shutdown_dart_vm_when_done
Definition: embedder.h:1512
Whether the semantics node represents a keyboard key.
Definition: embedder.h:216
const char *const * dart_entrypoint_argv
Definition: embedder.h:1566
VsyncCallback vsync_callback
Definition: embedder.h:1479
double scaleY
vertical scale factor
Definition: embedder.h:240
FlutterUIntSize size
The size of the surface that will be backed by the fbo.
Definition: embedder.h:363
FlutterEnginePlatformMessageCreateResponseHandleFnPtr PlatformMessageCreateResponseHandle
Definition: embedder.h:2388
size_t num_textures
Represents the size of the textures array.
Definition: embedder.h:471
const char * string_value
Definition: embedder.h:1288
void(* FlutterEngineTraceEventDurationBeginFnPtr)(const char *name)
Definition: embedder.h:2339
Whether the semantic node represents a button.
Definition: embedder.h:165
const char * hint
The hint description of this custom semantics action.
Definition: embedder.h:884
Decrease the value represented by the semantics node.
Definition: embedder.h:124
double left
Definition: embedder.h:334
VoidCallback destruction_callback
Definition: embedder.h:978
size_t struct_size
The size of this struct. Must be sizeof(FlutterSemanticsNode).
Definition: embedder.h:796
FlutterEngineResult(* FlutterEnginePostCallbackOnAllNativeThreadsFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
Definition: embedder.h:2361
FlutterOpenGLTargetType type
Definition: embedder.h:954
FlutterEngineResult(* FlutterEngineCreateAOTDataFnPtr)(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Definition: embedder.h:2257
FlutterEngineTraceEventInstantFnPtr TraceEventInstant
Definition: embedder.h:2403
size_t struct_size
The size of this struct. Must be sizeof(FlutterKeyEvent).
Definition: embedder.h:707
size_t struct_size
The size of this struct. Must be sizeof(FlutterEngineDartBuffer).
Definition: embedder.h:1236
The semantics node has the quality of either being "on" or "off".
Definition: embedder.h:193
FlutterMetalTexture texture
Definition: embedder.h:988
void(* FlutterPlatformMessageCallback)(const FlutterPlatformMessage *, void *)
Definition: embedder.h:770
VoidCallback destruction_callback
Definition: embedder.h:299
VoidCallback destruction_callback
Definition: embedder.h:509
const int32_t * custom_accessibility_actions
Definition: embedder.h:853
FlutterSemanticsFlag flags
The set of semantics flags associated with this node.
Definition: embedder.h:800
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:1087
GdkEventType type
Definition: fl_view.cc:80
Request that animations be disabled or simplified.
Definition: embedder.h:90
size_t struct_size
The size of this struct. Must be sizeof(FlutterFrameInfo).
Definition: embedder.h:361
bool synthesized
Definition: embedder.h:745
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
Definition: embedder.cc:1707
FlutterEngineResult(* FlutterEngineUpdateAccessibilityFeaturesFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
Definition: embedder.h:2323
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:1069
FlutterRendererType type
Definition: embedder.h:555
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: switches.h:41
const char * increased_value
Definition: embedder.h:831
FLUTTER_EXPORT 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:1993
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 re...
Definition: embedder.cc:1758
double transX
horizontal translation
Definition: embedder.h:236
FlutterEngineDisplayId display_id
Definition: embedder.h:1195
FlutterEngineResult(* FlutterEngineReloadSystemFontsFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2337
double x
Definition: embedder.h:342
VoidCallback destruction_callback
Definition: embedder.h:274
FlutterEngineCreateAOTDataFnPtr CreateAOTData
Definition: embedder.h:2376
double thickness
Describes how much space the semantics node takes up along the z-axis.
Definition: embedder.h:822
uint32_t(* UIntFrameInfoCallback)(void *, const FlutterFrameInfo *)
Callback for when a frame buffer object is requested.
Definition: embedder.h:367
uint64_t FlutterEngineDisplayId
Definition: embedder.h:1189
const uint8_t * message
Definition: embedder.h:759
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:969
const int32_t * children_in_hit_test_order
Array of child node IDs in hit test order. Has length child_count.
Definition: embedder.h:848
Indicate that the node has lost accessibility focus.
Definition: embedder.h:142
const char * main_path__unused__
Definition: embedder.h:1364
FlutterUpdateSemanticsNodeCallback update_semantics_node_callback
Definition: embedder.h:1446
void(* FlutterNativeThreadCallback)(FlutterNativeThreadType type, void *user_data)
Definition: embedder.h:1315
size_t height
Physical height of the window.
Definition: embedder.h:569
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
Definition: embedder.h:649
FlutterEngineNotifyDisplayUpdateFnPtr NotifyDisplayUpdate
Definition: embedder.h:2413
FlutterEngineResult(* FlutterEngineNotifyLowMemoryWarningFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2359
const int32_t * children_in_traversal_order
Array of child node IDs in traversal order. Has length child_count.
Definition: embedder.h:846
FlutterEnginePlatformMessageReleaseResponseHandleFnPtr PlatformMessageReleaseResponseHandle
Definition: embedder.h:2390
bool(* FlutterMetalTextureFrameCallback)(void *, int64_t, size_t, size_t, FlutterMetalExternalTexture *)
Definition: embedder.h:485
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 supp...
Definition: embedder.cc:1839
bool(* BoolPresentInfoCallback)(void *, const FlutterPresentInfo *)
Callback for when a surface is presented.
Definition: embedder.h:382
FlutterKeyEventType type
The event kind.
Definition: embedder.h:713
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
Definition: embedder.h:388
FlutterEngineReloadSystemFontsFnPtr ReloadSystemFonts
Definition: embedder.h:2400
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:1067
size_t width
Physical width of the window.
Definition: embedder.h:567
struct _FlutterEngineAOTData * FlutterEngineAOTData
Definition: embedder.h:1346
const FlutterPlatformView * platform_view
Definition: embedder.h:1102
FlutterRendererType
Definition: embedder.h:72
FlutterLayerContentType type
Definition: embedder.h:1095
SemanticsAction action
The pointer moved while up.
Definition: embedder.h:619
int32_t id
The unique identifier for this node.
Definition: embedder.h:798
size_t mutations_count
Definition: embedder.h:1027
FlutterEngineResult(* FlutterEnginePlatformMessageReleaseResponseHandleFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Definition: embedder.h:2302
Whether the semantic node currently holds the user&#39;s focus.
Definition: embedder.h:169
Whether the semantic node represents a text field.
Definition: embedder.h:167
double physical_view_inset_top
Top inset of window.
Definition: embedder.h:577
FlutterUpdateSemanticsCustomActionCallback update_semantics_custom_action_callback
Definition: embedder.h:1457
FlutterTransformation transform
Definition: embedder.h:842
Whether the semantics node represents a link.
Definition: embedder.h:212
BoolCallback make_resource_current
Definition: embedder.h:407
const uint8_t * vm_snapshot_data
Definition: embedder.h:1407
double scroll_extent_min
The minimum in-range value for scrollPosition if the node is scrollable.
Definition: embedder.h:817
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 ...
Definition: embedder.cc:2260
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 ...
Definition: embedder.cc:1945
BoolCallback clear_current
Definition: embedder.h:390
void *(* ProcResolver)(void *, const char *)
Definition: embedder.h:309
TextureFrameCallback gl_external_texture_frame_callback
Definition: embedder.h:429
VoidCallback buffer_collect_callback
Definition: embedder.h:1260
int64_t dart_old_gen_heap_size
Definition: embedder.h:1535
const char * hint
A brief description of the result of performing an action on the node.
Definition: embedder.h:826
double width
Definition: embedder.h:320
FLUTTER_EXPORT 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:1997
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:1055
bool(* FlutterBackingStoreCollectCallback)(const FlutterBackingStore *renderer, void *user_data)
Definition: embedder.h:1116
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...
Definition: embedder.cc:2001
const uint8_t * vm_snapshot_instructions
Definition: embedder.h:1415
A structure to represent the width and height.
Definition: embedder.h:319
double bottom
Definition: embedder.h:337
Move the cursor backward by one word.
Definition: embedder.h:150
size_t height
Height of the texture.
Definition: embedder.h:467
FlutterMetalTextureCallback get_next_drawable_callback
Definition: embedder.h:533
size_t struct_size
The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
Definition: embedder.h:565
const void * FlutterMetalTextureHandle
Alias for id<MTLTexture>.
Definition: embedder.h:453
FlutterTransformation(* TransformationCallback)(void *)
Definition: embedder.h:303
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.
Definition: embedder.cc:1879
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 ...
Definition: embedder.cc:889
Definition: embedder.h:612
double x
The x coordinate of the pointer event in physical pixels.
Definition: embedder.h:656
void(* VsyncCallback)(void *, intptr_t)
Definition: embedder.h:315
FlutterEngineSendWindowMetricsEventFnPtr SendWindowMetricsEvent
Definition: embedder.h:2383
const void * FlutterMetalCommandQueueHandle
Alias for id<MTLCommandQueue>.
Definition: embedder.h:450
size_t height
The number of rows in the allocation.
Definition: embedder.h:971
FlutterEngineMarkExternalTextureFrameAvailableFnPtr MarkExternalTextureFrameAvailable
Definition: embedder.h:2395
const char * custom_dart_entrypoint
Definition: embedder.h:1488
FlutterBackingStoreCollectCallback collect_backing_store_callback
Definition: embedder.h:1142
FlutterEngineOnVsyncFnPtr OnVsync
Definition: embedder.h:2399
const char * assets_path
Definition: embedder.h:1354
Whether a semantics node is checked.
Definition: embedder.h:161
Whether the value of the semantics node is obscured.
Definition: embedder.h:180
BoolCallback make_current
Definition: embedder.h:389
FlutterPointerSignalKind
The type of a pointer signal.
Definition: embedder.h:642
const char * label
The user-readable name of this custom semantics action.
Definition: embedder.h:882
const char * packages_path__unused__
Definition: embedder.h:1374
uint32_t(* UIntCallback)(void *)
Definition: embedder.h:304
FlutterOpenGLRendererConfig open_gl
Definition: embedder.h:557
FlutterEngineResult(* FlutterEngineCollectAOTDataFnPtr)(FlutterEngineAOTData data)
Definition: embedder.h:2260
FlutterEngineResult(* FlutterEngineSendPlatformMessageFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
Definition: embedder.h:2292
FlutterEngineShutdownFnPtr Shutdown
Definition: embedder.h:2379
size_t isolate_snapshot_instructions_size
Definition: embedder.h:1434
FlutterSemanticsAction override_action
Definition: embedder.h:880
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:1061
FlutterEngineResult
Definition: embedder.h:65
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
Definition: embedder.h:1350
size_t child_count
The number of children this node has.
Definition: embedder.h:844
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:1040
FlutterEnginePostCallbackOnAllNativeThreadsFnPtr PostCallbackOnAllNativeThreads
Definition: embedder.h:2412
size_t struct_size
The size of this struct. Must be sizeof(FlutterPresentInfo).
Definition: embedder.h:376
size_t height
Height of the texture.
Definition: embedder.h:282
FlutterEngineDispatchSemanticsActionFnPtr DispatchSemanticsAction
Definition: embedder.h:2398
const char * value
A textual description of the current value of the node.
Definition: embedder.h:828
int32_t text_selection_base
The position at which the text selection originates.
Definition: embedder.h:804
FlutterLayersPresentCallback present_layers_callback
Definition: embedder.h:1145
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:1013
FlutterEngineResult(* FlutterEngineUpdateSemanticsEnabledFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Definition: embedder.h:2320
int64_t buttons
The buttons currently pressed, if any.
Definition: embedder.h:674
UIntCallback fbo_callback
Definition: embedder.h:400
const char * label
A textual description of the node.
Definition: embedder.h:824
double physical_view_inset_bottom
Bottom inset of window.
Definition: embedder.h:581
FlutterEngineNotifyLowMemoryWarningFnPtr NotifyLowMemoryWarning
Definition: embedder.h:2410
const FlutterTaskRunnerDescription * platform_task_runner
Definition: embedder.h:943
double transY
vertical translation
Definition: embedder.h:242
Indicate that the node has gained accessibility focus.
Definition: embedder.h:140
FlutterEngineResult(* FlutterEngineSendKeyEventFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Definition: embedder.h:2287
Whether a semantic node that hasEnabledState is currently enabled.
Definition: embedder.h:174
FlutterMetalTextureHandle texture
Definition: embedder.h:502
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
Definition: embedder.h:1077
FlutterSemanticsAction actions
The set of semantics actions applicable to this node.
Definition: embedder.h:802
FlutterEngineResult(* FlutterEngineUnregisterExternalTextureFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2313
double height
Definition: embedder.h:321
FlutterSemanticsFlag
Definition: embedder.h:156
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition: embedder.h:930
void(* VoidCallback)(void *)
Definition: embedder.h:251
double scroll_extent_max
The maximum in-range value for scrollPosition if the node is scrollable.
Definition: embedder.h:815
Paste the current content of the clipboard.
Definition: embedder.h:138
size_t struct_size
This size of this struct. Must be sizeof(FlutterCompositor).
Definition: embedder.h:1126
FlutterNativeThreadType
Definition: embedder.h:1296
FlutterEngineResult(* FlutterEnginePostDartObjectFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
Definition: embedder.h:2355
FlutterEngineAOTDataSourceType type
Definition: embedder.h:1326
Move the cursor forward by one character.
Definition: embedder.h:128
double timestamp
Definition: embedder.h:711
Request that certain animations be simplified and parallax effects.
Definition: embedder.h:95
FlutterMetalExternalTexturePixelFormat
Pixel format for the external texture.
Definition: embedder.h:456
FlutterPointerSignalKind signal_kind
Definition: embedder.h:662
FlutterMetalRendererConfig metal
Definition: embedder.h:559
size_t isolate_snapshot_data_size
Definition: embedder.h:1426
FlutterEngineResult(* FlutterEngineRunInitializedFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2278
FlutterMetalBackingStore metal
Definition: embedder.h:1071
int32_t id
FlutterBackingStoreType
Definition: embedder.h:1043
FLUTTER_EXPORT bool FlutterEngineRunsAOTCompiledDartCode(void)
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading re...
Definition: embedder.cc:2132
bool(* FlutterEngineRunsAOTCompiledDartCodeFnPtr)(void)
Definition: embedder.h:2354
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUnregisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Unregister a previous texture registration.
Definition: embedder.cc:1858
const FlutterEngineDartBuffer * buffer_value
Definition: embedder.h:1289
uint32_t name
The name of the texture.
Definition: embedder.h:267
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:748
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:1009
FlutterEngineAOTData aot_data
Definition: embedder.h:1543
FlutterEngineTraceEventDurationEndFnPtr TraceEventDurationEnd
Definition: embedder.h:2402
size_t buffer_size
The size of the buffer.
Definition: embedder.h:1268
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:1020
bool(* FlutterMetalPresentCallback)(void *, const FlutterMetalTexture *)
Definition: embedder.h:520
FLUTTER_EXPORT const int32_t kFlutterSemanticsNodeIdBatchEnd
Definition: embedder.cc:69
FlutterSize size
The size of the render target the engine expects to render into.
Definition: embedder.h:1079
FlutterTextDirection
Definition: embedder.h:219
const uint8_t * isolate_snapshot_instructions
Definition: embedder.h:1431
FlutterMetalDeviceHandle device
Alias for id<MTLDevice>.
Definition: embedder.h:528
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:295
FlutterEngineResult(* FlutterEngineDispatchSemanticsActionFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Definition: embedder.h:2326
void(* FlutterEngineTraceEventInstantFnPtr)(const char *name)
Definition: embedder.h:2341
FlutterPointerDeviceKind device_kind
Definition: embedder.h:672
FlutterEngineResult(* FlutterEnginePlatformMessageCreateResponseHandleFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Definition: embedder.h:2296
ProcResolver gl_proc_resolver
Definition: embedder.h:424
FlutterMetalTextureHandle * textures
Definition: embedder.h:480
A structure to represent a rounded rectangle.
Definition: embedder.h:347
Text has unknown text direction.
Definition: embedder.h:221
A request that the node should be dismissed.
Definition: embedder.h:146
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
Definition: embedder.h:938
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:271
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformMessage).
Definition: embedder.h:757
FlutterEngineResult(* FlutterEngineSendPlatformMessageResponseFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: embedder.h:2305
void(* FlutterDataCallback)(const uint8_t *, size_t, void *)
Definition: embedder.h:774
const char * language_code
Definition: embedder.h:1156
bool(* FlutterLayersPresentCallback)(const FlutterLayer **layers, size_t layers_count, void *user_data)
Definition: embedder.h:1120
FlutterSize lower_left_corner_radius
Definition: embedder.h:352
double scaleX
horizontal scale factor
Definition: embedder.h:232
FlutterPointerPhase phase
Definition: embedder.h:650
VoidCallback root_isolate_create_callback
Definition: embedder.h:1437
FlutterEngineSendPointerEventFnPtr SendPointerEvent
Definition: embedder.h:2384
FlutterEngineInitializeFnPtr Initialize
Definition: embedder.h:2380
const char * decreased_value
Definition: embedder.h:834
Increase the value represented by the semantics node.
Definition: embedder.h:122
FLUTTER_EXPORT 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:768
size_t vm_snapshot_data_size
Definition: embedder.h:1410
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:269
BoolCallback runs_task_on_current_thread_callback
Definition: embedder.h:919
int command_line_argc
The command line argument count used to initialize the project.
Definition: embedder.h:1380
const char * elf_path
Absolute path to an ELF library file.
Definition: embedder.h:1329
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
Definition: embedder.h:546
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:1092
int64_t FlutterPlatformViewIdentifier
Definition: embedder.h:781
double physical_view_inset_left
Left inset of window.
Definition: embedder.h:583
double physical_view_inset_right
Right inset of window.
Definition: embedder.h:579
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 embed...
Definition: embedder.cc:1397
uint32_t name
The name of the framebuffer.
Definition: embedder.h:292
#define FLUTTER_API_SYMBOL(symbol)
Definition: embedder.h:60
SoftwareSurfacePresentCallback surface_present_callback
Definition: embedder.h:551
FlutterEngineResult(* FlutterEngineDeinitializeFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2276
FlutterEngineDartObjectType type
Definition: embedder.h:1279
Whether the semantics node is a live region.
Definition: embedder.h:191
uint64_t(* FlutterEngineGetCurrentTimeFnPtr)()
Definition: embedder.h:2346
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.
Definition: embedder.cc:1346
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:957
void(* FlutterEngineTraceEventDurationEndFnPtr)(const char *name)
Definition: embedder.h:2340
FlutterRect rect
Definition: embedder.h:348
FlutterEngineDartObjectType
Definition: embedder.h:1222
FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
Definition: embedder.cc:2363
size_t left
Horizontal physical location of the left side of the window on the screen.
Definition: embedder.h:573
FlutterEngineResult(* FlutterEngineShutdownFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2268
FlutterOpenGLTargetType
Definition: embedder.h:253
FlutterBackingStoreCreateCallback create_backing_store_callback
Definition: embedder.h:1139