implementAsBlocking static method
NSTextAttachmentCell
implementAsBlocking({
- required void drawWithFrame_inView_(),
- required bool wantsToTrackMouse(),
- required void highlight_withFrame_inView_(),
- required bool trackMouse_inRect_ofView_untilMouseUp_(),
- required CGSize cellSize(),
- required CGPoint cellBaselineOffset(),
- required NSTextAttachment? attachment(),
- required void setAttachment_(),
- required void drawWithFrame_inView_characterIndex_(),
- required void drawWithFrame_inView_characterIndex_layoutManager_(),
- required bool wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex_(),
- required bool trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp_(
- NSEvent,
- NSRect,
- NSView?,
- DartNSUInteger,
- bool,
- required NSRect cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex_(),
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextAttachmentCell protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSTextAttachmentCell implementAsBlocking({
required void Function(NSRect, NSView?) drawWithFrame_inView_,
required bool Function() wantsToTrackMouse,
required void Function(bool, NSRect, NSView?) highlight_withFrame_inView_,
required bool Function(NSEvent, NSRect, NSView?, bool)
trackMouse_inRect_ofView_untilMouseUp_,
required NSSize Function() cellSize,
required NSPoint Function() cellBaselineOffset,
required NSTextAttachment? Function() attachment,
required void Function(NSTextAttachment?) setAttachment_,
required void Function(NSRect, NSView?, DartNSUInteger)
drawWithFrame_inView_characterIndex_,
required void Function(NSRect, NSView?, DartNSUInteger, NSLayoutManager)
drawWithFrame_inView_characterIndex_layoutManager_,
required bool Function(NSEvent, NSRect, NSView?, DartNSUInteger)
wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex_,
required bool Function(NSEvent, NSRect, NSView?, DartNSUInteger, bool)
trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp_,
required NSRect Function(NSTextContainer, NSRect, NSPoint, DartNSUInteger)
cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSTextAttachmentCell');
NSTextAttachmentCell.drawWithFrame_inView_.implementAsBlocking(
builder,
drawWithFrame_inView_,
);
NSTextAttachmentCell.wantsToTrackMouse.implement(
builder,
wantsToTrackMouse,
);
NSTextAttachmentCell.highlight_withFrame_inView_.implementAsBlocking(
builder,
highlight_withFrame_inView_,
);
NSTextAttachmentCell.trackMouse_inRect_ofView_untilMouseUp_.implement(
builder,
trackMouse_inRect_ofView_untilMouseUp_,
);
NSTextAttachmentCell.cellSize.implement(builder, cellSize);
NSTextAttachmentCell.cellBaselineOffset.implement(
builder,
cellBaselineOffset,
);
NSTextAttachmentCell.attachment.implement(builder, attachment);
NSTextAttachmentCell.setAttachment_.implementAsBlocking(
builder,
setAttachment_,
);
NSTextAttachmentCell.drawWithFrame_inView_characterIndex_
.implementAsBlocking(builder, drawWithFrame_inView_characterIndex_);
NSTextAttachmentCell.drawWithFrame_inView_characterIndex_layoutManager_
.implementAsBlocking(
builder,
drawWithFrame_inView_characterIndex_layoutManager_,
);
NSTextAttachmentCell
.wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex_
.implement(
builder,
wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex_,
);
NSTextAttachmentCell.trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp_
.implement(
builder,
trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp_,
);
NSTextAttachmentCell
.cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex_
.implement(
builder,
cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
);
builder.addProtocol($protocol);
return NSTextAttachmentCell.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}