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 {
76 
77 /// Additional accessibility features that may be enabled by the platform.
78 /// Must match the `AccessibilityFeatures` enum in window.dart.
79 typedef enum {
80  /// Indicate there is a running accessibility service which is changing the
81  /// interaction model of the device.
83  /// Indicate the platform is inverting the colors of the application.
85  /// Request that animations be disabled or simplified.
87  /// Request that text be rendered at a bold font weight.
89  /// Request that certain animations be simplified and parallax effects
90  // removed.
93 
94 /// The set of possible actions that can be conveyed to a semantics node.
95 ///
96 /// Must match the `SemanticsAction` enum in semantics.dart.
97 typedef enum {
98  /// The equivalent of a user briefly tapping the screen with the finger
99  /// without moving it.
101  /// The equivalent of a user pressing and holding the screen with the finger
102  /// for a few seconds without moving it.
104  /// The equivalent of a user moving their finger across the screen from right
105  /// to left.
107  /// The equivalent of a user moving their finger across the screen from left
108  /// to
109  /// right.
111  /// The equivalent of a user moving their finger across the screen from bottom
112  /// to top.
114  /// The equivalent of a user moving their finger across the screen from top to
115  /// bottom.
117  /// Increase the value represented by the semantics node.
119  /// Decrease the value represented by the semantics node.
121  /// A request to fully show the semantics node on screen.
123  /// Move the cursor forward by one character.
125  /// Move the cursor backward by one character.
127  /// Set the text selection to the given range.
129  /// Copy the current selection to the clipboard.
131  /// Cut the current selection and place it in the clipboard.
133  /// Paste the current content of the clipboard.
135  /// Indicate that the node has gained accessibility focus.
137  /// Indicate that the node has lost accessibility focus.
139  /// Indicate that the user has invoked a custom accessibility action.
141  /// A request that the node should be dismissed.
143  /// Move the cursor forward by one word.
145  /// Move the cursor backward by one word.
148 
149 /// The set of properties that may be associated with a semantics node.
150 ///
151 /// Must match the `SemanticsFlag` enum in semantics.dart.
152 typedef enum {
153  /// The semantics node has the quality of either being "checked" or
154  /// "unchecked".
156  /// Whether a semantics node is checked.
158  /// Whether a semantics node is selected.
160  /// Whether the semantic node represents a button.
162  /// Whether the semantic node represents a text field.
164  /// Whether the semantic node currently holds the user's focus.
166  /// The semantics node has the quality of either being "enabled" or
167  /// "disabled".
169  /// Whether a semantic node that hasEnabledState is currently enabled.
171  /// Whether a semantic node is in a mutually exclusive group.
173  /// Whether a semantic node is a header that divides content into sections.
175  /// Whether the value of the semantics node is obscured.
177  /// Whether the semantics node is the root of a subtree for which a route name
178  /// should be announced.
180  /// Whether the semantics node label is the name of a visually distinct route.
182  /// Whether the semantics node is considered hidden.
184  /// Whether the semantics node represents an image.
186  /// Whether the semantics node is a live region.
188  /// The semantics node has the quality of either being "on" or "off".
190  /// If true, the semantics node is "on". If false, the semantics node is
191  /// "off".
193  /// Whether the platform can scroll the semantics node when the user attempts
194  /// to move the accessibility focus to an offscreen child.
195  ///
196  /// For example, a `ListView` widget has implicit scrolling so that users can
197  /// easily move the accessibility focus to the next set of children. A
198  /// `PageView` widget does not have implicit scrolling, so that users don't
199  /// navigate to the next page when reaching the end of the current one.
201  /// Whether the semantic node is read only.
202  ///
203  /// Only applicable when kFlutterSemanticsFlagIsTextField flag is on.
205  /// Whether the semantic node can hold the user's focus.
207  /// Whether the semantics node represents a link.
210 
211 typedef enum {
212  /// Text has unknown text direction.
214  /// Text is read from right to left.
216  /// Text is read from left to right.
219 
221 
222 typedef struct {
223  /// horizontal scale factor
224  double scaleX;
225  /// horizontal skew factor
226  double skewX;
227  /// horizontal translation
228  double transX;
229  /// vertical skew factor
230  double skewY;
231  /// vertical scale factor
232  double scaleY;
233  /// vertical translation
234  double transY;
235  /// input x-axis perspective factor
236  double pers0;
237  /// input y-axis perspective factor
238  double pers1;
239  /// perspective scale factor
240  double pers2;
242 
243 typedef void (*VoidCallback)(void* /* user data */);
244 
245 typedef enum {
246  /// Specifies an OpenGL texture target type. Textures are specified using
247  /// the FlutterOpenGLTexture struct.
249  /// Specifies an OpenGL frame-buffer target type. Framebuffers are specified
250  /// using the FlutterOpenGLFramebuffer struct.
253 
254 typedef struct {
255  /// Target texture of the active texture unit (example GL_TEXTURE_2D or
256  /// GL_TEXTURE_RECTANGLE).
257  uint32_t target;
258  /// The name of the texture.
259  uint32_t name;
260  /// The texture format (example GL_RGBA8).
261  uint32_t format;
262  /// User data to be returned on the invocation of the destruction callback.
263  void* user_data;
264  /// Callback invoked (on an engine managed thread) that asks the embedder to
265  /// collect the texture.
267  /// Optional parameters for texture height/width, default is 0, non-zero means
268  /// the texture has the specified width/height. Usually, when the texture type
269  /// is GL_TEXTURE_RECTANGLE, we need to specify the texture width/height to
270  /// tell the embedder to scale when rendering.
271  /// Width of the texture.
272  size_t width;
273  /// Height of the texture.
274  size_t height;
276 
277 typedef struct {
278  /// The target of the color attachment of the frame-buffer. For example,
279  /// GL_TEXTURE_2D or GL_RENDERBUFFER. In case of ambiguity when dealing with
280  /// Window bound frame-buffers, 0 may be used.
281  uint32_t target;
282 
283  /// The name of the framebuffer.
284  uint32_t name;
285 
286  /// User data to be returned on the invocation of the destruction callback.
287  void* user_data;
288 
289  /// Callback invoked (on an engine managed thread) that asks the embedder to
290  /// collect the framebuffer.
293 
294 typedef bool (*BoolCallback)(void* /* user data */);
295 typedef FlutterTransformation (*TransformationCallback)(void* /* user data */);
296 typedef uint32_t (*UIntCallback)(void* /* user data */);
297 typedef bool (*SoftwareSurfacePresentCallback)(void* /* user data */,
298  const void* /* allocation */,
299  size_t /* row bytes */,
300  size_t /* height */);
301 typedef void* (*ProcResolver)(void* /* user data */, const char* /* name */);
302 typedef bool (*TextureFrameCallback)(void* /* user data */,
303  int64_t /* texture identifier */,
304  size_t /* width */,
305  size_t /* height */,
306  FlutterOpenGLTexture* /* texture out */);
307 typedef void (*VsyncCallback)(void* /* user data */, intptr_t /* baton */);
308 
309 /// A structure to represent the width and height.
310 typedef struct {
311  double width;
312  double height;
313 } FlutterSize;
314 
315 /// A structure to represent the width and height.
316 ///
317 /// See: \ref FlutterSize when the value are not integers.
318 typedef struct {
319  uint32_t width;
320  uint32_t height;
322 
323 /// A structure to represent a rectangle.
324 typedef struct {
325  double left;
326  double top;
327  double right;
328  double bottom;
329 } FlutterRect;
330 
331 /// A structure to represent a 2D point.
332 typedef struct {
333  double x;
334  double y;
335 } FlutterPoint;
336 
337 /// A structure to represent a rounded rectangle.
338 typedef struct {
345 
346 /// This information is passed to the embedder when requesting a frame buffer
347 /// object.
348 ///
349 /// See: \ref FlutterOpenGLRendererConfig.fbo_with_frame_info_callback.
350 typedef struct {
351  /// The size of this struct. Must be sizeof(FlutterFrameInfo).
352  size_t struct_size;
353  /// The size of the surface that will be backed by the fbo.
356 
357 /// Callback for when a frame buffer object is requested.
358 typedef uint32_t (*UIntFrameInfoCallback)(
359  void* /* user data */,
360  const FlutterFrameInfo* /* frame info */);
361 
362 /// This information is passed to the embedder when a surface is presented.
363 ///
364 /// See: \ref FlutterOpenGLRendererConfig.present_with_info.
365 typedef struct {
366  /// The size of this struct. Must be sizeof(FlutterFrameInfo).
367  size_t struct_size;
368  /// Id of the fbo backing the surface that was presented.
369  uint32_t fbo_id;
371 
372 /// Callback for when a surface is presented.
373 typedef bool (*BoolPresentInfoCallback)(
374  void* /* user data */,
375  const FlutterPresentInfo* /* present info */);
376 
377 typedef struct {
378  /// The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
379  size_t struct_size;
382  /// Specifying one (and only one) of `present` or `present_with_info` is
383  /// required. Specifying both is an error and engine initialization will be
384  /// terminated. The return value indicates success of the present call.
386  /// Specifying one (and only one) of the `fbo_callback` or
387  /// `fbo_with_frame_info_callback` is required. Specifying both is an error
388  /// and engine intialization will be terminated. The return value indicates
389  /// the id of the frame buffer object that flutter will obtain the gl surface
390  /// from.
392  /// This is an optional callback. Flutter will ask the emebdder to create a GL
393  /// context current on a background thread. If the embedder is able to do so,
394  /// Flutter will assume that this context is in the same sharegroup as the
395  /// main rendering context and use this context for asynchronous texture
396  /// uploads. Though optional, it is recommended that all embedders set this
397  /// callback as it will lead to better performance in texture handling.
399  /// By default, the renderer config assumes that the FBO does not change for
400  /// the duration of the engine run. If this argument is true, the
401  /// engine will ask the embedder for an updated FBO target (via an
402  /// fbo_callback invocation) after a present call.
404  /// The transformation to apply to the render target before any rendering
405  /// operations. This callback is optional.
406  /// @attention When using a custom compositor, the layer offset and sizes
407  /// will be affected by this transformation. It will be
408  /// embedder responsibility to render contents at the
409  /// transformed offset and size. This is useful for embedders
410  /// that want to render transformed contents directly into
411  /// hardware overlay planes without having to apply extra
412  /// transformations to layer contents (which may necessitate
413  /// an expensive off-screen render pass).
416  /// When the embedder specifies that a texture has a frame available, the
417  /// engine will call this method (on an internal engine managed thread) so
418  /// that external texture details can be supplied to the engine for subsequent
419  /// composition.
421  /// Specifying one (and only one) of the `fbo_callback` or
422  /// `fbo_with_frame_info_callback` is required. Specifying both is an error
423  /// and engine intialization will be terminated. The return value indicates
424  /// the id of the frame buffer object (fbo) that flutter will obtain the gl
425  /// surface from. When using this variant, the embedder is passed a
426  /// `FlutterFrameInfo` struct that indicates the properties of the surface
427  /// that flutter will acquire from the returned fbo.
429  /// Specifying one (and only one) of `present` or `present_with_info` is
430  /// required. Specifying both is an error and engine initialization will be
431  /// terminated. When using this variant, the embedder is passed a
432  /// `FlutterPresentInfo` struct that the embedder can use to release any
433  /// resources. The return value indicates success of the present call.
436 
437 typedef struct {
438  /// The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
439  size_t struct_size;
440  /// The callback presented to the embedder to present a fully populated buffer
441  /// to the user. The pixel format of the buffer is the native 32-bit RGBA
442  /// format. The buffer is owned by the Flutter engine and must be copied in
443  /// this callback if needed.
446 
447 typedef struct {
448  FlutterRendererType type;
449  union {
452  };
454 
455 typedef struct {
456  /// The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
457  size_t struct_size;
458  /// Physical width of the window.
459  size_t width;
460  /// Physical height of the window.
461  size_t height;
462  /// Scale factor for the physical screen.
463  double pixel_ratio;
464  /// Horizontal physical location of the left side of the window on the screen.
465  size_t left;
466  /// Vertical physical location of the top of the window on the screen.
467  size_t top;
469 
470 /// The phase of the pointer event.
471 typedef enum {
473  /// The pointer, which must have been down (see kDown), is now up.
474  ///
475  /// For touch, this means that the pointer is no longer in contact with the
476  /// screen. For a mouse, it means the last button was released. Note that if
477  /// any other buttons are still pressed when one button is released, that
478  /// should be sent as a kMove rather than a kUp.
480  /// The pointer, which must have been been up, is now down.
481  ///
482  /// For touch, this means that the pointer has come into contact with the
483  /// screen. For a mouse, it means a button is now pressed. Note that if any
484  /// other buttons are already pressed when a new button is pressed, that
485  /// should be sent as a kMove rather than a kDown.
487  /// The pointer moved while down.
488  ///
489  /// This is also used for changes in button state that don't cause a kDown or
490  /// kUp, such as releasing one of two pressed buttons.
492  /// The pointer is now sending input to Flutter. For instance, a mouse has
493  /// entered the area where the Flutter content is displayed.
494  ///
495  /// A pointer should always be added before sending any other events.
497  /// The pointer is no longer sending input to Flutter. For instance, a mouse
498  /// has left the area where the Flutter content is displayed.
499  ///
500  /// A removed pointer should no longer send events until sending a new kAdd.
502  /// The pointer moved while up.
505 
506 /// The device type that created a pointer event.
507 typedef enum {
511 
512 /// Flags for the `buttons` field of `FlutterPointerEvent` when `device_kind`
513 /// is `kFlutterPointerDeviceKindMouse`.
514 typedef enum {
520  /// If a mouse has more than five buttons, send higher bit shifted values
521  /// corresponding to the button number: 1 << 5 for the 6th, etc.
523 
524 /// The type of a pointer signal.
525 typedef enum {
529 
530 typedef struct {
531  /// The size of this struct. Must be sizeof(FlutterPointerEvent).
532  size_t struct_size;
533  FlutterPointerPhase phase;
534  /// The timestamp at which the pointer event was generated. The timestamp
535  /// should be specified in microseconds and the clock should be the same as
536  /// that used by `FlutterEngineGetCurrentTime`.
537  size_t timestamp;
538  /// The x coordinate of the pointer event in physical pixels.
539  double x;
540  /// The y coordinate of the pointer event in physical pixels.
541  double y;
542  /// An optional device identifier. If this is not specified, it is assumed
543  /// that the embedder has no multi-touch capability.
544  int32_t device;
545  FlutterPointerSignalKind signal_kind;
546  /// The x offset of the scroll in physical pixels.
548  /// The y offset of the scroll in physical pixels.
550  /// The type of the device generating this event.
551  /// Backwards compatibility note: If this is not set, the device will be
552  /// treated as a mouse, with the primary button set for `kDown` and `kMove`.
553  /// If set explicitly to `kFlutterPointerDeviceKindMouse`, you must set the
554  /// correct buttons.
555  FlutterPointerDeviceKind device_kind;
556  /// The buttons currently pressed, if any.
557  int64_t buttons;
559 
563 
564 typedef struct {
565  /// The size of this struct. Must be sizeof(FlutterPlatformMessage).
566  size_t struct_size;
567  const char* channel;
568  const uint8_t* message;
569  size_t message_size;
570  /// The response handle on which to invoke
571  /// `FlutterEngineSendPlatformMessageResponse` when the response is ready.
572  /// `FlutterEngineSendPlatformMessageResponse` must be called for all messages
573  /// received by the embedder. Failure to call
574  /// `FlutterEngineSendPlatformMessageResponse` will cause a memory leak. It is
575  /// not safe to send multiple responses on a single response object.
578 
580  const FlutterPlatformMessage* /* message*/,
581  void* /* user data */);
582 
583 typedef void (*FlutterDataCallback)(const uint8_t* /* data */,
584  size_t /* size */,
585  void* /* user data */);
586 
587 /// The identifier of the platform view. This identifier is specified by the
588 /// application when a platform view is added to the scene via the
589 /// `SceneBuilder.addPlatformView` call.
591 
592 /// `FlutterSemanticsNode` ID used as a sentinel to signal the end of a batch of
593 /// semantics node updates.
595 extern const int32_t kFlutterSemanticsNodeIdBatchEnd;
596 
597 /// A node that represents some semantic data.
598 ///
599 /// The semantics tree is maintained during the semantics phase of the pipeline
600 /// (i.e., during PipelineOwner.flushSemantics), which happens after
601 /// compositing. Updates are then pushed to embedders via the registered
602 /// `FlutterUpdateSemanticsNodeCallback`.
603 typedef struct {
604  /// The size of this struct. Must be sizeof(FlutterSemanticsNode).
605  size_t struct_size;
606  /// The unique identifier for this node.
607  int32_t id;
608  /// The set of semantics flags associated with this node.
610  /// The set of semantics actions applicable to this node.
612  /// The position at which the text selection originates.
614  /// The position at which the text selection terminates.
616  /// The total number of scrollable children that contribute to semantics.
618  /// The index of the first visible semantic child of a scroll node.
619  int32_t scroll_index;
620  /// The current scrolling position in logical pixels if the node is
621  /// scrollable.
623  /// The maximum in-range value for `scrollPosition` if the node is scrollable.
625  /// The minimum in-range value for `scrollPosition` if the node is scrollable.
627  /// The elevation along the z-axis at which the rect of this semantics node is
628  /// located above its parent.
629  double elevation;
630  /// Describes how much space the semantics node takes up along the z-axis.
631  double thickness;
632  /// A textual description of the node.
633  const char* label;
634  /// A brief description of the result of performing an action on the node.
635  const char* hint;
636  /// A textual description of the current value of the node.
637  const char* value;
638  /// A value that `value` will have after a kFlutterSemanticsActionIncrease`
639  /// action has been performed.
640  const char* increased_value;
641  /// A value that `value` will have after a kFlutterSemanticsActionDecrease`
642  /// action has been performed.
643  const char* decreased_value;
644  /// The reading direction for `label`, `value`, `hint`, `increasedValue`, and
645  /// `decreasedValue`.
647  /// The bounding box for this node in its coordinate system.
649  /// The transform from this node's coordinate system to its parent's
650  /// coordinate system.
652  /// The number of children this node has.
653  size_t child_count;
654  /// Array of child node IDs in traversal order. Has length `child_count`.
656  /// Array of child node IDs in hit test order. Has length `child_count`.
658  /// The number of custom accessibility action associated with this node.
660  /// Array of `FlutterSemanticsCustomAction` IDs associated with this node.
661  /// Has length `custom_accessibility_actions_count`.
663  /// Identifier of the platform view associated with this semantics node, or
664  /// -1 if none.
665  FlutterPlatformViewIdentifier platform_view_id;
667 
668 /// `FlutterSemanticsCustomAction` ID used as a sentinel to signal the end of a
669 /// batch of semantics custom action updates.
671 extern const int32_t kFlutterSemanticsCustomActionIdBatchEnd;
672 
673 /// A custom semantics action, or action override.
674 ///
675 /// Custom actions can be registered by applications in order to provide
676 /// semantic actions other than the standard actions available through the
677 /// `FlutterSemanticsAction` enum.
678 ///
679 /// Action overrides are custom actions that the application developer requests
680 /// to be used in place of the standard actions in the `FlutterSemanticsAction`
681 /// enum.
682 typedef struct {
683  /// The size of the struct. Must be sizeof(FlutterSemanticsCustomAction).
684  size_t struct_size;
685  /// The unique custom action or action override ID.
686  int32_t id;
687  /// For overridden standard actions, corresponds to the
688  /// `FlutterSemanticsAction` to override.
690  /// The user-readable name of this custom semantics action.
691  const char* label;
692  /// The hint description of this custom semantics action.
693  const char* hint;
695 
697  const FlutterSemanticsNode* /* semantics node */,
698  void* /* user data */);
699 
701  const FlutterSemanticsCustomAction* /* semantics custom action */,
702  void* /* user data */);
703 
705 
706 typedef struct {
707  FlutterTaskRunner runner;
708  uint64_t task;
709 } FlutterTask;
710 
712  FlutterTask /* task */,
713  uint64_t /* target time nanos */,
714  void* /* user data */);
715 
716 /// An interface used by the Flutter engine to execute tasks at the target time
717 /// on a specified thread. There should be a 1-1 relationship between a thread
718 /// and a task runner. It is undefined behavior to run a task on a thread that
719 /// is not associated with its task runner.
720 typedef struct {
721  /// The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
722  size_t struct_size;
723  void* user_data;
724  /// May be called from any thread. Should return true if tasks posted on the
725  /// calling thread will be run on that same thread.
726  ///
727  /// @attention This field is required.
729  /// May be called from any thread. The given task should be executed by the
730  /// embedder on the thread associated with that task runner by calling
731  /// `FlutterEngineRunTask` at the given target time. The system monotonic
732  /// clock should be used for the target time. The target time is the absolute
733  /// time from epoch (NOT a delta) at which the task must be returned back to
734  /// the engine on the correct thread. If the embedder needs to calculate a
735  /// delta, `FlutterEngineGetCurrentTime` may be called and the difference used
736  /// as the delta.
737  ///
738  /// @attention This field is required.
740  /// A unique identifier for the task runner. If multiple task runners service
741  /// tasks on the same thread, their identifiers must match.
742  size_t identifier;
744 
745 typedef struct {
746  /// The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
747  size_t struct_size;
748  /// Specify the task runner for the thread on which the `FlutterEngineRun`
749  /// call is made. The same task runner description can be specified for both
750  /// the render and platform task runners. This makes the Flutter engine use
751  /// the same thread for both task runners.
753  /// Specify the task runner for the thread on which the render tasks will be
754  /// run. The same task runner description can be specified for both the render
755  /// and platform task runners. This makes the Flutter engine use the same
756  /// thread for both task runners.
759 
760 typedef struct {
761  /// The type of the OpenGL backing store. Currently, it can either be a
762  /// texture or a framebuffer.
763  FlutterOpenGLTargetType type;
764  union {
765  /// A texture for Flutter to render into.
767  /// A framebuffer for Flutter to render into. The embedder must ensure that
768  /// the framebuffer is complete.
770  };
772 
773 typedef struct {
774  /// A pointer to the raw bytes of the allocation described by this software
775  /// backing store.
776  const void* allocation;
777  /// The number of bytes in a single row of the allocation.
778  size_t row_bytes;
779  /// The number of rows in the allocation.
780  size_t height;
781  /// A baton that is not interpreted by the engine in any way. It will be given
782  /// back to the embedder in the destruction callback below. Embedder resources
783  /// may be associated with this baton.
784  void* user_data;
785  /// The callback invoked by the engine when it no longer needs this backing
786  /// store.
789 
790 typedef enum {
791  /// Indicates that the Flutter application requested that an opacity be
792  /// applied to the platform view.
794  /// Indicates that the Flutter application requested that the platform view be
795  /// clipped using a rectangle.
797  /// Indicates that the Flutter application requested that the platform view be
798  /// clipped using a rounded rectangle.
800  /// Indicates that the Flutter application requested that the platform view be
801  /// transformed before composition.
804 
805 typedef struct {
806  /// The type of the mutation described by the subsequent union.
807  FlutterPlatformViewMutationType type;
808  union {
809  double opacity;
813  };
815 
816 typedef struct {
817  /// The size of this struct. Must be sizeof(FlutterPlatformView).
818  size_t struct_size;
819  /// The identifier of this platform view. This identifier is specified by the
820  /// application when a platform view is added to the scene via the
821  /// `SceneBuilder.addPlatformView` call.
822  FlutterPlatformViewIdentifier identifier;
823  /// The number of mutations to be applied to the platform view by the embedder
824  /// before on-screen composition.
826  /// The mutations to be applied by this platform view before it is composited
827  /// on-screen. The Flutter application may transform the platform view but
828  /// these transformations cannot be affected by the Flutter compositor because
829  /// it does not render platform views. Since the embedder is responsible for
830  /// composition of these views, it is also the embedder's responsibility to
831  /// affect the appropriate transformation.
832  ///
833  /// The mutations must be applied in order. The mutations done in the
834  /// collection don't take into account the device pixel ratio or the root
835  /// surface transformation. If these exist, the first mutation in the list
836  /// will be a transformation mutation to make sure subsequent mutations are in
837  /// the correct coordinate space.
840 
841 typedef enum {
842  /// Specifies an OpenGL backing store. Can either be an OpenGL texture or
843  /// framebuffer.
845  /// Specified an software allocation for Flutter to render into using the CPU.
848 
849 typedef struct {
850  /// The size of this struct. Must be sizeof(FlutterBackingStore).
851  size_t struct_size;
852  /// A baton that is not interpreted by the engine in any way. The embedder may
853  /// use this to associate resources that are tied to the lifecycle of the
854  /// `FlutterBackingStore`.
855  void* user_data;
856  /// Specifies the type of backing store.
857  FlutterBackingStoreType type;
858  /// Indicates if this backing store was updated since the last time it was
859  /// associated with a presented layer.
861  union {
862  /// The description of the OpenGL backing store.
864  /// The description of the software backing store.
866  };
868 
869 typedef struct {
870  /// The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
871  size_t struct_size;
872  /// The size of the render target the engine expects to render into.
875 
876 typedef enum {
877  /// Indicates that the contents of this layer are rendered by Flutter into a
878  /// backing store.
880  /// Indicates that the contents of this layer are determined by the embedder.
883 
884 typedef struct {
885  /// This size of this struct. Must be sizeof(FlutterLayer).
886  size_t struct_size;
887  /// Each layer displays contents in one way or another. The type indicates
888  /// whether those contents are specified by Flutter or the embedder.
889  FlutterLayerContentType type;
890  union {
891  /// Indicates that the contents of this layer are rendered by Flutter into a
892  /// backing store.
894  /// Indicates that the contents of this layer are determined by the
895  /// embedder.
897  };
898  /// The offset of this layer (in physical pixels) relative to the top left of
899  /// the root surface used by the engine.
901  /// The size of the layer (in physical pixels).
903 } FlutterLayer;
904 
906  const FlutterBackingStoreConfig* config,
907  FlutterBackingStore* backing_store_out,
908  void* user_data);
909 
911  const FlutterBackingStore* renderer,
912  void* user_data);
913 
914 typedef bool (*FlutterLayersPresentCallback)(const FlutterLayer** layers,
915  size_t layers_count,
916  void* user_data);
917 
918 typedef struct {
919  /// This size of this struct. Must be sizeof(FlutterCompositor).
920  size_t struct_size;
921  /// A baton that in not interpreted by the engine in any way. If it passed
922  /// back to the embedder in `FlutterCompositor.create_backing_store_callback`,
923  /// `FlutterCompositor.collect_backing_store_callback` and
924  /// `FlutterCompositor.present_layers_callback`
925  void* user_data;
926  /// A callback invoked by the engine to obtain a backing store for a specific
927  /// `FlutterLayer`.
928  ///
929  /// On ABI stability: Callers must take care to restrict access within
930  /// `FlutterBackingStore::struct_size` when specifying a new backing store to
931  /// the engine. This only matters if the embedder expects to be used with
932  /// engines older than the version whose headers it used during compilation.
934  /// A callback invoked by the engine to release the backing store. The
935  /// embedder may collect any resources associated with the backing store.
937  /// Callback invoked by the engine to composite the contents of each layer
938  /// onto the screen.
941 
942 typedef struct {
943  /// This size of this struct. Must be sizeof(FlutterLocale).
944  size_t struct_size;
945  /// The language code of the locale. For example, "en". This is a required
946  /// field. The string must be null terminated. It may be collected after the
947  /// call to `FlutterEngineUpdateLocales`.
948  const char* language_code;
949  /// The country code of the locale. For example, "US". This is a an optional
950  /// field. The string must be null terminated if present. It may be collected
951  /// after the call to `FlutterEngineUpdateLocales`. If not present, a
952  /// `nullptr` may be specified.
953  const char* country_code;
954  /// The script code of the locale. This is a an optional field. The string
955  /// must be null terminated if present. It may be collected after the call to
956  /// `FlutterEngineUpdateLocales`. If not present, a `nullptr` may be
957  /// specified.
958  const char* script_code;
959  /// The variant code of the locale. This is a an optional field. The string
960  /// must be null terminated if present. It may be collected after the call to
961  /// `FlutterEngineUpdateLocales`. If not present, a `nullptr` may be
962  /// specified.
963  const char* variant_code;
964 } FlutterLocale;
965 
966 typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)(
967  const FlutterLocale** /* supported_locales*/,
968  size_t /* Number of locales*/);
969 
970 /// Display refers to a graphics hardware system consisting of a framebuffer,
971 /// typically a monitor or a screen. This ID is unique per display and is
972 /// stable until the Flutter application restarts.
973 typedef uint64_t FlutterEngineDisplayId;
974 
975 typedef struct {
976  /// This size of this struct. Must be sizeof(FlutterDisplay).
977  size_t struct_size;
978 
979  FlutterEngineDisplayId display_id;
980 
981  /// This is set to true if the embedder only has one display. In cases where
982  /// this is set to true, the value of display_id is ignored. In cases where
983  /// this is not set to true, it is expected that a valid display_id be
984  /// provided.
986 
987  /// This represents the refresh period in frames per second. This value may be
988  /// zero if the device is not running or unavaliable or unknown.
989  double refresh_rate;
991 
992 /// The update type parameter that is passed to
993 /// `FlutterEngineNotifyDisplayUpdate`.
994 typedef enum {
995  /// `FlutterEngineDisplay`s that were active during start-up. A display is
996  /// considered active if:
997  /// 1. The frame buffer hardware is connected.
998  /// 2. The display is drawable, e.g. it isn't being mirrored from another
999  /// connected display or sleeping.
1003 
1004 typedef int64_t FlutterEngineDartPort;
1005 
1006 typedef enum {
1013  /// The object will be made available to Dart code as an instance of
1014  /// Uint8List.
1017 
1018 typedef struct {
1019  /// The size of this struct. Must be sizeof(FlutterEngineDartBuffer).
1020  size_t struct_size;
1021  /// An opaque baton passed back to the embedder when the
1022  /// buffer_collect_callback is invoked. The engine does not interpret this
1023  /// field in any way.
1024  void* user_data;
1025  /// This is an optional field.
1026  ///
1027  /// When specified, the engine will assume that the buffer is owned by the
1028  /// embedder. When the data is no longer needed by any isolate, this callback
1029  /// will be made on an internal engine managed thread. The embedder is free to
1030  /// collect the buffer here. When this field is specified, it is the embedders
1031  /// responsibility to keep the buffer alive and not modify it till this
1032  /// callback is invoked by the engine. The user data specified in the callback
1033  /// is the value of `user_data` field in this struct.
1034  ///
1035  /// When NOT specified, the VM creates an internal copy of the buffer. The
1036  /// caller is free to modify the buffer as necessary or collect it immediately
1037  /// after the call to `FlutterEnginePostDartObject`.
1038  ///
1039  /// @attention The buffer_collect_callback is will only be invoked by the
1040  /// engine when the `FlutterEnginePostDartObject` method
1041  /// returns kSuccess. In case of non-successful calls to this
1042  /// method, it is the embedders responsibility to collect the
1043  /// buffer.
1045  /// A pointer to the bytes of the buffer. When the buffer is owned by the
1046  /// embedder (by specifying the `buffer_collect_callback`), Dart code may
1047  /// modify that embedder owned buffer. For this reason, it is important that
1048  /// this buffer not have page protections that restrict writing to this
1049  /// buffer.
1050  uint8_t* buffer;
1051  /// The size of the buffer.
1052  size_t buffer_size;
1054 
1055 /// This struct specifies the native representation of a Dart object that can be
1056 /// sent via a send port to any isolate in the VM that has the corresponding
1057 /// receive port.
1058 ///
1059 /// All fields in this struct are copied out in the call to
1060 /// `FlutterEnginePostDartObject` and the caller is free to reuse or collect
1061 /// this struct after that call.
1062 typedef struct {
1063  FlutterEngineDartObjectType type;
1064  union {
1066  int32_t int32_value;
1067  int64_t int64_value;
1069  /// A null terminated string. This string will be copied by the VM in the
1070  /// call to `FlutterEnginePostDartObject` and must be collected by the
1071  /// embedder after that call is made.
1072  const char* string_value;
1074  };
1076 
1077 /// This enum allows embedders to determine the type of the engine thread in the
1078 /// FlutterNativeThreadCallback. Based on the thread type, the embedder may be
1079 /// able to tweak the thread priorities for optimum performance.
1080 typedef enum {
1081  /// The Flutter Engine considers the thread on which the FlutterEngineRun call
1082  /// is made to be the platform thread. There is only one such thread per
1083  /// engine instance.
1085  /// This is the thread the Flutter Engine uses to execute rendering commands
1086  /// based on the selected client rendering API. There is only one such thread
1087  /// per engine instance.
1089  /// This is a dedicated thread on which the root Dart isolate is serviced.
1090  /// There is only one such thread per engine instance.
1092  /// Multiple threads are used by the Flutter engine to perform long running
1093  /// background tasks.
1096 
1097 /// A callback made by the engine in response to
1098 /// `FlutterEnginePostCallbackOnAllNativeThreads` on all internal thread.
1099 typedef void (*FlutterNativeThreadCallback)(FlutterNativeThreadType type,
1100  void* user_data);
1101 
1102 /// AOT data source type.
1103 typedef enum {
1106 
1107 /// This struct specifies one of the various locations the engine can look for
1108 /// AOT data sources.
1109 typedef struct {
1110  FlutterEngineAOTDataSourceType type;
1111  union {
1112  /// Absolute path to an ELF library file.
1113  const char* elf_path;
1114  };
1116 
1117 /// An opaque object that describes the AOT data that can be used to launch a
1118 /// FlutterEngine instance in AOT mode.
1120 
1121 typedef struct {
1122  /// The size of this struct. Must be sizeof(FlutterProjectArgs).
1123  size_t struct_size;
1124  /// The path to the Flutter assets directory containing project assets. The
1125  /// string can be collected after the call to `FlutterEngineRun` returns. The
1126  /// string must be NULL terminated.
1127  const char* assets_path;
1128  /// The path to the Dart file containing the `main` entry point.
1129  /// The string can be collected after the call to `FlutterEngineRun` returns.
1130  /// The string must be NULL terminated.
1131  ///
1132  /// @deprecated As of Dart 2, running from Dart source is no longer
1133  /// supported. Dart code should now be compiled to kernel form
1134  /// and will be loaded by from `kernel_blob.bin` in the assets
1135  /// directory. This struct member is retained for ABI
1136  /// stability.
1137  const char* main_path__unused__;
1138  /// The path to the `.packages` file for the project. The string can be
1139  /// collected after the call to `FlutterEngineRun` returns. The string must be
1140  /// NULL terminated.
1141  ///
1142  /// @deprecated As of Dart 2, running from Dart source is no longer
1143  /// supported. Dart code should now be compiled to kernel form
1144  /// and will be loaded by from `kernel_blob.bin` in the assets
1145  /// directory. This struct member is retained for ABI
1146  /// stability.
1148  /// The path to the `icudtl.dat` file for the project. The string can be
1149  /// collected after the call to `FlutterEngineRun` returns. The string must
1150  /// be NULL terminated.
1151  const char* icu_data_path;
1152  /// The command line argument count used to initialize the project.
1154  /// The command line arguments used to initialize the project. The strings can
1155  /// be collected after the call to `FlutterEngineRun` returns. The strings
1156  /// must be `NULL` terminated.
1157  ///
1158  /// @attention The first item in the command line (if specified at all) is
1159  /// interpreted as the executable name. So if an engine flag
1160  /// needs to be passed into the same, it needs to not be the
1161  /// very first item in the list.
1162  ///
1163  /// The set of engine flags are only meant to control
1164  /// unstable features in the engine. Deployed applications should not pass any
1165  /// command line arguments at all as they may affect engine stability at
1166  /// runtime in the presence of un-sanitized input. The list of currently
1167  /// recognized engine flags and their descriptions can be retrieved from the
1168  /// `switches.h` engine source file.
1169  const char* const* command_line_argv;
1170  /// The callback invoked by the engine in order to give the embedder the
1171  /// chance to respond to platform messages from the Dart application. The
1172  /// callback will be invoked on the thread on which the `FlutterEngineRun`
1173  /// call is made.
1175  /// The VM snapshot data buffer used in AOT operation. This buffer must be
1176  /// mapped in as read-only. For more information refer to the documentation on
1177  /// the Wiki at
1178  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1179  const uint8_t* vm_snapshot_data;
1180  /// The size of the VM snapshot data buffer. If vm_snapshot_data is a symbol
1181  /// reference, 0 may be passed here.
1183  /// The VM snapshot instructions buffer used in AOT operation. This buffer
1184  /// must be mapped in as read-execute. For more information refer to the
1185  /// documentation on the Wiki at
1186  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1188  /// The size of the VM snapshot instructions buffer. If
1189  /// vm_snapshot_instructions is a symbol reference, 0 may be passed here.
1191  /// The isolate snapshot data buffer used in AOT operation. This buffer must
1192  /// be mapped in as read-only. For more information refer to the documentation
1193  /// on the Wiki at
1194  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1195  const uint8_t* isolate_snapshot_data;
1196  /// The size of the isolate snapshot data buffer. If isolate_snapshot_data is
1197  /// a symbol reference, 0 may be passed here.
1199  /// The isolate snapshot instructions buffer used in AOT operation. This
1200  /// buffer must be mapped in as read-execute. For more information refer to
1201  /// the documentation on the Wiki at
1202  /// https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode
1204  /// The size of the isolate snapshot instructions buffer. If
1205  /// isolate_snapshot_instructions is a symbol reference, 0 may be passed here.
1207  /// The callback invoked by the engine in root isolate scope. Called
1208  /// immediately after the root isolate has been created and marked runnable.
1210  /// The callback invoked by the engine in order to give the embedder the
1211  /// chance to respond to semantics node updates from the Dart application.
1212  /// Semantics node updates are sent in batches terminated by a 'batch end'
1213  /// callback that is passed a sentinel `FlutterSemanticsNode` whose `id` field
1214  /// has the value `kFlutterSemanticsNodeIdBatchEnd`.
1215  ///
1216  /// The callback will be invoked on the thread on which the `FlutterEngineRun`
1217  /// call is made.
1219  /// The callback invoked by the engine in order to give the embedder the
1220  /// chance to respond to updates to semantics custom actions from the Dart
1221  /// application. Custom action updates are sent in batches terminated by a
1222  /// 'batch end' callback that is passed a sentinel
1223  /// `FlutterSemanticsCustomAction` whose `id` field has the value
1224  /// `kFlutterSemanticsCustomActionIdBatchEnd`.
1225  ///
1226  /// The callback will be invoked on the thread on which the `FlutterEngineRun`
1227  /// call is made.
1230  /// Path to a directory used to store data that is cached across runs of a
1231  /// Flutter application (such as compiled shader programs used by Skia).
1232  /// This is optional. The string must be NULL terminated.
1233  ///
1234  // This is different from the cache-path-dir argument defined in switches.h,
1235  // which is used in `flutter::Settings` as `temp_directory_path`.
1237 
1238  /// If true, the engine would only read the existing cache, but not write new
1239  /// ones.
1241 
1242  /// A callback that gets invoked by the engine when it attempts to wait for a
1243  /// platform vsync event. The engine will give the platform a baton that needs
1244  /// to be returned back to the engine via `FlutterEngineOnVsync`. All batons
1245  /// must be retured to the engine before initializing a
1246  /// `FlutterEngineShutdown`. Not doing the same will result in a memory leak.
1247  /// While the call to `FlutterEngineOnVsync` must occur on the thread that
1248  /// made the call to `FlutterEngineRun`, the engine will make this callback on
1249  /// an internal engine-managed thread. If the components accessed on the
1250  /// embedder are not thread safe, the appropriate re-threading must be done.
1252 
1253  /// The name of a custom Dart entrypoint. This is optional and specifying a
1254  /// null or empty entrypoint makes the engine look for a method named "main"
1255  /// in the root library of the application.
1256  ///
1257  /// Care must be taken to ensure that the custom entrypoint is not tree-shaken
1258  /// away. Usually, this is done using the `@pragma('vm:entry-point')`
1259  /// decoration.
1261 
1262  /// Typically the Flutter engine create and manages its internal threads. This
1263  /// optional argument allows for the specification of task runner interfaces
1264  /// to event loops managed by the embedder on threads it creates.
1266 
1267  /// All `FlutterEngine` instances in the process share the same Dart VM. When
1268  /// the first engine is launched, it starts the Dart VM as well. It used to be
1269  /// the case that it was not possible to shutdown the Dart VM cleanly and
1270  /// start it back up in the process in a safe manner. This issue has since
1271  /// been patched. Unfortunately, applications already began to make use of the
1272  /// fact that shutting down the Flutter engine instance left a running VM in
1273  /// the process. Since a Flutter engine could be launched on any thread,
1274  /// applications would "warm up" the VM on another thread by launching
1275  /// an engine with no isolates and then shutting it down immediately. The main
1276  /// Flutter application could then be started on the main thread without
1277  /// having to incur the Dart VM startup costs at that time. With the new
1278  /// behavior, this "optimization" immediately becomes massive performance
1279  /// pessimization as the VM would be started up in the "warm up" phase, shut
1280  /// down there and then started again on the main thread. Changing this
1281  /// behavior was deemed to be an unacceptable breaking change. Embedders that
1282  /// wish to shutdown the Dart VM when the last engine is terminated in the
1283  /// process should opt into this behavior by setting this flag to true.
1285 
1286  /// Typically, Flutter renders the layer hierarchy into a single root surface.
1287  /// However, when embedders need to interleave their own contents within the
1288  /// Flutter layer hierarchy, their applications can push platform views within
1289  /// the Flutter scene. This is done using the `SceneBuilder.addPlatformView`
1290  /// call. When this happens, the Flutter rasterizer divides the effective view
1291  /// hierarchy into multiple layers. Each layer gets its own backing store and
1292  /// Flutter renders into the same. Once the layers contents have been
1293  /// fulfilled, the embedder is asked to composite these layers on-screen. At
1294  /// this point, it can interleave its own contents within the effective
1295  /// hierarchy. The interface for the specification of these layer backing
1296  /// stores and the hooks to listen for the composition of layers on-screen can
1297  /// be controlled using this field. This field is completely optional. In its
1298  /// absence, platforms views in the scene are ignored and Flutter renders to
1299  /// the root surface as normal.
1301 
1302  /// Max size of the old gen heap for the Dart VM in MB, or 0 for unlimited, -1
1303  /// for default value.
1304  ///
1305  /// See also:
1306  /// https://github.com/dart-lang/sdk/blob/ca64509108b3e7219c50d6c52877c85ab6a35ff2/runtime/vm/flag_list.h#L150
1308 
1309  /// The AOT data to be used in AOT operation.
1310  ///
1311  /// Embedders should instantiate and destroy this object via the
1312  /// FlutterEngineCreateAOTData and FlutterEngineCollectAOTData methods.
1313  ///
1314  /// Embedders can provide either snapshot buffers or aot_data, but not both.
1315  FlutterEngineAOTData aot_data;
1316 
1317  /// A callback that computes the locale the platform would natively resolve
1318  /// to.
1319  ///
1320  /// The input parameter is an array of FlutterLocales which represent the
1321  /// locales supported by the app. One of the input supported locales should
1322  /// be selected and returned to best match with the user/device's preferred
1323  /// locale. The implementation should produce a result that as closely
1324  /// matches what the platform would natively resolve to as possible.
1327 
1328  /// The command line argument count for arguments passed through to the Dart
1329  /// entrypoint.
1331 
1332  /// The command line arguments passed through to the Dart entrypoint. The
1333  /// strings must be `NULL` terminated.
1334  ///
1335  /// The strings will be copied out and so any strings passed in here can
1336  /// be safely collected after initializing the engine with
1337  /// `FlutterProjectArgs`.
1338  const char* const* dart_entrypoint_argv;
1339 
1341 
1342 #ifndef FLUTTER_ENGINE_NO_PROTOTYPES
1343 
1344 //------------------------------------------------------------------------------
1345 /// @brief Creates the necessary data structures to launch a Flutter Dart
1346 /// application in AOT mode. The data may only be collected after
1347 /// all FlutterEngine instances launched using this data have been
1348 /// terminated.
1349 ///
1350 /// @param[in] source The source of the AOT data.
1351 /// @param[out] data_out The AOT data on success. Unchanged on failure.
1352 ///
1353 /// @return Returns if the AOT data could be successfully resolved.
1354 ///
1356 FlutterEngineResult FlutterEngineCreateAOTData(
1357  const FlutterEngineAOTDataSource* source,
1358  FlutterEngineAOTData* data_out);
1359 
1360 //------------------------------------------------------------------------------
1361 /// @brief Collects the AOT data.
1362 ///
1363 /// @warning The embedder must ensure that this call is made only after all
1364 /// FlutterEngine instances launched using this data have been
1365 /// terminated, and that all of those instances were launched with
1366 /// the FlutterProjectArgs::shutdown_dart_vm_when_done flag set to
1367 /// true.
1368 ///
1369 /// @param[in] data The data to collect.
1370 ///
1371 /// @return Returns if the AOT data was successfully collected.
1372 ///
1374 FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data);
1375 
1376 //------------------------------------------------------------------------------
1377 /// @brief Initialize and run a Flutter engine instance and return a handle
1378 /// to it. This is a convenience method for the pair of calls to
1379 /// `FlutterEngineInitialize` and `FlutterEngineRunInitialized`.
1380 ///
1381 /// @note This method of running a Flutter engine works well except in
1382 /// cases where the embedder specifies custom task runners via
1383 /// `FlutterProjectArgs::custom_task_runners`. In such cases, the
1384 /// engine may need the embedder to post tasks back to it before
1385 /// `FlutterEngineRun` has returned. Embedders can only post tasks
1386 /// to the engine if they have a handle to the engine. In such
1387 /// cases, embedders are advised to get the engine handle via the
1388 /// `FlutterInitializeCall`. Then they can call
1389 /// `FlutterEngineRunInitialized` knowing that they will be able to
1390 /// service custom tasks on other threads with the engine handle.
1391 ///
1392 /// @param[in] version The Flutter embedder API version. Must be
1393 /// FLUTTER_ENGINE_VERSION.
1394 /// @param[in] config The renderer configuration.
1395 /// @param[in] args The Flutter project arguments.
1396 /// @param user_data A user data baton passed back to embedders in
1397 /// callbacks.
1398 /// @param[out] engine_out The engine handle on successful engine creation.
1399 ///
1400 /// @return The result of the call to run the Flutter engine.
1401 ///
1403 FlutterEngineResult FlutterEngineRun(size_t version,
1404  const FlutterRendererConfig* config,
1405  const FlutterProjectArgs* args,
1406  void* user_data,
1408  engine_out);
1409 
1410 //------------------------------------------------------------------------------
1411 /// @brief Shuts down a Flutter engine instance. The engine handle is no
1412 /// longer valid for any calls in the embedder API after this point.
1413 /// Making additional calls with this handle is undefined behavior.
1414 ///
1415 /// @note This de-initializes the Flutter engine instance (via an implicit
1416 /// call to `FlutterEngineDeinitialize`) if necessary.
1417 ///
1418 /// @param[in] engine The Flutter engine instance to collect.
1419 ///
1420 /// @return The result of the call to shutdown the Flutter engine instance.
1421 ///
1424  engine);
1425 
1426 //------------------------------------------------------------------------------
1427 /// @brief Initialize a Flutter engine instance. This does not run the
1428 /// Flutter application code till the `FlutterEngineRunInitialized`
1429 /// call is made. Besides Flutter application code, no tasks are
1430 /// scheduled on embedder managed task runners either. This allows
1431 /// embedders providing custom task runners to the Flutter engine to
1432 /// obtain a handle to the Flutter engine before the engine can post
1433 /// tasks on these task runners.
1434 ///
1435 /// @param[in] version The Flutter embedder API version. Must be
1436 /// FLUTTER_ENGINE_VERSION.
1437 /// @param[in] config The renderer configuration.
1438 /// @param[in] args The Flutter project arguments.
1439 /// @param user_data A user data baton passed back to embedders in
1440 /// callbacks.
1441 /// @param[out] engine_out The engine handle on successful engine creation.
1442 ///
1443 /// @return The result of the call to initialize the Flutter engine.
1444 ///
1446 FlutterEngineResult FlutterEngineInitialize(size_t version,
1447  const FlutterRendererConfig* config,
1448  const FlutterProjectArgs* args,
1449  void* user_data,
1451  engine_out);
1452 
1453 //------------------------------------------------------------------------------
1454 /// @brief Stops running the Flutter engine instance. After this call, the
1455 /// embedder is also guaranteed that no more calls to post tasks
1456 /// onto custom task runners specified by the embedder are made. The
1457 /// Flutter engine handle still needs to be collected via a call to
1458 /// `FlutterEngineShutdown`.
1459 ///
1460 /// @param[in] engine The running engine instance to de-initialize.
1461 ///
1462 /// @return The result of the call to de-initialize the Flutter engine.
1463 ///
1466  engine);
1467 
1468 //------------------------------------------------------------------------------
1469 /// @brief Runs an initialized engine instance. An engine can be
1470 /// initialized via `FlutterEngineInitialize`. An initialized
1471 /// instance can only be run once. During and after this call,
1472 /// custom task runners supplied by the embedder are expected to
1473 /// start servicing tasks.
1474 ///
1475 /// @param[in] engine An initialized engine instance that has not previously
1476 /// been run.
1477 ///
1478 /// @return The result of the call to run the initialized Flutter
1479 /// engine instance.
1480 ///
1482 FlutterEngineResult FlutterEngineRunInitialized(
1484 
1486 FlutterEngineResult FlutterEngineSendWindowMetricsEvent(
1489 
1491 FlutterEngineResult FlutterEngineSendPointerEvent(
1493  const FlutterPointerEvent* events,
1494  size_t events_count);
1495 
1497 FlutterEngineResult FlutterEngineSendPlatformMessage(
1499  const FlutterPlatformMessage* message);
1500 
1501 //------------------------------------------------------------------------------
1502 /// @brief Creates a platform message response handle that allows the
1503 /// embedder to set a native callback for a response to a message.
1504 /// This handle may be set on the `response_handle` field of any
1505 /// `FlutterPlatformMessage` sent to the engine.
1506 ///
1507 /// The handle must be collected via a call to
1508 /// `FlutterPlatformMessageReleaseResponseHandle`. This may be done
1509 /// immediately after a call to `FlutterEngineSendPlatformMessage`
1510 /// with a platform message whose response handle contains the handle
1511 /// created using this call. In case a handle is created but never
1512 /// sent in a message, the release call must still be made. Not
1513 /// calling release on the handle results in a small memory leak.
1514 ///
1515 /// The user data baton passed to the data callback is the one
1516 /// specified in this call as the third argument.
1517 ///
1518 /// @see FlutterPlatformMessageReleaseResponseHandle()
1519 ///
1520 /// @param[in] engine A running engine instance.
1521 /// @param[in] data_callback The callback invoked by the engine when the
1522 /// Flutter application send a response on the
1523 /// handle.
1524 /// @param[in] user_data The user data associated with the data callback.
1525 /// @param[out] response_out The response handle created when this call is
1526 /// successful.
1527 ///
1528 /// @return The result of the call.
1529 ///
1531 FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(
1533  FlutterDataCallback data_callback,
1534  void* user_data,
1535  FlutterPlatformMessageResponseHandle** response_out);
1536 
1537 //------------------------------------------------------------------------------
1538 /// @brief Collects the handle created using
1539 /// `FlutterPlatformMessageCreateResponseHandle`.
1540 ///
1541 /// @see FlutterPlatformMessageCreateResponseHandle()
1542 ///
1543 /// @param[in] engine A running engine instance.
1544 /// @param[in] response The platform message response handle to collect.
1545 /// These handles are created using
1546 /// `FlutterPlatformMessageCreateResponseHandle()`.
1547 ///
1548 /// @return The result of the call.
1549 ///
1554 
1555 //------------------------------------------------------------------------------
1556 /// @brief Send a response from the native side to a platform message from
1557 /// the Dart Flutter application.
1558 ///
1559 /// @param[in] engine The running engine instance.
1560 /// @param[in] handle The platform message response handle.
1561 /// @param[in] data The data to associate with the platform message
1562 /// response.
1563 /// @param[in] data_length The length of the platform message response data.
1564 ///
1565 /// @return The result of the call.
1566 ///
1568 FlutterEngineResult FlutterEngineSendPlatformMessageResponse(
1571  const uint8_t* data,
1572  size_t data_length);
1573 
1574 //------------------------------------------------------------------------------
1575 /// @brief This API is only meant to be used by platforms that need to
1576 /// flush tasks on a message loop not controlled by the Flutter
1577 /// engine.
1578 ///
1579 /// @deprecated This API will be deprecated and is not part of the stable API.
1580 /// Please use the custom task runners API by setting an
1581 /// appropriate `FlutterProjectArgs::custom_task_runners`
1582 /// interface. This will yield better performance and the
1583 /// interface is stable.
1584 ///
1585 /// @return The result of the call.
1586 ///
1588 FlutterEngineResult __FlutterEngineFlushPendingTasksNow();
1589 
1590 //------------------------------------------------------------------------------
1591 /// @brief Register an external texture with a unique (per engine)
1592 /// identifier. Only rendering backends that support external
1593 /// textures accept external texture registrations. After the
1594 /// external texture is registered, the application can mark that a
1595 /// frame is available by calling
1596 /// `FlutterEngineMarkExternalTextureFrameAvailable`.
1597 ///
1598 /// @see FlutterEngineUnregisterExternalTexture()
1599 /// @see FlutterEngineMarkExternalTextureFrameAvailable()
1600 ///
1601 /// @param[in] engine A running engine instance.
1602 /// @param[in] texture_identifier The identifier of the texture to register
1603 /// with the engine. The embedder may supply new
1604 /// frames to this texture using the same
1605 /// identifier.
1606 ///
1607 /// @return The result of the call.
1608 ///
1610 FlutterEngineResult FlutterEngineRegisterExternalTexture(
1612  int64_t texture_identifier);
1613 
1614 //------------------------------------------------------------------------------
1615 /// @brief Unregister a previous texture registration.
1616 ///
1617 /// @see FlutterEngineRegisterExternalTexture()
1618 /// @see FlutterEngineMarkExternalTextureFrameAvailable()
1619 ///
1620 /// @param[in] engine A running engine instance.
1621 /// @param[in] texture_identifier The identifier of the texture for which new
1622 /// frame will not be available.
1623 ///
1624 /// @return The result of the call.
1625 ///
1627 FlutterEngineResult FlutterEngineUnregisterExternalTexture(
1629  int64_t texture_identifier);
1630 
1631 //------------------------------------------------------------------------------
1632 /// @brief Mark that a new texture frame is available for a given texture
1633 /// identifier.
1634 ///
1635 /// @see FlutterEngineRegisterExternalTexture()
1636 /// @see FlutterEngineUnregisterExternalTexture()
1637 ///
1638 /// @param[in] engine A running engine instance.
1639 /// @param[in] texture_identifier The identifier of the texture whose frame
1640 /// has been updated.
1641 ///
1642 /// @return The result of the call.
1643 ///
1647  int64_t texture_identifier);
1648 
1649 //------------------------------------------------------------------------------
1650 /// @brief Enable or disable accessibility semantics.
1651 ///
1652 /// @param[in] engine A running engine instance.
1653 /// @param[in] enabled When enabled, changes to the semantic contents of the
1654 /// window are sent via the
1655 /// `FlutterUpdateSemanticsNodeCallback` registered to
1656 /// `update_semantics_node_callback` in
1657 /// `FlutterProjectArgs`.
1658 ///
1659 /// @return The result of the call.
1660 ///
1662 FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(
1664  bool enabled);
1665 
1666 //------------------------------------------------------------------------------
1667 /// @brief Sets additional accessibility features.
1668 ///
1669 /// @param[in] engine A running engine instance
1670 /// @param[in] features The accessibility features to set.
1671 ///
1672 /// @return The result of the call.
1673 ///
1675 FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(
1677  FlutterAccessibilityFeature features);
1678 
1679 //------------------------------------------------------------------------------
1680 /// @brief Dispatch a semantics action to the specified semantics node.
1681 ///
1682 /// @param[in] engine A running engine instance.
1683 /// @param[in] identifier The semantics action identifier.
1684 /// @param[in] action The semantics action.
1685 /// @param[in] data Data associated with the action.
1686 /// @param[in] data_length The data length.
1687 ///
1688 /// @return The result of the call.
1689 ///
1691 FlutterEngineResult FlutterEngineDispatchSemanticsAction(
1693  uint64_t id,
1695  const uint8_t* data,
1696  size_t data_length);
1697 
1698 //------------------------------------------------------------------------------
1699 /// @brief Notify the engine that a vsync event occurred. A baton passed to
1700 /// the platform via the vsync callback must be returned. This call
1701 /// must be made on the thread on which the call to
1702 /// `FlutterEngineRun` was made.
1703 ///
1704 /// @see FlutterEngineGetCurrentTime()
1705 ///
1706 /// @attention That frame timepoints are in nanoseconds.
1707 ///
1708 /// @attention The system monotonic clock is used as the timebase.
1709 ///
1710 /// @param[in] engine. A running engine instance.
1711 /// @param[in] baton The baton supplied by the engine.
1712 /// @param[in] frame_start_time_nanos The point at which the vsync event
1713 /// occurred or will occur. If the time
1714 /// point is in the future, the engine will
1715 /// wait till that point to begin its frame
1716 /// workload.
1717 /// @param[in] frame_target_time_nanos The point at which the embedder
1718 /// anticipates the next vsync to occur.
1719 /// This is a hint the engine uses to
1720 /// schedule Dart VM garbage collection in
1721 /// periods in which the various threads
1722 /// are most likely to be idle. For
1723 /// example, for a 60Hz display, embedders
1724 /// should add 16.6 * 1e6 to the frame time
1725 /// field.
1726 ///
1727 /// @return The result of the call.
1728 ///
1731  engine,
1732  intptr_t baton,
1733  uint64_t frame_start_time_nanos,
1734  uint64_t frame_target_time_nanos);
1735 
1736 //------------------------------------------------------------------------------
1737 /// @brief Reloads the system fonts in engine.
1738 ///
1739 /// @param[in] engine. A running engine instance.
1740 ///
1741 /// @return The result of the call.
1742 ///
1744 FlutterEngineResult FlutterEngineReloadSystemFonts(
1746 
1747 //------------------------------------------------------------------------------
1748 /// @brief A profiling utility. Logs a trace duration begin event to the
1749 /// timeline. If the timeline is unavailable or disabled, this has
1750 /// no effect. Must be balanced with an duration end event (via
1751 /// `FlutterEngineTraceEventDurationEnd`) with the same name on the
1752 /// same thread. Can be called on any thread. Strings passed into
1753 /// the function will NOT be copied when added to the timeline. Only
1754 /// string literals may be passed in.
1755 ///
1756 /// @param[in] name The name of the trace event.
1757 ///
1759 void FlutterEngineTraceEventDurationBegin(const char* name);
1760 
1761 //-----------------------------------------------------------------------------
1762 /// @brief A profiling utility. Logs a trace duration end event to the
1763 /// timeline. If the timeline is unavailable or disabled, this has
1764 /// no effect. This call must be preceded by a trace duration begin
1765 /// call (via `FlutterEngineTraceEventDurationBegin`) with the same
1766 /// name on the same thread. Can be called on any thread. Strings
1767 /// passed into the function will NOT be copied when added to the
1768 /// timeline. Only string literals may be passed in.
1769 ///
1770 /// @param[in] name The name of the trace event.
1771 ///
1773 void FlutterEngineTraceEventDurationEnd(const char* name);
1774 
1775 //-----------------------------------------------------------------------------
1776 /// @brief A profiling utility. Logs a trace duration instant event to the
1777 /// timeline. If the timeline is unavailable or disabled, this has
1778 /// no effect. Can be called on any thread. Strings passed into the
1779 /// function will NOT be copied when added to the timeline. Only
1780 /// string literals may be passed in.
1781 ///
1782 /// @param[in] name The name of the trace event.
1783 ///
1785 void FlutterEngineTraceEventInstant(const char* name);
1786 
1787 //------------------------------------------------------------------------------
1788 /// @brief Posts a task onto the Flutter render thread. Typically, this may
1789 /// be called from any thread as long as a `FlutterEngineShutdown`
1790 /// on the specific engine has not already been initiated.
1791 ///
1792 /// @param[in] engine A running engine instance.
1793 /// @param[in] callback The callback to execute on the render thread.
1794 /// @param callback_data The callback context.
1795 ///
1796 /// @return The result of the call.
1797 ///
1799 FlutterEngineResult FlutterEnginePostRenderThreadTask(
1801  VoidCallback callback,
1802  void* callback_data);
1803 
1804 //------------------------------------------------------------------------------
1805 /// @brief Get the current time in nanoseconds from the clock used by the
1806 /// flutter engine. This is the system monotonic clock.
1807 ///
1808 /// @return The current time in nanoseconds.
1809 ///
1811 uint64_t FlutterEngineGetCurrentTime();
1812 
1813 //------------------------------------------------------------------------------
1814 /// @brief Inform the engine to run the specified task. This task has been
1815 /// given to the engine via the
1816 /// `FlutterTaskRunnerDescription.post_task_callback`. This call
1817 /// must only be made at the target time specified in that callback.
1818 /// Running the task before that time is undefined behavior.
1819 ///
1820 /// @param[in] engine A running engine instance.
1821 /// @param[in] task the task handle.
1822 ///
1823 /// @return The result of the call.
1824 ///
1827  engine,
1828  const FlutterTask* task);
1829 
1830 //------------------------------------------------------------------------------
1831 /// @brief Notify a running engine instance that the locale has been
1832 /// updated. The preferred locale must be the first item in the list
1833 /// of locales supplied. The other entries will be used as a
1834 /// fallback.
1835 ///
1836 /// @param[in] engine A running engine instance.
1837 /// @param[in] locales The updated locales in the order of preference.
1838 /// @param[in] locales_count The count of locales supplied.
1839 ///
1840 /// @return Whether the locale updates were applied.
1841 ///
1844  engine,
1845  const FlutterLocale** locales,
1846  size_t locales_count);
1847 
1848 //------------------------------------------------------------------------------
1849 /// @brief Returns if the Flutter engine instance will run AOT compiled
1850 /// Dart code. This call has no threading restrictions.
1851 ///
1852 /// For embedder code that is configured for both AOT and JIT mode
1853 /// Dart execution based on the Flutter engine being linked to, this
1854 /// runtime check may be used to appropriately configure the
1855 /// `FlutterProjectArgs`. In JIT mode execution, the kernel
1856 /// snapshots must be present in the Flutter assets directory
1857 /// specified in the `FlutterProjectArgs`. For AOT execution, the
1858 /// fields `vm_snapshot_data`, `vm_snapshot_instructions`,
1859 /// `isolate_snapshot_data` and `isolate_snapshot_instructions`
1860 /// (along with their size fields) must be specified in
1861 /// `FlutterProjectArgs`.
1862 ///
1863 /// @return True, if AOT Dart code is run. JIT otherwise.
1864 ///
1867 
1868 //------------------------------------------------------------------------------
1869 /// @brief Posts a Dart object to specified send port. The corresponding
1870 /// receive port for send port can be in any isolate running in the
1871 /// VM. This isolate can also be the root isolate for an
1872 /// unrelated engine. The engine parameter is necessary only to
1873 /// ensure the call is not made when no engine (and hence no VM) is
1874 /// running.
1875 ///
1876 /// Unlike the platform messages mechanism, there are no threading
1877 /// restrictions when using this API. Message can be posted on any
1878 /// thread and they will be made available to isolate on which the
1879 /// corresponding send port is listening.
1880 ///
1881 /// However, it is the embedders responsibility to ensure that the
1882 /// call is not made during an ongoing call the
1883 /// `FlutterEngineDeinitialize` or `FlutterEngineShutdown` on
1884 /// another thread.
1885 ///
1886 /// @param[in] engine A running engine instance.
1887 /// @param[in] port The send port to send the object to.
1888 /// @param[in] object The object to send to the isolate with the
1889 /// corresponding receive port.
1890 ///
1891 /// @return If the message was posted to the send port.
1892 ///
1894 FlutterEngineResult FlutterEnginePostDartObject(
1896  FlutterEngineDartPort port,
1897  const FlutterEngineDartObject* object);
1898 
1899 //------------------------------------------------------------------------------
1900 /// @brief Posts a low memory notification to a running engine instance.
1901 /// The engine will do its best to release non-critical resources in
1902 /// response. It is not guaranteed that the resource would have been
1903 /// collected by the time this call returns however. The
1904 /// notification is posted to engine subsystems that may be
1905 /// operating on other threads.
1906 ///
1907 /// Flutter applications can respond to these notifications by
1908 /// setting `WidgetsBindingObserver.didHaveMemoryPressure`
1909 /// observers.
1910 ///
1911 /// @param[in] engine A running engine instance.
1912 ///
1913 /// @return If the low memory notification was sent to the running engine
1914 /// instance.
1915 ///
1917 FlutterEngineResult FlutterEngineNotifyLowMemoryWarning(
1919 
1920 //------------------------------------------------------------------------------
1921 /// @brief Schedule a callback to be run on all engine managed threads.
1922 /// The engine will attempt to service this callback the next time
1923 /// the message loop for each managed thread is idle. Since the
1924 /// engine manages the entire lifecycle of multiple threads, there
1925 /// is no opportunity for the embedders to finely tune the
1926 /// priorities of threads directly, or, perform other thread
1927 /// specific configuration (for example, setting thread names for
1928 /// tracing). This callback gives embedders a chance to affect such
1929 /// tuning.
1930 ///
1931 /// @attention This call is expensive and must be made as few times as
1932 /// possible. The callback must also return immediately as not doing
1933 /// so may risk performance issues (especially for callbacks of type
1934 /// kFlutterNativeThreadTypeUI and kFlutterNativeThreadTypeRender).
1935 ///
1936 /// @attention Some callbacks (especially the ones of type
1937 /// kFlutterNativeThreadTypeWorker) may be called after the
1938 /// FlutterEngine instance has shut down. Embedders must be careful
1939 /// in handling the lifecycle of objects associated with the user
1940 /// data baton.
1941 ///
1942 /// @attention In case there are multiple running Flutter engine instances,
1943 /// their workers are shared.
1944 ///
1945 /// @param[in] engine A running engine instance.
1946 /// @param[in] callback The callback that will get called multiple times on
1947 /// each engine managed thread.
1948 /// @param[in] user_data A baton passed by the engine to the callback. This
1949 /// baton is not interpreted by the engine in any way.
1950 ///
1951 /// @return Returns if the callback was successfully posted to all threads.
1952 ///
1956  FlutterNativeThreadCallback callback,
1957  void* user_data);
1958 
1959 //------------------------------------------------------------------------------
1960 /// @brief Posts updates corresponding to display changes to a running engine
1961 /// instance.
1962 ///
1963 /// @param[in] update_type The type of update pushed to the engine.
1964 /// @param[in] displays The displays affected by this update.
1965 /// @param[in] display_count Size of the displays array, must be at least 1.
1966 ///
1967 /// @return the result of the call made to the engine.
1968 ///
1970 FlutterEngineResult FlutterEngineNotifyDisplayUpdate(
1972  FlutterEngineDisplaysUpdateType update_type,
1973  const FlutterEngineDisplay* displays,
1974  size_t display_count);
1975 
1976 #endif // !FLUTTER_ENGINE_NO_PROTOTYPES
1977 
1978 // Typedefs for the function pointers in FlutterEngineProcTable.
1980  const FlutterEngineAOTDataSource* source,
1981  FlutterEngineAOTData* data_out);
1983  FlutterEngineAOTData data);
1985  size_t version,
1986  const FlutterRendererConfig* config,
1987  const FlutterProjectArgs* args,
1988  void* user_data,
1989  FLUTTER_API_SYMBOL(FlutterEngine) * engine_out);
1993  size_t version,
1994  const FlutterRendererConfig* config,
1995  const FlutterProjectArgs* args,
1996  void* user_data,
1997  FLUTTER_API_SYMBOL(FlutterEngine) * engine_out);
2007  const FlutterPointerEvent* events,
2008  size_t events_count);
2011  const FlutterPlatformMessage* message);
2012 typedef FlutterEngineResult (
2015  FlutterDataCallback data_callback,
2016  void* user_data,
2017  FlutterPlatformMessageResponseHandle** response_out);
2018 typedef FlutterEngineResult (
2025  const uint8_t* data,
2026  size_t data_length);
2029  int64_t texture_identifier);
2032  int64_t texture_identifier);
2033 typedef FlutterEngineResult (
2036  int64_t texture_identifier);
2039  bool enabled);
2042  FlutterAccessibilityFeature features);
2045  uint64_t id,
2047  const uint8_t* data,
2048  size_t data_length);
2051  intptr_t baton,
2052  uint64_t frame_start_time_nanos,
2053  uint64_t frame_target_time_nanos);
2057 typedef void (*FlutterEngineTraceEventDurationEndFnPtr)(const char* name);
2058 typedef void (*FlutterEngineTraceEventInstantFnPtr)(const char* name);
2061  VoidCallback callback,
2062  void* callback_data);
2063 typedef uint64_t (*FlutterEngineGetCurrentTimeFnPtr)();
2066  const FlutterTask* task);
2069  const FlutterLocale** locales,
2070  size_t locales_count);
2074  FlutterEngineDartPort port,
2075  const FlutterEngineDartObject* object);
2080  FlutterNativeThreadCallback callback,
2081  void* user_data);
2084  FlutterEngineDisplaysUpdateType update_type,
2085  const FlutterEngineDisplay* displays,
2086  size_t display_count);
2087 
2088 /// Function-pointer-based versions of the APIs above.
2089 typedef struct {
2090  /// The size of this struct. Must be sizeof(FlutterEngineProcs).
2091  size_t struct_size;
2092 
2131 
2132 //------------------------------------------------------------------------------
2133 /// @brief Gets the table of engine function pointers.
2134 ///
2135 /// @param[out] table The table to fill with pointers. This should be
2136 /// zero-initialized, except for struct_size.
2137 ///
2138 /// @return Returns whether the table was successfully populated.
2139 ///
2141 FlutterEngineResult FlutterEngineGetProcAddresses(
2142  FlutterEngineProcTable* table);
2143 
2144 #if defined(__cplusplus)
2145 } // extern "C"
2146 #endif
2147 
2148 #endif // FLUTTER_EMBEDDER_H_
FlutterPointerMouseButtons
Definition: embedder.h:514
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:1713
double skewY
vertical skew factor
Definition: embedder.h:230
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition: embedder.h:944
uint32_t fbo_id
Id of the fbo backing the surface that was presented.
Definition: embedder.h:369
FlutterAccessibilityFeature
Definition: embedder.h:79
G_BEGIN_DECLS FlValue * args
FlutterEngineResult(* FlutterEnginePostRenderThreadTaskFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *callback_data)
Definition: embedder.h:2059
const FlutterCompositor * compositor
Definition: embedder.h:1300
struct _FlutterTaskRunner * FlutterTaskRunner
Definition: embedder.h:704
FlutterSoftwareRendererConfig software
Definition: embedder.h:451
TransformationCallback surface_transformation
Definition: embedder.h:414
FlutterPlatformViewMutationType
Definition: embedder.h:790
Definition: embedder.h:479
int32_t text_selection_extent
The position at which the text selection terminates.
Definition: embedder.h:615
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:1524
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:846
double pixel_ratio
Scale factor for the physical screen.
Definition: embedder.h:463
bool(* BoolCallback)(void *)
Definition: embedder.h:294
const char * channel
Definition: embedder.h:567
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double scroll_delta_y
The y offset of the scroll in physical pixels.
Definition: embedder.h:549
FlutterEngineResult(* FlutterEngineSendWindowMetricsEventFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
Definition: embedder.h:2002
A structure to represent a 2D point.
Definition: embedder.h:332
Request that text be rendered at a bold font weight.
Definition: embedder.h:88
FlutterSize upper_left_corner_radius
Definition: embedder.h:340
int32_t scroll_index
The index of the first visible semantic child of a scroll node.
Definition: embedder.h:619
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:1761
FlutterEngineRunsAOTCompiledDartCodeFnPtr RunsAOTCompiledDartCode
Definition: embedder.h:2124
const char * persistent_cache_path
Definition: embedder.h:1236
const uint8_t * isolate_snapshot_data
Definition: embedder.h:1195
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:1973
FlutterEnginePostDartObjectFnPtr PostDartObject
Definition: embedder.h:2125
FlutterSize upper_right_corner_radius
Definition: embedder.h:341
A request to fully show the semantics node on screen.
Definition: embedder.h:122
double pers2
perspective scale factor
Definition: embedder.h:240
size_t top
Vertical physical location of the top of the window on the screen.
Definition: embedder.h:467
FlutterEngineUpdateSemanticsEnabledFnPtr UpdateSemanticsEnabled
Definition: embedder.h:2112
FlutterComputePlatformResolvedLocaleCallback compute_platform_resolved_locale_callback
Definition: embedder.h:1326
Whether the semantics node is considered hidden.
Definition: embedder.h:183
Text is read from left to right.
Definition: embedder.h:217
uint32_t width
Definition: embedder.h:319
FlutterEngineGetCurrentTimeFnPtr GetCurrentTime
Definition: embedder.h:2121
double y
Definition: embedder.h:334
Whether a semantics node is selected.
Definition: embedder.h:159
FlutterEngineResult(* FlutterEngineRunFnPtr)(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Definition: embedder.h:1984
const FlutterTaskRunnerDescription * render_task_runner
Definition: embedder.h:757
FlutterEngineResult(* FlutterEngineInitializeFnPtr)(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Definition: embedder.h:1992
FlutterEngineRegisterExternalTextureFnPtr RegisterExternalTexture
Definition: embedder.h:2108
int64_t FlutterEngineDartPort
Definition: embedder.h:1004
int32_t id
The unique custom action or action override ID.
Definition: embedder.h:686
FlutterEngineUpdateAccessibilityFeaturesFnPtr UpdateAccessibilityFeatures
Definition: embedder.h:2113
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *event)
Definition: embedder.cc:1229
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:769
void * user_data
Definition: mock_engine.cc:17
const char * icu_data_path
Definition: embedder.h:1151
FlutterEngineRunTaskFnPtr RunTask
Definition: embedder.h:2122
bool(* SoftwareSurfacePresentCallback)(void *, const void *, size_t, size_t)
Definition: embedder.h:297
FlutterEngineAOTDataSourceType
AOT data source type.
Definition: embedder.h:1103
double y
The y coordinate of the pointer event in physical pixels.
Definition: embedder.h:541
FlutterEngineCollectAOTDataFnPtr CollectAOTData
Definition: embedder.h:2094
const FlutterBackingStore * backing_store
Definition: embedder.h:893
FLUTTER_EXPORT FlutterEngineResult FlutterEngineReloadSystemFonts(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Reloads the system fonts in engine.
Definition: embedder.cc:1662
FLUTTER_EXPORT FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
Definition: embedder.cc:1483
const FlutterPlatformMessageResponseHandle * response_handle
Definition: embedder.h:576
size_t struct_size
The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
Definition: embedder.h:722
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:2012
const FlutterCustomTaskRunners * custom_task_runners
Definition: embedder.h:1265
FlutterEngineDisplaysUpdateType
Definition: embedder.h:994
size_t vm_snapshot_instructions_size
Definition: embedder.h:1190
FlutterPlatformViewIdentifier platform_view_id
Definition: embedder.h:665
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:822
Text is read from right to left.
Definition: embedder.h:215
FlutterPointerPhase
The phase of the pointer event.
Definition: embedder.h:471
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:1825
FlutterRect rect
The bounding box for this node in its coordinate system.
Definition: embedder.h:648
FlutterTaskRunner runner
Definition: embedder.h:707
Indicate that the user has invoked a custom accessibility action.
Definition: embedder.h:140
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:902
Function-pointer-based versions of the APIs above.
Definition: embedder.h:2089
Whether the semantics node label is the name of a visually distinct route.
Definition: embedder.h:181
FlutterEngineResult(* FlutterEngineUpdateLocalesFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Definition: embedder.h:2067
double scroll_position
Definition: embedder.h:622
FlutterTransformation transformation
Definition: embedder.h:812
FlutterTextDirection text_direction
Definition: embedder.h:646
Whether the semantics node represents an image.
Definition: embedder.h:185
double pers0
input x-axis perspective factor
Definition: embedder.h:236
FlutterEngineResult(* FlutterEngineMarkExternalTextureFrameAvailableFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2034
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:1679
double scroll_delta_x
The x offset of the scroll in physical pixels.
Definition: embedder.h:547
bool(* TextureFrameCallback)(void *, int64_t, size_t, size_t, FlutterOpenGLTexture *)
Definition: embedder.h:302
FlutterEngineDeinitializeFnPtr Deinitialize
Definition: embedder.h:2098
FlutterEngineResult(* FlutterEngineNotifyDisplayUpdateFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *displays, size_t display_count)
Definition: embedder.h:2082
void * user_data
Definition: embedder.h:925
Move the cursor backward by one character.
Definition: embedder.h:126
FlutterEngineSendPlatformMessageFnPtr SendPlatformMessage
Definition: embedder.h:2102
BoolPresentInfoCallback present_with_info
Definition: embedder.h:434
const char * variant_code
Definition: embedder.h:963
Cut the current selection and place it in the clipboard.
Definition: embedder.h:132
FlutterEngineResult(* FlutterEngineSendPointerEventFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
Definition: embedder.h:2005
double right
Definition: embedder.h:327
size_t struct_size
The size of the struct. Must be sizeof(FlutterSemanticsCustomAction).
Definition: embedder.h:684
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory port
Definition: switches.h:75
FlutterEngineSendPlatformMessageResponseFnPtr SendPlatformMessageResponse
Definition: embedder.h:2107
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:1497
Whether the semantic node can hold the user&#39;s focus.
Definition: embedder.h:206
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:1206
#define FLUTTER_EXPORT
Definition: embedder.h:50
FlutterLayerContentType
Definition: embedder.h:876
void(* FlutterUpdateSemanticsNodeCallback)(const FlutterSemanticsNode *, void *)
Definition: embedder.h:696
FlutterEngineUnregisterExternalTextureFnPtr UnregisterExternalTexture
Definition: embedder.h:2109
size_t custom_accessibility_actions_count
The number of custom accessibility action associated with this node.
Definition: embedder.h:659
FlutterPointerDeviceKind
The device type that created a pointer event.
Definition: embedder.h:507
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Enable or disable accessibility semantics.
Definition: embedder.cc:1587
UIntFrameInfoCallback fbo_with_frame_info_callback
Definition: embedder.h:428
FlutterPoint offset
Definition: embedder.h:900
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:1717
bool(* FlutterBackingStoreCreateCallback)(const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)
Definition: embedder.h:905
size_t struct_size
This size of this struct. Must be sizeof(FlutterDisplay).
Definition: embedder.h:977
FLUTTER_EXPORT FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
Definition: embedder.cc:651
FlutterPlatformMessageCallback platform_message_callback
Definition: embedder.h:1174
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:1615
FlutterSize lower_right_corner_radius
Definition: embedder.h:342
double top
Definition: embedder.h:326
Whether a semantic node is in a mutually exclusive group.
Definition: embedder.h:172
A structure to represent a rectangle.
Definition: embedder.h:324
bool is_persistent_cache_read_only
Definition: embedder.h:1240
FlutterEnginePostRenderThreadTaskFnPtr PostRenderThreadTask
Definition: embedder.h:2120
uint64_t task
Definition: embedder.h:708
Move the cursor forward by one word.
Definition: embedder.h:144
Indicate the platform is inverting the colors of the application.
Definition: embedder.h:84
void(* FlutterUpdateSemanticsCustomActionCallback)(const FlutterSemanticsCustomAction *, void *)
Definition: embedder.h:700
int32_t scroll_child_count
The total number of scrollable children that contribute to semantics.
Definition: embedder.h:617
Set the text selection to the given range.
Definition: embedder.h:128
FLUTTER_EXPORT const int32_t kFlutterSemanticsCustomActionIdBatchEnd
Definition: embedder.cc:65
FlutterEngineUpdateLocalesFnPtr UpdateLocales
Definition: embedder.h:2123
FlutterEngineRunInitializedFnPtr RunInitialized
Definition: embedder.h:2099
const char *const * command_line_argv
Definition: embedder.h:1169
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
Sets additional accessibility features.
Definition: embedder.cc:1601
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:2049
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:734
FlutterEngineResult(* FlutterEngineRunTaskFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
Definition: embedder.h:2064
Copy the current selection to the clipboard.
Definition: embedder.h:130
FlutterEngineRunFnPtr Run
Definition: embedder.h:2095
FlutterSemanticsAction
Definition: embedder.h:97
FlutterEngineResult(* FlutterEngineRegisterExternalTextureFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2027
size_t struct_size
The size of this struct. Must be sizeof(FlutterEngineProcs).
Definition: embedder.h:2091
FlutterEngineTraceEventDurationBeginFnPtr TraceEventDurationBegin
Definition: embedder.h:2117
const FlutterLocale *(* FlutterComputePlatformResolvedLocaleCallback)(const FlutterLocale **, size_t)
Definition: embedder.h:966
Whether a semantic node is a header that divides content into sections.
Definition: embedder.h:174
const char * script_code
Definition: embedder.h:958
const char * country_code
Definition: embedder.h:953
uint32_t height
Definition: embedder.h:320
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *events, size_t events_count)
Definition: embedder.cc:1323
void(* FlutterTaskRunnerPostTaskCallback)(FlutterTask, uint64_t, void *)
Definition: embedder.h:711
bool shutdown_dart_vm_when_done
Definition: embedder.h:1284
const char *const * dart_entrypoint_argv
Definition: embedder.h:1338
VsyncCallback vsync_callback
Definition: embedder.h:1251
double scaleY
vertical scale factor
Definition: embedder.h:232
FlutterUIntSize size
The size of the surface that will be backed by the fbo.
Definition: embedder.h:354
FlutterEnginePlatformMessageCreateResponseHandleFnPtr PlatformMessageCreateResponseHandle
Definition: embedder.h:2104
const char * string_value
Definition: embedder.h:1072
void(* FlutterEngineTraceEventDurationBeginFnPtr)(const char *name)
Definition: embedder.h:2056
Whether the semantic node represents a button.
Definition: embedder.h:161
const char * hint
The hint description of this custom semantics action.
Definition: embedder.h:693
Decrease the value represented by the semantics node.
Definition: embedder.h:120
double left
Definition: embedder.h:325
VoidCallback destruction_callback
Definition: embedder.h:787
size_t struct_size
The size of this struct. Must be sizeof(FlutterSemanticsNode).
Definition: embedder.h:605
FlutterEngineResult(* FlutterEnginePostCallbackOnAllNativeThreadsFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
Definition: embedder.h:2078
FlutterOpenGLTargetType type
Definition: embedder.h:763
FlutterEngineResult(* FlutterEngineCreateAOTDataFnPtr)(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Definition: embedder.h:1979
FlutterEngineTraceEventInstantFnPtr TraceEventInstant
Definition: embedder.h:2119
size_t struct_size
The size of this struct. Must be sizeof(FlutterEngineDartBuffer).
Definition: embedder.h:1020
The semantics node has the quality of either being "on" or "off".
Definition: embedder.h:189
void(* FlutterPlatformMessageCallback)(const FlutterPlatformMessage *, void *)
Definition: embedder.h:579
VoidCallback destruction_callback
Definition: embedder.h:291
const int32_t * custom_accessibility_actions
Definition: embedder.h:662
FlutterSemanticsFlag flags
The set of semantics flags associated with this node.
Definition: embedder.h:609
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:881
Request that animations be disabled or simplified.
Definition: embedder.h:86
size_t struct_size
The size of this struct. Must be sizeof(FlutterFrameInfo).
Definition: embedder.h:352
FLUTTER_EXPORT FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
Definition: embedder.cc:1396
FlutterEngineResult(* FlutterEngineUpdateAccessibilityFeaturesFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature features)
Definition: embedder.h:2040
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:865
FlutterRendererType type
Definition: embedder.h:448
const char * increased_value
Definition: embedder.h:640
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:1683
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:1448
double transX
horizontal translation
Definition: embedder.h:228
FlutterEngineDisplayId display_id
Definition: embedder.h:979
FlutterEngineResult(* FlutterEngineReloadSystemFontsFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2054
double x
Definition: embedder.h:333
VoidCallback destruction_callback
Definition: embedder.h:266
FlutterEngineCreateAOTDataFnPtr CreateAOTData
Definition: embedder.h:2093
double thickness
Describes how much space the semantics node takes up along the z-axis.
Definition: embedder.h:631
uint32_t(* UIntFrameInfoCallback)(void *, const FlutterFrameInfo *)
Callback for when a frame buffer object is requested.
Definition: embedder.h:358
uint64_t FlutterEngineDisplayId
Definition: embedder.h:973
const uint8_t * message
Definition: embedder.h:568
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:778
const int32_t * children_in_hit_test_order
Array of child node IDs in hit test order. Has length child_count.
Definition: embedder.h:657
Indicate that the node has lost accessibility focus.
Definition: embedder.h:138
const char * main_path__unused__
Definition: embedder.h:1137
FlutterUpdateSemanticsNodeCallback update_semantics_node_callback
Definition: embedder.h:1218
void(* FlutterNativeThreadCallback)(FlutterNativeThreadType type, void *user_data)
Definition: embedder.h:1099
size_t height
Physical height of the window.
Definition: embedder.h:461
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
Definition: embedder.h:532
FlutterEngineNotifyDisplayUpdateFnPtr NotifyDisplayUpdate
Definition: embedder.h:2129
FlutterEngineResult(* FlutterEngineNotifyLowMemoryWarningFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2076
const int32_t * children_in_traversal_order
Array of child node IDs in traversal order. Has length child_count.
Definition: embedder.h:655
FlutterEnginePlatformMessageReleaseResponseHandleFnPtr PlatformMessageReleaseResponseHandle
Definition: embedder.h:2106
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:1529
bool(* BoolPresentInfoCallback)(void *, const FlutterPresentInfo *)
Callback for when a surface is presented.
Definition: embedder.h:373
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
Definition: embedder.h:379
FlutterEngineReloadSystemFontsFnPtr ReloadSystemFonts
Definition: embedder.h:2116
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:863
size_t width
Physical width of the window.
Definition: embedder.h:459
struct _FlutterEngineAOTData * FlutterEngineAOTData
Definition: embedder.h:1119
const FlutterPlatformView * platform_view
Definition: embedder.h:896
FlutterRendererType
Definition: embedder.h:72
FlutterLayerContentType type
Definition: embedder.h:889
SemanticsAction action
The pointer moved while up.
Definition: embedder.h:503
int32_t id
The unique identifier for this node.
Definition: embedder.h:607
size_t mutations_count
Definition: embedder.h:825
FlutterEngineResult(* FlutterEnginePlatformMessageReleaseResponseHandleFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Definition: embedder.h:2019
Whether the semantic node currently holds the user&#39;s focus.
Definition: embedder.h:165
Whether the semantic node represents a text field.
Definition: embedder.h:163
FlutterUpdateSemanticsCustomActionCallback update_semantics_custom_action_callback
Definition: embedder.h:1229
FlutterTransformation transform
Definition: embedder.h:651
Whether the semantics node represents a link.
Definition: embedder.h:208
BoolCallback make_resource_current
Definition: embedder.h:398
const uint8_t * vm_snapshot_data
Definition: embedder.h:1179
double scroll_extent_min
The minimum in-range value for scrollPosition if the node is scrollable.
Definition: embedder.h:626
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:1950
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:1635
BoolCallback clear_current
Definition: embedder.h:381
void *(* ProcResolver)(void *, const char *)
Definition: embedder.h:301
TextureFrameCallback gl_external_texture_frame_callback
Definition: embedder.h:420
VoidCallback buffer_collect_callback
Definition: embedder.h:1044
int64_t dart_old_gen_heap_size
Definition: embedder.h:1307
const char * hint
A brief description of the result of performing an action on the node.
Definition: embedder.h:635
double width
Definition: embedder.h:311
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:1687
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:851
bool(* FlutterBackingStoreCollectCallback)(const FlutterBackingStore *renderer, void *user_data)
Definition: embedder.h:910
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:1691
const uint8_t * vm_snapshot_instructions
Definition: embedder.h:1187
A structure to represent the width and height.
Definition: embedder.h:310
double bottom
Definition: embedder.h:328
Move the cursor backward by one word.
Definition: embedder.h:146
size_t struct_size
The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
Definition: embedder.h:457
FlutterTransformation(* TransformationCallback)(void *)
Definition: embedder.h:295
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:1569
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:718
Definition: embedder.h:496
double x
The x coordinate of the pointer event in physical pixels.
Definition: embedder.h:539
void(* VsyncCallback)(void *, intptr_t)
Definition: embedder.h:307
FlutterEngineSendWindowMetricsEventFnPtr SendWindowMetricsEvent
Definition: embedder.h:2100
GdkEventButton * event
Definition: fl_view.cc:62
size_t height
The number of rows in the allocation.
Definition: embedder.h:780
FlutterEngineMarkExternalTextureFrameAvailableFnPtr MarkExternalTextureFrameAvailable
Definition: embedder.h:2111
const char * custom_dart_entrypoint
Definition: embedder.h:1260
FlutterBackingStoreCollectCallback collect_backing_store_callback
Definition: embedder.h:936
FlutterEngineOnVsyncFnPtr OnVsync
Definition: embedder.h:2115
const char * assets_path
Definition: embedder.h:1127
Whether a semantics node is checked.
Definition: embedder.h:157
Whether the value of the semantics node is obscured.
Definition: embedder.h:176
BoolCallback make_current
Definition: embedder.h:380
FlutterPointerSignalKind
The type of a pointer signal.
Definition: embedder.h:525
const char * label
The user-readable name of this custom semantics action.
Definition: embedder.h:691
const char * packages_path__unused__
Definition: embedder.h:1147
uint32_t(* UIntCallback)(void *)
Definition: embedder.h:296
FlutterOpenGLRendererConfig open_gl
Definition: embedder.h:450
FlutterEngineResult(* FlutterEngineCollectAOTDataFnPtr)(FlutterEngineAOTData data)
Definition: embedder.h:1982
FlutterEngineResult(* FlutterEngineSendPlatformMessageFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *message)
Definition: embedder.h:2009
FlutterEngineShutdownFnPtr Shutdown
Definition: embedder.h:2096
size_t isolate_snapshot_instructions_size
Definition: embedder.h:1206
FlutterSemanticsAction override_action
Definition: embedder.h:689
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:857
FlutterEngineResult
Definition: embedder.h:65
size_t struct_size
The size of this struct. Must be sizeof(FlutterProjectArgs).
Definition: embedder.h:1123
size_t child_count
The number of children this node has.
Definition: embedder.h:653
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:838
FlutterEnginePostCallbackOnAllNativeThreadsFnPtr PostCallbackOnAllNativeThreads
Definition: embedder.h:2128
size_t struct_size
The size of this struct. Must be sizeof(FlutterFrameInfo).
Definition: embedder.h:367
size_t height
Height of the texture.
Definition: embedder.h:274
FlutterEngineDispatchSemanticsActionFnPtr DispatchSemanticsAction
Definition: embedder.h:2114
const char * value
A textual description of the current value of the node.
Definition: embedder.h:637
int32_t text_selection_base
The position at which the text selection originates.
Definition: embedder.h:613
FlutterLayersPresentCallback present_layers_callback
Definition: embedder.h:939
const char * name
Definition: fuchsia.cc:50
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:811
FlutterEngineResult(* FlutterEngineUpdateSemanticsEnabledFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Definition: embedder.h:2037
int64_t buttons
The buttons currently pressed, if any.
Definition: embedder.h:557
UIntCallback fbo_callback
Definition: embedder.h:391
const char * label
A textual description of the node.
Definition: embedder.h:633
FlutterEngineNotifyLowMemoryWarningFnPtr NotifyLowMemoryWarning
Definition: embedder.h:2126
const FlutterTaskRunnerDescription * platform_task_runner
Definition: embedder.h:752
double transY
vertical translation
Definition: embedder.h:234
Indicate that the node has gained accessibility focus.
Definition: embedder.h:136
Whether a semantic node that hasEnabledState is currently enabled.
Definition: embedder.h:170
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
Definition: embedder.h:871
FlutterSemanticsAction actions
The set of semantics actions applicable to this node.
Definition: embedder.h:611
FlutterEngineResult(* FlutterEngineUnregisterExternalTextureFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Definition: embedder.h:2030
double height
Definition: embedder.h:312
FlutterSemanticsFlag
Definition: embedder.h:152
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition: embedder.h:739
void(* VoidCallback)(void *)
Definition: embedder.h:243
double scroll_extent_max
The maximum in-range value for scrollPosition if the node is scrollable.
Definition: embedder.h:624
Paste the current content of the clipboard.
Definition: embedder.h:134
size_t struct_size
This size of this struct. Must be sizeof(FlutterCompositor).
Definition: embedder.h:920
FlutterNativeThreadType
Definition: embedder.h:1080
FlutterEngineResult(* FlutterEnginePostDartObjectFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
Definition: embedder.h:2072
FlutterEngineAOTDataSourceType type
Definition: embedder.h:1110
Move the cursor forward by one character.
Definition: embedder.h:124
Request that certain animations be simplified and parallax effects.
Definition: embedder.h:91
FlutterPointerSignalKind signal_kind
Definition: embedder.h:545
size_t isolate_snapshot_data_size
Definition: embedder.h:1198
FlutterEngineResult(* FlutterEngineRunInitializedFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:2000
int32_t id
FlutterBackingStoreType
Definition: embedder.h:841
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:1821
bool(* FlutterEngineRunsAOTCompiledDartCodeFnPtr)(void)
Definition: embedder.h:2071
FLUTTER_EXPORT FlutterEngineResult FlutterEngineUnregisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Unregister a previous texture registration.
Definition: embedder.cc:1548
const FlutterEngineDartBuffer * buffer_value
Definition: embedder.h:1073
uint32_t name
The name of the texture.
Definition: embedder.h:259
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807
FlutterEngineAOTData aot_data
Definition: embedder.h:1315
FlutterEngineTraceEventDurationEndFnPtr TraceEventDurationEnd
Definition: embedder.h:2118
size_t buffer_size
The size of the buffer.
Definition: embedder.h:1052
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:818
FLUTTER_EXPORT const int32_t kFlutterSemanticsNodeIdBatchEnd
Definition: embedder.cc:64
FlutterSize size
The size of the render target the engine expects to render into.
Definition: embedder.h:873
FlutterTextDirection
Definition: embedder.h:211
const uint8_t * isolate_snapshot_instructions
Definition: embedder.h:1203
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:287
FlutterEngineResult(* FlutterEngineDispatchSemanticsActionFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Definition: embedder.h:2043
void(* FlutterEngineTraceEventInstantFnPtr)(const char *name)
Definition: embedder.h:2058
FlutterPointerDeviceKind device_kind
Definition: embedder.h:555
FlutterEngineResult(* FlutterEnginePlatformMessageCreateResponseHandleFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Definition: embedder.h:2013
ProcResolver gl_proc_resolver
Definition: embedder.h:415
A structure to represent a rounded rectangle.
Definition: embedder.h:338
Text has unknown text direction.
Definition: embedder.h:213
A request that the node should be dismissed.
Definition: embedder.h:142
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
Definition: embedder.h:747
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:263
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformMessage).
Definition: embedder.h:566
FlutterEngineResult(* FlutterEngineSendPlatformMessageResponseFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Definition: embedder.h:2022
void(* FlutterDataCallback)(const uint8_t *, size_t, void *)
Definition: embedder.h:583
const char * language_code
Definition: embedder.h:948
bool(* FlutterLayersPresentCallback)(const FlutterLayer **layers, size_t layers_count, void *user_data)
Definition: embedder.h:914
FlutterSize lower_left_corner_radius
Definition: embedder.h:343
double scaleX
horizontal scale factor
Definition: embedder.h:224
FlutterPointerPhase phase
Definition: embedder.h:533
VoidCallback root_isolate_create_callback
Definition: embedder.h:1209
FlutterEngineSendPointerEventFnPtr SendPointerEvent
Definition: embedder.h:2101
FlutterEngineInitializeFnPtr Initialize
Definition: embedder.h:2097
const char * decreased_value
Definition: embedder.h:643
Increase the value represented by the semantics node.
Definition: embedder.h:118
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:597
size_t vm_snapshot_data_size
Definition: embedder.h:1182
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:261
BoolCallback runs_task_on_current_thread_callback
Definition: embedder.h:728
int command_line_argc
The command line argument count used to initialize the project.
Definition: embedder.h:1153
const char * elf_path
Absolute path to an ELF library file.
Definition: embedder.h:1113
size_t struct_size
The size of this struct. Must be sizeof(FlutterSoftwareRendererConfig).
Definition: embedder.h:439
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:886
int64_t FlutterPlatformViewIdentifier
Definition: embedder.h:590
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:1218
uint32_t name
The name of the framebuffer.
Definition: embedder.h:284
#define FLUTTER_API_SYMBOL(symbol)
Definition: embedder.h:60
SoftwareSurfacePresentCallback surface_present_callback
Definition: embedder.h:444
FlutterEngineResult(* FlutterEngineDeinitializeFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:1998
FlutterEngineDartObjectType type
Definition: embedder.h:1063
Whether the semantics node is a live region.
Definition: embedder.h:187
uint64_t(* FlutterEngineGetCurrentTimeFnPtr)()
Definition: embedder.h:2063
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:1167
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:766
void(* FlutterEngineTraceEventDurationEndFnPtr)(const char *name)
Definition: embedder.h:2057
FlutterRect rect
Definition: embedder.h:339
FlutterEngineDartObjectType
Definition: embedder.h:1006
FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
Definition: embedder.cc:2052
size_t left
Horizontal physical location of the left side of the window on the screen.
Definition: embedder.h:465
FlutterEngineResult(* FlutterEngineShutdownFnPtr)(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Definition: embedder.h:1990
FlutterOpenGLTargetType
Definition: embedder.h:245
FlutterBackingStoreCreateCallback create_backing_store_callback
Definition: embedder.h:933