@@ -153,6 +153,10 @@ typedef enum {
153
153
// |PageView| widget does not have implicit scrolling, so that users don't
154
154
// navigate to the next page when reaching the end of the current one.
155
155
kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18 ,
156
+ // Whether the semantic node is read only.
157
+ //
158
+ // Only applicable when kFlutterSemanticsFlagIsTextField flag is on.
159
+ kFlutterSemanticsFlagIsReadOnly = 1 << 20 ,
156
160
} FlutterSemanticsFlag ;
157
161
158
162
typedef enum {
@@ -369,12 +373,11 @@ typedef struct {
369
373
size_t struct_size ;
370
374
const char * channel ;
371
375
const uint8_t * message ;
372
- const size_t message_size ;
376
+ size_t message_size ;
373
377
// The response handle on which to invoke
374
- // |FlutterEngineSendPlatformMessageResponse| when the response is ready. This
375
- // field is ignored for messages being sent from the embedder to the
376
- // framework. |FlutterEngineSendPlatformMessageResponse| must be called for
377
- // all messages received by the embedder. Failure to call
378
+ // |FlutterEngineSendPlatformMessageResponse| when the response is ready.
379
+ // |FlutterEngineSendPlatformMessageResponse| must be called for all messages
380
+ // received by the embedder. Failure to call
378
381
// |FlutterEngineSendPlatformMessageResponse| will cause a memory leak. It is
379
382
// not safe to send multiple responses on a single response object.
380
383
const FlutterPlatformMessageResponseHandle * response_handle ;
@@ -384,6 +387,10 @@ typedef void (*FlutterPlatformMessageCallback)(
384
387
const FlutterPlatformMessage * /* message*/ ,
385
388
void * /* user data */ );
386
389
390
+ typedef void (* FlutterDataCallback )(const uint8_t * /* data */ ,
391
+ size_t /* size */ ,
392
+ void * /* user data */ );
393
+
387
394
typedef struct {
388
395
double left ;
389
396
double top ;
@@ -646,6 +653,9 @@ typedef struct {
646
653
// Path to a directory used to store data that is cached across runs of a
647
654
// Flutter application (such as compiled shader programs used by Skia).
648
655
// This is optional. The string must be NULL terminated.
656
+ //
657
+ // This is different from the cache-path-dir argument defined in switches.h,
658
+ // which is used in |flutter::Settings| as |temp_directory_path|.
649
659
const char * persistent_cache_path ;
650
660
651
661
// If true, we'll only read the existing cache, but not write new ones.
@@ -703,6 +713,33 @@ FlutterEngineResult FlutterEngineSendPlatformMessage(
703
713
FlutterEngine engine ,
704
714
const FlutterPlatformMessage * message );
705
715
716
+ // Creates a platform message response handle that allows the embedder to set a
717
+ // native callback for a response to a message. This handle may be set on the
718
+ // |response_handle| field of any |FlutterPlatformMessage| sent to the engine.
719
+ //
720
+ // The handle must be collected via a call to
721
+ // |FlutterPlatformMessageReleaseResponseHandle|. This may be done immediately
722
+ // after a call to |FlutterEngineSendPlatformMessage| with a platform message
723
+ // whose response handle contains the handle created using this call. In case a
724
+ // handle is created but never sent in a message, the release call must still be
725
+ // made. Not calling release on the handle results in a small memory leak.
726
+ //
727
+ // The user data baton passed to the data callback is the one specified in this
728
+ // call as the third argument.
729
+ FLUTTER_EXPORT
730
+ FlutterEngineResult FlutterPlatformMessageCreateResponseHandle (
731
+ FlutterEngine engine ,
732
+ FlutterDataCallback data_callback ,
733
+ void * user_data ,
734
+ FlutterPlatformMessageResponseHandle * * response_out );
735
+
736
+ // Collects the handle created using
737
+ // |FlutterPlatformMessageCreateResponseHandle|.
738
+ FLUTTER_EXPORT
739
+ FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle (
740
+ FlutterEngine engine ,
741
+ FlutterPlatformMessageResponseHandle * response );
742
+
706
743
FLUTTER_EXPORT
707
744
FlutterEngineResult FlutterEngineSendPlatformMessageResponse (
708
745
FlutterEngine engine ,
@@ -835,4 +872,4 @@ FlutterEngineResult FlutterEngineRunTask(FlutterEngine engine,
835
872
} // extern "C"
836
873
#endif
837
874
838
- #endif // FLUTTER_EMBEDDER_H_
875
+ #endif // FLUTTER_EMBEDDER_H_
0 commit comments