addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. void menuNeedsUpdate_(
    1. NSMenu
    )?,
  3. DartNSInteger numberOfItemsInMenu_(
    1. NSMenu
    )?,
  4. bool menu_updateItem_atIndex_shouldCancel_(
    1. NSMenu,
    2. NSMenuItem,
    3. DartNSInteger,
    4. bool,
    )?,
  5. bool menuHasKeyEquivalent_forEvent_target_action_(
    1. NSMenu,
    2. NSEvent,
    3. Pointer<Pointer<ObjCObject>>,
    4. Pointer<Pointer<ObjCSelector>>,
    )?,
  6. void menuWillOpen_(
    1. NSMenu
    )?,
  7. void menuDidClose_(
    1. NSMenu
    )?,
  8. void menu_willHighlightItem_(
    1. NSMenu,
    2. NSMenuItem?
    )?,
  9. NSRect confinementRectForMenu_onScreen_(
    1. NSMenu,
    2. NSScreen?
    )?,
  10. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSMenuDelegate 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, {
  void Function(NSMenu)? menuNeedsUpdate_,
  DartNSInteger Function(NSMenu)? numberOfItemsInMenu_,
  bool Function(NSMenu, NSMenuItem, DartNSInteger, bool)?
  menu_updateItem_atIndex_shouldCancel_,
  bool Function(
    NSMenu,
    NSEvent,
    ffi.Pointer<ffi.Pointer<objc.ObjCObject>>,
    ffi.Pointer<ffi.Pointer<objc.ObjCSelector>>,
  )?
  menuHasKeyEquivalent_forEvent_target_action_,
  void Function(NSMenu)? menuWillOpen_,
  void Function(NSMenu)? menuDidClose_,
  void Function(NSMenu, NSMenuItem?)? menu_willHighlightItem_,
  NSRect Function(NSMenu, NSScreen?)? confinementRectForMenu_onScreen_,
  bool $keepIsolateAlive = true,
}) {
  NSMenuDelegate.menuNeedsUpdate_.implement(builder, menuNeedsUpdate_);
  NSMenuDelegate.numberOfItemsInMenu_.implement(
    builder,
    numberOfItemsInMenu_,
  );
  NSMenuDelegate.menu_updateItem_atIndex_shouldCancel_.implement(
    builder,
    menu_updateItem_atIndex_shouldCancel_,
  );
  NSMenuDelegate.menuHasKeyEquivalent_forEvent_target_action_.implement(
    builder,
    menuHasKeyEquivalent_forEvent_target_action_,
  );
  NSMenuDelegate.menuWillOpen_.implement(builder, menuWillOpen_);
  NSMenuDelegate.menuDidClose_.implement(builder, menuDidClose_);
  NSMenuDelegate.menu_willHighlightItem_.implement(
    builder,
    menu_willHighlightItem_,
  );
  NSMenuDelegate.confinementRectForMenu_onScreen_.implement(
    builder,
    confinementRectForMenu_onScreen_,
  );
  builder.addProtocol($protocol);
}