addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. required void drawWithFrame_inView_(
    1. NSRect,
    2. NSView?
    ),
  3. required bool wantsToTrackMouse(),
  4. required void highlight_withFrame_inView_(
    1. bool,
    2. NSRect,
    3. NSView?
    ),
  5. required bool trackMouse_inRect_ofView_untilMouseUp_(
    1. NSEvent,
    2. NSRect,
    3. NSView?,
    4. bool,
    ),
  6. required CGSize cellSize(),
  7. required CGPoint cellBaselineOffset(),
  8. required NSTextAttachment? attachment(),
  9. required void setAttachment_(
    1. NSTextAttachment?
    ),
  10. required void drawWithFrame_inView_characterIndex_(
    1. NSRect,
    2. NSView?,
    3. DartNSUInteger
    ),
  11. required void drawWithFrame_inView_characterIndex_layoutManager_(
    1. NSRect,
    2. NSView?,
    3. DartNSUInteger,
    4. NSLayoutManager,
    ),
  12. required bool wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex_(
    1. NSEvent,
    2. NSRect,
    3. NSView?,
    4. DartNSUInteger,
    ),
  13. required bool trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp_(
    1. NSEvent,
    2. NSRect,
    3. NSView?,
    4. DartNSUInteger,
    5. bool,
    ),
  14. required NSRect cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex_(
    1. NSTextContainer,
    2. NSRect,
    3. NSPoint,
    4. DartNSUInteger,
    ),
  15. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextAttachmentCell 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(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,
}) {
  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);
}