addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. required void insertText_(
    1. ObjCObjectBase object
    ),
  3. required void doCommandBySelector_(
    1. Pointer<ObjCSelector> aSelector
    ),
  4. required void setMarkedText_selectedRange_(
    1. ObjCObjectBase,
    2. NSRange
    ),
  5. required void unmarkText(),
  6. required bool hasMarkedText(),
  7. required int conversationIdentifier(),
  8. required NSAttributedString attributedSubstringFromRange_(
    1. NSRange range
    ),
  9. required NSRange markedRange(),
  10. required NSRange selectedRange(),
  11. required NSRect firstRectForCharacterRange_(
    1. NSRange
    ),
  12. required DartNSInteger characterIndexForPoint_(
    1. NSPoint point
    ),
  13. required NSArray validAttributesForMarkedText(),
  14. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextInput protocol to an existing objc.ObjCProtocolBuilder. All methods that can be implemented as blocking listeners will be.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilderAsBlocking(
  objc.ObjCProtocolBuilder builder, {
  required void Function(objc.ObjCObjectBase) insertText_,
  required void Function(ffi.Pointer<objc.ObjCSelector>) doCommandBySelector_,
  required void Function(objc.ObjCObjectBase, NSRange)
  setMarkedText_selectedRange_,
  required void Function() unmarkText,
  required bool Function() hasMarkedText,
  required DartNSInteger Function() conversationIdentifier,
  required NSAttributedString Function(NSRange) attributedSubstringFromRange_,
  required NSRange Function() markedRange,
  required NSRange Function() selectedRange,
  required NSRect Function(NSRange) firstRectForCharacterRange_,
  required DartNSUInteger Function(NSPoint) characterIndexForPoint_,
  required objc.NSArray Function() validAttributesForMarkedText,
  bool $keepIsolateAlive = true,
}) {
  NSTextInput.insertText_.implementAsBlocking(builder, insertText_);
  NSTextInput.doCommandBySelector_.implementAsBlocking(
    builder,
    doCommandBySelector_,
  );
  NSTextInput.setMarkedText_selectedRange_.implementAsBlocking(
    builder,
    setMarkedText_selectedRange_,
  );
  NSTextInput.unmarkText.implementAsBlocking(builder, unmarkText);
  NSTextInput.hasMarkedText.implement(builder, hasMarkedText);
  NSTextInput.conversationIdentifier.implement(
    builder,
    conversationIdentifier,
  );
  NSTextInput.attributedSubstringFromRange_.implement(
    builder,
    attributedSubstringFromRange_,
  );
  NSTextInput.markedRange.implement(builder, markedRange);
  NSTextInput.selectedRange.implement(builder, selectedRange);
  NSTextInput.firstRectForCharacterRange_.implement(
    builder,
    firstRectForCharacterRange_,
  );
  NSTextInput.characterIndexForPoint_.implement(
    builder,
    characterIndexForPoint_,
  );
  NSTextInput.validAttributesForMarkedText.implement(
    builder,
    validAttributesForMarkedText,
  );
  builder.addProtocol($protocol);
}