Mercurial > projects > dstep
diff dstep/appkit/NSView.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | f8a3b67adfcb |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/appkit/NSView.d Sun Jan 03 22:06:11 2010 +0100 @@ -0,0 +1,1373 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Sep 24, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.appkit.NSView; + +import dstep.appkit.AppKitDefines; +import dstep.appkit.NSAnimation; +import dstep.appkit.NSAttributedString; +import dstep.appkit.NSBitmapImageRep; +import dstep.appkit.NSClipView; +import dstep.appkit.NSCursor; +import dstep.appkit.NSEvent; +import dstep.appkit.NSGraphics; +import dstep.appkit.NSGraphicsContext; +import dstep.appkit.NSImage; +import dstep.appkit.NSMenu; +import dstep.appkit.NSMenuItem; +import dstep.appkit.NSPasteboard; +import dstep.appkit.NSResponder; +import dstep.appkit.NSRulerMarker; +import dstep.appkit.NSRulerView; +import dstep.appkit.NSScreen; +import dstep.appkit.NSScrollView; +import dstep.appkit.NSShadow; +import dstep.appkit.NSTrackingArea; +import dstep.appkit.NSWindow; +import dstep.applicationservices.coregraphics.CGBase; +import dstep.foundation.NSArray; +import dstep.foundation.NSAttributedString; +import dstep.foundation.NSData; +import dstep.foundation.NSDictionary; +import dstep.foundation.NSGeometry; +import dstep.foundation.NSObjCRuntime; +import dstep.foundation.NSRange; +import dstep.foundation.NSString; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc; +import dstep.quartzcore.CALayer; +import dstep.quartzcore.CIFilter; + +import bindings = dstep.appkit.NSView_bindings; + +typedef NSUInteger NSBorderType; +typedef NSInteger NSTrackingRectTag; +typedef NSInteger NSToolTipTag; + +alias extern (C) NSComparisonResult function (id, id, void*) Compare; + +private +{ + NSString NSFullScreenModeAllScreens_; + NSString NSFullScreenModeSetting_; + NSString NSFullScreenModeWindowLevel_; + NSString NSViewFrameDidChangeNotification_; + NSString NSViewFocusDidChangeNotification_; + NSString NSViewBoundsDidChangeNotification_; + NSString NSViewGlobalFrameDidChangeNotification_; + NSString NSViewDidUpdateTrackingAreasNotification_; +} + +NSString NSFullScreenModeAllScreens () +{ + if (NSFullScreenModeAllScreens_) + return NSFullScreenModeAllScreens_; + + return NSFullScreenModeAllScreens_ = new NSString(bindings.NSFullScreenModeAllScreens); +} + +NSString NSFullScreenModeSetting () +{ + if (NSFullScreenModeSetting_) + return NSFullScreenModeSetting_; + + return NSFullScreenModeSetting_ = new NSString(bindings.NSFullScreenModeSetting); +} + +NSString NSFullScreenModeWindowLevel () +{ + if (NSFullScreenModeWindowLevel_) + return NSFullScreenModeWindowLevel_; + + return NSFullScreenModeWindowLevel_ = new NSString(bindings.NSFullScreenModeWindowLevel); +} + +NSString NSViewFrameDidChangeNotification () +{ + if (NSViewFrameDidChangeNotification_) + return NSViewFrameDidChangeNotification_; + + return NSViewFrameDidChangeNotification_ = new NSString(bindings.NSViewFrameDidChangeNotification); +} + +NSString NSViewFocusDidChangeNotification () +{ + if (NSViewFocusDidChangeNotification_) + return NSViewFocusDidChangeNotification_; + + return NSViewFocusDidChangeNotification_ = new NSString(bindings.NSViewFocusDidChangeNotification); +} + +NSString NSViewBoundsDidChangeNotification () +{ + if (NSViewBoundsDidChangeNotification_) + return NSViewBoundsDidChangeNotification_; + + return NSViewBoundsDidChangeNotification_ = new NSString(bindings.NSViewBoundsDidChangeNotification); +} + +NSString NSViewGlobalFrameDidChangeNotification () +{ + if (NSViewGlobalFrameDidChangeNotification_) + return NSViewGlobalFrameDidChangeNotification_; + + return NSViewGlobalFrameDidChangeNotification_ = new NSString(bindings.NSViewGlobalFrameDidChangeNotification); +} + +NSString NSViewDidUpdateTrackingAreasNotification () +{ + if (NSViewDidUpdateTrackingAreasNotification_) + return NSViewDidUpdateTrackingAreasNotification_; + + return NSViewDidUpdateTrackingAreasNotification_ = new NSString(bindings.NSViewDidUpdateTrackingAreasNotification); +} + +enum +{ + NSViewNotSizable = 0, + NSViewMinXMargin = 1, + NSViewWidthSizable = 2, + NSViewMaxXMargin = 4, + NSViewMinYMargin = 8, + NSViewHeightSizable = 16, + NSViewMaxYMargin = 32 +} + +enum : NSUInteger +{ + NSNoBorder = 0, + NSLineBorder = 1, + NSBezelBorder = 2, + NSGrooveBorder = 3 +} + +struct _VFlags +{ + uint aboutToResize; + uint retainCountOverMax; + uint retainCount; + uint interfaceStyle1; + uint specialArchiving; + uint needsDisplayForBounds; + uint interfaceStyle0; + uint removingWithoutInvalidation; + uint needsBoundsChangeNote; + uint boundsChangeNotesSuspended; + uint focusChangeNotesSuspended; + uint needsFrameChangeNote; + uint frameChangeNotesSuspended; + uint noVerticalAutosizing; + uint newGState; + uint validGState; + uint needsDisplay; + uint wantsGState; + uint autoresizeSubviews; + uint autosizing; + uint rotatedOrScaledFromBase; + uint rotatedFromBase; +} + +const TNSDrag = ` + + void dragImage (NSImage anImage, NSPoint viewLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, Object sourceObj, bool slideFlag) + { + return invokeObjcSelf!(void, "dragImage:at:offset:event:pasteboard:source:slideBack:", NSImage, NSPoint, NSSize, NSEvent, NSPasteboard, Object, bool)(anImage, viewLocation, initialOffset, event, pboard, sourceObj, slideFlag); + } + + NSArray registeredDraggedTypes () + { + return invokeObjcSelf!(NSArray, "registeredDraggedTypes"); + } + + void registerForDraggedTypes (NSArray newTypes) + { + return invokeObjcSelf!(void, "registerForDraggedTypes:", NSArray)(newTypes); + } + + void unregisterDraggedTypes () + { + return invokeObjcSelf!(void, "unregisterDraggedTypes"); + } + + bool dragFile (NSString filename, NSRect rect, bool aFlag, NSEvent event) + { + return invokeObjcSelf!(bool, "dragFile:fromRect:slideBack:event:", NSString, NSRect, bool, NSEvent)(filename, rect, aFlag, event); + } + + bool dragPromisedFilesOfTypes (NSArray typeArray, NSRect rect, Object sourceObject, bool aFlag, NSEvent event) + { + return invokeObjcSelf!(bool, "dragPromisedFilesOfTypes:fromRect:source:slideBack:event:", NSArray, NSRect, Object, bool, NSEvent)(typeArray, rect, sourceObject, aFlag, event); + } + + //mixin ObjcBindMethod!(dragImage, "dragImage:at:offset:event:pasteboard:source:slideBack:"); + //mixin ObjcBindMethod!(registeredDraggedTypes, "registeredDraggedTypes"); + //mixin ObjcBindMethod!(registerForDraggedTypes, "registerForDraggedTypes:"); + //mixin ObjcBindMethod!(unregisterDraggedTypes, "unregisterDraggedTypes"); + //mixin ObjcBindMethod!(dragFile, "dragFile:fromRect:slideBack:event:"); + //mixin ObjcBindMethod!(dragPromisedFilesOfTypes, "dragPromisedFilesOfTypes:fromRect:source:slideBack:event:"); + +`; + +const TNSFullScreenMode = ` + + bool enterFullScreenMode (NSScreen screen, NSDictionary options) + { + return invokeObjcSelf!(bool, "enterFullScreenMode:withOptions:", NSScreen, NSDictionary)(screen, options); + } + + void exitFullScreenModeWithOptions (NSDictionary options) + { + return invokeObjcSelf!(void, "exitFullScreenModeWithOptions:", NSDictionary)(options); + } + + bool isInFullScreenMode () + { + return invokeObjcSelf!(bool, "isInFullScreenMode"); + } + + //mixin ObjcBindMethod!(enterFullScreenMode, "enterFullScreenMode:withOptions:"); + //mixin ObjcBindMethod!(exitFullScreenModeWithOptions, "exitFullScreenModeWithOptions:"); + //mixin ObjcBindMethod!(isInFullScreenMode, "isInFullScreenMode"); + +`; + +const TNSToolTipOwner = ` + + NSString view (NSView view, int tag, NSPoint point, void* data) + { + return invokeObjcSelf!(NSString, "view:stringForToolTip:point:userData:", NSView, int, NSPoint, void*)(view, tag, point, data); + } + + //mixin ObjcBindMethod!(view, "view:stringForToolTip:point:userData:"); + +`; + +const TNSPrinting = ` + + void writeEPSInsideRect (NSRect rect, NSPasteboard pasteboard) + { + return invokeObjcSelf!(void, "writeEPSInsideRect:toPasteboard:", NSRect, NSPasteboard)(rect, pasteboard); + } + + NSData dataWithEPSInsideRect (NSRect rect) + { + return invokeObjcSelf!(NSData, "dataWithEPSInsideRect:", NSRect)(rect); + } + + void writePDFInsideRect (NSRect rect, NSPasteboard pasteboard) + { + return invokeObjcSelf!(void, "writePDFInsideRect:toPasteboard:", NSRect, NSPasteboard)(rect, pasteboard); + } + + NSData dataWithPDFInsideRect (NSRect rect) + { + return invokeObjcSelf!(NSData, "dataWithPDFInsideRect:", NSRect)(rect); + } + + void print (Object sender) + { + return invokeObjcSelf!(void, "print:", Object)(sender); + } + + bool knowsPageRange (NSRangePointer range) + { + return invokeObjcSelf!(bool, "knowsPageRange:", NSRangePointer)(range); + } + + CGFloat heightAdjustLimit () + { + return invokeObjcSelf!(CGFloat, "heightAdjustLimit"); + } + + CGFloat widthAdjustLimit () + { + return invokeObjcSelf!(CGFloat, "widthAdjustLimit"); + } + + void adjustPageWidthNew (CGFloat* newRight, CGFloat oldLeft, CGFloat oldRight, CGFloat rightLimit) + { + return invokeObjcSelf!(void, "adjustPageWidthNew:left:right:limit:", CGFloat*, CGFloat, CGFloat, CGFloat)(newRight, oldLeft, oldRight, rightLimit); + } + + void adjustPageHeightNew (CGFloat* newBottom, CGFloat oldTop, CGFloat oldBottom, CGFloat bottomLimit) + { + return invokeObjcSelf!(void, "adjustPageHeightNew:top:bottom:limit:", CGFloat*, CGFloat, CGFloat, CGFloat)(newBottom, oldTop, oldBottom, bottomLimit); + } + + NSRect rectForPage (NSInteger page) + { + return invokeObjcSelf!(NSRect, "rectForPage:", NSInteger)(page); + } + + NSPoint locationOfPrintRect (NSRect aRect) + { + return invokeObjcSelf!(NSPoint, "locationOfPrintRect:", NSRect)(aRect); + } + + void drawPageBorderWithSize (NSSize borderSize) + { + return invokeObjcSelf!(void, "drawPageBorderWithSize:", NSSize)(borderSize); + } + + NSAttributedString pageHeader () + { + return invokeObjcSelf!(NSAttributedString, "pageHeader"); + } + + NSAttributedString pageFooter () + { + return invokeObjcSelf!(NSAttributedString, "pageFooter"); + } + + void drawSheetBorderWithSize (NSSize borderSize) + { + return invokeObjcSelf!(void, "drawSheetBorderWithSize:", NSSize)(borderSize); + } + + NSString printJobTitle () + { + return invokeObjcSelf!(NSString, "printJobTitle"); + } + + void beginDocument () + { + return invokeObjcSelf!(void, "beginDocument"); + } + + void endDocument () + { + return invokeObjcSelf!(void, "endDocument"); + } + + void beginPageInRect (NSRect aRect, NSPoint location) + { + return invokeObjcSelf!(void, "beginPageInRect:atPlacement:", NSRect, NSPoint)(aRect, location); + } + + void endPage () + { + return invokeObjcSelf!(void, "endPage"); + } + + //mixin ObjcBindMethod!(writeEPSInsideRect, "writeEPSInsideRect:toPasteboard:"); + //mixin ObjcBindMethod!(dataWithEPSInsideRect, "dataWithEPSInsideRect:"); + //mixin ObjcBindMethod!(writePDFInsideRect, "writePDFInsideRect:toPasteboard:"); + //mixin ObjcBindMethod!(dataWithPDFInsideRect, "dataWithPDFInsideRect:"); + //mixin ObjcBindMethod!(print, "print:"); + //mixin ObjcBindMethod!(knowsPageRange, "knowsPageRange:"); + //mixin ObjcBindMethod!(heightAdjustLimit, "heightAdjustLimit"); + //mixin ObjcBindMethod!(widthAdjustLimit, "widthAdjustLimit"); + //mixin ObjcBindMethod!(adjustPageWidthNew, "adjustPageWidthNew:left:right:limit:"); + //mixin ObjcBindMethod!(adjustPageHeightNew, "adjustPageHeightNew:top:bottom:limit:"); + //mixin ObjcBindMethod!(rectForPage, "rectForPage:"); + //mixin ObjcBindMethod!(locationOfPrintRect, "locationOfPrintRect:"); + //mixin ObjcBindMethod!(drawPageBorderWithSize, "drawPageBorderWithSize:"); + //mixin ObjcBindMethod!(pageHeader, "pageHeader"); + //mixin ObjcBindMethod!(pageFooter, "pageFooter"); + //mixin ObjcBindMethod!(drawSheetBorderWithSize, "drawSheetBorderWithSize:"); + //mixin ObjcBindMethod!(printJobTitle, "printJobTitle"); + //mixin ObjcBindMethod!(beginDocument, "beginDocument"); + //mixin ObjcBindMethod!(endDocument, "endDocument"); + //mixin ObjcBindMethod!(beginPageInRect, "beginPageInRect:atPlacement:"); + //mixin ObjcBindMethod!(endPage, "endPage"); + +`; + +class NSView : NSResponder +{ + mixin (ObjcWrap); + + NSView initWithFrame (NSRect frameRect) + { + id result = invokeObjcSelf!(id, "initWithFrame:", NSRect)(frameRect); + return result is this.objcObject ? this : (result !is null ? new NSView(result) : null); + } + + this (NSRect frameRect) + { + super(NSView.alloc.initWithFrame(frameRect).objcObject); + } + + NSWindow window () + { + return invokeObjcSelf!(NSWindow, "window"); + } + + NSView superview () + { + id result = invokeObjcSelf!(id, "superview"); + return result is this.objcObject ? this : (result !is null ? new NSView(result) : null); + } + + NSArray subviews () + { + return invokeObjcSelf!(NSArray, "subviews"); + } + + bool isDescendantOf (NSView aView) + { + return invokeObjcSelf!(bool, "isDescendantOf:", NSView)(aView); + } + + NSView ancestorSharedWithView (NSView aView) + { + id result = invokeObjcSelf!(id, "ancestorSharedWithView:", NSView)(aView); + return result is this.objcObject ? this : (result !is null ? new NSView(result) : null); + } + + NSView opaqueAncestor () + { + id result = invokeObjcSelf!(id, "opaqueAncestor"); + return result is this.objcObject ? this : (result !is null ? new NSView(result) : null); + } + + void setHidden (bool flag) + { + return invokeObjcSelf!(void, "setHidden:", bool)(flag); + } + + bool isHidden () + { + return invokeObjcSelf!(bool, "isHidden"); + } + + bool isHiddenOrHasHiddenAncestor () + { + return invokeObjcSelf!(bool, "isHiddenOrHasHiddenAncestor"); + } + + void getRectsBeingDrawn (out NSRect* rects, out NSInteger count) + { + return invokeObjcSelf!(void, "getRectsBeingDrawn:count:", NSRect**, NSInteger*)(&rects, &count); + } + + bool needsToDrawRect (NSRect aRect) + { + return invokeObjcSelf!(bool, "needsToDrawRect:", NSRect)(aRect); + } + + bool wantsDefaultClipping () + { + return invokeObjcSelf!(bool, "wantsDefaultClipping"); + } + + void viewDidHide () + { + return invokeObjcSelf!(void, "viewDidHide"); + } + + void viewDidUnhide () + { + return invokeObjcSelf!(void, "viewDidUnhide"); + } + + void setSubviews (NSArray newSubviews) + { + return invokeObjcSelf!(void, "setSubviews:", NSArray)(newSubviews); + } + + void addSubview (NSView aView) + { + return invokeObjcSelf!(void, "addSubview:", NSView)(aView); + } + + void addSubview (NSView aView, int place, NSView otherView) + { + return invokeObjcSelf!(void, "addSubview:positioned:relativeTo:", NSView, int, NSView)(aView, place, otherView); + } + + void sortSubviewsUsingFunction (Compare compare, void* context) + { + return invokeObjcSelf!(void, "sortSubviewsUsingFunction:context:", Compare, void*)(compare, context); + } + + void viewWillMoveToWindow (NSWindow newWindow) + { + return invokeObjcSelf!(void, "viewWillMoveToWindow:", NSWindow)(newWindow); + } + + void viewDidMoveToWindow () + { + return invokeObjcSelf!(void, "viewDidMoveToWindow"); + } + + void viewWillMoveToSuperview (NSView newSuperview) + { + return invokeObjcSelf!(void, "viewWillMoveToSuperview:", NSView)(newSuperview); + } + + void viewDidMoveToSuperview () + { + return invokeObjcSelf!(void, "viewDidMoveToSuperview"); + } + + void didAddSubview (NSView subview) + { + return invokeObjcSelf!(void, "didAddSubview:", NSView)(subview); + } + + void willRemoveSubview (NSView subview) + { + return invokeObjcSelf!(void, "willRemoveSubview:", NSView)(subview); + } + + void removeFromSuperview () + { + return invokeObjcSelf!(void, "removeFromSuperview"); + } + + void replaceSubview (NSView oldView, NSView newView) + { + return invokeObjcSelf!(void, "replaceSubview:with:", NSView, NSView)(oldView, newView); + } + + void removeFromSuperviewWithoutNeedingDisplay () + { + return invokeObjcSelf!(void, "removeFromSuperviewWithoutNeedingDisplay"); + } + + void setPostsFrameChangedNotifications (bool flag) + { + return invokeObjcSelf!(void, "setPostsFrameChangedNotifications:", bool)(flag); + } + + bool postsFrameChangedNotifications () + { + return invokeObjcSelf!(bool, "postsFrameChangedNotifications"); + } + + void resizeSubviewsWithOldSize (NSSize oldSize) + { + return invokeObjcSelf!(void, "resizeSubviewsWithOldSize:", NSSize)(oldSize); + } + + void resizeWithOldSuperviewSize (NSSize oldSize) + { + return invokeObjcSelf!(void, "resizeWithOldSuperviewSize:", NSSize)(oldSize); + } + + void setAutoresizesSubviews (bool flag) + { + return invokeObjcSelf!(void, "setAutoresizesSubviews:", bool)(flag); + } + + bool autoresizesSubviews () + { + return invokeObjcSelf!(bool, "autoresizesSubviews"); + } + + void setAutoresizingMask (NSUInteger mask) + { + return invokeObjcSelf!(void, "setAutoresizingMask:", NSUInteger)(mask); + } + + NSUInteger autoresizingMask () + { + return invokeObjcSelf!(NSUInteger, "autoresizingMask"); + } + + void setFrameOrigin (NSPoint newOrigin) + { + return invokeObjcSelf!(void, "setFrameOrigin:", NSPoint)(newOrigin); + } + + void setFrameSize (NSSize newSize) + { + return invokeObjcSelf!(void, "setFrameSize:", NSSize)(newSize); + } + + void setFrame (NSRect frameRect) + { + return invokeObjcSelf!(void, "setFrame:", NSRect)(frameRect); + } + + NSRect frame () + { + return invokeObjcSelf!(NSRect, "frame"); + } + + void setFrameRotation (CGFloat angle) + { + return invokeObjcSelf!(void, "setFrameRotation:", CGFloat)(angle); + } + + CGFloat frameRotation () + { + return invokeObjcSelf!(CGFloat, "frameRotation"); + } + + void setFrameCenterRotation (CGFloat angle) + { + return invokeObjcSelf!(void, "setFrameCenterRotation:", CGFloat)(angle); + } + + CGFloat frameCenterRotation () + { + return invokeObjcSelf!(CGFloat, "frameCenterRotation"); + } + + void setBoundsOrigin (NSPoint newOrigin) + { + return invokeObjcSelf!(void, "setBoundsOrigin:", NSPoint)(newOrigin); + } + + void setBoundsSize (NSSize newSize) + { + return invokeObjcSelf!(void, "setBoundsSize:", NSSize)(newSize); + } + + void setBoundsRotation (CGFloat angle) + { + return invokeObjcSelf!(void, "setBoundsRotation:", CGFloat)(angle); + } + + CGFloat boundsRotation () + { + return invokeObjcSelf!(CGFloat, "boundsRotation"); + } + + void translateOriginToPoint (NSPoint translation) + { + return invokeObjcSelf!(void, "translateOriginToPoint:", NSPoint)(translation); + } + + void scaleUnitSquareToSize (NSSize newUnitSize) + { + return invokeObjcSelf!(void, "scaleUnitSquareToSize:", NSSize)(newUnitSize); + } + + void rotateByAngle (CGFloat angle) + { + return invokeObjcSelf!(void, "rotateByAngle:", CGFloat)(angle); + } + + void setBounds (NSRect aRect) + { + return invokeObjcSelf!(void, "setBounds:", NSRect)(aRect); + } + + NSRect bounds () + { + return invokeObjcSelf!(NSRect, "bounds"); + } + + bool isFlipped () + { + return invokeObjcSelf!(bool, "isFlipped"); + } + + bool isRotatedFromBase () + { + return invokeObjcSelf!(bool, "isRotatedFromBase"); + } + + bool isRotatedOrScaledFromBase () + { + return invokeObjcSelf!(bool, "isRotatedOrScaledFromBase"); + } + + bool isOpaque () + { + return invokeObjcSelf!(bool, "isOpaque"); + } + + NSPoint convertPoint (NSPoint aPoint, NSView aView) + { + return invokeObjcSelf!(NSPoint, "convertPoint:fromView:", NSPoint, NSView)(aPoint, aView); + } + + NSPoint convertPoint (NSPoint aPoint, NSView aView) + { + return invokeObjcSelf!(NSPoint, "convertPoint:toView:", NSPoint, NSView)(aPoint, aView); + } + + NSSize convertSize (NSSize aSize, NSView aView) + { + return invokeObjcSelf!(NSSize, "convertSize:fromView:", NSSize, NSView)(aSize, aView); + } + + NSSize convertSize (NSSize aSize, NSView aView) + { + return invokeObjcSelf!(NSSize, "convertSize:toView:", NSSize, NSView)(aSize, aView); + } + + NSRect convertRect (NSRect aRect, NSView aView) + { + return invokeObjcSelf!(NSRect, "convertRect:fromView:", NSRect, NSView)(aRect, aView); + } + + NSRect convertRect (NSRect aRect, NSView aView) + { + return invokeObjcSelf!(NSRect, "convertRect:toView:", NSRect, NSView)(aRect, aView); + } + + NSRect centerScanRect (NSRect aRect) + { + return invokeObjcSelf!(NSRect, "centerScanRect:", NSRect)(aRect); + } + + NSPoint convertPointToBase (NSPoint aPoint) + { + return invokeObjcSelf!(NSPoint, "convertPointToBase:", NSPoint)(aPoint); + } + + NSPoint convertPointFromBase (NSPoint aPoint) + { + return invokeObjcSelf!(NSPoint, "convertPointFromBase:", NSPoint)(aPoint); + } + + NSSize convertSizeToBase (NSSize aSize) + { + return invokeObjcSelf!(NSSize, "convertSizeToBase:", NSSize)(aSize); + } + + NSSize convertSizeFromBase (NSSize aSize) + { + return invokeObjcSelf!(NSSize, "convertSizeFromBase:", NSSize)(aSize); + } + + NSRect convertRectToBase (NSRect aRect) + { + return invokeObjcSelf!(NSRect, "convertRectToBase:", NSRect)(aRect); + } + + NSRect convertRectFromBase (NSRect aRect) + { + return invokeObjcSelf!(NSRect, "convertRectFromBase:", NSRect)(aRect); + } + + bool canDraw () + { + return invokeObjcSelf!(bool, "canDraw"); + } + + void setNeedsDisplay (bool flag) + { + return invokeObjcSelf!(void, "setNeedsDisplay:", bool)(flag); + } + + void setNeedsDisplayInRect (NSRect invalidRect) + { + return invokeObjcSelf!(void, "setNeedsDisplayInRect:", NSRect)(invalidRect); + } + + bool needsDisplay () + { + return invokeObjcSelf!(bool, "needsDisplay"); + } + + void lockFocus () + { + return invokeObjcSelf!(void, "lockFocus"); + } + + void unlockFocus () + { + return invokeObjcSelf!(void, "unlockFocus"); + } + + bool lockFocusIfCanDraw () + { + return invokeObjcSelf!(bool, "lockFocusIfCanDraw"); + } + + bool lockFocusIfCanDrawInContext (NSGraphicsContext context) + { + return invokeObjcSelf!(bool, "lockFocusIfCanDrawInContext:", NSGraphicsContext)(context); + } + + static NSView focusView () + { + return invokeObjcSelfClass!(NSView, "focusView"); + } + + NSRect visibleRect () + { + return invokeObjcSelf!(NSRect, "visibleRect"); + } + + void display () + { + return invokeObjcSelf!(void, "display"); + } + + void displayIfNeeded () + { + return invokeObjcSelf!(void, "displayIfNeeded"); + } + + void displayIfNeededIgnoringOpacity () + { + return invokeObjcSelf!(void, "displayIfNeededIgnoringOpacity"); + } + + void displayRect (NSRect rect) + { + return invokeObjcSelf!(void, "displayRect:", NSRect)(rect); + } + + void displayIfNeededInRect (NSRect rect) + { + return invokeObjcSelf!(void, "displayIfNeededInRect:", NSRect)(rect); + } + + void displayRectIgnoringOpacity (NSRect rect) + { + return invokeObjcSelf!(void, "displayRectIgnoringOpacity:", NSRect)(rect); + } + + void displayIfNeededInRectIgnoringOpacity (NSRect rect) + { + return invokeObjcSelf!(void, "displayIfNeededInRectIgnoringOpacity:", NSRect)(rect); + } + + void drawRect (NSRect rect) + { + return invokeObjcSelf!(void, "drawRect:", NSRect)(rect); + } + + void displayRectIgnoringOpacity (NSRect aRect, NSGraphicsContext context) + { + return invokeObjcSelf!(void, "displayRectIgnoringOpacity:inContext:", NSRect, NSGraphicsContext)(aRect, context); + } + + NSBitmapImageRep bitmapImageRepForCachingDisplayInRect (NSRect rect) + { + return invokeObjcSelf!(NSBitmapImageRep, "bitmapImageRepForCachingDisplayInRect:", NSRect)(rect); + } + + void cacheDisplayInRect (NSRect rect, NSBitmapImageRep bitmapImageRep) + { + return invokeObjcSelf!(void, "cacheDisplayInRect:toBitmapImageRep:", NSRect, NSBitmapImageRep)(rect, bitmapImageRep); + } + + void viewWillDraw () + { + return invokeObjcSelf!(void, "viewWillDraw"); + } + + NSInteger gState () + { + return invokeObjcSelf!(NSInteger, "gState"); + } + + void releaseGState () + { + return invokeObjcSelf!(void, "releaseGState"); + } + + void setUpGState () + { + return invokeObjcSelf!(void, "setUpGState"); + } + + void renewGState () + { + return invokeObjcSelf!(void, "renewGState"); + } + + void scrollPoint (NSPoint aPoint) + { + return invokeObjcSelf!(void, "scrollPoint:", NSPoint)(aPoint); + } + + bool scrollRectToVisible (NSRect aRect) + { + return invokeObjcSelf!(bool, "scrollRectToVisible:", NSRect)(aRect); + } + + bool autoscroll (NSEvent theEvent) + { + return invokeObjcSelf!(bool, "autoscroll:", NSEvent)(theEvent); + } + + NSRect adjustScroll (NSRect newVisible) + { + return invokeObjcSelf!(NSRect, "adjustScroll:", NSRect)(newVisible); + } + + void scrollRect (NSRect aRect, NSSize delta) + { + return invokeObjcSelf!(void, "scrollRect:by:", NSRect, NSSize)(aRect, delta); + } + + void translateRectsNeedingDisplayInRect (NSRect clipRect, NSSize delta) + { + return invokeObjcSelf!(void, "translateRectsNeedingDisplayInRect:by:", NSRect, NSSize)(clipRect, delta); + } + + NSView hitTest (NSPoint aPoint) + { + id result = invokeObjcSelf!(id, "hitTest:", NSPoint)(aPoint); + return result is this.objcObject ? this : (result !is null ? new NSView(result) : null); + } + + bool mouse (NSPoint aPoint, NSRect aRect) + { + return invokeObjcSelf!(bool, "mouse:inRect:", NSPoint, NSRect)(aPoint, aRect); + } + + Object viewWithTag (NSInteger aTag) + { + return invokeObjcSelf!(Object, "viewWithTag:", NSInteger)(aTag); + } + + NSInteger tag () + { + return invokeObjcSelf!(NSInteger, "tag"); + } + + bool performKeyEquivalent (NSEvent theEvent) + { + return invokeObjcSelf!(bool, "performKeyEquivalent:", NSEvent)(theEvent); + } + + bool acceptsFirstMouse (NSEvent theEvent) + { + return invokeObjcSelf!(bool, "acceptsFirstMouse:", NSEvent)(theEvent); + } + + bool shouldDelayWindowOrderingForEvent (NSEvent theEvent) + { + return invokeObjcSelf!(bool, "shouldDelayWindowOrderingForEvent:", NSEvent)(theEvent); + } + + bool needsPanelToBecomeKey () + { + return invokeObjcSelf!(bool, "needsPanelToBecomeKey"); + } + + bool mouseDownCanMoveWindow () + { + return invokeObjcSelf!(bool, "mouseDownCanMoveWindow"); + } + + void addCursorRect (NSRect aRect, NSCursor anObj) + { + return invokeObjcSelf!(void, "addCursorRect:cursor:", NSRect, NSCursor)(aRect, anObj); + } + + void removeCursorRect (NSRect aRect, NSCursor anObj) + { + return invokeObjcSelf!(void, "removeCursorRect:cursor:", NSRect, NSCursor)(aRect, anObj); + } + + void discardCursorRects () + { + return invokeObjcSelf!(void, "discardCursorRects"); + } + + void resetCursorRects () + { + return invokeObjcSelf!(void, "resetCursorRects"); + } + + int addTrackingRect (NSRect aRect, Object anObject, void* data, bool flag) + { + return invokeObjcSelf!(int, "addTrackingRect:owner:userData:assumeInside:", NSRect, Object, void*, bool)(aRect, anObject, data, flag); + } + + void removeTrackingRect (int tag) + { + return invokeObjcSelf!(void, "removeTrackingRect:", int)(tag); + } + + void setWantsLayer (bool flag) + { + return invokeObjcSelf!(void, "setWantsLayer:", bool)(flag); + } + + bool wantsLayer () + { + return invokeObjcSelf!(bool, "wantsLayer"); + } + + void setLayer (CALayer newLayer) + { + return invokeObjcSelf!(void, "setLayer:", CALayer)(newLayer); + } + + CALayer layer () + { + return invokeObjcSelf!(CALayer, "layer"); + } + + void setAlphaValue (CGFloat viewAlpha) + { + return invokeObjcSelf!(void, "setAlphaValue:", CGFloat)(viewAlpha); + } + + CGFloat alphaValue () + { + return invokeObjcSelf!(CGFloat, "alphaValue"); + } + + void setBackgroundFilters (NSArray filters) + { + return invokeObjcSelf!(void, "setBackgroundFilters:", NSArray)(filters); + } + + NSArray backgroundFilters () + { + return invokeObjcSelf!(NSArray, "backgroundFilters"); + } + + void setCompositingFilter (CIFilter filter) + { + return invokeObjcSelf!(void, "setCompositingFilter:", CIFilter)(filter); + } + + CIFilter compositingFilter () + { + return invokeObjcSelf!(CIFilter, "compositingFilter"); + } + + void setContentFilters (NSArray filters) + { + return invokeObjcSelf!(void, "setContentFilters:", NSArray)(filters); + } + + NSArray contentFilters () + { + return invokeObjcSelf!(NSArray, "contentFilters"); + } + + void setShadow (NSShadow shadow) + { + return invokeObjcSelf!(void, "setShadow:", NSShadow)(shadow); + } + + NSShadow shadow () + { + return invokeObjcSelf!(NSShadow, "shadow"); + } + + void addTrackingArea (NSTrackingArea trackingArea) + { + return invokeObjcSelf!(void, "addTrackingArea:", NSTrackingArea)(trackingArea); + } + + void removeTrackingArea (NSTrackingArea trackingArea) + { + return invokeObjcSelf!(void, "removeTrackingArea:", NSTrackingArea)(trackingArea); + } + + NSArray trackingAreas () + { + return invokeObjcSelf!(NSArray, "trackingAreas"); + } + + void updateTrackingAreas () + { + return invokeObjcSelf!(void, "updateTrackingAreas"); + } + + bool shouldDrawColor () + { + return invokeObjcSelf!(bool, "shouldDrawColor"); + } + + void setPostsBoundsChangedNotifications (bool flag) + { + return invokeObjcSelf!(void, "setPostsBoundsChangedNotifications:", bool)(flag); + } + + bool postsBoundsChangedNotifications () + { + return invokeObjcSelf!(bool, "postsBoundsChangedNotifications"); + } + + NSScrollView enclosingScrollView () + { + return invokeObjcSelf!(NSScrollView, "enclosingScrollView"); + } + + NSMenu menuForEvent (NSEvent event) + { + return invokeObjcSelf!(NSMenu, "menuForEvent:", NSEvent)(event); + } + + static NSMenu defaultMenu () + { + return invokeObjcSelfClass!(NSMenu, "defaultMenu"); + } + + void setToolTip (NSString string) + { + return invokeObjcSelf!(void, "setToolTip:", NSString)(string); + } + + NSString toolTip () + { + return invokeObjcSelf!(NSString, "toolTip"); + } + + int addToolTipRect (NSRect aRect, Object anObject, void* data) + { + return invokeObjcSelf!(int, "addToolTipRect:owner:userData:", NSRect, Object, void*)(aRect, anObject, data); + } + + void removeToolTip (int tag) + { + return invokeObjcSelf!(void, "removeToolTip:", int)(tag); + } + + void removeAllToolTips () + { + return invokeObjcSelf!(void, "removeAllToolTips"); + } + + void viewWillStartLiveResize () + { + return invokeObjcSelf!(void, "viewWillStartLiveResize"); + } + + void viewDidEndLiveResize () + { + return invokeObjcSelf!(void, "viewDidEndLiveResize"); + } + + bool inLiveResize () + { + return invokeObjcSelf!(bool, "inLiveResize"); + } + + bool preservesContentDuringLiveResize () + { + return invokeObjcSelf!(bool, "preservesContentDuringLiveResize"); + } + + NSRect rectPreservedDuringLiveResize () + { + return invokeObjcSelf!(NSRect, "rectPreservedDuringLiveResize"); + } + + void getRectsExposedDuringLiveResize (NSRect* exposedRects, NSInteger* count) + { + return invokeObjcSelf!(void, "getRectsExposedDuringLiveResize:count:", NSRect*, NSInteger*)(exposedRects, count); + } + + // NSDrag + void dragImage (NSImage anImage, NSPoint viewLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, Object sourceObj, bool slideFlag) + { + return invokeObjcSelf!(void, "dragImage:at:offset:event:pasteboard:source:slideBack:", NSImage, NSPoint, NSSize, NSEvent, NSPasteboard, Object, bool)(anImage, viewLocation, initialOffset, event, pboard, sourceObj, slideFlag); + } + + NSArray registeredDraggedTypes () + { + return invokeObjcSelf!(NSArray, "registeredDraggedTypes"); + } + + void registerForDraggedTypes (NSArray newTypes) + { + return invokeObjcSelf!(void, "registerForDraggedTypes:", NSArray)(newTypes); + } + + void unregisterDraggedTypes () + { + return invokeObjcSelf!(void, "unregisterDraggedTypes"); + } + + bool dragFile (NSString filename, NSRect rect, bool aFlag, NSEvent event) + { + return invokeObjcSelf!(bool, "dragFile:fromRect:slideBack:event:", NSString, NSRect, bool, NSEvent)(filename, rect, aFlag, event); + } + + bool dragPromisedFilesOfTypes (NSArray typeArray, NSRect rect, Object sourceObject, bool aFlag, NSEvent event) + { + return invokeObjcSelf!(bool, "dragPromisedFilesOfTypes:fromRect:source:slideBack:event:", NSArray, NSRect, Object, bool, NSEvent)(typeArray, rect, sourceObject, aFlag, event); + } + + // NSFullScreenMode + bool enterFullScreenMode (NSScreen screen, NSDictionary options) + { + return invokeObjcSelf!(bool, "enterFullScreenMode:withOptions:", NSScreen, NSDictionary)(screen, options); + } + + void exitFullScreenModeWithOptions (NSDictionary options) + { + return invokeObjcSelf!(void, "exitFullScreenModeWithOptions:", NSDictionary)(options); + } + + bool isInFullScreenMode () + { + return invokeObjcSelf!(bool, "isInFullScreenMode"); + } + + // NSPrinting + void writeEPSInsideRect (NSRect rect, NSPasteboard pasteboard) + { + return invokeObjcSelf!(void, "writeEPSInsideRect:toPasteboard:", NSRect, NSPasteboard)(rect, pasteboard); + } + + NSData dataWithEPSInsideRect (NSRect rect) + { + return invokeObjcSelf!(NSData, "dataWithEPSInsideRect:", NSRect)(rect); + } + + void writePDFInsideRect (NSRect rect, NSPasteboard pasteboard) + { + return invokeObjcSelf!(void, "writePDFInsideRect:toPasteboard:", NSRect, NSPasteboard)(rect, pasteboard); + } + + NSData dataWithPDFInsideRect (NSRect rect) + { + return invokeObjcSelf!(NSData, "dataWithPDFInsideRect:", NSRect)(rect); + } + + void print (Object sender) + { + return invokeObjcSelf!(void, "print:", Object)(sender); + } + + bool knowsPageRange (NSRangePointer range) + { + return invokeObjcSelf!(bool, "knowsPageRange:", NSRangePointer)(range); + } + + CGFloat heightAdjustLimit () + { + return invokeObjcSelf!(CGFloat, "heightAdjustLimit"); + } + + CGFloat widthAdjustLimit () + { + return invokeObjcSelf!(CGFloat, "widthAdjustLimit"); + } + + void adjustPageWidthNew (CGFloat* newRight, CGFloat oldLeft, CGFloat oldRight, CGFloat rightLimit) + { + return invokeObjcSelf!(void, "adjustPageWidthNew:left:right:limit:", CGFloat*, CGFloat, CGFloat, CGFloat)(newRight, oldLeft, oldRight, rightLimit); + } + + void adjustPageHeightNew (CGFloat* newBottom, CGFloat oldTop, CGFloat oldBottom, CGFloat bottomLimit) + { + return invokeObjcSelf!(void, "adjustPageHeightNew:top:bottom:limit:", CGFloat*, CGFloat, CGFloat, CGFloat)(newBottom, oldTop, oldBottom, bottomLimit); + } + + NSRect rectForPage (NSInteger page) + { + return invokeObjcSelf!(NSRect, "rectForPage:", NSInteger)(page); + } + + NSPoint locationOfPrintRect (NSRect aRect) + { + return invokeObjcSelf!(NSPoint, "locationOfPrintRect:", NSRect)(aRect); + } + + void drawPageBorderWithSize (NSSize borderSize) + { + return invokeObjcSelf!(void, "drawPageBorderWithSize:", NSSize)(borderSize); + } + + NSAttributedString pageHeader () + { + return invokeObjcSelf!(NSAttributedString, "pageHeader"); + } + + NSAttributedString pageFooter () + { + return invokeObjcSelf!(NSAttributedString, "pageFooter"); + } + + void drawSheetBorderWithSize (NSSize borderSize) + { + return invokeObjcSelf!(void, "drawSheetBorderWithSize:", NSSize)(borderSize); + } + + NSString printJobTitle () + { + return invokeObjcSelf!(NSString, "printJobTitle"); + } + + void beginDocument () + { + return invokeObjcSelf!(void, "beginDocument"); + } + + void endDocument () + { + return invokeObjcSelf!(void, "endDocument"); + } + + void beginPageInRect (NSRect aRect, NSPoint location) + { + return invokeObjcSelf!(void, "beginPageInRect:atPlacement:", NSRect, NSPoint)(aRect, location); + } + + void endPage () + { + return invokeObjcSelf!(void, "endPage"); + } + + // NSViewEnclosingMenuItem + NSMenuItem enclosingMenuItem () + { + return invokeObjcSelf!(NSMenuItem, "enclosingMenuItem"); + } + + // NSRulerMarkerClientViewDelegation + bool rulerView_shouldMoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(bool, "rulerView:shouldMoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + CGFloat rulerView (NSRulerView ruler, NSRulerMarker marker, CGFloat location) + { + return invokeObjcSelf!(CGFloat, "rulerView:willMoveMarker:toLocation:", NSRulerView, NSRulerMarker, CGFloat)(ruler, marker, location); + } + + void rulerView (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didMoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView_shouldRemoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:shouldRemoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView_didRemoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didRemoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + bool rulerView_shouldAddMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(bool, "rulerView:shouldAddMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + CGFloat rulerView_willAddMarker_atLocation (NSRulerView ruler, NSRulerMarker marker, CGFloat location) + { + return invokeObjcSelf!(CGFloat, "rulerView:willAddMarker:atLocation:", NSRulerView, NSRulerMarker, CGFloat)(ruler, marker, location); + } + + void rulerView_didAddMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didAddMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView (NSRulerView ruler, NSEvent event) + { + return invokeObjcSelf!(void, "rulerView:handleMouseDown:", NSRulerView, NSEvent)(ruler, event); + } + + CGFloat rulerView (NSRulerView ruler, NSView newClient) + { + return invokeObjcSelf!(CGFloat, "rulerView:willSetClientView:", NSRulerView, NSView)(ruler, newClient); + } + + // NSClipViewSuperview + void reflectScrolledClipView (NSClipView aClipView) + { + return invokeObjcSelf!(void, "reflectScrolledClipView:", NSClipView)(aClipView); + } + + void scrollClipView (NSClipView aClipView, NSPoint aPoint) + { + return invokeObjcSelf!(void, "scrollClipView:toPoint:", NSClipView, NSPoint)(aClipView, aPoint); + } +} \ No newline at end of file