@@ -126,6 +126,7 @@ @implementation FlutterEngine {
126
126
fml::scoped_nsobject<FlutterMethodChannel> _platformViewsChannel;
127
127
fml::scoped_nsobject<FlutterMethodChannel> _textInputChannel;
128
128
fml::scoped_nsobject<FlutterMethodChannel> _undoManagerChannel;
129
+ fml::scoped_nsobject<FlutterMethodChannel> _scribbleChannel;
129
130
fml::scoped_nsobject<FlutterMethodChannel> _spellCheckChannel;
130
131
fml::scoped_nsobject<FlutterBasicMessageChannel> _lifecycleChannel;
131
132
fml::scoped_nsobject<FlutterBasicMessageChannel> _systemChannel;
@@ -471,6 +472,9 @@ - (FlutterMethodChannel*)textInputChannel {
471
472
- (FlutterMethodChannel*)undoManagerChannel {
472
473
return _undoManagerChannel.get ();
473
474
}
475
+ - (FlutterMethodChannel*)scribbleChannel {
476
+ return _scribbleChannel.get ();
477
+ }
474
478
- (FlutterMethodChannel*)spellCheckChannel {
475
479
return _spellCheckChannel.get ();
476
480
}
@@ -499,6 +503,7 @@ - (void)resetChannels {
499
503
_platformViewsChannel.reset ();
500
504
_textInputChannel.reset ();
501
505
_undoManagerChannel.reset ();
506
+ _scribbleChannel.reset ();
502
507
_lifecycleChannel.reset ();
503
508
_systemChannel.reset ();
504
509
_settingsChannel.reset ();
@@ -572,6 +577,11 @@ - (void)setupChannels {
572
577
binaryMessenger: self .binaryMessenger
573
578
codec: [FlutterJSONMethodCodec sharedInstance ]]);
574
579
580
+ _scribbleChannel.reset ([[FlutterMethodChannel alloc ]
581
+ initWithName: @" flutter/scribble"
582
+ binaryMessenger: self .binaryMessenger
583
+ codec: [FlutterJSONMethodCodec sharedInstance ]]);
584
+
575
585
_spellCheckChannel.reset ([[FlutterMethodChannel alloc ]
576
586
initWithName: @" flutter/spellcheck"
577
587
binaryMessenger: self .binaryMessenger
@@ -965,48 +975,83 @@ - (void)flutterTextInputView:(FlutterTextInputView*)textInputView
965
975
#pragma mark - FlutterViewEngineDelegate
966
976
967
977
- (void )flutterTextInputView : (FlutterTextInputView*)textInputView showToolbar : (int )client {
978
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
979
+ // finished transitioning to using the Scribble channel.
980
+ // https://github.com/flutter/flutter/pull/104128
968
981
[_textInputChannel.get () invokeMethod: @" TextInputClient.showToolbar" arguments: @[ @(client) ]];
982
+ [_scribbleChannel.get () invokeMethod: @" Scribble.showToolbar" arguments: @[ @(client) ]];
969
983
}
970
984
971
985
- (void )flutterTextInputPlugin : (FlutterTextInputPlugin*)textInputPlugin
972
986
focusElement : (UIScribbleElementIdentifier)elementIdentifier
973
987
atPoint : (CGPoint )referencePoint
974
988
result : (FlutterResult)callback {
989
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
990
+ // finished transitioning to using the Scribble channel.
991
+ // https://github.com/flutter/flutter/pull/104128
975
992
[_textInputChannel.get ()
976
993
invokeMethod: @" TextInputClient.focusElement"
977
994
arguments: @[ elementIdentifier, @(referencePoint.x), @(referencePoint.y) ]
978
995
result: callback];
996
+ [_scribbleChannel.get ()
997
+ invokeMethod: @" Scribble.focusElement"
998
+ arguments: @[ elementIdentifier, @(referencePoint.x), @(referencePoint.y) ]
999
+ result: callback];
979
1000
}
980
1001
981
1002
- (void )flutterTextInputPlugin : (FlutterTextInputPlugin*)textInputPlugin
982
1003
requestElementsInRect : (CGRect )rect
983
1004
result : (FlutterResult)callback {
1005
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
1006
+ // finished transitioning to using the Scribble channel.
1007
+ // https://github.com/flutter/flutter/pull/104128
1008
+ [_scribbleChannel.get ()
1009
+ invokeMethod: @" Scribble.requestElementsInRect"
1010
+ arguments: @[ @(rect.origin.x), @(rect.origin.y), @(rect.size.width), @(rect.size.height) ]
1011
+ result: callback];
984
1012
[_textInputChannel.get ()
985
1013
invokeMethod: @" TextInputClient.requestElementsInRect"
986
1014
arguments: @[ @(rect.origin.x), @(rect.origin.y), @(rect.size.width), @(rect.size.height) ]
987
1015
result: callback];
988
1016
}
989
1017
990
1018
- (void )flutterTextInputViewScribbleInteractionBegan : (FlutterTextInputView*)textInputView {
1019
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
1020
+ // finished transitioning to using the Scribble channel.
1021
+ // https://github.com/flutter/flutter/pull/104128
991
1022
[_textInputChannel.get () invokeMethod: @" TextInputClient.scribbleInteractionBegan" arguments: nil ];
1023
+ [_scribbleChannel.get () invokeMethod: @" Scribble.scribbleInteractionBegan" arguments: nil ];
992
1024
}
993
1025
994
1026
- (void )flutterTextInputViewScribbleInteractionFinished : (FlutterTextInputView*)textInputView {
1027
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
1028
+ // finished transitioning to using the Scribble channel.
1029
+ // https://github.com/flutter/flutter/pull/104128
995
1030
[_textInputChannel.get () invokeMethod: @" TextInputClient.scribbleInteractionFinished"
996
1031
arguments: nil ];
1032
+ [_scribbleChannel.get () invokeMethod: @" Scribble.scribbleInteractionFinished" arguments: nil ];
997
1033
}
998
1034
999
1035
- (void )flutterTextInputView : (FlutterTextInputView*)textInputView
1000
1036
insertTextPlaceholderWithSize : (CGSize )size
1001
1037
withClient : (int )client {
1038
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
1039
+ // finished transitioning to using the Scribble channel.
1040
+ // https://github.com/flutter/flutter/pull/104128
1002
1041
[_textInputChannel.get () invokeMethod: @" TextInputClient.insertTextPlaceholder"
1003
1042
arguments: @[ @(client), @(size.width), @(size.height) ]];
1043
+ [_scribbleChannel.get () invokeMethod: @" Scribble.insertTextPlaceholder"
1044
+ arguments: @[ @(client), @(size.width), @(size.height) ]];
1004
1045
}
1005
1046
1006
1047
- (void )flutterTextInputView : (FlutterTextInputView*)textInputView
1007
1048
removeTextPlaceholder : (int )client {
1049
+ // TODO(justinmc): Remove the TextInputClient usage when the framework has
1050
+ // finished transitioning to using the Scribble channel.
1051
+ // https://github.com/flutter/flutter/pull/104128
1008
1052
[_textInputChannel.get () invokeMethod: @" TextInputClient.removeTextPlaceholder"
1009
1053
arguments: @[ @(client) ]];
1054
+ [_scribbleChannel.get () invokeMethod: @" Scribble.removeTextPlaceholder" arguments: @[ @(client) ]];
1010
1055
}
1011
1056
1012
1057
- (void )flutterTextInputViewDidResignFirstResponder : (FlutterTextInputView*)textInputView {
0 commit comments