implement static method

NSWindowDelegate implement({
  1. bool windowShouldClose_(
    1. NSWindow
    )?,
  2. ObjCObjectBase? windowWillReturnFieldEditor_toObject_(
    1. NSWindow,
    2. ObjCObjectBase?
    )?,
  3. NSSize windowWillResize_toSize_(
    1. NSWindow,
    2. NSSize
    )?,
  4. NSRect windowWillUseStandardFrame_defaultFrame_(
    1. NSWindow,
    2. NSRect
    )?,
  5. bool windowShouldZoom_toFrame_(
    1. NSWindow,
    2. NSRect
    )?,
  6. NSUndoManager? windowWillReturnUndoManager_(
    1. NSWindow
    )?,
  7. NSRect window_willPositionSheet_usingRect_(
    1. NSWindow,
    2. NSWindow,
    3. NSRect
    )?,
  8. bool window_shouldPopUpDocumentPathMenu_(
    1. NSWindow,
    2. NSMenu
    )?,
  9. bool window_shouldDragDocumentWithEvent_from_withPasteboard_(
    1. NSWindow,
    2. NSEvent,
    3. NSPoint,
    4. NSPasteboard,
    )?,
  10. NSSize window_willUseFullScreenContentSize_(
    1. NSWindow,
    2. NSSize
    )?,
  11. NSApplicationPresentationOptions window_willUseFullScreenPresentationOptions_(
    1. NSWindow,
    2. NSApplicationPresentationOptions
    )?,
  12. NSArray? customWindowsToEnterFullScreenForWindow_(
    1. NSWindow
    )?,
  13. void window_startCustomAnimationToEnterFullScreenWithDuration_(
    1. NSWindow,
    2. DartNSTimeInterval
    )?,
  14. void windowDidFailToEnterFullScreen_(
    1. NSWindow
    )?,
  15. NSArray? customWindowsToExitFullScreenForWindow_(
    1. NSWindow
    )?,
  16. void window_startCustomAnimationToExitFullScreenWithDuration_(
    1. NSWindow,
    2. DartNSTimeInterval
    )?,
  17. NSArray? customWindowsToEnterFullScreenForWindow_onScreen_(
    1. NSWindow,
    2. NSScreen
    )?,
  18. void window_startCustomAnimationToEnterFullScreenOnScreen_withDuration_(
    1. NSWindow,
    2. NSScreen,
    3. DartNSTimeInterval
    )?,
  19. void windowDidFailToExitFullScreen_(
    1. NSWindow
    )?,
  20. NSSize window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize_(
    1. NSWindow,
    2. NSSize,
    3. NSSize
    )?,
  21. void window_willEncodeRestorableState_(
    1. NSWindow,
    2. NSCoder
    )?,
  22. void window_didDecodeRestorableState_(
    1. NSWindow,
    2. NSCoder
    )?,
  23. NSArray? previewRepresentableActivityItemsForWindow_(
    1. NSWindow
    )?,
  24. NSWindow? windowForSharingRequestFromWindow_(
    1. NSWindow
    )?,
  25. void windowDidResize_(
    1. NSNotification
    )?,
  26. void windowDidExpose_(
    1. NSNotification
    )?,
  27. void windowWillMove_(
    1. NSNotification
    )?,
  28. void windowDidMove_(
    1. NSNotification
    )?,
  29. void windowDidBecomeKey_(
    1. NSNotification
    )?,
  30. void windowDidResignKey_(
    1. NSNotification
    )?,
  31. void windowDidBecomeMain_(
    1. NSNotification
    )?,
  32. void windowDidResignMain_(
    1. NSNotification
    )?,
  33. void windowWillClose_(
    1. NSNotification
    )?,
  34. void windowWillMiniaturize_(
    1. NSNotification
    )?,
  35. void windowDidMiniaturize_(
    1. NSNotification
    )?,
  36. void windowDidDeminiaturize_(
    1. NSNotification
    )?,
  37. void windowDidUpdate_(
    1. NSNotification
    )?,
  38. void windowDidChangeScreen_(
    1. NSNotification
    )?,
  39. void windowDidChangeScreenProfile_(
    1. NSNotification
    )?,
  40. void windowDidChangeBackingProperties_(
    1. NSNotification
    )?,
  41. void windowWillBeginSheet_(
    1. NSNotification
    )?,
  42. void windowDidEndSheet_(
    1. NSNotification
    )?,
  43. void windowWillStartLiveResize_(
    1. NSNotification
    )?,
  44. void windowDidEndLiveResize_(
    1. NSNotification
    )?,
  45. void windowWillEnterFullScreen_(
    1. NSNotification
    )?,
  46. void windowDidEnterFullScreen_(
    1. NSNotification
    )?,
  47. void windowWillExitFullScreen_(
    1. NSNotification
    )?,
  48. void windowDidExitFullScreen_(
    1. NSNotification
    )?,
  49. void windowWillEnterVersionBrowser_(
    1. NSNotification
    )?,
  50. void windowDidEnterVersionBrowser_(
    1. NSNotification
    )?,
  51. void windowWillExitVersionBrowser_(
    1. NSNotification
    )?,
  52. void windowDidExitVersionBrowser_(
    1. NSNotification
    )?,
  53. void windowDidChangeOcclusionState_(
    1. NSNotification
    )?,
  54. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSWindowDelegate protocol. To implement multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.

If $keepIsolateAlive is true, this protocol will keep this isolate alive until it is garbage collected by both Dart and ObjC.

Implementation

static NSWindowDelegate implement({
  bool Function(NSWindow)? windowShouldClose_,
  objc.ObjCObjectBase? Function(NSWindow, objc.ObjCObjectBase?)?
  windowWillReturnFieldEditor_toObject_,
  NSSize Function(NSWindow, NSSize)? windowWillResize_toSize_,
  NSRect Function(NSWindow, NSRect)? windowWillUseStandardFrame_defaultFrame_,
  bool Function(NSWindow, NSRect)? windowShouldZoom_toFrame_,
  NSUndoManager? Function(NSWindow)? windowWillReturnUndoManager_,
  NSRect Function(NSWindow, NSWindow, NSRect)?
  window_willPositionSheet_usingRect_,
  bool Function(NSWindow, NSMenu)? window_shouldPopUpDocumentPathMenu_,
  bool Function(NSWindow, NSEvent, NSPoint, NSPasteboard)?
  window_shouldDragDocumentWithEvent_from_withPasteboard_,
  NSSize Function(NSWindow, NSSize)? window_willUseFullScreenContentSize_,
  NSApplicationPresentationOptions Function(
    NSWindow,
    NSApplicationPresentationOptions,
  )?
  window_willUseFullScreenPresentationOptions_,
  objc.NSArray? Function(NSWindow)? customWindowsToEnterFullScreenForWindow_,
  void Function(NSWindow, DartNSTimeInterval)?
  window_startCustomAnimationToEnterFullScreenWithDuration_,
  void Function(NSWindow)? windowDidFailToEnterFullScreen_,
  objc.NSArray? Function(NSWindow)? customWindowsToExitFullScreenForWindow_,
  void Function(NSWindow, DartNSTimeInterval)?
  window_startCustomAnimationToExitFullScreenWithDuration_,
  objc.NSArray? Function(NSWindow, NSScreen)?
  customWindowsToEnterFullScreenForWindow_onScreen_,
  void Function(NSWindow, NSScreen, DartNSTimeInterval)?
  window_startCustomAnimationToEnterFullScreenOnScreen_withDuration_,
  void Function(NSWindow)? windowDidFailToExitFullScreen_,
  NSSize Function(NSWindow, NSSize, NSSize)?
  window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize_,
  void Function(NSWindow, objc.NSCoder)? window_willEncodeRestorableState_,
  void Function(NSWindow, objc.NSCoder)? window_didDecodeRestorableState_,
  objc.NSArray? Function(NSWindow)?
  previewRepresentableActivityItemsForWindow_,
  NSWindow? Function(NSWindow)? windowForSharingRequestFromWindow_,
  void Function(objc.NSNotification)? windowDidResize_,
  void Function(objc.NSNotification)? windowDidExpose_,
  void Function(objc.NSNotification)? windowWillMove_,
  void Function(objc.NSNotification)? windowDidMove_,
  void Function(objc.NSNotification)? windowDidBecomeKey_,
  void Function(objc.NSNotification)? windowDidResignKey_,
  void Function(objc.NSNotification)? windowDidBecomeMain_,
  void Function(objc.NSNotification)? windowDidResignMain_,
  void Function(objc.NSNotification)? windowWillClose_,
  void Function(objc.NSNotification)? windowWillMiniaturize_,
  void Function(objc.NSNotification)? windowDidMiniaturize_,
  void Function(objc.NSNotification)? windowDidDeminiaturize_,
  void Function(objc.NSNotification)? windowDidUpdate_,
  void Function(objc.NSNotification)? windowDidChangeScreen_,
  void Function(objc.NSNotification)? windowDidChangeScreenProfile_,
  void Function(objc.NSNotification)? windowDidChangeBackingProperties_,
  void Function(objc.NSNotification)? windowWillBeginSheet_,
  void Function(objc.NSNotification)? windowDidEndSheet_,
  void Function(objc.NSNotification)? windowWillStartLiveResize_,
  void Function(objc.NSNotification)? windowDidEndLiveResize_,
  void Function(objc.NSNotification)? windowWillEnterFullScreen_,
  void Function(objc.NSNotification)? windowDidEnterFullScreen_,
  void Function(objc.NSNotification)? windowWillExitFullScreen_,
  void Function(objc.NSNotification)? windowDidExitFullScreen_,
  void Function(objc.NSNotification)? windowWillEnterVersionBrowser_,
  void Function(objc.NSNotification)? windowDidEnterVersionBrowser_,
  void Function(objc.NSNotification)? windowWillExitVersionBrowser_,
  void Function(objc.NSNotification)? windowDidExitVersionBrowser_,
  void Function(objc.NSNotification)? windowDidChangeOcclusionState_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSWindowDelegate');
  NSWindowDelegate.windowShouldClose_.implement(builder, windowShouldClose_);
  NSWindowDelegate.windowWillReturnFieldEditor_toObject_.implement(
    builder,
    windowWillReturnFieldEditor_toObject_,
  );
  NSWindowDelegate.windowWillResize_toSize_.implement(
    builder,
    windowWillResize_toSize_,
  );
  NSWindowDelegate.windowWillUseStandardFrame_defaultFrame_.implement(
    builder,
    windowWillUseStandardFrame_defaultFrame_,
  );
  NSWindowDelegate.windowShouldZoom_toFrame_.implement(
    builder,
    windowShouldZoom_toFrame_,
  );
  NSWindowDelegate.windowWillReturnUndoManager_.implement(
    builder,
    windowWillReturnUndoManager_,
  );
  NSWindowDelegate.window_willPositionSheet_usingRect_.implement(
    builder,
    window_willPositionSheet_usingRect_,
  );
  NSWindowDelegate.window_shouldPopUpDocumentPathMenu_.implement(
    builder,
    window_shouldPopUpDocumentPathMenu_,
  );
  NSWindowDelegate.window_shouldDragDocumentWithEvent_from_withPasteboard_
      .implement(
        builder,
        window_shouldDragDocumentWithEvent_from_withPasteboard_,
      );
  NSWindowDelegate.window_willUseFullScreenContentSize_.implement(
    builder,
    window_willUseFullScreenContentSize_,
  );
  NSWindowDelegate.window_willUseFullScreenPresentationOptions_.implement(
    builder,
    window_willUseFullScreenPresentationOptions_,
  );
  NSWindowDelegate.customWindowsToEnterFullScreenForWindow_.implement(
    builder,
    customWindowsToEnterFullScreenForWindow_,
  );
  NSWindowDelegate.window_startCustomAnimationToEnterFullScreenWithDuration_
      .implement(
        builder,
        window_startCustomAnimationToEnterFullScreenWithDuration_,
      );
  NSWindowDelegate.windowDidFailToEnterFullScreen_.implement(
    builder,
    windowDidFailToEnterFullScreen_,
  );
  NSWindowDelegate.customWindowsToExitFullScreenForWindow_.implement(
    builder,
    customWindowsToExitFullScreenForWindow_,
  );
  NSWindowDelegate.window_startCustomAnimationToExitFullScreenWithDuration_
      .implement(
        builder,
        window_startCustomAnimationToExitFullScreenWithDuration_,
      );
  NSWindowDelegate.customWindowsToEnterFullScreenForWindow_onScreen_
      .implement(builder, customWindowsToEnterFullScreenForWindow_onScreen_);
  NSWindowDelegate
      .window_startCustomAnimationToEnterFullScreenOnScreen_withDuration_
      .implement(
        builder,
        window_startCustomAnimationToEnterFullScreenOnScreen_withDuration_,
      );
  NSWindowDelegate.windowDidFailToExitFullScreen_.implement(
    builder,
    windowDidFailToExitFullScreen_,
  );
  NSWindowDelegate
      .window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize_
      .implement(
        builder,
        window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize_,
      );
  NSWindowDelegate.window_willEncodeRestorableState_.implement(
    builder,
    window_willEncodeRestorableState_,
  );
  NSWindowDelegate.window_didDecodeRestorableState_.implement(
    builder,
    window_didDecodeRestorableState_,
  );
  NSWindowDelegate.previewRepresentableActivityItemsForWindow_.implement(
    builder,
    previewRepresentableActivityItemsForWindow_,
  );
  NSWindowDelegate.windowForSharingRequestFromWindow_.implement(
    builder,
    windowForSharingRequestFromWindow_,
  );
  NSWindowDelegate.windowDidResize_.implement(builder, windowDidResize_);
  NSWindowDelegate.windowDidExpose_.implement(builder, windowDidExpose_);
  NSWindowDelegate.windowWillMove_.implement(builder, windowWillMove_);
  NSWindowDelegate.windowDidMove_.implement(builder, windowDidMove_);
  NSWindowDelegate.windowDidBecomeKey_.implement(
    builder,
    windowDidBecomeKey_,
  );
  NSWindowDelegate.windowDidResignKey_.implement(
    builder,
    windowDidResignKey_,
  );
  NSWindowDelegate.windowDidBecomeMain_.implement(
    builder,
    windowDidBecomeMain_,
  );
  NSWindowDelegate.windowDidResignMain_.implement(
    builder,
    windowDidResignMain_,
  );
  NSWindowDelegate.windowWillClose_.implement(builder, windowWillClose_);
  NSWindowDelegate.windowWillMiniaturize_.implement(
    builder,
    windowWillMiniaturize_,
  );
  NSWindowDelegate.windowDidMiniaturize_.implement(
    builder,
    windowDidMiniaturize_,
  );
  NSWindowDelegate.windowDidDeminiaturize_.implement(
    builder,
    windowDidDeminiaturize_,
  );
  NSWindowDelegate.windowDidUpdate_.implement(builder, windowDidUpdate_);
  NSWindowDelegate.windowDidChangeScreen_.implement(
    builder,
    windowDidChangeScreen_,
  );
  NSWindowDelegate.windowDidChangeScreenProfile_.implement(
    builder,
    windowDidChangeScreenProfile_,
  );
  NSWindowDelegate.windowDidChangeBackingProperties_.implement(
    builder,
    windowDidChangeBackingProperties_,
  );
  NSWindowDelegate.windowWillBeginSheet_.implement(
    builder,
    windowWillBeginSheet_,
  );
  NSWindowDelegate.windowDidEndSheet_.implement(builder, windowDidEndSheet_);
  NSWindowDelegate.windowWillStartLiveResize_.implement(
    builder,
    windowWillStartLiveResize_,
  );
  NSWindowDelegate.windowDidEndLiveResize_.implement(
    builder,
    windowDidEndLiveResize_,
  );
  NSWindowDelegate.windowWillEnterFullScreen_.implement(
    builder,
    windowWillEnterFullScreen_,
  );
  NSWindowDelegate.windowDidEnterFullScreen_.implement(
    builder,
    windowDidEnterFullScreen_,
  );
  NSWindowDelegate.windowWillExitFullScreen_.implement(
    builder,
    windowWillExitFullScreen_,
  );
  NSWindowDelegate.windowDidExitFullScreen_.implement(
    builder,
    windowDidExitFullScreen_,
  );
  NSWindowDelegate.windowWillEnterVersionBrowser_.implement(
    builder,
    windowWillEnterVersionBrowser_,
  );
  NSWindowDelegate.windowDidEnterVersionBrowser_.implement(
    builder,
    windowDidEnterVersionBrowser_,
  );
  NSWindowDelegate.windowWillExitVersionBrowser_.implement(
    builder,
    windowWillExitVersionBrowser_,
  );
  NSWindowDelegate.windowDidExitVersionBrowser_.implement(
    builder,
    windowDidExitVersionBrowser_,
  );
  NSWindowDelegate.windowDidChangeOcclusionState_.implement(
    builder,
    windowDidChangeOcclusionState_,
  );
  builder.addProtocol($protocol);
  return NSWindowDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}