addToBuilderAsBlocking static method
void
addToBuilderAsBlocking(
- ObjCProtocolBuilder builder, {
- required void insertText_replacementRange_(
- ObjCObjectBase,
- NSRange
- required void doCommandBySelector_(
- Pointer<
ObjCSelector> aSelector
- Pointer<
- required void setMarkedText_selectedRange_replacementRange_(),
- required void unmarkText(),
- required NSRange selectedRange(),
- required NSRange markedRange(),
- required bool hasMarkedText(),
- required NSAttributedString? attributedSubstringForProposedRange_actualRange_(),
- required NSArray validAttributesForMarkedText(),
- required NSRect firstRectForCharacterRange_actualRange_(),
- required DartNSInteger characterIndexForPoint_(
- NSPoint point
- NSAttributedString attributedString()?,
- DartCGFloat fractionOfDistanceThroughGlyphForPoint_()?,
- DartCGFloat baselineDeltaForCharacterAtIndex_()?,
- DartNSInteger windowLevel()?,
- bool drawsVerticallyForCharacterAtIndex_()?,
- NSTextCursorAccessoryPlacement preferredTextAccessoryPlacement()?,
- NSRect unionRectInVisibleSelectedRange()?,
- NSRect documentVisibleRect()?,
- bool supportsAdaptiveImageGlyph()?,
- void insertAdaptiveImageGlyph_replacementRange_()?,
- bool $keepIsolateAlive = true,
Adds the implementation of the NSTextInputClient 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, NSRange)
insertText_replacementRange_,
required void Function(ffi.Pointer<objc.ObjCSelector>) doCommandBySelector_,
required void Function(objc.ObjCObjectBase, NSRange, NSRange)
setMarkedText_selectedRange_replacementRange_,
required void Function() unmarkText,
required NSRange Function() selectedRange,
required NSRange Function() markedRange,
required bool Function() hasMarkedText,
required NSAttributedString? Function(NSRange, NSRangePointer)
attributedSubstringForProposedRange_actualRange_,
required objc.NSArray Function() validAttributesForMarkedText,
required NSRect Function(NSRange, NSRangePointer)
firstRectForCharacterRange_actualRange_,
required DartNSUInteger Function(NSPoint) characterIndexForPoint_,
NSAttributedString Function()? attributedString,
DartCGFloat Function(NSPoint)? fractionOfDistanceThroughGlyphForPoint_,
DartCGFloat Function(DartNSUInteger)? baselineDeltaForCharacterAtIndex_,
DartNSInteger Function()? windowLevel,
bool Function(DartNSUInteger)? drawsVerticallyForCharacterAtIndex_,
NSTextCursorAccessoryPlacement Function()? preferredTextAccessoryPlacement,
NSRect Function()? unionRectInVisibleSelectedRange,
NSRect Function()? documentVisibleRect,
bool Function()? supportsAdaptiveImageGlyph,
void Function(NSAdaptiveImageGlyph, NSRange)?
insertAdaptiveImageGlyph_replacementRange_,
bool $keepIsolateAlive = true,
}) {
NSTextInputClient.insertText_replacementRange_.implementAsBlocking(
builder,
insertText_replacementRange_,
);
NSTextInputClient.doCommandBySelector_.implementAsBlocking(
builder,
doCommandBySelector_,
);
NSTextInputClient.setMarkedText_selectedRange_replacementRange_
.implementAsBlocking(
builder,
setMarkedText_selectedRange_replacementRange_,
);
NSTextInputClient.unmarkText.implementAsBlocking(builder, unmarkText);
NSTextInputClient.selectedRange.implement(builder, selectedRange);
NSTextInputClient.markedRange.implement(builder, markedRange);
NSTextInputClient.hasMarkedText.implement(builder, hasMarkedText);
NSTextInputClient.attributedSubstringForProposedRange_actualRange_
.implement(builder, attributedSubstringForProposedRange_actualRange_);
NSTextInputClient.validAttributesForMarkedText.implement(
builder,
validAttributesForMarkedText,
);
NSTextInputClient.firstRectForCharacterRange_actualRange_.implement(
builder,
firstRectForCharacterRange_actualRange_,
);
NSTextInputClient.characterIndexForPoint_.implement(
builder,
characterIndexForPoint_,
);
NSTextInputClient.attributedString.implement(builder, attributedString);
NSTextInputClient.fractionOfDistanceThroughGlyphForPoint_.implement(
builder,
fractionOfDistanceThroughGlyphForPoint_,
);
NSTextInputClient.baselineDeltaForCharacterAtIndex_.implement(
builder,
baselineDeltaForCharacterAtIndex_,
);
NSTextInputClient.windowLevel.implement(builder, windowLevel);
NSTextInputClient.drawsVerticallyForCharacterAtIndex_.implement(
builder,
drawsVerticallyForCharacterAtIndex_,
);
NSTextInputClient.preferredTextAccessoryPlacement.implement(
builder,
preferredTextAccessoryPlacement,
);
NSTextInputClient.unionRectInVisibleSelectedRange.implement(
builder,
unionRectInVisibleSelectedRange,
);
NSTextInputClient.documentVisibleRect.implement(
builder,
documentVisibleRect,
);
NSTextInputClient.supportsAdaptiveImageGlyph.implement(
builder,
supportsAdaptiveImageGlyph,
);
NSTextInputClient.insertAdaptiveImageGlyph_replacementRange_
.implementAsBlocking(
builder,
insertAdaptiveImageGlyph_replacementRange_,
);
builder.addProtocol($protocol);
}