diff --git a/bindings/pascocoa/appkit/NSApplication.inc b/bindings/pascocoa/appkit/NSApplication.inc index 9407d5546..a5aecbf61 100644 --- a/bindings/pascocoa/appkit/NSApplication.inc +++ b/bindings/pascocoa/appkit/NSApplication.inc @@ -106,15 +106,14 @@ const //@class NSDate, NSDictionary, NSError, NSException, NSNotification; //@class NSGraphicsContext, NSImage, NSPasteboard, NSWindow; - NSWindow = class; - +// NSWindow = class; { The version of the AppKit framework } //APPKIT_EXTERN const double NSAppKitVersionNumber; NSApplication = class(NSResponder) public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public constructor sharedApplication; @@ -363,7 +362,7 @@ If not specified, obtain from CFBundleShortVersionString key in infoDictionary. {$endif} {$ifdef IMPLEMENTATION} -function NSApplication.getClass: objc.id; +class function NSApplication.getClass: objc.id; begin Result := objc_getClass(Str_NSApplication); end; diff --git a/bindings/pascocoa/appkit/NSButton.inc b/bindings/pascocoa/appkit/NSButton.inc index bc0bec3c3..9ce224bd0 100644 --- a/bindings/pascocoa/appkit/NSButton.inc +++ b/bindings/pascocoa/appkit/NSButton.inc @@ -1,129 +1,446 @@ -{%mainunit appkit.pas} -{ +(* NSButton.h Application Kit Copyright (c) 1994-2005, Apple Computer, Inc. All rights reserved. -} +*) {$ifdef HEADER} {$ifndef NSBUTTON_PAS_H} {$define NSBUTTON_PAS_H} -const - Str_NSButton = 'NSButton'; - - Str_setTitle = 'setTitle:'; - Str_setBezelStyle = 'setBezelStyle:'; +{$include NSControl.inc} +{$include NSButtonCell.inc} +{$include NSImage.inc} {$endif} {$endif} + +{$ifdef FORWARD} +{$ifndef NSBUTTON_PAS__FORWARD} +{$define NSBUTTON_PAS__FORWARD} + + NSButton = class; + +{$endif} +{$endif} + {$ifdef CLASSES} {$ifndef NSBUTTON_PAS_C} {$define NSBUTTON_PAS_C} {$include NSControl.inc} {$include NSButtonCell.inc} +{$include NSImage.inc} -//@class NSSound; + { NSButton } NSButton = class(NSControl) public - { Extra binding functions } - function getClass: objc.id; override; - public -//- (NSString *)title; - procedure setTitle(aString: CFStringRef); -{- (NSString *)alternateTitle; -- (void)setAlternateTitle:(NSString *)aString; -- (NSImage *)image; -- (void)setImage:(NSImage *)image; -- (NSImage *)alternateImage; -- (void)setAlternateImage:(NSImage *)image; -- (NSCellImagePosition)imagePosition; -- (void)setImagePosition:(NSCellImagePosition)aPosition; -- (void)setButtonType:(NSButtonType)aType; -- (int)state; -- (void)setState:(int)value; -- (BOOL)isBordered; -- (void)setBordered:(BOOL)flag; -- (BOOL)isTransparent; -- (void)setTransparent:(BOOL)flag; -- (void)setPeriodicDelay:(float)delay interval:(float)interval; -- (void)getPeriodicDelay:(float *)delay interval:(float *)interval; -- (NSString *)keyEquivalent; -- (void)setKeyEquivalent:(NSString *)charCode; -- (unsigned int)keyEquivalentModifierMask; -- (void)setKeyEquivalentModifierMask:(unsigned int)mask; -- (void)highlight:(BOOL)flag; -- (BOOL)performKeyEquivalent:(NSEvent *)key; - -@end - -@interface NSButton(NSKeyboardUI) -- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand; -@end - -@interface NSButton(NSButtonAttributedStringMethods) -- (NSAttributedString *)attributedTitle; -- (void)setAttributedTitle:(NSAttributedString *)aString; -- (NSAttributedString *)attributedAlternateTitle; -- (void)setAttributedAlternateTitle:(NSAttributedString *)obj; -@end} - -//@interface NSButton(NSButtonBezelStyles) - procedure setBezelStyle(bezelStyle: NSBezelStyle); -//- (NSBezelStyle)bezelStyle; -//@end - -{@interface NSButton(NSButtonMixedState) -- (void)setAllowsMixedState:(BOOL)flag; -- (BOOL)allowsMixedState; -- (void)setNextState; -@end - -@interface NSButton(NSButtonBorder) -- (void) setShowsBorderOnlyWhileMouseInside:(BOOL)show; -- (BOOL) showsBorderOnlyWhileMouseInside; -@end - -@interface NSButton (NSButtonSoundExtensions) -- (void)setSound:(NSSound *)aSound; -- (NSSound *)sound; -@end} - + class function getClass: objc.id; override; + function title: CFStringRef; + procedure setTitle(_aString: CFStringRef); + function alternateTitle: CFStringRef; + procedure setAlternateTitle(_aString: CFStringRef); + function image: NSImage; + procedure setImage(_image: NSImage); + function alternateImage: NSImage; + procedure setAlternateImage(_image: NSImage); + function imagePosition: NSCellImagePosition; + procedure setImagePosition(_aPosition: NSCellImagePosition); + procedure setButtonType(_aType: NSButtonType); + function state: Integer; + procedure setState(_value: Integer); + function isBordered: LongBool; + procedure setBordered(_flag: LongBool); + function isTransparent: LongBool; + procedure setTransparent(_flag: LongBool); + procedure setPeriodicDelay_interval(_delay: Single; _interval: Single); + procedure getPeriodicDelay_interval(_delay: Single; _interval: Single); + function keyEquivalent: CFStringRef; + procedure setKeyEquivalent(_charCode: CFStringRef); + function keyEquivalentModifierMask: LongWord; + procedure setKeyEquivalentModifierMask(_mask: LongWord); + procedure highlight(_flag: LongBool); +// function performKeyEquivalent(_key: NSEvent): LongBool; + procedure setTitleWithMnemonic(_stringWithAmpersand: CFStringRef); + function attributedTitle: objc.id;{NSAttributedString} + procedure setAttributedTitle(_aString: objc.id {NSAttributedString}); + function attributedAlternateTitle: objc.id;{NSAttributedString} + procedure setAttributedAlternateTitle(_obj: objc.id {NSAttributedString}); + procedure setBezelStyle(_bezelStyle: NSBezelStyle); + function bezelStyle: NSBezelStyle; + procedure setAllowsMixedState(_flag: LongBool); + function allowsMixedState: LongBool; + procedure setNextState; + procedure setShowsBorderOnlyWhileMouseInside(_show: LongBool); + function showsBorderOnlyWhileMouseInside: LongBool; + procedure setSound(_aSound: objc.id {NSSound}); + function sound: objc.id;{NSSound} end; {$endif} {$endif} + {$ifdef IMPLEMENTATION} +const + StrNSButton_NSButton = 'NSButton'; + StrNSButton_title = 'title'; + StrNSButton_setTitle = 'setTitle:'; + StrNSButton_alternateTitle = 'alternateTitle'; + StrNSButton_setAlternateTitle = 'setAlternateTitle:'; + StrNSButton_image = 'image'; + StrNSButton_setImage = 'setImage:'; + StrNSButton_alternateImage = 'alternateImage'; + StrNSButton_setAlternateImage = 'setAlternateImage:'; + StrNSButton_imagePosition = 'imagePosition'; + StrNSButton_setImagePosition = 'setImagePosition:'; + StrNSButton_setButtonType = 'setButtonType:'; + StrNSButton_state = 'state'; + StrNSButton_setState = 'setState:'; + StrNSButton_isBordered = 'isBordered'; + StrNSButton_setBordered = 'setBordered:'; + StrNSButton_isTransparent = 'isTransparent'; + StrNSButton_setTransparent = 'setTransparent:'; + StrNSButton_setPeriodicDelay_interval = 'setPeriodicDelay:interval:'; + StrNSButton_getPeriodicDelay_interval = 'getPeriodicDelay:interval:'; + StrNSButton_keyEquivalent = 'keyEquivalent'; + StrNSButton_setKeyEquivalent = 'setKeyEquivalent:'; + StrNSButton_keyEquivalentModifierMask = 'keyEquivalentModifierMask'; + StrNSButton_setKeyEquivalentModifierMask = 'setKeyEquivalentModifierMask:'; + StrNSButton_highlight = 'highlight:'; + StrNSButton_performKeyEquivalent = 'performKeyEquivalent:'; -function NSButton.getClass: objc.id; + StrNSButton_setTitleWithMnemonic = 'setTitleWithMnemonic:'; + + StrNSButton_attributedTitle = 'attributedTitle'; + StrNSButton_setAttributedTitle = 'setAttributedTitle:'; + StrNSButton_attributedAlternateTitle = 'attributedAlternateTitle'; + StrNSButton_setAttributedAlternateTitle = 'setAttributedAlternateTitle:'; + + StrNSButton_setBezelStyle = 'setBezelStyle:'; + StrNSButton_bezelStyle = 'bezelStyle'; + + StrNSButton_setAllowsMixedState = 'setAllowsMixedState:'; + StrNSButton_allowsMixedState = 'allowsMixedState'; + StrNSButton_setNextState = 'setNextState'; + + StrNSButton_setShowsBorderOnlyWhileMouseInside = 'setShowsBorderOnlyWhileMouseInside:'; + StrNSButton_showsBorderOnlyWhileMouseInside = 'showsBorderOnlyWhileMouseInside'; + + StrNSButton_setSound = 'setSound:'; + StrNSButton_sound = 'sound'; + +{ NSButton } + +class function NSButton.getClass: objc.id; begin - Result := objc_getClass(Str_NSButton); + Result := objc_getClass(StrNSButton_NSButton); end; -procedure NSButton.setTitle(aString: CFStringRef); -type - setTitle_t = procedure (param1: objc.id; param2: SEL; - param3: CFStringRef); cdecl; -var - vmethod: setTitle_t; +function NSButton.title: CFStringRef; begin - vmethod := setTitle_t(@objc_msgSend); - vmethod(Handle, sel_registerName(PChar(Str_setTitle)), aString); + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_title)), [])); end; -procedure NSButton.setBezelStyle(bezelStyle: NSBezelStyle); +procedure NSButton.setTitle(_aString: CFStringRef); type - setBezelStyle_t = procedure (param1: objc.id; param2: SEL; - param3: NSBezelStyle); cdecl; + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: CFStringRef); cdecl; var - vmethod: setBezelStyle_t; + vmethod: TmsgSendWrapper; begin - vmethod := setBezelStyle_t(@objc_msgSend); - vmethod(Handle, sel_registerName(PChar(Str_setBezelStyle)), bezelStyle); + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setTitle)), _aString); +end; + +function NSButton.alternateTitle: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_alternateTitle)), [])); +end; + +procedure NSButton.setAlternateTitle(_aString: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setAlternateTitle)), _aString); +end; + +function NSButton.image: NSImage; +begin + Result := NSImage(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_image)), [])); +end; + +procedure NSButton.setImage(_image: NSImage); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: NSImage); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setImage)), _image); +end; + +function NSButton.alternateImage: NSImage; +begin + Result := NSImage(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_alternateImage)), [])); +end; + +procedure NSButton.setAlternateImage(_image: NSImage); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: NSImage); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setAlternateImage)), _image); +end; + +function NSButton.imagePosition: NSCellImagePosition; +begin + Result := NSCellImagePosition(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_imagePosition)), [])); +end; + +procedure NSButton.setImagePosition(_aPosition: NSCellImagePosition); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aPosition: NSCellImagePosition); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setImagePosition)), _aPosition); +end; + +procedure NSButton.setButtonType(_aType: NSButtonType); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aType: NSButtonType); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setButtonType)), _aType); +end; + +function NSButton.state: Integer; +begin + Result := Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_state)), [])); +end; + +procedure NSButton.setState(_value: Integer); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_value: Integer); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setState)), _value); +end; + +function NSButton.isBordered: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_isBordered)), [])); +end; + +procedure NSButton.setBordered(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setBordered)), _flag); +end; + +function NSButton.isTransparent: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_isTransparent)), [])); +end; + +procedure NSButton.setTransparent(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setTransparent)), _flag); +end; + +procedure NSButton.setPeriodicDelay_interval(_delay: Single; _interval: Single); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_delay: Single; _interval: Single); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setPeriodicDelay_interval)), _delay, _interval); +end; + +procedure NSButton.getPeriodicDelay_interval(_delay: Single; _interval: Single); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_delay: Single; _interval: Single); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_getPeriodicDelay_interval)), _delay, _interval); +end; + +function NSButton.keyEquivalent: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_keyEquivalent)), [])); +end; + +procedure NSButton.setKeyEquivalent(_charCode: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_charCode: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setKeyEquivalent)), _charCode); +end; + +function NSButton.keyEquivalentModifierMask: LongWord; +begin + Result := LongWord(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_keyEquivalentModifierMask)), [])); +end; + +procedure NSButton.setKeyEquivalentModifierMask(_mask: LongWord); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_mask: LongWord); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setKeyEquivalentModifierMask)), _mask); +end; + +procedure NSButton.highlight(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_highlight)), _flag); +end; + +{function NSButton.performKeyEquivalent(_key: NSEvent): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_key: NSEvent): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSButton_performKeyEquivalent)), _key)); +end;} + +procedure NSButton.setTitleWithMnemonic(_stringWithAmpersand: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_stringWithAmpersand: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setTitleWithMnemonic)), _stringWithAmpersand); +end; + +function NSButton.attributedTitle: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_attributedTitle)), [])); +end; + +procedure NSButton.setAttributedTitle(_aString: objc.id {NSAttributedString}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: objc.id {NSAttributedString}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setAttributedTitle)), _aString); +end; + +function NSButton.attributedAlternateTitle: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_attributedAlternateTitle)), [])); +end; + +procedure NSButton.setAttributedAlternateTitle(_obj: objc.id {NSAttributedString}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_obj: objc.id {NSAttributedString}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setAttributedAlternateTitle)), _obj); +end; + +procedure NSButton.setBezelStyle(_bezelStyle: NSBezelStyle); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_bezelStyle: NSBezelStyle); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setBezelStyle)), _bezelStyle); +end; + +function NSButton.bezelStyle: NSBezelStyle; +begin + Result := NSBezelStyle(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_bezelStyle)), [])); +end; + +procedure NSButton.setAllowsMixedState(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setAllowsMixedState)), _flag); +end; + +function NSButton.allowsMixedState: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_allowsMixedState)), [])); +end; + +procedure NSButton.setNextState; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_setNextState)), []); +end; + +procedure NSButton.setShowsBorderOnlyWhileMouseInside(_show: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_show: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setShowsBorderOnlyWhileMouseInside)), _show); +end; + +function NSButton.showsBorderOnlyWhileMouseInside: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_showsBorderOnlyWhileMouseInside)), [])); +end; + +procedure NSButton.setSound(_aSound: objc.id {NSSound}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aSound: objc.id {NSSound}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSButton_setSound)), _aSound); +end; + +function NSButton.sound: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_sound)), [])); end; {$endif} - diff --git a/bindings/pascocoa/appkit/NSGraphics.inc b/bindings/pascocoa/appkit/NSGraphics.inc index 677d2665e..e51afb800 100644 --- a/bindings/pascocoa/appkit/NSGraphics.inc +++ b/bindings/pascocoa/appkit/NSGraphics.inc @@ -1,194 +1,161 @@ -{%mainunit appkit.pas} -{ +(* NSGraphics.h Application Kit Copyright (c) 1994-2005, Apple Computer, Inc. All rights reserved. -} +*) {$ifdef HEADER} {$ifndef NSGRAPHICS_PAS_H} {$define NSGRAPHICS_PAS_H} -//#import -//#import +{.$include NSGeometry.inc} +{.$include AppKitDefines.inc} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} +type + NSCompositingOperation = ( + NSCompositeClear = 0, + NSCompositeCopy = 1, + NSCompositeSourceOver = 2, + NSCompositeSourceIn = 3, + NSCompositeSourceOut = 4, + NSCompositeSourceAtop = 5, + NSCompositeDestinationOver = 6, + NSCompositeDestinationIn = 7, + NSCompositeDestinationOut = 8, + NSCompositeDestinationAtop = 9, + NSCompositeXOR = 10, + NSCompositePlusDarker = 11, + NSCompositeHighlight = 12, + NSCompositePlusLighter = 13 + ); -//@class NSColor, NSView; -{=== CONSTANTS ===} -{ operation types for composite operators } -{ Constants moved from dpsOpenStep.h } -(*typedef enum _NSCompositingOperation { - NSCompositeClear = 0, - NSCompositeCopy = 1, - NSCompositeSourceOver = 2, - NSCompositeSourceIn = 3, - NSCompositeSourceOut = 4, - NSCompositeSourceAtop = 5, - NSCompositeDestinationOver = 6, - NSCompositeDestinationIn = 7, - NSCompositeDestinationOut = 8, - NSCompositeDestinationAtop = 9, - NSCompositeXOR = 10, - NSCompositePlusDarker = 11, - NSCompositeHighlight = 12, - NSCompositePlusLighter = 13 -} NSCompositingOperation;*) - -{ types of window backing store } type NSBackingStoreType = ( - NSBackingStoreRetained = 0, - NSBackingStoreNonretained = 1, - NSBackingStoreBuffered = 2); + NSBackingStoreRetained = 0, + NSBackingStoreNonretained = 1, + NSBackingStoreBuffered = 2 + ); -(*/* ways to order windows */ -typedef enum _NSWindowOrderingMode { - NSWindowAbove = 1, - NSWindowBelow = -1, - NSWindowOut = 0 -} NSWindowOrderingMode; -/* order in which to draw focus ring - above or below graphic or just draw ring */ -typedef enum { - NSFocusRingOnly = 0, - NSFocusRingBelow = 1, - NSFocusRingAbove = 2 -} NSFocusRingPlacement; +type + NSWindowOrderingMode = ( + NSWindowAbove = 1, + NSWindowBelow = 1, + NSWindowOut = 0 + ); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -/* used by NSView and NSCell to configure if and how the control should draw its focus ring */ -typedef enum _NSFocusRingType { - NSFocusRingTypeDefault = 0, - NSFocusRingTypeNone = 1, + +type + NSFocusRingPlacement = ( + NSFocusRingOnly = 0, + NSFocusRingBelow = 1, + NSFocusRingAbove = 2 + ); + + +type + NSFocusRingType = ( + NSFocusRingTypeDefault = 0, + NSFocusRingTypeNone = 1, NSFocusRingTypeExterior = 2 -} NSFocusRingType; -#endif - -/* Predefined colorspace names. -*/ -APPKIT_EXTERN NSString *NSCalibratedWhiteColorSpace; /* 1.0 == white */ -APPKIT_EXTERN NSString *NSCalibratedBlackColorSpace; /* 1.0 == black */ -APPKIT_EXTERN NSString *NSCalibratedRGBColorSpace; -APPKIT_EXTERN NSString *NSDeviceWhiteColorSpace; /* 1.0 == white */ -APPKIT_EXTERN NSString *NSDeviceBlackColorSpace; /* 1.0 == black */ -APPKIT_EXTERN NSString *NSDeviceRGBColorSpace; -APPKIT_EXTERN NSString *NSDeviceCMYKColorSpace; -APPKIT_EXTERN NSString *NSNamedColorSpace; /* Used for "catalog" colors */ -APPKIT_EXTERN NSString *NSPatternColorSpace; -APPKIT_EXTERN NSString *NSCustomColorSpace; /* Used to indicate a custom gstate in images */ + ); -/* NSWindowDepth defines the values used in setting window depth limits. "0" indicates default depth. Window depths should not be made persistent as they will not be the same across systems. Use the functions NSBPSFromDepth(), NSColorSpaceFromDepth(), NSBitsPerPixelFromDepth(), and NSPlanarFromDepth() to extract info from an NSWindowDepth. Use NSBestDepth() to compute window depths. NSBestDepth() will try to accomodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching colorSpace first, then bps, then planar, then bpp. bpp is "bits per pixel"; 0 indicates default (same as the number of bits per plane, either bps or bps * NSNumberOfColorComponents()); other values maybe used as hints to provide backing stores of different configuration; for instance, 8 bit color. exactMatch is optional and indicates whether all the parameters matched exactly. -*/ -typedef int NSWindowDepth; -APPKIT_EXTERN NSWindowDepth NSBestDepth (NSString *colorSpace, int bps, int bpp, BOOL planar, BOOL *exactMatch); -APPKIT_EXTERN BOOL NSPlanarFromDepth (NSWindowDepth depth); -APPKIT_EXTERN NSString *NSColorSpaceFromDepth (NSWindowDepth depth); -APPKIT_EXTERN int NSBitsPerSampleFromDepth (NSWindowDepth depth); -APPKIT_EXTERN int NSBitsPerPixelFromDepth (NSWindowDepth depth); -APPKIT_EXTERN int NSNumberOfColorComponents (NSString *colorSpaceName); -APPKIT_EXTERN const NSWindowDepth *NSAvailableWindowDepths (void); /* 0 terminated */ +//APPKIT_EXTERN NSString *NSCalibratedWhiteColorSpace; /* 1.0 == white */ +//APPKIT_EXTERN NSString *NSCalibratedBlackColorSpace; /* 1.0 == black */ +//APPKIT_EXTERN NSString *NSCalibratedRGBColorSpace; +//APPKIT_EXTERN NSString *NSDeviceWhiteColorSpace; /* 1.0 == white */ +//APPKIT_EXTERN NSString *NSDeviceBlackColorSpace; /* 1.0 == black */ +//APPKIT_EXTERN NSString *NSDeviceRGBColorSpace; +//APPKIT_EXTERN NSString *NSDeviceCMYKColorSpace; +//APPKIT_EXTERN NSString *NSNamedColorSpace; /* Used for "catalog" colors */ +//APPKIT_EXTERN NSString *NSPatternColorSpace; +//APPKIT_EXTERN NSString *NSCustomColorSpace; /* Used to indicate a custom gstate in images */ +type + NSWindowDepth = Integer; + +//APPKIT_EXTERN NSWindowDepth NSBestDepth (NSString *colorSpace, int bps, int bpp, BOOL planar, BOOL *exactMatch); +//APPKIT_EXTERN BOOL NSPlanarFromDepth (NSWindowDepth depth); +//APPKIT_EXTERN NSString *NSColorSpaceFromDepth (NSWindowDepth depth); +//APPKIT_EXTERN int NSBitsPerSampleFromDepth (NSWindowDepth depth); +//APPKIT_EXTERN int NSBitsPerPixelFromDepth (NSWindowDepth depth); +//APPKIT_EXTERN int NSNumberOfColorComponents (NSString *colorSpaceName); +//APPKIT_EXTERN const NSWindowDepth *NSAvailableWindowDepths (void); /* 0 terminated */ +//APPKIT_EXTERN const float NSWhite; +//APPKIT_EXTERN const float NSLightGray; +//APPKIT_EXTERN const float NSDarkGray; +//APPKIT_EXTERN const float NSBlack; +//APPKIT_EXTERN NSString *NSDeviceResolution; /* NSValue containing NSSize, basically dpi */ +//APPKIT_EXTERN NSString *NSDeviceColorSpaceName; /* NSString */ +//APPKIT_EXTERN NSString *NSDeviceBitsPerSample; /* NSValue containing int */ +//APPKIT_EXTERN NSString *NSDeviceIsScreen; /* "YES" or not there */ +//APPKIT_EXTERN NSString *NSDeviceIsPrinter; /* "YES" or not there */ +//APPKIT_EXTERN NSString *NSDeviceSize; /* NSValue containing NSSize */ +//APPKIT_EXTERN void NSRectFill(NSRect aRect); +//APPKIT_EXTERN void NSRectFillList(const NSRect *rects, int count); +//APPKIT_EXTERN void NSRectFillListWithGrays(const NSRect *rects, const float *grays, int num); +//APPKIT_EXTERN void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int num); +//APPKIT_EXTERN void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op); +//APPKIT_EXTERN void NSRectFillListUsingOperation(const NSRect *rects, int count, NSCompositingOperation op); +//APPKIT_EXTERN void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor **colors, int num, NSCompositingOperation op); +//APPKIT_EXTERN void NSFrameRect(NSRect aRect); +//APPKIT_EXTERN void NSFrameRectWithWidth(NSRect aRect, float frameWidth); +//APPKIT_EXTERN void NSFrameRectWithWidthUsingOperation(NSRect aRect, float frameWidth, NSCompositingOperation op); +//APPKIT_EXTERN void NSRectClip(NSRect aRect); +//APPKIT_EXTERN void NSRectClipList(const NSRect *rects, int count); +//APPKIT_EXTERN NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const float *grays, int count); +//APPKIT_EXTERN void NSDrawGrayBezel(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSDrawGroove(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSDrawButton(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSEraseRect(NSRect aRect); +//APPKIT_EXTERN NSColor *NSReadPixel(NSPoint passedPoint); +//APPKIT_EXTERN void NSDrawBitmap(NSRect rect, int width, int height, int bps, int spp, int bpp, int bpr, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]); +//APPKIT_EXTERN void NSCopyBits(int srcGState, NSRect srcRect, NSPoint destPoint); +//APPKIT_EXTERN void NSHighlightRect(NSRect aRect); +//APPKIT_EXTERN void NSBeep(void); +//APPKIT_EXTERN void NSCountWindows(int *count); +//APPKIT_EXTERN void NSWindowList(int size, int list[]); +//APPKIT_EXTERN void NSCountWindowsForContext(int context, int *count); +//APPKIT_EXTERN void NSWindowListForContext(int context, int size, int list[]); +//APPKIT_EXTERN int NSGetWindowServerMemory(int context, int *virtualMemory, int *windowBackingMemory, NSString **windowDumpString); +//APPKIT_EXTERN NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor **colors, int count); +//APPKIT_EXTERN void NSDrawDarkBezel(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSDrawLightBezel(NSRect aRect, NSRect clipRect); +//APPKIT_EXTERN void NSDottedFrameRect(NSRect aRect); +//APPKIT_EXTERN void NSDrawWindowBackground(NSRect aRect); +//APPKIT_EXTERN void NSSetFocusRingStyle(NSFocusRingPlacement placement); +//APPKIT_EXTERN void NSDisableScreenUpdates(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +//APPKIT_EXTERN void NSEnableScreenUpdates(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +type + NSAnimationEffect = ( + NSAnimationEffectDisappearingItemDefault = 0, + NSAnimationEffectPoof = 10 + ); -/* Standard gray values for the 2-bit deep grayscale colorspace. -*/ -APPKIT_EXTERN const float NSWhite; -APPKIT_EXTERN const float NSLightGray; -APPKIT_EXTERN const float NSDarkGray; -APPKIT_EXTERN const float NSBlack; - - -/* Keys for deviceDescription dictionaries. -*/ -APPKIT_EXTERN NSString *NSDeviceResolution; /* NSValue containing NSSize, basically dpi */ -APPKIT_EXTERN NSString *NSDeviceColorSpaceName; /* NSString */ -APPKIT_EXTERN NSString *NSDeviceBitsPerSample; /* NSValue containing int */ -APPKIT_EXTERN NSString *NSDeviceIsScreen; /* "YES" or not there */ -APPKIT_EXTERN NSString *NSDeviceIsPrinter; /* "YES" or not there */ -APPKIT_EXTERN NSString *NSDeviceSize; /* NSValue containing NSSize */ - - -/* Graphics functions -*/ -APPKIT_EXTERN void NSRectFill(NSRect aRect); -APPKIT_EXTERN void NSRectFillList(const NSRect *rects, int count); -APPKIT_EXTERN void NSRectFillListWithGrays(const NSRect *rects, const float *grays, int num); -APPKIT_EXTERN void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int num); -APPKIT_EXTERN void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op); -APPKIT_EXTERN void NSRectFillListUsingOperation(const NSRect *rects, int count, NSCompositingOperation op); -APPKIT_EXTERN void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor **colors, int num, NSCompositingOperation op); -APPKIT_EXTERN void NSFrameRect(NSRect aRect); -APPKIT_EXTERN void NSFrameRectWithWidth(NSRect aRect, float frameWidth); -APPKIT_EXTERN void NSFrameRectWithWidthUsingOperation(NSRect aRect, float frameWidth, NSCompositingOperation op); -APPKIT_EXTERN void NSRectClip(NSRect aRect); -APPKIT_EXTERN void NSRectClipList(const NSRect *rects, int count); -APPKIT_EXTERN NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const float *grays, int count); -APPKIT_EXTERN void NSDrawGrayBezel(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSDrawGroove(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSDrawButton(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSEraseRect(NSRect aRect); -APPKIT_EXTERN NSColor *NSReadPixel(NSPoint passedPoint); -APPKIT_EXTERN void NSDrawBitmap(NSRect rect, int width, int height, int bps, int spp, int bpp, int bpr, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]); -APPKIT_EXTERN void NSCopyBits(int srcGState, NSRect srcRect, NSPoint destPoint); -APPKIT_EXTERN void NSHighlightRect(NSRect aRect); -APPKIT_EXTERN void NSBeep(void); -APPKIT_EXTERN void NSCountWindows(int *count); -APPKIT_EXTERN void NSWindowList(int size, int list[]); -APPKIT_EXTERN void NSCountWindowsForContext(int context, int *count); -APPKIT_EXTERN void NSWindowListForContext(int context, int size, int list[]); - -/* gets performance stats about window server memory usage */ -APPKIT_EXTERN int NSGetWindowServerMemory(int context, int *virtualMemory, int *windowBackingMemory, NSString **windowDumpString); - -APPKIT_EXTERN NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor **colors, int count); -APPKIT_EXTERN void NSDrawDarkBezel(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSDrawLightBezel(NSRect aRect, NSRect clipRect); -APPKIT_EXTERN void NSDottedFrameRect(NSRect aRect); - -APPKIT_EXTERN void NSDrawWindowBackground(NSRect aRect); -APPKIT_EXTERN void NSSetFocusRingStyle(NSFocusRingPlacement placement); - -/* Disable and reenable screen updates. -** NSDisableScreenUpdates prevents drawing for all windows belonging to the calling -** process from being flushed to the screen. This function permits operations on -** multiple windows to appear atomic to the user, and is particularly useful for parent -** and child windows. Note that this function should be used with care for short -** operations only as the system will only allow updates to be disabled for a short -** time (currently one second) before automatically reenabling updates. -** NSEnableScreenUpdates reenables drawing that was previously disabled by -** NSDisableScreenUpdates. Multiple calls stack. -*/ -APPKIT_EXTERN void NSDisableScreenUpdates(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; -APPKIT_EXTERN void NSEnableScreenUpdates(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 - -/* Runs one of the standard system animation effects (display and sound). -** 'centerLocation' represents the center, in screen coordinates, to show the effect. -** 'size' specifies how big the effect should be. Use NSZeroSize to get the default size. -** 'animationDelegate' is optionally, an object that wants to know when the effect has completed. -** 'didEndSelector' will be invoked in the animationDelegate when the animation has completed. -** -** The didEndSelector should have the following signature: -** - (void)animationEffectDidEnd:(void * )contextInfo; -*/ - -typedef enum _NSAnimationEffect { - // The default effect used to indicate removal of an item from a collection, - // such as toolbar (indicates removal, without destroying the underlying data). - NSAnimationEffectDisappearingItemDefault = 0, - - // An effect showing a puff of smoke. - NSAnimationEffectPoof = 10 -} NSAnimationEffect; - -APPKIT_EXTERN void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, id animationDelegate, SEL didEndSelector, void *contextInfo) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; - -#endif *) - +//APPKIT_EXTERN void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, id animationDelegate, SEL didEndSelector, void *contextInfo) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; {$endif} {$endif} +{$ifdef CLASSES} +{$ifndef NSGRAPHICS_PAS_C} +{$define NSGRAPHICS_PAS_C} +{.$include NSGeometry.inc} +{.$include AppKitDefines.inc} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + {.$endif} +{$endif} +{$endif} diff --git a/bindings/pascocoa/appkit/NSImage.inc b/bindings/pascocoa/appkit/NSImage.inc index 1a3b2af76..4de41fe5a 100644 --- a/bindings/pascocoa/appkit/NSImage.inc +++ b/bindings/pascocoa/appkit/NSImage.inc @@ -53,7 +53,7 @@ const NSImage = class(NSObject) // public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public { + (id)imageNamed:(NSString *)name; /* If this finds & creates the image, only name is saved when archived */ @@ -167,7 +167,7 @@ const {$endif} {$ifdef IMPLEMENTATION} -function NSImage.getClass: objc.id; +class function NSImage.getClass: objc.id; begin Result := objc_getClass(Str_NSImage); end; diff --git a/bindings/pascocoa/appkit/NSResponder.inc b/bindings/pascocoa/appkit/NSResponder.inc index 4041a4ff2..7da161a82 100644 --- a/bindings/pascocoa/appkit/NSResponder.inc +++ b/bindings/pascocoa/appkit/NSResponder.inc @@ -1,3 +1,4 @@ +{%mainunit appkit.pas} { NSResponder.h Application Kit diff --git a/bindings/pascocoa/appkit/NSStatusBar.inc b/bindings/pascocoa/appkit/NSStatusBar.inc index 3ee466af3..cf5ff2220 100644 --- a/bindings/pascocoa/appkit/NSStatusBar.inc +++ b/bindings/pascocoa/appkit/NSStatusBar.inc @@ -35,7 +35,7 @@ const NSStatusBar = class(NSObject) public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public constructor systemStatusBar(); @@ -51,7 +51,7 @@ const {$endif} {$ifdef IMPLEMENTATION} -function NSStatusBar.getClass: objc.id; +class function NSStatusBar.getClass: objc.id; begin Result := objc_getClass(Str_NSStatusBar); end; diff --git a/bindings/pascocoa/appkit/NSStatusItem.inc b/bindings/pascocoa/appkit/NSStatusItem.inc index cd55fac39..ae0ec37ef 100644 --- a/bindings/pascocoa/appkit/NSStatusItem.inc +++ b/bindings/pascocoa/appkit/NSStatusItem.inc @@ -43,7 +43,7 @@ const NSStatusItem = class(NSObject) public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public {- (NSStatusBar*) statusBar; @@ -112,7 +112,7 @@ const {$endif} {$ifdef IMPLEMENTATION} -function NSStatusItem.getClass: objc.id; +class function NSStatusItem.getClass: objc.id; begin Result := objc_getClass(Str_NSStatusItem); end; diff --git a/bindings/pascocoa/appkit/NSTextField.inc b/bindings/pascocoa/appkit/NSTextField.inc index e167c3bba..4772f4bce 100644 --- a/bindings/pascocoa/appkit/NSTextField.inc +++ b/bindings/pascocoa/appkit/NSTextField.inc @@ -29,7 +29,7 @@ const NSTextField = class(NSControl) public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public {- (void)setBackgroundColor:(NSColor *)color; @@ -79,7 +79,7 @@ const {$endif} {$ifdef IMPLEMENTATION} -function NSTextField.getClass: objc.id; +class function NSTextField.getClass: objc.id; begin Result := objc_getClass(Str_NSTextField); end; diff --git a/bindings/pascocoa/appkit/NSWindow.inc b/bindings/pascocoa/appkit/NSWindow.inc index 7ec2d5397..4b503152d 100644 --- a/bindings/pascocoa/appkit/NSWindow.inc +++ b/bindings/pascocoa/appkit/NSWindow.inc @@ -1,534 +1,2301 @@ -{%mainunit appkit.pas} -{ +(* NSWindow.h Application Kit Copyright (c) 1994-2005, Apple Computer, Inc. All rights reserved. -} +*) {$ifdef HEADER} {$ifndef NSWINDOW_PAS_H} {$define NSWINDOW_PAS_H} -{#import -#import -#import -#import -#import -} - +{.$include NSGeometry.inc} +{.$include NSResponder.inc} +{$include NSGraphics.inc} +{.$include AppKitDefines.inc} +{.$include NSDate.inc} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} + {.$else} + {.$endif} const NSAppKitVersionNumberWithCustomSheetPosition = 686.0; + NSNormalWindowLevel = kCGNormalWindowLevel; + NSFloatingWindowLevel = kCGFloatingWindowLevel; + NSSubmenuWindowLevel = kCGTornOffMenuWindowLevel; + NSTornOffMenuWindowLevel = kCGTornOffMenuWindowLevel; + NSMainMenuWindowLevel = kCGMainMenuWindowLevel; + NSStatusWindowLevel = kCGStatusWindowLevel; + NSDockWindowLevel = kCGDockWindowLevel; + NSModalPanelWindowLevel = kCGModalPanelWindowLevel; + NSPopUpMenuWindowLevel = kCGPopUpMenuWindowLevel; + NSScreenSaverWindowLevel = kCGScreenSaverWindowLevel; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} + {.$else} + {.$endif} +const + NSBorderlessWindowMask = 0; + NSTitledWindowMask = 1 shl 0; + NSClosableWindowMask = 1 shl 1; + NSMiniaturizableWindowMask = 1 shl 2; + NSResizableWindowMask = 1 shl 3; - NSBorderlessWindowMask = 0; - NSTitledWindowMask = 1 shl 0; - NSClosableWindowMask = 1 shl 1; - NSMiniaturizableWindowMask = 1 shl 2; - NSResizableWindowMask = 1 shl 3; + // Specifies a window with textured background (eg. metal) +const + NSTexturedBackgroundWindowMask = 1 shl 8; -//#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -{ Specifies a window with textured background (eg. metal) -} - NSTexturedBackgroundWindowMask = 1 shl 8; -//#endif + // Specifies a window that ignores the userSpaceScaleFactor of the NSScreen on which + // it is created. Currently restricted to borderless windows (NSBorderlessWindowMask) +const + NSUnscaledWindowMask = 1 shl 11; -//#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -{ Specifies a window that ignores the userSpaceScaleFactor of the NSScreen on which it is created. Currently restricted to borderless windows (NSBorderlessWindowMask) -} - NSUnscaledWindowMask = 1 shl 11; + // Specifies a window whose titlebar and toolbar have a unified look - that is, a continuous + // background +const + NSUnifiedTitleAndToolbarWindowMask = 1 shl 12; -{ Specifies a window whose titlebar and toolbar have a unified look - that is, a continuous background -} - NSUnifiedTitleAndToolbarWindowMask = 1 shl 12; - -//#endif - -{ used with NSRunLoop's performSelector:target:argument:order:modes: } - NSDisplayWindowRunLoopOrdering = 600000; - NSResetCursorRectsRunLoopOrdering = 700000; - -{#define NSNormalWindowLevel kCGNormalWindowLevel -#define NSFloatingWindowLevel kCGFloatingWindowLevel -#define NSSubmenuWindowLevel kCGTornOffMenuWindowLevel -#define NSTornOffMenuWindowLevel kCGTornOffMenuWindowLevel -#define NSMainMenuWindowLevel kCGMainMenuWindowLevel -#define NSStatusWindowLevel kCGStatusWindowLevel -// NSDockWindowLevel is deprecated -#define NSDockWindowLevel kCGDockWindowLevel -#define NSModalPanelWindowLevel kCGModalPanelWindowLevel -#define NSPopUpMenuWindowLevel kCGPopUpMenuWindowLevel -#define NSScreenSaverWindowLevel kCGScreenSaverWindowLevel } + // used with NSRunLoop's performSelector:target:argument:order:modes: +const + NSDisplayWindowRunLoopOrdering = 600000; + NSResetCursorRectsRunLoopOrdering = 700000; type NSSelectionDirection = ( - NSDirectSelection = 0, - NSSelectingNext, - NSSelectingPrevious); + NSDirectSelection = 0, + NSSelectingNext, + NSSelectingPrevious + ); -//#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -// standard window buttons + +type NSWindowButton = ( - NSWindowCloseButton, - NSWindowMiniaturizeButton, - NSWindowZoomButton, - NSWindowToolbarButton, - NSWindowDocumentIconButton); -//#endif + NSWindowCloseButton, + NSWindowMiniaturizeButton, + NSWindowZoomButton, + NSWindowToolbarButton, + NSWindowDocumentIconButton + ); -{ Notifications } -{APPKIT_EXTERN NSString *NSWindowDidBecomeKeyNotification; -APPKIT_EXTERN NSString *NSWindowDidBecomeMainNotification; -APPKIT_EXTERN NSString *NSWindowDidChangeScreenNotification; -APPKIT_EXTERN NSString *NSWindowDidDeminiaturizeNotification; -APPKIT_EXTERN NSString *NSWindowDidExposeNotification; // userInfo key: @"NSExposedRect" -APPKIT_EXTERN NSString *NSWindowDidMiniaturizeNotification; -APPKIT_EXTERN NSString *NSWindowDidMoveNotification; -APPKIT_EXTERN NSString *NSWindowDidResignKeyNotification; -APPKIT_EXTERN NSString *NSWindowDidResignMainNotification; -APPKIT_EXTERN NSString *NSWindowDidResizeNotification; -APPKIT_EXTERN NSString *NSWindowDidUpdateNotification; -APPKIT_EXTERN NSString *NSWindowWillCloseNotification; -APPKIT_EXTERN NSString *NSWindowWillMiniaturizeNotification; -APPKIT_EXTERN NSString *NSWindowWillMoveNotification; -APPKIT_EXTERN NSString *NSWindowWillBeginSheetNotification; -APPKIT_EXTERN NSString *NSWindowDidEndSheetNotification; -APPKIT_EXTERN NSString *NSWindowDidChangeScreenProfileNotification AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -} - -{ Class and method name strings } -const - Str_NSWindow = 'NSWindow'; - - Str_initWithContentRect = 'initWithContentRect:styleMask:backing:defer:'; - Str_orderFrontRegardless = 'orderFrontRegardless'; - Str_contentView = 'contentView'; +//APPKIT_EXTERN NSString *NSWindowDidBecomeKeyNotification; +//APPKIT_EXTERN NSString *NSWindowDidBecomeMainNotification; +//APPKIT_EXTERN NSString *NSWindowDidChangeScreenNotification; +//APPKIT_EXTERN NSString *NSWindowDidDeminiaturizeNotification; +//APPKIT_EXTERN NSString *NSWindowDidExposeNotification; // userInfo key: @"NSExposedRect" +//APPKIT_EXTERN NSString *NSWindowDidMiniaturizeNotification; +//APPKIT_EXTERN NSString *NSWindowDidMoveNotification; +//APPKIT_EXTERN NSString *NSWindowDidResignKeyNotification; +//APPKIT_EXTERN NSString *NSWindowDidResignMainNotification; +//APPKIT_EXTERN NSString *NSWindowDidResizeNotification; +//APPKIT_EXTERN NSString *NSWindowDidUpdateNotification; +//APPKIT_EXTERN NSString *NSWindowWillCloseNotification; +//APPKIT_EXTERN NSString *NSWindowWillMiniaturizeNotification; +//APPKIT_EXTERN NSString *NSWindowWillMoveNotification; +//APPKIT_EXTERN NSString *NSWindowWillBeginSheetNotification; +//APPKIT_EXTERN NSString *NSWindowDidEndSheetNotification; +//APPKIT_EXTERN NSString *NSWindowDidChangeScreenProfileNotification AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; {$endif} {$endif} + +{$ifdef FORWARD} +{$ifndef NSWINDOW_PAS__FORWARD} +{$define NSWINDOW_PAS__FORWARD} + + NSWindow = class; +{$endif} +{$endif} + {$ifdef CLASSES} {$ifndef NSWINDOW_PAS_C} {$define NSWINDOW_PAS_C} -{@class NSButton, NSButtonCell, NSColor, NSImage, NSPasteboard, NSScreen; -@class NSNotification, NSText, NSView, NSMutableSet, NSSet, NSDate; -@class NSToolbar, NSGraphicsContext;} +{.$include NSGeometry.inc} +{.$include NSResponder.inc} +{$include NSGraphics.inc} +{.$include AppKitDefines.inc} +{.$include NSDate.inc} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + {.$endif} -{@class NSWindowAuxiliary; -@class NSEvent; -@class NSWindowController; } + { NSWindow } NSWindow = class(NSResponder) public - { Extra binding functions } - function getClass: objc.id; override; - public - - -{+ (NSRect)frameRectForContentRect:(NSRect)cRect styleMask:(unsigned int)aStyle; -+ (NSRect)contentRectForFrameRect:(NSRect)fRect styleMask:(unsigned int)aStyle; -+ (float)minFrameWidthWithTitle:(NSString *)aTitle styleMask:(unsigned int)aStyle; -+ (NSWindowDepth)defaultDepthLimit; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -- (NSRect)frameRectForContentRect:(NSRect)contentRect; -- (NSRect)contentRectForFrameRect:(NSRect)frameRect; -#endif} - - constructor initWithContentRect(contentRect: NSRect; aStyle: cuint; bufferingType: NSBackingStoreType; defer: CBOOL); -{- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)screen; - -- (NSString *)title;} - procedure setTitle(aString: CFStringRef); -{- (NSString *)representedFilename; -- (void)setRepresentedFilename:(NSString *)aString; -- (void)setTitleWithRepresentedFilename:(NSString *)filename; -- (void)setExcludedFromWindowsMenu:(BOOL)flag; -- (BOOL)isExcludedFromWindowsMenu; -- (void)setContentView:(NSView *)aView;} + class function getClass: objc.id; override; + // All instance variables are private + class function frameRectForContentRect_styleMask(_cRect: NSRect; _aStyle: LongWord): NSRect; + class function contentRectForFrameRect_styleMask(_fRect: NSRect; _aStyle: LongWord): NSRect; + class function minFrameWidthWithTitle_styleMask(_aTitle: CFStringRef; _aStyle: LongWord): Single; + class function defaultDepthLimit: NSWindowDepth; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + function frameRectForContentRect(_contentRect: NSRect): NSRect; + function contentRectForFrameRect(_frameRect: NSRect): NSRect; + {.$endif} + constructor initWithContentRect_styleMask_backing_defer(_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool); + constructor initWithContentRect_styleMask_backing_defer_screen(_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool; _screen: objc.id {NSScreen}); + function title: CFStringRef; + procedure setTitle(_aString: CFStringRef); + function representedFilename: CFStringRef; + procedure setRepresentedFilename(_aString: CFStringRef); + procedure setTitleWithRepresentedFilename(_filename: CFStringRef); + procedure setExcludedFromWindowsMenu(_flag: LongBool); + function isExcludedFromWindowsMenu: LongBool; + procedure setContentView(_aView: objc.id {NSView}); function contentView: objc.id; -{- (void)setDelegate:(id)anObject; -- (id)delegate; -- (int)windowNumber; -- (unsigned int)styleMask; -- (NSText *)fieldEditor:(BOOL)createFlag forObject:(id)anObject; -- (void)endEditingFor:(id)anObject; - -- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; -- (void)setFrame:(NSRect)frameRect display:(BOOL)flag; -- (void)setContentSize:(NSSize)aSize; -- (void)setFrameOrigin:(NSPoint)aPoint; -- (void)setFrameTopLeftPoint:(NSPoint)aPoint; -- (NSPoint)cascadeTopLeftFromPoint:(NSPoint)topLeftPoint; -- (NSRect)frame; - -// smooth resize -// subclasses can override animationResizeTime: to control the total time for the frame change. -// newFrame is the rect passed into setFrame:display:animate: -- (NSTimeInterval)animationResizeTime:(NSRect)newFrame; -// setFrame:display:animate: is equivalent to setFrame:display: if animateFlag is NO -// If animationFlag is YES, this method will perform a smooth resize of the window, where the total time for the resize is specified by -animationResizeTime: -- (void)setFrame:(NSRect)frameRect display:(BOOL)displayFlag animate:(BOOL)animateFlag; - -// show/hide resize corner (does not affect whether window is resizable) -- (void)setShowsResizeIndicator:(BOOL)show; -- (BOOL)showsResizeIndicator; - -- (void)setResizeIncrements:(NSSize)increments; -- (NSSize)resizeIncrements; -- (void)setAspectRatio:(NSSize)ratio; -- (NSSize)aspectRatio; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -- (void)setContentResizeIncrements:(NSSize)increments; -- (NSSize)contentResizeIncrements; -- (void)setContentAspectRatio:(NSSize)ratio; -- (NSSize)contentAspectRatio; -#endif - -- (void)useOptimizedDrawing:(BOOL)flag; -- (void)disableFlushWindow; -- (void)enableFlushWindow; -- (BOOL)isFlushWindowDisabled; -- (void)flushWindow; -- (void)flushWindowIfNeeded; -- (void)setViewsNeedDisplay:(BOOL)flag; -- (BOOL)viewsNeedDisplay; -- (void)displayIfNeeded; -- (void)display; -- (void)setAutodisplay:(BOOL)flag; -- (BOOL)isAutodisplay; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- (BOOL)preservesContentDuringLiveResize; -- (void)setPreservesContentDuringLiveResize:(BOOL)flag; -#endif - -- (void)update; -- (BOOL)makeFirstResponder:(NSResponder *)aResponder; -- (NSResponder *)firstResponder; -- (int)resizeFlags; -- (void)keyDown:(NSEvent *)theEvent; -- (void)close; -- (void)setReleasedWhenClosed:(BOOL)flag; -- (BOOL)isReleasedWhenClosed; -- (void)miniaturize:(id)sender; -- (void)deminiaturize:(id)sender; -- (BOOL)isZoomed; -- (void)zoom:(id)sender; -- (BOOL)isMiniaturized; -- (BOOL)tryToPerform:(SEL)anAction with:(id)anObject; -- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType; -- (void)setBackgroundColor:(NSColor *)color; -- (NSColor *)backgroundColor; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -- (void)setMovableByWindowBackground:(BOOL)flag; -- (BOOL)isMovableByWindowBackground; -#endif - -- (void)setHidesOnDeactivate:(BOOL)flag; -- (BOOL)hidesOnDeactivate; - -// indicate whether a window can be hidden during -[NSApplication hide:]. Default is YES -- (void)setCanHide:(BOOL)flag; -- (BOOL)canHide; - -- (void)center; -- (void)makeKeyAndOrderFront:(id)sender; -- (void)orderFront:(id)sender; -- (void)orderBack:(id)sender; -- (void)orderOut:(id)sender; -- (void)orderWindow:(NSWindowOrderingMode)place relativeTo:(int)otherWin;} - procedure orderFrontRegardless; - -{- (void)setMiniwindowImage:(NSImage *)image; -- (void)setMiniwindowTitle:(NSString *)title; -- (NSImage *)miniwindowImage; -- (NSString *)miniwindowTitle; - -- (void)setDocumentEdited:(BOOL)flag; -- (BOOL)isDocumentEdited; -- (BOOL)isVisible; -- (BOOL)isKeyWindow; -- (BOOL)isMainWindow; -- (BOOL)canBecomeKeyWindow; -- (BOOL)canBecomeMainWindow; -- (void)makeKeyWindow; -- (void)makeMainWindow; -- (void)becomeKeyWindow; -- (void)resignKeyWindow; -- (void)becomeMainWindow; -- (void)resignMainWindow; - -- (BOOL)worksWhenModal; -- (NSPoint)convertBaseToScreen:(NSPoint)aPoint; -- (NSPoint)convertScreenToBase:(NSPoint)aPoint; -- (void)performClose:(id)sender; -- (void)performMiniaturize:(id)sender; -- (void)performZoom:(id)sender; -- (int)gState; -- (void)setOneShot:(BOOL)flag; -- (BOOL)isOneShot; -- (NSData *)dataWithEPSInsideRect:(NSRect)rect; -- (NSData *)dataWithPDFInsideRect:(NSRect)rect; -- (void)print:(id)sender; - -- (void)disableCursorRects; -- (void)enableCursorRects; -- (void)discardCursorRects; -- (BOOL)areCursorRectsEnabled; -- (void)invalidateCursorRectsForView:(NSView *)aView; -- (void)resetCursorRects; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -- (void)setAllowsToolTipsWhenApplicationIsInactive:(BOOL)allowWhenInactive; - // Default is NO. Set to YES to allow a window to display tooltips even when the application is in the background. Note that, enabling tooltips in an inactive application will cause the app to do work any time the mouse passes over the window. This can degrade system performance. - -- (BOOL)allowsToolTipsWhenApplicationIsInactive; - // Returns YES if this window displays tooltips even when the application is in the background. To configure this setting you should call setAllowsToolTipsWhenApplicationIsInactive: instead of overriding -allowsToolTipsWhenApplicationIsInactive. -#endif - -- (void)setBackingType:(NSBackingStoreType)bufferingType; -- (NSBackingStoreType)backingType; -- (void)setLevel:(int)newLevel; -- (int)level; -- (void)setDepthLimit:(NSWindowDepth)limit; -- (NSWindowDepth)depthLimit; -- (void)setDynamicDepthLimit:(BOOL)flag; -- (BOOL)hasDynamicDepthLimit; -- (NSScreen *)screen; -- (NSScreen *)deepestScreen; -- (BOOL)canStoreColor; -- (void)setHasShadow:(BOOL)hasShadow; -- (BOOL)hasShadow; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -- (void)invalidateShadow; -#endif -- (void)setAlphaValue:(float)windowAlpha; -- (float)alphaValue; -- (void)setOpaque:(BOOL)isOpaque; -- (BOOL)isOpaque; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- (BOOL)displaysWhenScreenProfileChanges; -- (void)setDisplaysWhenScreenProfileChanges:(BOOL)flag; - -- (void)disableScreenUpdatesUntilFlush; -#endif - - -- (NSString *)stringWithSavedFrame; -- (void)setFrameFromString:(NSString *)string; -- (void)saveFrameUsingName:(NSString *)name; -// Set force=YES to use setFrameUsingName on a non-resizable window -- (BOOL)setFrameUsingName:(NSString *)name force:(BOOL)force; -- (BOOL)setFrameUsingName:(NSString *)name; -- (BOOL)setFrameAutosaveName:(NSString *)name; -- (NSString *)frameAutosaveName; -+ (void)removeFrameUsingName:(NSString *)name; - - -- (void)cacheImageInRect:(NSRect)aRect; -- (void)restoreCachedImage; -- (void)discardCachedImage; - -- (NSSize)minSize; -- (NSSize)maxSize; -- (void)setMinSize:(NSSize)size; -- (void)setMaxSize:(NSSize)size; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -- (NSSize)contentMinSize; -- (NSSize)contentMaxSize; -- (void)setContentMinSize:(NSSize)size; -- (void)setContentMaxSize:(NSSize)size; -#endif -- (NSEvent *)nextEventMatchingMask:(unsigned int)mask; -- (NSEvent *)nextEventMatchingMask:(unsigned int)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag; -- (void)discardEventsMatchingMask:(unsigned int)mask beforeEvent:(NSEvent *)lastEvent; -- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag; -- (NSEvent *)currentEvent; -- (void)setAcceptsMouseMovedEvents:(BOOL)flag; -- (BOOL)acceptsMouseMovedEvents; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -- (void)setIgnoresMouseEvents:(BOOL)flag; -- (BOOL)ignoresMouseEvents; -#endif -- (NSDictionary *)deviceDescription; -- (void)sendEvent:(NSEvent *)theEvent; -- (NSPoint)mouseLocationOutsideOfEventStream; -+ (void)menuChanged:(NSMenu *)menu; - -- (id)windowController; -- (void)setWindowController:(NSWindowController *)windowController; - -- (BOOL)isSheet; -- (NSWindow *)attachedSheet; - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -+ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(unsigned int)styleMask; -- (NSButton *)standardWindowButton:(NSWindowButton)b; -#endif - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 -- (void)addChildWindow:(NSWindow *)childWin ordered:(NSWindowOrderingMode)place; -- (void)removeChildWindow:(NSWindow *)childWin; -- (NSArray *)childWindows; - -- (NSWindow *)parentWindow; -- (void)setParentWindow:(NSWindow *)window; -#endif - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -/* Returns NSGraphicsContext used to render the receiver's content on the screen for the calling thread. -*/ -- (NSGraphicsContext *)graphicsContext; - -/* Returns scale factor applied to view coordinate system to get to base coordinate system of window -*/ -- (float)userSpaceScaleFactor; - -#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 */} - -{@interface NSWindow(NSKeyboardUI) -- (void)setInitialFirstResponder:(NSView *)view; -- (NSView *)initialFirstResponder; -- (void)selectNextKeyView:(id)sender; -- (void)selectPreviousKeyView:(id)sender; -- (void)selectKeyViewFollowingView:(NSView *)aView; -- (void)selectKeyViewPrecedingView:(NSView *)aView; -- (NSSelectionDirection)keyViewSelectionDirection; -- (void)setDefaultButtonCell:(NSButtonCell *)defButt; -- (NSButtonCell *)defaultButtonCell; -- (void)disableKeyEquivalentForDefaultButtonCell; -- (void)enableKeyEquivalentForDefaultButtonCell; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- (void)setAutorecalculatesKeyViewLoop:(BOOL)flag; -- (BOOL)autorecalculatesKeyViewLoop; -- (void)recalculateKeyViewLoop; -#endif -@end - -@interface NSWindow (NSToolbarSupport) -- (void)setToolbar:(NSToolbar*)toolbar; -- (NSToolbar *)toolbar; -- (void)toggleToolbarShown:(id)sender; -- (void)runToolbarCustomizationPalette:(id)sender; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- (void)setShowsToolbarButton:(BOOL)show; -- (BOOL)showsToolbarButton; -#endif -@end - -@interface NSWindow(NSDrag) -- (void)dragImage:(NSImage *)anImage at:(NSPoint)baseLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag; - -- (void)registerForDraggedTypes:(NSArray *)newTypes; -- (void)unregisterDraggedTypes; -@end - -#ifdef WIN32 -@interface NSWindow (NSWindowsExtensions) -- (void * /*HWND*/)windowHandle; -@end -#else -@interface NSWindow(NSCarbonExtensions) -// create an NSWindow for a Carbon window - windowRef must be a Carbon WindowRef - see MacWindows.h -- (NSWindow *)initWithWindowRef:(void * /* WindowRef */)windowRef; -// return the Carbon WindowRef for this window, creating if necessary: - see MacWindows.h -- (void * /* WindowRef */)windowRef; -@end - -#endif - -@interface NSObject(NSWindowNotifications) -- (void)windowDidResize:(NSNotification *)notification; -- (void)windowDidExpose:(NSNotification *)notification; -- (void)windowWillMove:(NSNotification *)notification; -- (void)windowDidMove:(NSNotification *)notification; -- (void)windowDidBecomeKey:(NSNotification *)notification; -- (void)windowDidResignKey:(NSNotification *)notification; -- (void)windowDidBecomeMain:(NSNotification *)notification; -- (void)windowDidResignMain:(NSNotification *)notification; -- (void)windowWillClose:(NSNotification *)notification; -- (void)windowWillMiniaturize:(NSNotification *)notification; -- (void)windowDidMiniaturize:(NSNotification *)notification; -- (void)windowDidDeminiaturize:(NSNotification *)notification; -- (void)windowDidUpdate:(NSNotification *)notification; -- (void)windowDidChangeScreen:(NSNotification *)notification; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- (void)windowDidChangeScreenProfile:(NSNotification *)notification; -#endif -- (void)windowWillBeginSheet:(NSNotification *)notification; -- (void)windowDidEndSheet:(NSNotification *)notification; -@end - -@interface NSObject(NSWindowDelegate) -- (BOOL)windowShouldClose:(id)sender; -- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client; -- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize; -- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame; -- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; -- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 -- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect; -#endif -@end} + procedure setDelegate(_anObject: objc.id); + function delegate: objc.id; + function windowNumber: Integer; + function styleMask: LongWord; + function fieldEditor_forObject(_createFlag: LongBool; _anObject: objc.id): objc.id;{NSText} + procedure endEditingFor(_anObject: objc.id); + function constrainFrameRect_toScreen(_frameRect: NSRect; _screen: objc.id {NSScreen}): NSRect; + procedure setFrame_display(_frameRect: NSRect; _flag: LongBool); + procedure setContentSize(_aSize: NSSize); + procedure setFrameOrigin(_aPoint: NSPoint); + procedure setFrameTopLeftPoint(_aPoint: NSPoint); + function cascadeTopLeftFromPoint(_topLeftPoint: NSPoint): NSPoint; + function frame: NSRect; + // smooth resize + // subclasses can override animationResizeTime: to control the total time for the frame + // change. + // newFrame is the rect passed into setFrame:display:animate: +// function animationResizeTime(_newFrame: NSRect): NSTimeInterval; + // setFrame:display:animate: is equivalent to setFrame:display: if animateFlag is NO + // If animationFlag is YES, this method will perform a smooth resize of the window, + // where the total time for the resize is specified by -animationResizeTime: + procedure setFrame_display_animate(_frameRect: NSRect; _displayFlag: LongBool; _animateFlag: LongBool); + // show/hide resize corner (does not affect whether window is resizable) + procedure setShowsResizeIndicator(_show: LongBool); + function showsResizeIndicator: LongBool; + procedure setResizeIncrements(_increments: NSSize); + function resizeIncrements: NSSize; + procedure setAspectRatio(_ratio: NSSize); + function aspectRatio: NSSize; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + procedure setContentResizeIncrements(_increments: NSSize); + function contentResizeIncrements: NSSize; + procedure setContentAspectRatio(_ratio: NSSize); + function contentAspectRatio: NSSize; + {.$endif} + procedure useOptimizedDrawing(_flag: LongBool); + procedure disableFlushWindow; + procedure enableFlushWindow; + function isFlushWindowDisabled: LongBool; + procedure flushWindow; + procedure flushWindowIfNeeded; + procedure setViewsNeedDisplay(_flag: LongBool); + function viewsNeedDisplay: LongBool; + procedure displayIfNeeded; + procedure display; + procedure setAutodisplay(_flag: LongBool); + function isAutodisplay: LongBool; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + function preservesContentDuringLiveResize: LongBool; + procedure setPreservesContentDuringLiveResize(_flag: LongBool); + {.$endif} + procedure update; + function makeFirstResponder(_aResponder: NSResponder): LongBool; + function firstResponder: NSResponder; + function resizeFlags: Integer; + procedure keyDown(_theEvent: objc.id {NSEvent}); + procedure close; + procedure setReleasedWhenClosed(_flag: LongBool); + function isReleasedWhenClosed: LongBool; + procedure miniaturize(_sender: objc.id); + procedure deminiaturize(_sender: objc.id); + function isZoomed: LongBool; + procedure zoom(_sender: objc.id); + function isMiniaturized: LongBool; + function tryToPerform_with(_anAction: SEL; _anObject: objc.id): LongBool; + function validRequestorForSendType_returnType(_sendType: CFStringRef; _returnType: CFStringRef): objc.id; + procedure setBackgroundColor(_color: objc.id {NSColor}); + function backgroundColor: objc.id;{NSColor} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + procedure setMovableByWindowBackground(_flag: LongBool); + function isMovableByWindowBackground: LongBool; + {.$endif} + procedure setHidesOnDeactivate(_flag: LongBool); + function hidesOnDeactivate: LongBool; + // indicate whether a window can be hidden during -[NSApplication hide:]. Default + // is YES + procedure setCanHide(_flag: LongBool); + function canHide: LongBool; + procedure center; + procedure makeKeyAndOrderFront(_sender: objc.id); + procedure orderFront(_sender: objc.id); + procedure orderBack(_sender: objc.id); + procedure orderOut(_sender: objc.id); + procedure orderWindow_relativeTo(_place: NSWindowOrderingMode; _otherWin: Integer); + procedure orderFrontRegardless; + procedure setMiniwindowImage(_image: objc.id {NSImage}); + procedure setMiniwindowTitle(_title: CFStringRef); + function miniwindowImage: objc.id;{NSImage} + function miniwindowTitle: CFStringRef; + procedure setDocumentEdited(_flag: LongBool); + function isDocumentEdited: LongBool; + function isVisible: LongBool; + function isKeyWindow: LongBool; + function isMainWindow: LongBool; + function canBecomeKeyWindow: LongBool; + function canBecomeMainWindow: LongBool; + procedure makeKeyWindow; + procedure makeMainWindow; + procedure becomeKeyWindow; + procedure resignKeyWindow; + procedure becomeMainWindow; + procedure resignMainWindow; + function worksWhenModal: LongBool; + function convertBaseToScreen(_aPoint: NSPoint): NSPoint; + function convertScreenToBase(_aPoint: NSPoint): NSPoint; + procedure performClose(_sender: objc.id); + procedure performMiniaturize(_sender: objc.id); + procedure performZoom(_sender: objc.id); + function gState: Integer; + procedure setOneShot(_flag: LongBool); + function isOneShot: LongBool; + function dataWithEPSInsideRect(_rect: NSRect): CFDataRef; + function dataWithPDFInsideRect(_rect: NSRect): CFDataRef; + procedure print(_sender: objc.id); + procedure disableCursorRects; + procedure enableCursorRects; + procedure discardCursorRects; + function areCursorRectsEnabled: LongBool; + procedure invalidateCursorRectsForView(_aView: objc.id {NSView}); + procedure resetCursorRects; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + procedure setAllowsToolTipsWhenApplicationIsInactive(_allowWhenInactive: LongBool); + // Default is NO. Set to YES to allow a window to display tooltips even when the application + // is in the background. Note that, enabling tooltips in an inactive application will + // cause the app to do work any time the mouse passes over the window. This can degrade + // system performance. + function allowsToolTipsWhenApplicationIsInactive: LongBool; + {.$endif} + procedure setBackingType(_bufferingType: NSBackingStoreType); + function backingType: NSBackingStoreType; + procedure setLevel(_newLevel: Integer); + function level: Integer; + procedure setDepthLimit(_limit: NSWindowDepth); + function depthLimit: NSWindowDepth; + procedure setDynamicDepthLimit(_flag: LongBool); + function hasDynamicDepthLimit: LongBool; + function screen: objc.id;{NSScreen} + function deepestScreen: objc.id;{NSScreen} + function canStoreColor: LongBool; + procedure setHasShadow(_hasShadow: LongBool); + function hasShadow: LongBool; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + procedure invalidateShadow; + {.$endif} + procedure setAlphaValue(_windowAlpha: Single); + function alphaValue: Single; + procedure setOpaque(_isOpaque: LongBool); + function isOpaque: LongBool; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + function displaysWhenScreenProfileChanges: LongBool; + procedure setDisplaysWhenScreenProfileChanges(_flag: LongBool); + procedure disableScreenUpdatesUntilFlush; + {.$endif} + function stringWithSavedFrame: CFStringRef; + procedure setFrameFromString(__string: CFStringRef); + procedure saveFrameUsingName(_name: CFStringRef); + // Set force=YES to use setFrameUsingName on a non-resizable window + function setFrameUsingName_force(_name: CFStringRef; _force: LongBool): LongBool; + function setFrameUsingName(_name: CFStringRef): LongBool; + function setFrameAutosaveName(_name: CFStringRef): LongBool; + function frameAutosaveName: CFStringRef; + class procedure removeFrameUsingName(_name: CFStringRef); + procedure cacheImageInRect(_aRect: NSRect); + procedure restoreCachedImage; + procedure discardCachedImage; + function minSize: NSSize; + function maxSize: NSSize; + procedure setMinSize(_size: NSSize); + procedure setMaxSize(_size: NSSize); + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} + function contentMinSize: NSSize; + function contentMaxSize: NSSize; + procedure setContentMinSize(_size: NSSize); + procedure setContentMaxSize(_size: NSSize); + {.$endif} + function nextEventMatchingMask(_mask: LongWord): objc.id;{NSEvent} + function nextEventMatchingMask_untilDate_inMode_dequeue(_mask: LongWord; _expiration: CFDateRef; _mode: CFStringRef; _deqFlag: LongBool): objc.id;{NSEvent} + procedure discardEventsMatchingMask_beforeEvent(_mask: LongWord; _lastEvent: objc.id {NSEvent}); + procedure postEvent_atStart(_event: objc.id {NSEvent}; _flag: LongBool); + function currentEvent: objc.id;{NSEvent} + procedure setAcceptsMouseMovedEvents(_flag: LongBool); + function acceptsMouseMovedEvents: LongBool; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + procedure setIgnoresMouseEvents(_flag: LongBool); + function ignoresMouseEvents: LongBool; + {.$endif} + function deviceDescription: CFDictionaryRef; + procedure sendEvent(_theEvent: objc.id {NSEvent}); + function mouseLocationOutsideOfEventStream: NSPoint; +// class procedure menuChanged(_menu: NSMenu); + function windowController: objc.id; + procedure setWindowController(_windowController: objc.id {NSWindowController}); + function isSheet: LongBool; + function attachedSheet: NSWindow; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + class function standardWindowButton_forStyleMask(_b: NSWindowButton; _styleMask: LongWord): objc.id;{NSButton} + function standardWindowButton(_b: NSWindowButton): objc.id;{NSButton} + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} + procedure addChildWindow_ordered(_childWin: NSWindow; _place: NSWindowOrderingMode); + procedure removeChildWindow(_childWin: NSWindow); + function childWindows: CFArrayRef; + function parentWindow: NSWindow; + procedure setParentWindow(_window: NSWindow); + {.$endif} + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + // Returns NSGraphicsContext used to render the receiver's content on the screen for + // the calling thread. + function graphicsContext: objc.id;{NSGraphicsContext} + // Returns scale factor applied to view coordinate system to get to base coordinate + // system of window + function userSpaceScaleFactor: Single; + {.$endif} + procedure setInitialFirstResponder(_view: objc.id {NSView}); + function initialFirstResponder: objc.id;{NSView} + procedure selectNextKeyView(_sender: objc.id); + procedure selectPreviousKeyView(_sender: objc.id); + procedure selectKeyViewFollowingView(_aView: objc.id {NSView}); + procedure selectKeyViewPrecedingView(_aView: objc.id {NSView}); + function keyViewSelectionDirection: NSSelectionDirection; + procedure setDefaultButtonCell(_defButt: objc.id {NSButtonCell}); + function defaultButtonCell: objc.id;{NSButtonCell} + procedure disableKeyEquivalentForDefaultButtonCell; + procedure enableKeyEquivalentForDefaultButtonCell; + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + procedure setAutorecalculatesKeyViewLoop(_flag: LongBool); + function autorecalculatesKeyViewLoop: LongBool; + procedure recalculateKeyViewLoop; + {.$endif} + procedure setToolbar(_toolbar: objc.id {NSToolbar}); + function toolbar: objc.id;{NSToolbar} + procedure toggleToolbarShown(_sender: objc.id); + procedure runToolbarCustomizationPalette(_sender: objc.id); + {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} + procedure setShowsToolbarButton(_show: LongBool); + function showsToolbarButton: LongBool; + {.$endif} + procedure dragImage_at_offset_event_pasteboard_source_slideBack(_anImage: objc.id {NSImage}; _baseLocation: NSPoint; _initialOffset: NSSize; _event: objc.id {NSEvent}; _pboard: objc.id {NSPasteboard}; _sourceObj: objc.id; _slideFlag: LongBool); + procedure registerForDraggedTypes(_newTypes: CFArrayRef); + procedure unregisterDraggedTypes; + function windowHandle: Pointer; + // create an NSWindow for a Carbon window - windowRef must be a Carbon WindowRef - + // see MacWindows.h + constructor initWithWindowRef(_windowRef: Pointer); + // return the Carbon WindowRef for this window, creating if necessary: - see MacWindows.h + function windowRef: Pointer; end; + {.$else} + {.$endif} {$endif} {$endif} + {$ifdef IMPLEMENTATION} +const + StrNSWindow_NSWindow = 'NSWindow'; + StrNSWindow_frameRectForContentRect_styleMask = 'frameRectForContentRect:styleMask:'; + StrNSWindow_contentRectForFrameRect_styleMask = 'contentRectForFrameRect:styleMask:'; + StrNSWindow_minFrameWidthWithTitle_styleMask = 'minFrameWidthWithTitle:styleMask:'; + StrNSWindow_defaultDepthLimit = 'defaultDepthLimit'; + StrNSWindow_frameRectForContentRect = 'frameRectForContentRect:'; + StrNSWindow_contentRectForFrameRect = 'contentRectForFrameRect:'; + StrNSWindow_initWithContentRect_styleMask_backing_defer = 'initWithContentRect:styleMask:backing:defer:'; + StrNSWindow_initWithContentRect_styleMask_backing_defer_screen = 'initWithContentRect:styleMask:backing:defer:screen:'; + StrNSWindow_title = 'title'; + StrNSWindow_setTitle = 'setTitle:'; + StrNSWindow_representedFilename = 'representedFilename'; + StrNSWindow_setRepresentedFilename = 'setRepresentedFilename:'; + StrNSWindow_setTitleWithRepresentedFilename = 'setTitleWithRepresentedFilename:'; + StrNSWindow_setExcludedFromWindowsMenu = 'setExcludedFromWindowsMenu:'; + StrNSWindow_isExcludedFromWindowsMenu = 'isExcludedFromWindowsMenu'; + StrNSWindow_setContentView = 'setContentView:'; + StrNSWindow_contentView = 'contentView'; + StrNSWindow_setDelegate = 'setDelegate:'; + StrNSWindow_delegate = 'delegate'; + StrNSWindow_windowNumber = 'windowNumber'; + StrNSWindow_styleMask = 'styleMask'; + StrNSWindow_fieldEditor_forObject = 'fieldEditor:forObject:'; + StrNSWindow_endEditingFor = 'endEditingFor:'; + StrNSWindow_constrainFrameRect_toScreen = 'constrainFrameRect:toScreen:'; + StrNSWindow_setFrame_display = 'setFrame:display:'; + StrNSWindow_setContentSize = 'setContentSize:'; + StrNSWindow_setFrameOrigin = 'setFrameOrigin:'; + StrNSWindow_setFrameTopLeftPoint = 'setFrameTopLeftPoint:'; + StrNSWindow_cascadeTopLeftFromPoint = 'cascadeTopLeftFromPoint:'; + StrNSWindow_frame = 'frame'; + StrNSWindow_animationResizeTime = 'animationResizeTime:'; + StrNSWindow_setFrame_display_animate = 'setFrame:display:animate:'; + StrNSWindow_setShowsResizeIndicator = 'setShowsResizeIndicator:'; + StrNSWindow_showsResizeIndicator = 'showsResizeIndicator'; + StrNSWindow_setResizeIncrements = 'setResizeIncrements:'; + StrNSWindow_resizeIncrements = 'resizeIncrements'; + StrNSWindow_setAspectRatio = 'setAspectRatio:'; + StrNSWindow_aspectRatio = 'aspectRatio'; + StrNSWindow_setContentResizeIncrements = 'setContentResizeIncrements:'; + StrNSWindow_contentResizeIncrements = 'contentResizeIncrements'; + StrNSWindow_setContentAspectRatio = 'setContentAspectRatio:'; + StrNSWindow_contentAspectRatio = 'contentAspectRatio'; + StrNSWindow_useOptimizedDrawing = 'useOptimizedDrawing:'; + StrNSWindow_disableFlushWindow = 'disableFlushWindow'; + StrNSWindow_enableFlushWindow = 'enableFlushWindow'; + StrNSWindow_isFlushWindowDisabled = 'isFlushWindowDisabled'; + StrNSWindow_flushWindow = 'flushWindow'; + StrNSWindow_flushWindowIfNeeded = 'flushWindowIfNeeded'; + StrNSWindow_setViewsNeedDisplay = 'setViewsNeedDisplay:'; + StrNSWindow_viewsNeedDisplay = 'viewsNeedDisplay'; + StrNSWindow_displayIfNeeded = 'displayIfNeeded'; + StrNSWindow_display = 'display'; + StrNSWindow_setAutodisplay = 'setAutodisplay:'; + StrNSWindow_isAutodisplay = 'isAutodisplay'; + StrNSWindow_preservesContentDuringLiveResize = 'preservesContentDuringLiveResize'; + StrNSWindow_setPreservesContentDuringLiveResize = 'setPreservesContentDuringLiveResize:'; + StrNSWindow_update = 'update'; + StrNSWindow_makeFirstResponder = 'makeFirstResponder:'; + StrNSWindow_firstResponder = 'firstResponder'; + StrNSWindow_resizeFlags = 'resizeFlags'; + StrNSWindow_keyDown = 'keyDown:'; + StrNSWindow_close = 'close'; + StrNSWindow_setReleasedWhenClosed = 'setReleasedWhenClosed:'; + StrNSWindow_isReleasedWhenClosed = 'isReleasedWhenClosed'; + StrNSWindow_miniaturize = 'miniaturize:'; + StrNSWindow_deminiaturize = 'deminiaturize:'; + StrNSWindow_isZoomed = 'isZoomed'; + StrNSWindow_zoom = 'zoom:'; + StrNSWindow_isMiniaturized = 'isMiniaturized'; + StrNSWindow_tryToPerform_with = 'tryToPerform:with:'; + StrNSWindow_validRequestorForSendType_returnType = 'validRequestorForSendType:returnType:'; + StrNSWindow_setBackgroundColor = 'setBackgroundColor:'; + StrNSWindow_backgroundColor = 'backgroundColor'; + StrNSWindow_setMovableByWindowBackground = 'setMovableByWindowBackground:'; + StrNSWindow_isMovableByWindowBackground = 'isMovableByWindowBackground'; + StrNSWindow_setHidesOnDeactivate = 'setHidesOnDeactivate:'; + StrNSWindow_hidesOnDeactivate = 'hidesOnDeactivate'; + StrNSWindow_setCanHide = 'setCanHide:'; + StrNSWindow_canHide = 'canHide'; + StrNSWindow_center = 'center'; + StrNSWindow_makeKeyAndOrderFront = 'makeKeyAndOrderFront:'; + StrNSWindow_orderFront = 'orderFront:'; + StrNSWindow_orderBack = 'orderBack:'; + StrNSWindow_orderOut = 'orderOut:'; + StrNSWindow_orderWindow_relativeTo = 'orderWindow:relativeTo:'; + StrNSWindow_orderFrontRegardless = 'orderFrontRegardless'; + StrNSWindow_setMiniwindowImage = 'setMiniwindowImage:'; + StrNSWindow_setMiniwindowTitle = 'setMiniwindowTitle:'; + StrNSWindow_miniwindowImage = 'miniwindowImage'; + StrNSWindow_miniwindowTitle = 'miniwindowTitle'; + StrNSWindow_setDocumentEdited = 'setDocumentEdited:'; + StrNSWindow_isDocumentEdited = 'isDocumentEdited'; + StrNSWindow_isVisible = 'isVisible'; + StrNSWindow_isKeyWindow = 'isKeyWindow'; + StrNSWindow_isMainWindow = 'isMainWindow'; + StrNSWindow_canBecomeKeyWindow = 'canBecomeKeyWindow'; + StrNSWindow_canBecomeMainWindow = 'canBecomeMainWindow'; + StrNSWindow_makeKeyWindow = 'makeKeyWindow'; + StrNSWindow_makeMainWindow = 'makeMainWindow'; + StrNSWindow_becomeKeyWindow = 'becomeKeyWindow'; + StrNSWindow_resignKeyWindow = 'resignKeyWindow'; + StrNSWindow_becomeMainWindow = 'becomeMainWindow'; + StrNSWindow_resignMainWindow = 'resignMainWindow'; + StrNSWindow_worksWhenModal = 'worksWhenModal'; + StrNSWindow_convertBaseToScreen = 'convertBaseToScreen:'; + StrNSWindow_convertScreenToBase = 'convertScreenToBase:'; + StrNSWindow_performClose = 'performClose:'; + StrNSWindow_performMiniaturize = 'performMiniaturize:'; + StrNSWindow_performZoom = 'performZoom:'; + StrNSWindow_gState = 'gState'; + StrNSWindow_setOneShot = 'setOneShot:'; + StrNSWindow_isOneShot = 'isOneShot'; + StrNSWindow_dataWithEPSInsideRect = 'dataWithEPSInsideRect:'; + StrNSWindow_dataWithPDFInsideRect = 'dataWithPDFInsideRect:'; + StrNSWindow_print = 'print:'; + StrNSWindow_disableCursorRects = 'disableCursorRects'; + StrNSWindow_enableCursorRects = 'enableCursorRects'; + StrNSWindow_discardCursorRects = 'discardCursorRects'; + StrNSWindow_areCursorRectsEnabled = 'areCursorRectsEnabled'; + StrNSWindow_invalidateCursorRectsForView = 'invalidateCursorRectsForView:'; + StrNSWindow_resetCursorRects = 'resetCursorRects'; + StrNSWindow_setAllowsToolTipsWhenApplicationIsInactive = 'setAllowsToolTipsWhenApplicationIsInactive:'; + StrNSWindow_allowsToolTipsWhenApplicationIsInactive = 'allowsToolTipsWhenApplicationIsInactive'; + StrNSWindow_setBackingType = 'setBackingType:'; + StrNSWindow_backingType = 'backingType'; + StrNSWindow_setLevel = 'setLevel:'; + StrNSWindow_level = 'level'; + StrNSWindow_setDepthLimit = 'setDepthLimit:'; + StrNSWindow_depthLimit = 'depthLimit'; + StrNSWindow_setDynamicDepthLimit = 'setDynamicDepthLimit:'; + StrNSWindow_hasDynamicDepthLimit = 'hasDynamicDepthLimit'; + StrNSWindow_screen = 'screen'; + StrNSWindow_deepestScreen = 'deepestScreen'; + StrNSWindow_canStoreColor = 'canStoreColor'; + StrNSWindow_setHasShadow = 'setHasShadow:'; + StrNSWindow_hasShadow = 'hasShadow'; + StrNSWindow_invalidateShadow = 'invalidateShadow'; + StrNSWindow_setAlphaValue = 'setAlphaValue:'; + StrNSWindow_alphaValue = 'alphaValue'; + StrNSWindow_setOpaque = 'setOpaque:'; + StrNSWindow_isOpaque = 'isOpaque'; + StrNSWindow_displaysWhenScreenProfileChanges = 'displaysWhenScreenProfileChanges'; + StrNSWindow_setDisplaysWhenScreenProfileChanges = 'setDisplaysWhenScreenProfileChanges:'; + StrNSWindow_disableScreenUpdatesUntilFlush = 'disableScreenUpdatesUntilFlush'; + StrNSWindow_stringWithSavedFrame = 'stringWithSavedFrame'; + StrNSWindow_setFrameFromString = 'setFrameFromString:'; + StrNSWindow_saveFrameUsingName = 'saveFrameUsingName:'; + StrNSWindow_setFrameUsingName_force = 'setFrameUsingName:force:'; + StrNSWindow_setFrameUsingName = 'setFrameUsingName:'; + StrNSWindow_setFrameAutosaveName = 'setFrameAutosaveName:'; + StrNSWindow_frameAutosaveName = 'frameAutosaveName'; + StrNSWindow_removeFrameUsingName = 'removeFrameUsingName:'; + StrNSWindow_cacheImageInRect = 'cacheImageInRect:'; + StrNSWindow_restoreCachedImage = 'restoreCachedImage'; + StrNSWindow_discardCachedImage = 'discardCachedImage'; + StrNSWindow_minSize = 'minSize'; + StrNSWindow_maxSize = 'maxSize'; + StrNSWindow_setMinSize = 'setMinSize:'; + StrNSWindow_setMaxSize = 'setMaxSize:'; + StrNSWindow_contentMinSize = 'contentMinSize'; + StrNSWindow_contentMaxSize = 'contentMaxSize'; + StrNSWindow_setContentMinSize = 'setContentMinSize:'; + StrNSWindow_setContentMaxSize = 'setContentMaxSize:'; + StrNSWindow_nextEventMatchingMask = 'nextEventMatchingMask:'; + StrNSWindow_nextEventMatchingMask_untilDate_inMode_dequeue = 'nextEventMatchingMask:untilDate:inMode:dequeue:'; + StrNSWindow_discardEventsMatchingMask_beforeEvent = 'discardEventsMatchingMask:beforeEvent:'; + StrNSWindow_postEvent_atStart = 'postEvent:atStart:'; + StrNSWindow_currentEvent = 'currentEvent'; + StrNSWindow_setAcceptsMouseMovedEvents = 'setAcceptsMouseMovedEvents:'; + StrNSWindow_acceptsMouseMovedEvents = 'acceptsMouseMovedEvents'; + StrNSWindow_setIgnoresMouseEvents = 'setIgnoresMouseEvents:'; + StrNSWindow_ignoresMouseEvents = 'ignoresMouseEvents'; + StrNSWindow_deviceDescription = 'deviceDescription'; + StrNSWindow_sendEvent = 'sendEvent:'; + StrNSWindow_mouseLocationOutsideOfEventStream = 'mouseLocationOutsideOfEventStream'; + StrNSWindow_menuChanged = 'menuChanged:'; + StrNSWindow_windowController = 'windowController'; + StrNSWindow_setWindowController = 'setWindowController:'; + StrNSWindow_isSheet = 'isSheet'; + StrNSWindow_attachedSheet = 'attachedSheet'; + StrNSWindow_standardWindowButton_forStyleMask = 'standardWindowButton:forStyleMask:'; + StrNSWindow_standardWindowButton = 'standardWindowButton:'; + StrNSWindow_addChildWindow_ordered = 'addChildWindow:ordered:'; + StrNSWindow_removeChildWindow = 'removeChildWindow:'; + StrNSWindow_childWindows = 'childWindows'; + StrNSWindow_parentWindow = 'parentWindow'; + StrNSWindow_setParentWindow = 'setParentWindow:'; + StrNSWindow_graphicsContext = 'graphicsContext'; + StrNSWindow_userSpaceScaleFactor = 'userSpaceScaleFactor'; -function NSWindow.getClass: objc.id; + StrNSWindow_setInitialFirstResponder = 'setInitialFirstResponder:'; + StrNSWindow_initialFirstResponder = 'initialFirstResponder'; + StrNSWindow_selectNextKeyView = 'selectNextKeyView:'; + StrNSWindow_selectPreviousKeyView = 'selectPreviousKeyView:'; + StrNSWindow_selectKeyViewFollowingView = 'selectKeyViewFollowingView:'; + StrNSWindow_selectKeyViewPrecedingView = 'selectKeyViewPrecedingView:'; + StrNSWindow_keyViewSelectionDirection = 'keyViewSelectionDirection'; + StrNSWindow_setDefaultButtonCell = 'setDefaultButtonCell:'; + StrNSWindow_defaultButtonCell = 'defaultButtonCell'; + StrNSWindow_disableKeyEquivalentForDefaultButtonCell = 'disableKeyEquivalentForDefaultButtonCell'; + StrNSWindow_enableKeyEquivalentForDefaultButtonCell = 'enableKeyEquivalentForDefaultButtonCell'; + StrNSWindow_setAutorecalculatesKeyViewLoop = 'setAutorecalculatesKeyViewLoop:'; + StrNSWindow_autorecalculatesKeyViewLoop = 'autorecalculatesKeyViewLoop'; + StrNSWindow_recalculateKeyViewLoop = 'recalculateKeyViewLoop'; + + StrNSWindow_setToolbar = 'setToolbar:'; + StrNSWindow_toolbar = 'toolbar'; + StrNSWindow_toggleToolbarShown = 'toggleToolbarShown:'; + StrNSWindow_runToolbarCustomizationPalette = 'runToolbarCustomizationPalette:'; + StrNSWindow_setShowsToolbarButton = 'setShowsToolbarButton:'; + StrNSWindow_showsToolbarButton = 'showsToolbarButton'; + + StrNSWindow_dragImage_at_offset_event_pasteboard_source_slideBack = 'dragImage:at:offset:event:pasteboard:source:slideBack:'; + StrNSWindow_registerForDraggedTypes = 'registerForDraggedTypes:'; + StrNSWindow_unregisterDraggedTypes = 'unregisterDraggedTypes'; + + StrNSWindow_windowHandle = 'windowHandle'; + + StrNSWindow_initWithWindowRef = 'initWithWindowRef:'; + StrNSWindow_windowRef = 'windowRef'; + +{ NSWindow } + +class function NSWindow.getClass: objc.id; begin - Result := objc_getClass(Str_NSWindow); + Result := objc_getClass(StrNSWindow_NSWindow); end; -constructor NSWindow.initWithContentRect( - contentRect: NSRect; - aStyle: cuint; - bufferingType: NSBackingStoreType; - defer: CBOOL); +class function NSWindow.frameRectForContentRect_styleMask(_cRect: NSRect; _aStyle: LongWord): NSRect; type - initWithContentRect_t = function (param1: objc.id; param2: SEL; - param3, param4, param5, param6: cfloat; - param7: cuint; - param8: NSBackingStoreType; param9: BOOL): objc.id; cdecl; + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_cRect: NSRect; _aStyle: LongWord); cdecl; var - vinit: initWithContentRect_t; + vmethod: TmsgSendWrapper; begin -{ NSWindow* MainWindow = [[NSWindow alloc] initWithContentRect: MainWindowRect - styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask - backing: NSBackingStoreBuffered - defer: NO]; } - ClassId := getClass(); - allocbuf := objc_msgSend(ClassId, sel_registerName(PChar(Str_alloc)), []); - vinit := initWithContentRect_t(@objc_msgSend); - Handle := vinit(allocbuf, sel_registerName(PChar(Str_initWithContentRect)), - contentRect.origin.x, contentRect.origin.y, contentRect.size.width, contentRect.size.height, - aStyle, bufferingType, defer); + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, getClass, sel_registerName(PChar(StrNSWindow_frameRectForContentRect_styleMask)), _cRect, _aStyle); end; -procedure NSWindow.setTitle(aString: CFStringRef); +class function NSWindow.contentRectForFrameRect_styleMask(_fRect: NSRect; _aStyle: LongWord): NSRect; type - setTitle_t = procedure (param1: objc.id; param2: SEL; - param3: CFStringRef); cdecl; + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_fRect: NSRect; _aStyle: LongWord); cdecl; var - vmethod: setTitle_t; + vmethod: TmsgSendWrapper; begin - vmethod := setTitle_t(@objc_msgSend); - vmethod(Handle, sel_registerName(PChar(Str_setTitle)), aString); + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, getClass, sel_registerName(PChar(StrNSWindow_contentRectForFrameRect_styleMask)), _fRect, _aStyle); +end; + +class function NSWindow.minFrameWidthWithTitle_styleMask(_aTitle: CFStringRef; _aStyle: LongWord): Single; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_aTitle: CFStringRef; _aStyle: LongWord): Single; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := Single(vmethod(getClass, sel_registerName(PChar(StrNSWindow_minFrameWidthWithTitle_styleMask)), _aTitle, _aStyle)); +end; + +class function NSWindow.defaultDepthLimit: NSWindowDepth; +begin + Result := NSWindowDepth(objc_msgSend(getClass, sel_registerName(PChar(StrNSWindow_defaultDepthLimit)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} +function NSWindow.frameRectForContentRect(_contentRect: NSRect): NSRect; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_contentRect: NSRect); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_frameRectForContentRect)), _contentRect); +end; + +function NSWindow.contentRectForFrameRect(_frameRect: NSRect): NSRect; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_frameRect: NSRect); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_contentRectForFrameRect)), _frameRect); +end; + +{.$endif} +constructor NSWindow.initWithContentRect_styleMask_backing_defer(_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool); +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + ClassID := getClass(); + allocbuf := objc_msgSend(ClassID, sel_registerName(PChar(Str_alloc)), []); + vmethod := TmsgSendWrapper(@objc_msgSend); + Handle := vmethod(allocbuf, sel_registerName(PChar(StrNSWindow_initWithContentRect_styleMask_backing_defer)), _contentRect, _aStyle, _bufferingType, _flag); +end; + +constructor NSWindow.initWithContentRect_styleMask_backing_defer_screen(_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool; _screen: objc.id {NSScreen}); +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_contentRect: NSRect; _aStyle: LongWord; _bufferingType: NSBackingStoreType; _flag: LongBool; _screen: objc.id {NSScreen}): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + ClassID := getClass(); + allocbuf := objc_msgSend(ClassID, sel_registerName(PChar(Str_alloc)), []); + vmethod := TmsgSendWrapper(@objc_msgSend); + Handle := vmethod(allocbuf, sel_registerName(PChar(StrNSWindow_initWithContentRect_styleMask_backing_defer_screen)), _contentRect, _aStyle, _bufferingType, _flag, _screen); +end; + +function NSWindow.title: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_title)), [])); +end; + +procedure NSWindow.setTitle(_aString: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setTitle)), _aString); +end; + +function NSWindow.representedFilename: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_representedFilename)), [])); +end; + +procedure NSWindow.setRepresentedFilename(_aString: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setRepresentedFilename)), _aString); +end; + +procedure NSWindow.setTitleWithRepresentedFilename(_filename: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_filename: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setTitleWithRepresentedFilename)), _filename); +end; + +procedure NSWindow.setExcludedFromWindowsMenu(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setExcludedFromWindowsMenu)), _flag); +end; + +function NSWindow.isExcludedFromWindowsMenu: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isExcludedFromWindowsMenu)), [])); +end; + +procedure NSWindow.setContentView(_aView: objc.id {NSView}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aView: objc.id {NSView}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentView)), _aView); end; function NSWindow.contentView: objc.id; begin - Result := objc_msgSend(Handle, sel_registerName(PChar(Str_contentView)), []); + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_contentView)), [])); +end; + +procedure NSWindow.setDelegate(_anObject: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_anObject: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDelegate)), _anObject); +end; + +function NSWindow.delegate: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_delegate)), [])); +end; + +function NSWindow.windowNumber: Integer; +begin + Result := Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_windowNumber)), [])); +end; + +function NSWindow.styleMask: LongWord; +begin + Result := LongWord(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_styleMask)), [])); +end; + +function NSWindow.fieldEditor_forObject(_createFlag: LongBool; _anObject: objc.id): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_createFlag: LongBool; _anObject: objc.id): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSWindow_fieldEditor_forObject)), _createFlag, _anObject)); +end; + +procedure NSWindow.endEditingFor(_anObject: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_anObject: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_endEditingFor)), _anObject); +end; + +function NSWindow.constrainFrameRect_toScreen(_frameRect: NSRect; _screen: objc.id {NSScreen}): NSRect; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_frameRect: NSRect; _screen: objc.id {NSScreen}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_constrainFrameRect_toScreen)), _frameRect, _screen); +end; + +procedure NSWindow.setFrame_display(_frameRect: NSRect; _flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_frameRect: NSRect; _flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrame_display)), _frameRect, _flag); +end; + +procedure NSWindow.setContentSize(_aSize: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aSize: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentSize)), _aSize); +end; + +procedure NSWindow.setFrameOrigin(_aPoint: NSPoint); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aPoint: NSPoint); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameOrigin)), _aPoint); +end; + +procedure NSWindow.setFrameTopLeftPoint(_aPoint: NSPoint); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aPoint: NSPoint); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameTopLeftPoint)), _aPoint); +end; + +function NSWindow.cascadeTopLeftFromPoint(_topLeftPoint: NSPoint): NSPoint; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_topLeftPoint: NSPoint); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_cascadeTopLeftFromPoint)), _topLeftPoint); +end; + +function NSWindow.frame: NSRect; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_frame)), []); +end; + +{function NSWindow.animationResizeTime(_newFrame: NSRect): NSTimeInterval; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_newFrame: NSRect): NSTimeInterval; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_stret); + Result := vmethod(Handle, sel_registerName(PChar(StrNSWindow_animationResizeTime)), _newFrame); +end;} + +procedure NSWindow.setFrame_display_animate(_frameRect: NSRect; _displayFlag: LongBool; _animateFlag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_frameRect: NSRect; _displayFlag: LongBool; _animateFlag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrame_display_animate)), _frameRect, _displayFlag, _animateFlag); +end; + +procedure NSWindow.setShowsResizeIndicator(_show: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_show: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setShowsResizeIndicator)), _show); +end; + +function NSWindow.showsResizeIndicator: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_showsResizeIndicator)), [])); +end; + +procedure NSWindow.setResizeIncrements(_increments: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_increments: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setResizeIncrements)), _increments); +end; + +function NSWindow.resizeIncrements: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_resizeIncrements)), []); +end; + +procedure NSWindow.setAspectRatio(_ratio: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_ratio: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAspectRatio)), _ratio); +end; + +function NSWindow.aspectRatio: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_aspectRatio)), []); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} +procedure NSWindow.setContentResizeIncrements(_increments: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_increments: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentResizeIncrements)), _increments); +end; + +function NSWindow.contentResizeIncrements: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_contentResizeIncrements)), []); +end; + +procedure NSWindow.setContentAspectRatio(_ratio: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_ratio: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentAspectRatio)), _ratio); +end; + +function NSWindow.contentAspectRatio: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_contentAspectRatio)), []); +end; + +{.$endif} +procedure NSWindow.useOptimizedDrawing(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_useOptimizedDrawing)), _flag); +end; + +procedure NSWindow.disableFlushWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_disableFlushWindow)), []); +end; + +procedure NSWindow.enableFlushWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_enableFlushWindow)), []); +end; + +function NSWindow.isFlushWindowDisabled: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isFlushWindowDisabled)), [])); +end; + +procedure NSWindow.flushWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_flushWindow)), []); +end; + +procedure NSWindow.flushWindowIfNeeded; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_flushWindowIfNeeded)), []); +end; + +procedure NSWindow.setViewsNeedDisplay(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setViewsNeedDisplay)), _flag); +end; + +function NSWindow.viewsNeedDisplay: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_viewsNeedDisplay)), [])); +end; + +procedure NSWindow.displayIfNeeded; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_displayIfNeeded)), []); +end; + +procedure NSWindow.display; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_display)), []); +end; + +procedure NSWindow.setAutodisplay(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAutodisplay)), _flag); +end; + +function NSWindow.isAutodisplay: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isAutodisplay)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} +function NSWindow.preservesContentDuringLiveResize: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_preservesContentDuringLiveResize)), [])); +end; + +procedure NSWindow.setPreservesContentDuringLiveResize(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setPreservesContentDuringLiveResize)), _flag); +end; + +{.$endif} +procedure NSWindow.update; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_update)), []); +end; + +function NSWindow.makeFirstResponder(_aResponder: NSResponder): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_aResponder: NSResponder): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_makeFirstResponder)), _aResponder)); +end; + +function NSWindow.firstResponder: NSResponder; +begin + Result := NSResponder(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_firstResponder)), [])); +end; + +function NSWindow.resizeFlags: Integer; +begin + Result := Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_resizeFlags)), [])); +end; + +procedure NSWindow.keyDown(_theEvent: objc.id {NSEvent}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_theEvent: objc.id {NSEvent}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_keyDown)), _theEvent); +end; + +procedure NSWindow.close; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_close)), []); +end; + +procedure NSWindow.setReleasedWhenClosed(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setReleasedWhenClosed)), _flag); +end; + +function NSWindow.isReleasedWhenClosed: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isReleasedWhenClosed)), [])); +end; + +procedure NSWindow.miniaturize(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_miniaturize)), _sender); +end; + +procedure NSWindow.deminiaturize(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_deminiaturize)), _sender); +end; + +function NSWindow.isZoomed: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isZoomed)), [])); +end; + +procedure NSWindow.zoom(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_zoom)), _sender); +end; + +function NSWindow.isMiniaturized: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isMiniaturized)), [])); +end; + +function NSWindow.tryToPerform_with(_anAction: SEL; _anObject: objc.id): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_anAction: SEL; _anObject: objc.id): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_tryToPerform_with)), _anAction, _anObject)); +end; + +function NSWindow.validRequestorForSendType_returnType(_sendType: CFStringRef; _returnType: CFStringRef): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_sendType: CFStringRef; _returnType: CFStringRef): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSWindow_validRequestorForSendType_returnType)), _sendType, _returnType)); +end; + +procedure NSWindow.setBackgroundColor(_color: objc.id {NSColor}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_color: objc.id {NSColor}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setBackgroundColor)), _color); +end; + +function NSWindow.backgroundColor: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_backgroundColor)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} +procedure NSWindow.setMovableByWindowBackground(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setMovableByWindowBackground)), _flag); +end; + +function NSWindow.isMovableByWindowBackground: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isMovableByWindowBackground)), [])); +end; + +{.$endif} +procedure NSWindow.setHidesOnDeactivate(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setHidesOnDeactivate)), _flag); +end; + +function NSWindow.hidesOnDeactivate: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_hidesOnDeactivate)), [])); +end; + +procedure NSWindow.setCanHide(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setCanHide)), _flag); +end; + +function NSWindow.canHide: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_canHide)), [])); +end; + +procedure NSWindow.center; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_center)), []); +end; + +procedure NSWindow.makeKeyAndOrderFront(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_makeKeyAndOrderFront)), _sender); +end; + +procedure NSWindow.orderFront(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_orderFront)), _sender); +end; + +procedure NSWindow.orderBack(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_orderBack)), _sender); +end; + +procedure NSWindow.orderOut(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_orderOut)), _sender); +end; + +procedure NSWindow.orderWindow_relativeTo(_place: NSWindowOrderingMode; _otherWin: Integer); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_place: NSWindowOrderingMode; _otherWin: Integer); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_orderWindow_relativeTo)), _place, _otherWin); end; procedure NSWindow.orderFrontRegardless; begin - objc_msgSend(Handle, sel_registerName(PChar(Str_orderFrontRegardless)), []); + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_orderFrontRegardless)), []); +end; + +procedure NSWindow.setMiniwindowImage(_image: objc.id {NSImage}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: objc.id {NSImage}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setMiniwindowImage)), _image); +end; + +procedure NSWindow.setMiniwindowTitle(_title: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_title: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setMiniwindowTitle)), _title); +end; + +function NSWindow.miniwindowImage: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_miniwindowImage)), [])); +end; + +function NSWindow.miniwindowTitle: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_miniwindowTitle)), [])); +end; + +procedure NSWindow.setDocumentEdited(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDocumentEdited)), _flag); +end; + +function NSWindow.isDocumentEdited: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isDocumentEdited)), [])); +end; + +function NSWindow.isVisible: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isVisible)), [])); +end; + +function NSWindow.isKeyWindow: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isKeyWindow)), [])); +end; + +function NSWindow.isMainWindow: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isMainWindow)), [])); +end; + +function NSWindow.canBecomeKeyWindow: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_canBecomeKeyWindow)), [])); +end; + +function NSWindow.canBecomeMainWindow: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_canBecomeMainWindow)), [])); +end; + +procedure NSWindow.makeKeyWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_makeKeyWindow)), []); +end; + +procedure NSWindow.makeMainWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_makeMainWindow)), []); +end; + +procedure NSWindow.becomeKeyWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_becomeKeyWindow)), []); +end; + +procedure NSWindow.resignKeyWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_resignKeyWindow)), []); +end; + +procedure NSWindow.becomeMainWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_becomeMainWindow)), []); +end; + +procedure NSWindow.resignMainWindow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_resignMainWindow)), []); +end; + +function NSWindow.worksWhenModal: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_worksWhenModal)), [])); +end; + +function NSWindow.convertBaseToScreen(_aPoint: NSPoint): NSPoint; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_aPoint: NSPoint); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_convertBaseToScreen)), _aPoint); +end; + +function NSWindow.convertScreenToBase(_aPoint: NSPoint): NSPoint; +type + TmsgSendWrapper = procedure (result_param: Pointer; param1: objc.id; param2: SEL;_aPoint: NSPoint); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend_fpret); + vmethod(@Result, Handle, sel_registerName(PChar(StrNSWindow_convertScreenToBase)), _aPoint); +end; + +procedure NSWindow.performClose(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_performClose)), _sender); +end; + +procedure NSWindow.performMiniaturize(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_performMiniaturize)), _sender); +end; + +procedure NSWindow.performZoom(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_performZoom)), _sender); +end; + +function NSWindow.gState: Integer; +begin + Result := Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_gState)), [])); +end; + +procedure NSWindow.setOneShot(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setOneShot)), _flag); +end; + +function NSWindow.isOneShot: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isOneShot)), [])); +end; + +function NSWindow.dataWithEPSInsideRect(_rect: NSRect): CFDataRef; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_rect: NSRect): CFDataRef; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := CFDataRef(vmethod(Handle, sel_registerName(PChar(StrNSWindow_dataWithEPSInsideRect)), _rect)); +end; + +function NSWindow.dataWithPDFInsideRect(_rect: NSRect): CFDataRef; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_rect: NSRect): CFDataRef; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := CFDataRef(vmethod(Handle, sel_registerName(PChar(StrNSWindow_dataWithPDFInsideRect)), _rect)); +end; + +procedure NSWindow.print(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_print)), _sender); +end; + +procedure NSWindow.disableCursorRects; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_disableCursorRects)), []); +end; + +procedure NSWindow.enableCursorRects; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_enableCursorRects)), []); +end; + +procedure NSWindow.discardCursorRects; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_discardCursorRects)), []); +end; + +function NSWindow.areCursorRectsEnabled: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_areCursorRectsEnabled)), [])); +end; + +procedure NSWindow.invalidateCursorRectsForView(_aView: objc.id {NSView}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aView: objc.id {NSView}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_invalidateCursorRectsForView)), _aView); +end; + +procedure NSWindow.resetCursorRects; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_resetCursorRects)), []); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} +procedure NSWindow.setAllowsToolTipsWhenApplicationIsInactive(_allowWhenInactive: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_allowWhenInactive: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAllowsToolTipsWhenApplicationIsInactive)), _allowWhenInactive); +end; + +function NSWindow.allowsToolTipsWhenApplicationIsInactive: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_allowsToolTipsWhenApplicationIsInactive)), [])); +end; + +{.$endif} +procedure NSWindow.setBackingType(_bufferingType: NSBackingStoreType); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_bufferingType: NSBackingStoreType); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setBackingType)), _bufferingType); +end; + +function NSWindow.backingType: NSBackingStoreType; +begin + Result := NSBackingStoreType(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_backingType)), [])); +end; + +procedure NSWindow.setLevel(_newLevel: Integer); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_newLevel: Integer); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setLevel)), _newLevel); +end; + +function NSWindow.level: Integer; +begin + Result := Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_level)), [])); +end; + +procedure NSWindow.setDepthLimit(_limit: NSWindowDepth); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_limit: NSWindowDepth); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDepthLimit)), _limit); +end; + +function NSWindow.depthLimit: NSWindowDepth; +begin + Result := NSWindowDepth(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_depthLimit)), [])); +end; + +procedure NSWindow.setDynamicDepthLimit(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDynamicDepthLimit)), _flag); +end; + +function NSWindow.hasDynamicDepthLimit: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_hasDynamicDepthLimit)), [])); +end; + +function NSWindow.screen: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_screen)), [])); +end; + +function NSWindow.deepestScreen: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_deepestScreen)), [])); +end; + +function NSWindow.canStoreColor: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_canStoreColor)), [])); +end; + +procedure NSWindow.setHasShadow(_hasShadow: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_hasShadow: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setHasShadow)), _hasShadow); +end; + +function NSWindow.hasShadow: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_hasShadow)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} +procedure NSWindow.invalidateShadow; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_invalidateShadow)), []); +end; + +{.$endif} +procedure NSWindow.setAlphaValue(_windowAlpha: Single); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_windowAlpha: Single); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAlphaValue)), _windowAlpha); +end; + +function NSWindow.alphaValue: Single; +begin + Result := Single(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_alphaValue)), [])); +end; + +procedure NSWindow.setOpaque(_isOpaque: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_isOpaque: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setOpaque)), _isOpaque); +end; + +function NSWindow.isOpaque: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isOpaque)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} +function NSWindow.displaysWhenScreenProfileChanges: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_displaysWhenScreenProfileChanges)), [])); +end; + +procedure NSWindow.setDisplaysWhenScreenProfileChanges(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDisplaysWhenScreenProfileChanges)), _flag); +end; + +procedure NSWindow.disableScreenUpdatesUntilFlush; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_disableScreenUpdatesUntilFlush)), []); +end; + +{.$endif} +function NSWindow.stringWithSavedFrame: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_stringWithSavedFrame)), [])); +end; + +procedure NSWindow.setFrameFromString(__string: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;__string: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameFromString)), __string); +end; + +procedure NSWindow.saveFrameUsingName(_name: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_name: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_saveFrameUsingName)), _name); +end; + +function NSWindow.setFrameUsingName_force(_name: CFStringRef; _force: LongBool): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef; _force: LongBool): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameUsingName_force)), _name, _force)); +end; + +function NSWindow.setFrameUsingName(_name: CFStringRef): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameUsingName)), _name)); +end; + +function NSWindow.setFrameAutosaveName(_name: CFStringRef): LongBool; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef): LongBool; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_setFrameAutosaveName)), _name)); +end; + +function NSWindow.frameAutosaveName: CFStringRef; +begin + Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_frameAutosaveName)), [])); +end; + +class procedure NSWindow.removeFrameUsingName(_name: CFStringRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_name: CFStringRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(getClass, sel_registerName(PChar(StrNSWindow_removeFrameUsingName)), _name); +end; + +procedure NSWindow.cacheImageInRect(_aRect: NSRect); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aRect: NSRect); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_cacheImageInRect)), _aRect); +end; + +procedure NSWindow.restoreCachedImage; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_restoreCachedImage)), []); +end; + +procedure NSWindow.discardCachedImage; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_discardCachedImage)), []); +end; + +function NSWindow.minSize: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_minSize)), []); +end; + +function NSWindow.maxSize: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_maxSize)), []); +end; + +procedure NSWindow.setMinSize(_size: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_size: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setMinSize)), _size); +end; + +procedure NSWindow.setMaxSize(_size: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_size: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setMaxSize)), _size); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} +function NSWindow.contentMinSize: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_contentMinSize)), []); +end; + +function NSWindow.contentMaxSize: NSSize; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_contentMaxSize)), []); +end; + +procedure NSWindow.setContentMinSize(_size: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_size: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentMinSize)), _size); +end; + +procedure NSWindow.setContentMaxSize(_size: NSSize); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_size: NSSize); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setContentMaxSize)), _size); +end; + +{.$endif} +function NSWindow.nextEventMatchingMask(_mask: LongWord): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_mask: LongWord): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSWindow_nextEventMatchingMask)), _mask)); +end; + +function NSWindow.nextEventMatchingMask_untilDate_inMode_dequeue(_mask: LongWord; _expiration: CFDateRef; _mode: CFStringRef; _deqFlag: LongBool): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_mask: LongWord; _expiration: CFDateRef; _mode: CFStringRef; _deqFlag: LongBool): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSWindow_nextEventMatchingMask_untilDate_inMode_dequeue)), _mask, _expiration, _mode, _deqFlag)); +end; + +procedure NSWindow.discardEventsMatchingMask_beforeEvent(_mask: LongWord; _lastEvent: objc.id {NSEvent}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_mask: LongWord; _lastEvent: objc.id {NSEvent}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_discardEventsMatchingMask_beforeEvent)), _mask, _lastEvent); +end; + +procedure NSWindow.postEvent_atStart(_event: objc.id {NSEvent}; _flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_event: objc.id {NSEvent}; _flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_postEvent_atStart)), _event, _flag); +end; + +function NSWindow.currentEvent: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_currentEvent)), [])); +end; + +procedure NSWindow.setAcceptsMouseMovedEvents(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAcceptsMouseMovedEvents)), _flag); +end; + +function NSWindow.acceptsMouseMovedEvents: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_acceptsMouseMovedEvents)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} +procedure NSWindow.setIgnoresMouseEvents(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setIgnoresMouseEvents)), _flag); +end; + +function NSWindow.ignoresMouseEvents: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_ignoresMouseEvents)), [])); +end; + +{.$endif} +function NSWindow.deviceDescription: CFDictionaryRef; +begin + Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_deviceDescription)), [])); +end; + +procedure NSWindow.sendEvent(_theEvent: objc.id {NSEvent}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_theEvent: objc.id {NSEvent}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_sendEvent)), _theEvent); +end; + +function NSWindow.mouseLocationOutsideOfEventStream: NSPoint; +begin + objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_mouseLocationOutsideOfEventStream)), []); +end; + +{class procedure NSWindow.menuChanged(_menu: NSMenu); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_menu: NSMenu); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(getClass, sel_registerName(PChar(StrNSWindow_menuChanged)), _menu); +end;} + +function NSWindow.windowController: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_windowController)), [])); +end; + +procedure NSWindow.setWindowController(_windowController: objc.id {NSWindowController}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_windowController: objc.id {NSWindowController}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setWindowController)), _windowController); +end; + +function NSWindow.isSheet: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isSheet)), [])); +end; + +function NSWindow.attachedSheet: NSWindow; +begin + Result := NSWindow(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_attachedSheet)), [])); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} +class function NSWindow.standardWindowButton_forStyleMask(_b: NSWindowButton; _styleMask: LongWord): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_b: NSWindowButton; _styleMask: LongWord): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(getClass, sel_registerName(PChar(StrNSWindow_standardWindowButton_forStyleMask)), _b, _styleMask)); +end; + +function NSWindow.standardWindowButton(_b: NSWindowButton): objc.id; +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_b: NSWindowButton): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSWindow_standardWindowButton)), _b)); +end; + +{.$endif} +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} +procedure NSWindow.addChildWindow_ordered(_childWin: NSWindow; _place: NSWindowOrderingMode); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: NSWindow; _place: NSWindowOrderingMode); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_addChildWindow_ordered)), _childWin, _place); +end; + +procedure NSWindow.removeChildWindow(_childWin: NSWindow); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: NSWindow); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_removeChildWindow)), _childWin); +end; + +function NSWindow.childWindows: CFArrayRef; +begin + Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_childWindows)), [])); +end; + +function NSWindow.parentWindow: NSWindow; +begin + Result := NSWindow(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_parentWindow)), [])); +end; + +procedure NSWindow.setParentWindow(_window: NSWindow); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_window: NSWindow); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setParentWindow)), _window); +end; + +{.$endif} +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} +function NSWindow.graphicsContext: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_graphicsContext)), [])); +end; + +function NSWindow.userSpaceScaleFactor: Single; +begin + Result := Single(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_userSpaceScaleFactor)), [])); +end; + +{.$endif} +procedure NSWindow.setInitialFirstResponder(_view: objc.id {NSView}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_view: objc.id {NSView}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setInitialFirstResponder)), _view); +end; + +function NSWindow.initialFirstResponder: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_initialFirstResponder)), [])); +end; + +procedure NSWindow.selectNextKeyView(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_selectNextKeyView)), _sender); +end; + +procedure NSWindow.selectPreviousKeyView(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_selectPreviousKeyView)), _sender); +end; + +procedure NSWindow.selectKeyViewFollowingView(_aView: objc.id {NSView}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aView: objc.id {NSView}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_selectKeyViewFollowingView)), _aView); +end; + +procedure NSWindow.selectKeyViewPrecedingView(_aView: objc.id {NSView}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aView: objc.id {NSView}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_selectKeyViewPrecedingView)), _aView); +end; + +function NSWindow.keyViewSelectionDirection: NSSelectionDirection; +begin + Result := NSSelectionDirection(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_keyViewSelectionDirection)), [])); +end; + +procedure NSWindow.setDefaultButtonCell(_defButt: objc.id {NSButtonCell}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_defButt: objc.id {NSButtonCell}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setDefaultButtonCell)), _defButt); +end; + +function NSWindow.defaultButtonCell: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_defaultButtonCell)), [])); +end; + +procedure NSWindow.disableKeyEquivalentForDefaultButtonCell; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_disableKeyEquivalentForDefaultButtonCell)), []); +end; + +procedure NSWindow.enableKeyEquivalentForDefaultButtonCell; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_enableKeyEquivalentForDefaultButtonCell)), []); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} +procedure NSWindow.setAutorecalculatesKeyViewLoop(_flag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_flag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setAutorecalculatesKeyViewLoop)), _flag); +end; + +function NSWindow.autorecalculatesKeyViewLoop: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_autorecalculatesKeyViewLoop)), [])); +end; + +procedure NSWindow.recalculateKeyViewLoop; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_recalculateKeyViewLoop)), []); +end; + +{.$endif} +procedure NSWindow.setToolbar(_toolbar: objc.id {NSToolbar}); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_toolbar: objc.id {NSToolbar}); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setToolbar)), _toolbar); +end; + +function NSWindow.toolbar: objc.id; +begin + Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_toolbar)), [])); +end; + +procedure NSWindow.toggleToolbarShown(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_toggleToolbarShown)), _sender); +end; + +procedure NSWindow.runToolbarCustomizationPalette(_sender: objc.id); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_sender: objc.id); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_runToolbarCustomizationPalette)), _sender); +end; + +{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} +procedure NSWindow.setShowsToolbarButton(_show: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_show: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_setShowsToolbarButton)), _show); +end; + +function NSWindow.showsToolbarButton: LongBool; +begin + Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_showsToolbarButton)), [])); +end; + +{.$endif} +procedure NSWindow.dragImage_at_offset_event_pasteboard_source_slideBack(_anImage: objc.id {NSImage}; _baseLocation: NSPoint; _initialOffset: NSSize; _event: objc.id {NSEvent}; _pboard: objc.id {NSPasteboard}; _sourceObj: objc.id; _slideFlag: LongBool); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_anImage: objc.id {NSImage}; _baseLocation: NSPoint; _initialOffset: NSSize; _event: objc.id {NSEvent}; _pboard: objc.id {NSPasteboard}; _sourceObj: objc.id; _slideFlag: LongBool); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_dragImage_at_offset_event_pasteboard_source_slideBack)), _anImage, _baseLocation, _initialOffset, _event, _pboard, _sourceObj, _slideFlag); +end; + +procedure NSWindow.registerForDraggedTypes(_newTypes: CFArrayRef); +type + TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_newTypes: CFArrayRef); cdecl; +var + vmethod: TmsgSendWrapper; +begin + vmethod := TmsgSendWrapper(@objc_msgSend); + vmethod(Handle, sel_registerName(PChar(StrNSWindow_registerForDraggedTypes)), _newTypes); +end; + +procedure NSWindow.unregisterDraggedTypes; +begin + objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_unregisterDraggedTypes)), []); +end; + +function NSWindow.windowHandle: Pointer; +begin + Result := Pointer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_windowHandle)), [])); +end; + +constructor NSWindow.initWithWindowRef(_windowRef: Pointer); +type + TmsgSendWrapper = function (param1: objc.id; param2: SEL;_windowRef: Pointer): objc.id; cdecl; +var + vmethod: TmsgSendWrapper; +begin + ClassID := getClass(); + allocbuf := objc_msgSend(ClassID, sel_registerName(PChar(Str_alloc)), []); + vmethod := TmsgSendWrapper(@objc_msgSend); + Handle := vmethod(allocbuf, sel_registerName(PChar(StrNSWindow_initWithWindowRef)), _windowRef); +end; + +function NSWindow.windowRef: Pointer; +begin + Result := Pointer(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_windowRef)), [])); end; {$endif} - diff --git a/bindings/pascocoa/appkit/appkit.pas b/bindings/pascocoa/appkit/appkit.pas index 1e94de4c7..6b71f5e76 100644 --- a/bindings/pascocoa/appkit/appkit.pas +++ b/bindings/pascocoa/appkit/appkit.pas @@ -15,13 +15,17 @@ unit appkit; interface -uses ctypes, FPCMacOSAll, objc, foundation; +uses ctypes, FPCMacOSAll, objc, foundation, coregraphics; {$define HEADER} {$include AppKit.inc} {$undef HEADER} type +{$define FORWARD} +{$include AppKit.inc} +{$undef FORWARD} + {$define CLASSES} {$include AppKit.inc} {$undef CLASSES} diff --git a/bindings/pascocoa/applicationservices/coregraphics/CGWindowLevel.inc b/bindings/pascocoa/applicationservices/coregraphics/CGWindowLevel.inc new file mode 100644 index 000000000..17d166d8f --- /dev/null +++ b/bindings/pascocoa/applicationservices/coregraphics/CGWindowLevel.inc @@ -0,0 +1,89 @@ +{%MainUnit CoreGraphics.pas} +{ + CGWindowLevel.h + CoreGraphics + + Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + +} + +//#include +//#include + +//CG_EXTERN_C_BEGIN + +{ + * Windows may be assigned to a particular level. When assigned to a level, + * the window is ordered relative to all other windows in that level. + * Windows with a higher level are sorted in front of windows with a lower + * level. + * + * A common set of window levels is defined here for use within higher + * level frameworks. The levels are accessed via a key and function, + * so that levels may be changed or adjusted in future releases without + * breaking binary compatability. + } + +type + CGWindowLevel = LongInt; + CGWindowLevelKey = LongInt; + + CGCommonWindowLevelKey = ( + kCGBaseWindowLevelKey = 0, + kCGMinimumWindowLevelKey, + kCGDesktopWindowLevelKey, + kCGBackstopMenuLevelKey, + kCGNormalWindowLevelKey, + kCGFloatingWindowLevelKey, + kCGTornOffMenuWindowLevelKey, + kCGDockWindowLevelKey, + kCGMainMenuWindowLevelKey, + kCGStatusWindowLevelKey, + kCGModalPanelWindowLevelKey, + kCGPopUpMenuWindowLevelKey, + kCGDraggingWindowLevelKey, + kCGScreenSaverWindowLevelKey, + kCGMaximumWindowLevelKey, + kCGOverlayWindowLevelKey, + kCGHelpWindowLevelKey, + kCGUtilityWindowLevelKey, + kCGDesktopIconWindowLevelKey, + kCGCursorWindowLevelKey, + kCGAssistiveTechHighWindowLevelKey, + kCGNumberOfWindowLevelKeys { Internal bookkeeping; must be last } + ); + +//CGWindowLevel CGWindowLevelForKey( CGWindowLevelKey key ); + +{ number of levels above kCGMaximumWindowLevel reserved for internal use } +const + kCGNumReservedWindowLevels = (16); + +{ Definitions of older constant values as calls } + kCGBaseWindowLevel = Low(LongInt); { LONG_MIN } + kCGMinimumWindowLevel = kCGBaseWindowLevel + 1; //CGWindowLevelForKey(kCGMinimumWindowLevelKey) /* (kCGBaseWindowLevel + 1) */ + kCGDesktopWindowLevel = kCGBaseWindowLevel; //CGWindowLevelForKey(kCGDesktopWindowLevelKey) /* kCGMinimumWindowLevel */ + kCGDesktopIconWindowLevel = kCGBaseWindowLevel + 20; //CGWindowLevelForKey(kCGDesktopIconWindowLevelKey) /* kCGMinimumWindowLevel + 20 */ + kCGBackstopMenuLevel = -20; //CGWindowLevelForKey(kCGBackstopMenuLevelKey) /* -20 */ + kCGNormalWindowLevel = 0; //CGWindowLevelForKey(kCGNormalWindowLevelKey) /* 0 */ + kCGFloatingWindowLevel = 3; //CGWindowLevelForKey(kCGFloatingWindowLevelKey) /* 3 */ + kCGTornOffMenuWindowLevel = 3; //CGWindowLevelForKey(kCGTornOffMenuWindowLevelKey) /* 3 */ + kCGDockWindowLevel = 20; //CGWindowLevelForKey(kCGDockWindowLevelKey) /* 20 */ + kCGMainMenuWindowLevel = 24; //CGWindowLevelForKey(kCGMainMenuWindowLevelKey) /* 24 */ + kCGStatusWindowLevel = 25; //CGWindowLevelForKey(kCGStatusWindowLevelKey) /* 25 */ + kCGModalPanelWindowLevel = 8; //CGWindowLevelForKey(kCGModalPanelWindowLevelKey) /* 8 */ + kCGPopUpMenuWindowLevel = 101; //CGWindowLevelForKey(kCGPopUpMenuWindowLevelKey) { 101 } + kCGDraggingWindowLevel = 500; //CGWindowLevelForKey(kCGDraggingWindowLevelKey) { 500 } + kCGScreenSaverWindowLevel = 1000; //CGWindowLevelForKey(kCGScreenSaverWindowLevelKey) { 1000 } + kCGCursorWindowLevel = 2000; //CGWindowLevelForKey(kCGCursorWindowLevelKey) { 2000 } + kCGOverlayWindowLevel = 102; //CGWindowLevelForKey(kCGOverlayWindowLevelKey) { 102 } + kCGHelpWindowLevel = 102; //CGWindowLevelForKey(kCGHelpWindowLevelKey) { 102 } + kCGUtilityWindowLevel = 19; //CGWindowLevelForKey(kCGUtilityWindowLevelKey) { 19 } + + kCGAssistiveTechHighWindowLevel = 1500; //CGWindowLevelForKey(kCGAssistiveTechHighWindowLevelKey) { 1500 } + + kCGMaximumWindowLevel = High(LongInt) -kCGNumReservedWindowLevels; { LONG_MAX - kCGNumReservedWindowLevels } + + +//CG_EXTERN_C_END + diff --git a/bindings/pascocoa/applicationservices/coregraphics/CoreGraphics.pas b/bindings/pascocoa/applicationservices/coregraphics/CoreGraphics.pas new file mode 100644 index 000000000..28fa60fcc --- /dev/null +++ b/bindings/pascocoa/applicationservices/coregraphics/CoreGraphics.pas @@ -0,0 +1,59 @@ +{ + CoreGraphics - CoreGraphics.h + Copyright (c) 2000 Apple Computer, Inc. + All rights reserved. + + Main CoreGraphics file. Includes all include files from CoreGraphics + + CoreGraphics is located inside the ApplicationServices framework +} +unit CoreGraphics; + +interface + +{#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include } +{$include CGWindowLevel.inc} + +implementation + +end. + diff --git a/bindings/pascocoa/examples/simplewindow/simplewindow.lpi b/bindings/pascocoa/examples/simplewindow/simplewindow.lpi index f4a25aaf5..d23a82071 100644 --- a/bindings/pascocoa/examples/simplewindow/simplewindow.lpi +++ b/bindings/pascocoa/examples/simplewindow/simplewindow.lpi @@ -11,7 +11,7 @@ - <ActiveEditorIndexAtStart Value="0"/> + <ActiveEditorIndexAtStart Value="2"/> </General> <VersionInfo> <ProjectVersion Value=""/> @@ -33,8 +33,8 @@ <Filename Value="simplewindow.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="simplewindow"/> - <CursorPos X="105" Y="56"/> - <TopLine Value="52"/> + <CursorPos X="13" Y="67"/> + <TopLine Value="45"/> <EditorIndex Value="0"/> <UsageCount Value="106"/> <Loaded Value="True"/> @@ -43,7 +43,7 @@ <Filename Value="../../appkit/appkit.pas"/> <UnitName Value="appkit"/> <CursorPos X="102" Y="36"/> - <TopLine Value="19"/> + <TopLine Value="14"/> <EditorIndex Value="1"/> <UsageCount Value="42"/> <Loaded Value="True"/> @@ -284,8 +284,8 @@ </Unit37> <Unit38> <Filename Value="../../appkit/NSStatusBar.inc"/> - <CursorPos X="1" Y="13"/> - <TopLine Value="4"/> + <CursorPos X="4" Y="10"/> + <TopLine Value="22"/> <EditorIndex Value="2"/> <UsageCount Value="50"/> <Loaded Value="True"/> diff --git a/bindings/pascocoa/examples/statusitem/controller.pas b/bindings/pascocoa/examples/statusitem/controller.pas index dd92c5936..f5660e4fc 100644 --- a/bindings/pascocoa/examples/statusitem/controller.pas +++ b/bindings/pascocoa/examples/statusitem/controller.pas @@ -22,11 +22,12 @@ type public { Extra binding functions } constructor Create; override; - function getClass: objc.id; override; + class function getClass: objc.id; override; procedure AddMethods; override; { Objective-c Methods } class procedure doShowStatusitem(_self: objc.id; _cmd: SEL; sender: objc.id); cdecl; static; class procedure doHideStatusitem(_self: objc.id; _cmd: SEL; sender: objc.id); cdecl; static; + class procedure doClose(_self: objc.id; _cmd: SEL; sender: objc.id); cdecl; static; class function applicationShouldTerminateAfterLastWindowClosed(_self: objc.id; _cmd: SEL; theApplication: objc.id): cbool; cdecl; static; { Other helper functions } @@ -45,11 +46,20 @@ const Str_doShowStatusitem = 'doShowStatusitem:'; Str_doHideStatusitem = 'doHideStatusitem:'; + Str_doClose = 'doClose:'; Str_applicationShouldTerminateAfterLastWindowClosed = 'applicationShouldTerminateAfterLastWindowClosed:'; var myController: TMyController; + { classes } + pool: NSAutoreleasePool; + MainWindow: NSWindow; + MainWindowView: NSView; + { strings and sizes} + CFTitle: CFStringRef; + MainWindowRect: NSRect; + implementation { TMyController } @@ -67,6 +77,7 @@ procedure TMyController.AddMethods; begin AddMethod(Str_doShowStatusItem, 'v@:@', Pointer(doShowStatusitem)); AddMethod(Str_doHideStatusitem, 'v@:@', Pointer(doHideStatusitem)); + AddMethod(Str_doClose, 'v@:@', Pointer(doClose)); AddMethod(Str_applicationShouldTerminateAfterLastWindowClosed, 'b@:@', Pointer(applicationShouldTerminateAfterLastWindowClosed)); end; @@ -88,7 +99,7 @@ begin image := NSImage.initWithContentsOfFile(fileName); end; -function TMyController.getClass: objc.id; +class function TMyController.getClass: objc.id; begin Result := objc_getClass(Str_TMyController); end; @@ -112,6 +123,11 @@ begin myController.item := nil; end; +class procedure TMyController.doClose(_self: objc.id; _cmd: SEL; sender: objc.id); cdecl; +begin + MainWindow.close; +end; + class function TMyController.applicationShouldTerminateAfterLastWindowClosed(_self: objc.id; _cmd: SEL; theApplication: objc.id): cbool; cdecl; begin diff --git a/bindings/pascocoa/examples/statusitem/statusitem.lpi b/bindings/pascocoa/examples/statusitem/statusitem.lpi index 175b8951c..4fd9e1fdb 100644 --- a/bindings/pascocoa/examples/statusitem/statusitem.lpi +++ b/bindings/pascocoa/examples/statusitem/statusitem.lpi @@ -26,15 +26,15 @@ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> - <Units Count="49"> + <Units Count="53"> <Unit0> <Filename Value="statusitem.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="statusitem"/> - <CursorPos X="19" Y="57"/> - <TopLine Value="5"/> + <CursorPos X="84" Y="40"/> + <TopLine Value="27"/> <EditorIndex Value="0"/> - <UsageCount Value="51"/> + <UsageCount Value="55"/> <Loaded Value="True"/> </Unit0> <Unit1> @@ -46,37 +46,38 @@ </Unit1> <Unit2> <Filename Value="../../appkit/NSButton.inc"/> - <CursorPos X="32" Y="98"/> - <TopLine Value="92"/> - <UsageCount Value="21"/> + <CursorPos X="6" Y="339"/> + <TopLine Value="318"/> + <EditorIndex Value="7"/> + <UsageCount Value="22"/> + <Loaded Value="True"/> </Unit2> <Unit3> <Filename Value="../../appkit/NSApplication.inc"/> - <CursorPos X="50" Y="133"/> - <TopLine Value="130"/> - <UsageCount Value="15"/> + <CursorPos X="3" Y="109"/> + <TopLine Value="96"/> + <EditorIndex Value="8"/> + <UsageCount Value="16"/> + <Loaded Value="True"/> </Unit3> <Unit4> <Filename Value="../../appkit/NSAlert.inc"/> <CursorPos X="1" Y="12"/> <TopLine Value="1"/> - <UsageCount Value="28"/> + <UsageCount Value="30"/> <Loaded Value="True"/> </Unit4> <Unit5> <Filename Value="../../appkit/NSStatusItem.inc"/> - <CursorPos X="1" Y="129"/> - <TopLine Value="113"/> - <EditorIndex Value="5"/> - <UsageCount Value="21"/> - <Loaded Value="True"/> + <CursorPos X="25" Y="109"/> + <TopLine Value="105"/> + <UsageCount Value="22"/> </Unit5> <Unit6> <Filename Value="../../appkit/AppKit.inc"/> - <CursorPos X="32" Y="27"/> - <TopLine Value="21"/> + <CursorPos X="17" Y="5"/> + <TopLine Value="1"/> <UsageCount Value="19"/> - <Loaded Value="True"/> </Unit6> <Unit7> <Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSActionCell.h"/> @@ -126,8 +127,8 @@ </Unit13> <Unit14> <Filename Value="../../appkit/NSControl.inc"/> - <CursorPos X="45" Y="142"/> - <TopLine Value="142"/> + <CursorPos X="43" Y="144"/> + <TopLine Value="138"/> <UsageCount Value="24"/> </Unit14> <Unit15> @@ -139,8 +140,8 @@ </Unit15> <Unit16> <Filename Value="../../appkit/NSView.inc"/> - <CursorPos X="40" Y="101"/> - <TopLine Value="97"/> + <CursorPos X="38" Y="11"/> + <TopLine Value="2"/> <UsageCount Value="20"/> </Unit16> <Unit17> @@ -152,23 +153,26 @@ </Unit17> <Unit18> <Filename Value="../../appkit/NSResponder.inc"/> - <CursorPos X="46" Y="3"/> + <CursorPos X="42" Y="8"/> <TopLine Value="1"/> <UsageCount Value="22"/> </Unit18> <Unit19> <Filename Value="../../appkit/appkit.pas"/> <UnitName Value="appkit"/> - <CursorPos X="32" Y="27"/> - <TopLine Value="21"/> - <UsageCount Value="27"/> + <CursorPos X="32" Y="22"/> + <TopLine Value="10"/> + <EditorIndex Value="3"/> + <UsageCount Value="29"/> <Loaded Value="True"/> </Unit19> <Unit20> <Filename Value="../../appkit/NSWindow.inc"/> - <CursorPos X="39" Y="95"/> - <TopLine Value="92"/> - <UsageCount Value="21"/> + <CursorPos X="58" Y="1977"/> + <TopLine Value="1971"/> + <EditorIndex Value="5"/> + <UsageCount Value="23"/> + <Loaded Value="True"/> </Unit20> <Unit21> <Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h"/> @@ -186,8 +190,8 @@ </Unit22> <Unit23> <Filename Value="../../appkit/NSTextField.inc"/> - <CursorPos X="47" Y="71"/> - <TopLine Value="69"/> + <CursorPos X="47" Y="73"/> + <TopLine Value="63"/> <UsageCount Value="10"/> </Unit23> <Unit24> @@ -216,46 +220,44 @@ </Unit27> <Unit28> <Filename Value="../../foundation/NSObject.inc"/> - <CursorPos X="32" Y="202"/> - <TopLine Value="193"/> - <EditorIndex Value="3"/> - <UsageCount Value="14"/> - <Loaded Value="True"/> + <CursorPos X="54" Y="10"/> + <TopLine Value="1"/> + <UsageCount Value="15"/> </Unit28> <Unit29> <Filename Value="../../appkit/NSStatusBar.inc"/> - <CursorPos X="58" Y="25"/> - <TopLine Value="21"/> + <CursorPos X="7" Y="55"/> + <TopLine Value="38"/> + <EditorIndex Value="6"/> <UsageCount Value="21"/> + <Loaded Value="True"/> </Unit29> <Unit30> <Filename Value="../../foundation/NSAutoreleasePool.inc"/> - <CursorPos X="26" Y="19"/> - <TopLine Value="13"/> + <CursorPos X="50" Y="9"/> + <TopLine Value="1"/> <UsageCount Value="10"/> </Unit30> <Unit31> <Filename Value="../../../objc/objc-class.inc"/> - <CursorPos X="11" Y="168"/> - <TopLine Value="159"/> - <EditorIndex Value="4"/> - <UsageCount Value="13"/> - <Loaded Value="True"/> + <CursorPos X="70" Y="54"/> + <TopLine Value="47"/> + <UsageCount Value="14"/> </Unit31> <Unit32> <Filename Value="../../../objc/objc.inc"/> - <CursorPos X="65" Y="75"/> - <TopLine Value="73"/> + <CursorPos X="50" Y="53"/> + <TopLine Value="37"/> <UsageCount Value="16"/> </Unit32> <Unit33> <Filename Value="controller.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="controller"/> - <CursorPos X="26" Y="28"/> - <TopLine Value="19"/> + <CursorPos X="19" Y="128"/> + <TopLine Value="119"/> <EditorIndex Value="1"/> - <UsageCount Value="35"/> + <UsageCount Value="39"/> <Loaded Value="True"/> </Unit33> <Unit34> @@ -267,8 +269,8 @@ </Unit34> <Unit35> <Filename Value="../../appkit/NSImage.inc"/> - <CursorPos X="39" Y="172"/> - <TopLine Value="169"/> + <CursorPos X="60" Y="170"/> + <TopLine Value="160"/> <UsageCount Value="28"/> </Unit35> <Unit36> @@ -305,9 +307,9 @@ <Filename Value="../../foundation/foundation.pas"/> <UnitName Value="foundation"/> <CursorPos X="16" Y="10"/> - <TopLine Value="9"/> - <EditorIndex Value="2"/> - <UsageCount Value="11"/> + <TopLine Value="3"/> + <EditorIndex Value="4"/> + <UsageCount Value="13"/> <Loaded Value="True"/> </Unit40> <Unit41> @@ -364,35 +366,155 @@ <TopLine Value="71"/> <UsageCount Value="10"/> </Unit48> + <Unit49> + <Filename Value="../../applicationservices/coregraphics/CoreGraphics.pas"/> + <UnitName Value="CoreGraphics"/> + <CursorPos X="25" Y="4"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + </Unit49> + <Unit50> + <Filename Value="../../applicationservices/coregraphics/CGWindowLevel.inc"/> + <CursorPos X="13" Y="1"/> + <TopLine Value="1"/> + <EditorIndex Value="2"/> + <UsageCount Value="11"/> + <Loaded Value="True"/> + </Unit50> + <Unit51> + <Filename Value="../../applicationservices/CoreGraphics.pas"/> + <UnitName Value="CoreGraphics"/> + <CursorPos X="54" Y="37"/> + <TopLine Value="34"/> + <UsageCount Value="10"/> + </Unit51> + <Unit52> + <Filename Value="../../appkit/NSGraphics.inc"/> + <CursorPos X="24" Y="138"/> + <TopLine Value="136"/> + <UsageCount Value="10"/> + </Unit52> </Units> - <JumpHistory Count="5" HistoryIndex="4"> + <JumpHistory Count="28" HistoryIndex="27"> <Position1> - <Filename Value="../../foundation/NSObject.inc"/> - <Caret Line="262" Column="13" TopLine="246"/> + <Filename Value="../../appkit/NSApplication.inc"/> + <Caret Line="109" Column="1" TopLine="96"/> </Position1> <Position2> - <Filename Value="../../foundation/NSObject.inc"/> - <Caret Line="215" Column="31" TopLine="206"/> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="140" Column="15" TopLine="122"/> </Position2> <Position3> - <Filename Value="../../foundation/NSObject.inc"/> - <Caret Line="216" Column="55" TopLine="206"/> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="178" Column="3" TopLine="162"/> </Position3> <Position4> - <Filename Value="../../foundation/NSObject.inc"/> - <Caret Line="207" Column="8" TopLine="195"/> + <Filename Value="../../appkit/NSStatusBar.inc"/> + <Caret Line="25" Column="58" TopLine="21"/> </Position4> <Position5> - <Filename Value="../../foundation/NSObject.inc"/> - <Caret Line="204" Column="1" TopLine="194"/> + <Filename Value="../../appkit/NSButton.inc"/> + <Caret Line="35" Column="73" TopLine="28"/> </Position5> + <Position6> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="347" Column="3" TopLine="334"/> + </Position6> + <Position7> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="911" Column="6" TopLine="890"/> + </Position7> + <Position8> + <Filename Value="controller.pas"/> + <Caret Line="128" Column="3" TopLine="112"/> + </Position8> + <Position9> + <Filename Value="statusitem.pas"/> + <Caret Line="19" Column="60" TopLine="19"/> + </Position9> + <Position10> + <Filename Value="statusitem.pas"/> + <Caret Line="40" Column="21" TopLine="27"/> + </Position10> + <Position11> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="135" Column="3" TopLine="122"/> + </Position11> + <Position12> + <Filename Value="statusitem.pas"/> + <Caret Line="40" Column="42" TopLine="29"/> + </Position12> + <Position13> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="147" Column="21" TopLine="134"/> + </Position13> + <Position14> + <Filename Value="statusitem.pas"/> + <Caret Line="42" Column="41" TopLine="29"/> + </Position14> + <Position15> + <Filename Value="controller.pas"/> + <Caret Line="61" Column="22" TopLine="47"/> + </Position15> + <Position16> + <Filename Value="statusitem.pas"/> + <Caret Line="40" Column="55" TopLine="27"/> + </Position16> + <Position17> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="147" Column="41" TopLine="134"/> + </Position17> + <Position18> + <Filename Value="statusitem.pas"/> + <Caret Line="40" Column="76" TopLine="27"/> + </Position18> + <Position19> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="1" Column="1" TopLine="1"/> + </Position19> + <Position20> + <Filename Value="../../appkit/NSButton.inc"/> + <Caret Line="1" Column="1" TopLine="1"/> + </Position20> + <Position21> + <Filename Value="../../appkit/NSButton.inc"/> + <Caret Line="35" Column="1" TopLine="14"/> + </Position21> + <Position22> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="16" Column="3" TopLine="1"/> + </Position22> + <Position23> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="125" Column="3" TopLine="108"/> + </Position23> + <Position24> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="175" Column="3" TopLine="162"/> + </Position24> + <Position25> + <Filename Value="../../appkit/NSButton.inc"/> + <Caret Line="65" Column="3" TopLine="52"/> + </Position25> + <Position26> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="347" Column="3" TopLine="334"/> + </Position26> + <Position27> + <Filename Value="../../appkit/NSWindow.inc"/> + <Caret Line="911" Column="6" TopLine="890"/> + </Position27> + <Position28> + <Filename Value="../../applicationservices/coregraphics/CGWindowLevel.inc"/> + <Caret Line="1" Column="13" TopLine="1"/> + </Position28> </JumpHistory> </ProjectOptions> <CompilerOptions> <Version Value="5"/> <SearchPaths> - <OtherUnitFiles Value="../../appkit/;../../../objc/;../../foundation/"/> - <SrcPath Value="../../appkit/;../../../objc/;../../foundation/"/> + <OtherUnitFiles Value="../../appkit/;../../../objc/;../../foundation/;../../applicationservices/coregraphics/"/> + <SrcPath Value="../../appkit/;../../../objc/;../../foundation/;../../applicationservices/coregraphics/"/> </SearchPaths> <CodeGeneration> <Generate Value="Faster"/> diff --git a/bindings/pascocoa/examples/statusitem/statusitem.pas b/bindings/pascocoa/examples/statusitem/statusitem.pas index 311aba12c..058c45ff6 100644 --- a/bindings/pascocoa/examples/statusitem/statusitem.pas +++ b/bindings/pascocoa/examples/statusitem/statusitem.pas @@ -22,14 +22,7 @@ const Str_Window_Title = 'StatusItem example project'; Str_Show_Button = 'Show StatusItem'; Str_Hide_Button = 'Hide StatusItem'; -var - { classes } - pool: NSAutoreleasePool; - MainWindow: NSWindow; - MainWindowView: NSView; - { strings and sizes} - CFTitle: CFStringRef; - MainWindowRect: NSRect; + Str_Close_Button = 'Exit Program'; begin { Creates the AutoreleasePool } pool := NSAutoreleasePool.Create; @@ -44,9 +37,9 @@ begin MainWindowRect.size.width := 300.0; MainWindowRect.size.height := 500.0; - MainWindow := NSWindow.initWithContentRect(MainWindowRect, + MainWindow := NSWindow.initWithContentRect_styleMask_backing_defer(MainWindowRect, NSTitledWindowMask or NSClosableWindowMask or NSMiniaturizableWindowMask or NSResizableWindowMask, - NSBackingStoreBuffered, NO); + NSBackingStoreBuffered, LongBool(NO)); MainWindowView := NSView.CreateWithHandle(MainWindow.contentView); CFTitle := CFStringCreateWithPascalString(nil, Str_Window_Title, kCFStringEncodingUTF8); @@ -66,6 +59,10 @@ begin 50.0, MainWindowRect.size.height - 100.0, 200.0, 25.0, Str_doHideStatusItem, myController); + myController.CreateButton(MainWindowView, Str_Close_Button, + 50.0, MainWindowRect.size.height - 150.0, 200.0, 25.0, + Str_doClose, myController); + { Enters main message loop } MainWindow.orderFrontRegardless; diff --git a/bindings/pascocoa/foundation/NSAutoreleasePool.inc b/bindings/pascocoa/foundation/NSAutoreleasePool.inc index 6607bd7c6..552100351 100644 --- a/bindings/pascocoa/foundation/NSAutoreleasePool.inc +++ b/bindings/pascocoa/foundation/NSAutoreleasePool.inc @@ -1,3 +1,4 @@ +{%MainUnit Foundation.pas} { NSAutoreleasePool.h Copyright (c) 1994-2005, Apple, Inc. All rights reserved. } @@ -22,7 +23,7 @@ const NSAutoreleasePool = class(NSObject) public { Extra binding functions } - function getClass: objc.id; override; + class function getClass: objc.id; override; public //+ (void)addObject:(id)anObject; @@ -39,7 +40,7 @@ const {$endif} {$ifdef IMPLEMENTATION} -function NSAutoreleasePool.getClass: objc.id; +class function NSAutoreleasePool.getClass: objc.id; begin Result := objc_getClass(Str_NSAutoreleasePool); end; diff --git a/bindings/pascocoa/foundation/NSObject.inc b/bindings/pascocoa/foundation/NSObject.inc index 500a7d626..2eff4326f 100644 --- a/bindings/pascocoa/foundation/NSObject.inc +++ b/bindings/pascocoa/foundation/NSObject.inc @@ -1,3 +1,4 @@ +{%MainUnit Foundation.pas} { NSObject.h Copyright (c) 1994-2005, Apple, Inc. All rights reserved. } @@ -58,7 +59,7 @@ FOUNDATION_EXPORT unsigned NSExtraRefCount(id object);} constructor CreateWithHandle(aHandle: objc.id); destructor Destroy; override; { Extra binding functions } - function getClass: objc.id; virtual; + class function getClass: objc.id; virtual; procedure AddMethods; virtual; { Class creation methods } procedure AddMethod(aName, aParameters: string; aPointer: Pointer); @@ -193,7 +194,7 @@ begin if Handle <> nil then release; end; -function NSObject.getClass: objc.id; +class function NSObject.getClass: objc.id; begin Result := objc_getClass(Str_NSObject); end; diff --git a/bindings/pascocoa/parser/buildappkit.sh b/bindings/pascocoa/parser/buildappkit.sh new file mode 100755 index 000000000..4e4bef102 --- /dev/null +++ b/bindings/pascocoa/parser/buildappkit.sh @@ -0,0 +1,3 @@ +./objcparser -ini=default.ini /System/Library/Frameworks/AppKit.framework/Headers/NSButton.h > ../appkit/NSButton.inc +./objcparser -ini=default.ini /System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h > ../appkit/NSWindow.inc +./objcparser -ini=default.ini /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h > ../appkit/NSGraphics.inc diff --git a/bindings/pascocoa/parser/default.ini b/bindings/pascocoa/parser/default.ini index 3ad111103..529205519 100755 --- a/bindings/pascocoa/parser/default.ini +++ b/bindings/pascocoa/parser/default.ini @@ -7,7 +7,6 @@ ignoreincludes4=ApplicationServices/../FrameWorks/CoreGraphics.framework/Headers ignoreincludes5=AvailabilityMacros.h [TypeReplace] -NSRect=CGRect NSStringRef=CFStringRef NSStringRef*=CFStringRef NSArray=CFArrayRef @@ -40,11 +39,11 @@ NSMutableSet = CFMutableSetRef NSMutableString = CFMutableStringRef NSNumber = CFNumberRef NSInputStream = CFReadStreamRef -NSTimer = CFRunLoopTimerRef -NSSet = CFSetRef -NSString = CFStringRef -NSTimeZone = CFTimeZoneRef -NSURL = CFURLRef +NSTimer= CFRunLoopTimerRef +NSSet= CFSetRef +NSString=CFStringRef +NSTimeZone= CFTimeZoneRef +NSURL= CFURLRef NSOutputStream = CFWriteStreamRef AEDesc*=AEDescPtr NSMutableData*= CFMutableDataRef diff --git a/bindings/pascocoa/parser/objcparser.lpi b/bindings/pascocoa/parser/objcparser.lpi index de8748238..9d671f2ea 100755 --- a/bindings/pascocoa/parser/objcparser.lpi +++ b/bindings/pascocoa/parser/objcparser.lpi @@ -61,52 +61,7 @@ <Loaded Value="True"/> </Unit2> </Units> - <JumpHistory Count="11" HistoryIndex="10"> - <Position1> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="1772" Column="46" TopLine="1769"/> - </Position1> - <Position2> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="1" Column="1" TopLine="1"/> - </Position2> - <Position3> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="64" Column="85" TopLine="52"/> - </Position3> - <Position4> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="89" Column="42" TopLine="77"/> - </Position4> - <Position5> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="91" Column="39" TopLine="79"/> - </Position5> - <Position6> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="98" Column="39" TopLine="86"/> - </Position6> - <Position7> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="101" Column="32" TopLine="89"/> - </Position7> - <Position8> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="106" Column="49" TopLine="94"/> - </Position8> - <Position9> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="1" Column="1" TopLine="1"/> - </Position9> - <Position10> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="1365" Column="15" TopLine="1361"/> - </Position10> - <Position11> - <Filename Value="ObjCParserUtils.pas"/> - <Caret Line="1306" Column="3" TopLine="1295"/> - </Position11> - </JumpHistory> + <JumpHistory Count="0" HistoryIndex="-1"/> </ProjectOptions> <CompilerOptions> <Version Value="5"/>