addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required NSDragOperation draggingSession_sourceOperationMaskForDraggingContext_(
    1. NSDraggingSession,
    2. NSDraggingContext
    ),
  3. void draggingSession_willBeginAtPoint_(
    1. NSDraggingSession,
    2. NSPoint
    )?,
  4. void draggingSession_movedToPoint_(
    1. NSDraggingSession,
    2. NSPoint
    )?,
  5. void draggingSession_endedAtPoint_operation_(
    1. NSDraggingSession,
    2. NSPoint,
    3. NSDragOperation
    )?,
  6. bool ignoreModifierKeysForDraggingSession_(
    1. NSDraggingSession
    )?,
  7. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSDraggingSource protocol to an existing objc.ObjCProtocolBuilder.

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

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  required NSDragOperation Function(NSDraggingSession, NSDraggingContext)
  draggingSession_sourceOperationMaskForDraggingContext_,
  void Function(NSDraggingSession, NSPoint)?
  draggingSession_willBeginAtPoint_,
  void Function(NSDraggingSession, NSPoint)? draggingSession_movedToPoint_,
  void Function(NSDraggingSession, NSPoint, NSDragOperation)?
  draggingSession_endedAtPoint_operation_,
  bool Function(NSDraggingSession)? ignoreModifierKeysForDraggingSession_,
  bool $keepIsolateAlive = true,
}) {
  NSDraggingSource.draggingSession_sourceOperationMaskForDraggingContext_
      .implement(
        builder,
        draggingSession_sourceOperationMaskForDraggingContext_,
      );
  NSDraggingSource.draggingSession_willBeginAtPoint_.implement(
    builder,
    draggingSession_willBeginAtPoint_,
  );
  NSDraggingSource.draggingSession_movedToPoint_.implement(
    builder,
    draggingSession_movedToPoint_,
  );
  NSDraggingSource.draggingSession_endedAtPoint_operation_.implement(
    builder,
    draggingSession_endedAtPoint_operation_,
  );
  NSDraggingSource.ignoreModifierKeysForDraggingSession_.implement(
    builder,
    ignoreModifierKeysForDraggingSession_,
  );
  builder.addProtocol($protocol);
}