Improves the PasCocoa bindings. Adds a script to parse appkit. NSWindow and NSButton are already taken from the parser.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@447 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2008-05-09 19:51:36 +00:00
parent 81763fac6a
commit bc7c85f132
21 changed files with 3184 additions and 887 deletions

View File

@ -106,15 +106,14 @@ const
//@class NSDate, NSDictionary, NSError, NSException, NSNotification; //@class NSDate, NSDictionary, NSError, NSException, NSNotification;
//@class NSGraphicsContext, NSImage, NSPasteboard, NSWindow; //@class NSGraphicsContext, NSImage, NSPasteboard, NSWindow;
NSWindow = class; // NSWindow = class;
{ The version of the AppKit framework } { The version of the AppKit framework }
//APPKIT_EXTERN const double NSAppKitVersionNumber; //APPKIT_EXTERN const double NSAppKitVersionNumber;
NSApplication = class(NSResponder) NSApplication = class(NSResponder)
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
constructor sharedApplication; constructor sharedApplication;
@ -363,7 +362,7 @@ If not specified, obtain from CFBundleShortVersionString key in infoDictionary.
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSApplication.getClass: objc.id; class function NSApplication.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSApplication); Result := objc_getClass(Str_NSApplication);
end; end;

View File

@ -1,129 +1,446 @@
{%mainunit appkit.pas} (*
{
NSButton.h NSButton.h
Application Kit Application Kit
Copyright (c) 1994-2005, Apple Computer, Inc. Copyright (c) 1994-2005, Apple Computer, Inc.
All rights reserved. All rights reserved.
} *)
{$ifdef HEADER} {$ifdef HEADER}
{$ifndef NSBUTTON_PAS_H} {$ifndef NSBUTTON_PAS_H}
{$define NSBUTTON_PAS_H} {$define NSBUTTON_PAS_H}
const {$include NSControl.inc}
Str_NSButton = 'NSButton'; {$include NSButtonCell.inc}
{$include NSImage.inc}
Str_setTitle = 'setTitle:';
Str_setBezelStyle = 'setBezelStyle:';
{$endif} {$endif}
{$endif} {$endif}
{$ifdef FORWARD}
{$ifndef NSBUTTON_PAS__FORWARD}
{$define NSBUTTON_PAS__FORWARD}
NSButton = class;
{$endif}
{$endif}
{$ifdef CLASSES} {$ifdef CLASSES}
{$ifndef NSBUTTON_PAS_C} {$ifndef NSBUTTON_PAS_C}
{$define NSBUTTON_PAS_C} {$define NSBUTTON_PAS_C}
{$include NSControl.inc} {$include NSControl.inc}
{$include NSButtonCell.inc} {$include NSButtonCell.inc}
{$include NSImage.inc}
//@class NSSound; { NSButton }
NSButton = class(NSControl) NSButton = class(NSControl)
public public
{ Extra binding functions } class function getClass: objc.id; override;
function getClass: objc.id; override; function title: CFStringRef;
public procedure setTitle(_aString: CFStringRef);
//- (NSString *)title; function alternateTitle: CFStringRef;
procedure setTitle(aString: CFStringRef); procedure setAlternateTitle(_aString: CFStringRef);
{- (NSString *)alternateTitle; function image: NSImage;
- (void)setAlternateTitle:(NSString *)aString; procedure setImage(_image: NSImage);
- (NSImage *)image; function alternateImage: NSImage;
- (void)setImage:(NSImage *)image; procedure setAlternateImage(_image: NSImage);
- (NSImage *)alternateImage; function imagePosition: NSCellImagePosition;
- (void)setAlternateImage:(NSImage *)image; procedure setImagePosition(_aPosition: NSCellImagePosition);
- (NSCellImagePosition)imagePosition; procedure setButtonType(_aType: NSButtonType);
- (void)setImagePosition:(NSCellImagePosition)aPosition; function state: Integer;
- (void)setButtonType:(NSButtonType)aType; procedure setState(_value: Integer);
- (int)state; function isBordered: LongBool;
- (void)setState:(int)value; procedure setBordered(_flag: LongBool);
- (BOOL)isBordered; function isTransparent: LongBool;
- (void)setBordered:(BOOL)flag; procedure setTransparent(_flag: LongBool);
- (BOOL)isTransparent; procedure setPeriodicDelay_interval(_delay: Single; _interval: Single);
- (void)setTransparent:(BOOL)flag; procedure getPeriodicDelay_interval(_delay: Single; _interval: Single);
- (void)setPeriodicDelay:(float)delay interval:(float)interval; function keyEquivalent: CFStringRef;
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval; procedure setKeyEquivalent(_charCode: CFStringRef);
- (NSString *)keyEquivalent; function keyEquivalentModifierMask: LongWord;
- (void)setKeyEquivalent:(NSString *)charCode; procedure setKeyEquivalentModifierMask(_mask: LongWord);
- (unsigned int)keyEquivalentModifierMask; procedure highlight(_flag: LongBool);
- (void)setKeyEquivalentModifierMask:(unsigned int)mask; // function performKeyEquivalent(_key: NSEvent): LongBool;
- (void)highlight:(BOOL)flag; procedure setTitleWithMnemonic(_stringWithAmpersand: CFStringRef);
- (BOOL)performKeyEquivalent:(NSEvent *)key; function attributedTitle: objc.id;{NSAttributedString}
procedure setAttributedTitle(_aString: objc.id {NSAttributedString});
@end function attributedAlternateTitle: objc.id;{NSAttributedString}
procedure setAttributedAlternateTitle(_obj: objc.id {NSAttributedString});
@interface NSButton(NSKeyboardUI) procedure setBezelStyle(_bezelStyle: NSBezelStyle);
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand; function bezelStyle: NSBezelStyle;
@end procedure setAllowsMixedState(_flag: LongBool);
function allowsMixedState: LongBool;
@interface NSButton(NSButtonAttributedStringMethods) procedure setNextState;
- (NSAttributedString *)attributedTitle; procedure setShowsBorderOnlyWhileMouseInside(_show: LongBool);
- (void)setAttributedTitle:(NSAttributedString *)aString; function showsBorderOnlyWhileMouseInside: LongBool;
- (NSAttributedString *)attributedAlternateTitle; procedure setSound(_aSound: objc.id {NSSound});
- (void)setAttributedAlternateTitle:(NSAttributedString *)obj; function sound: objc.id;{NSSound}
@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}
end; end;
{$endif} {$endif}
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$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 begin
Result := objc_getClass(Str_NSButton); Result := objc_getClass(StrNSButton_NSButton);
end; end;
procedure NSButton.setTitle(aString: CFStringRef); function NSButton.title: CFStringRef;
type
setTitle_t = procedure (param1: objc.id; param2: SEL;
param3: CFStringRef); cdecl;
var
vmethod: setTitle_t;
begin begin
vmethod := setTitle_t(@objc_msgSend); Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_title)), []));
vmethod(Handle, sel_registerName(PChar(Str_setTitle)), aString);
end; end;
procedure NSButton.setBezelStyle(bezelStyle: NSBezelStyle); procedure NSButton.setTitle(_aString: CFStringRef);
type type
setBezelStyle_t = procedure (param1: objc.id; param2: SEL; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_aString: CFStringRef); cdecl;
param3: NSBezelStyle); cdecl;
var var
vmethod: setBezelStyle_t; vmethod: TmsgSendWrapper;
begin begin
vmethod := setBezelStyle_t(@objc_msgSend); vmethod := TmsgSendWrapper(@objc_msgSend);
vmethod(Handle, sel_registerName(PChar(Str_setBezelStyle)), bezelStyle); 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; end;
{$endif} {$endif}

View File

@ -1,194 +1,161 @@
{%mainunit appkit.pas} (*
{
NSGraphics.h NSGraphics.h
Application Kit Application Kit
Copyright (c) 1994-2005, Apple Computer, Inc. Copyright (c) 1994-2005, Apple Computer, Inc.
All rights reserved. All rights reserved.
} *)
{$ifdef HEADER} {$ifdef HEADER}
{$ifndef NSGRAPHICS_PAS_H} {$ifndef NSGRAPHICS_PAS_H}
{$define NSGRAPHICS_PAS_H} {$define NSGRAPHICS_PAS_H}
//#import <Foundation/NSGeometry.h> {.$include NSGeometry.inc}
//#import <AppKit/AppKitDefines.h> {.$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 type
NSBackingStoreType = ( NSBackingStoreType = (
NSBackingStoreRetained = 0, NSBackingStoreRetained = 0,
NSBackingStoreNonretained = 1, NSBackingStoreNonretained = 1,
NSBackingStoreBuffered = 2); 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 */ type
typedef enum { NSWindowOrderingMode = (
NSFocusRingOnly = 0, NSWindowAbove = 1,
NSFocusRingBelow = 1, NSWindowBelow = 1,
NSFocusRingAbove = 2 NSWindowOut = 0
} NSFocusRingPlacement; );
#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 */ type
typedef enum _NSFocusRingType { NSFocusRingPlacement = (
NSFocusRingTypeDefault = 0, NSFocusRingOnly = 0,
NSFocusRingTypeNone = 1, NSFocusRingBelow = 1,
NSFocusRingAbove = 2
);
type
NSFocusRingType = (
NSFocusRingTypeDefault = 0,
NSFocusRingTypeNone = 1,
NSFocusRingTypeExterior = 2 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. //APPKIT_EXTERN NSString *NSCalibratedWhiteColorSpace; /* 1.0 == white */
*/ //APPKIT_EXTERN NSString *NSCalibratedBlackColorSpace; /* 1.0 == black */
typedef int NSWindowDepth; //APPKIT_EXTERN NSString *NSCalibratedRGBColorSpace;
APPKIT_EXTERN NSWindowDepth NSBestDepth (NSString *colorSpace, int bps, int bpp, BOOL planar, BOOL *exactMatch); //APPKIT_EXTERN NSString *NSDeviceWhiteColorSpace; /* 1.0 == white */
APPKIT_EXTERN BOOL NSPlanarFromDepth (NSWindowDepth depth); //APPKIT_EXTERN NSString *NSDeviceBlackColorSpace; /* 1.0 == black */
APPKIT_EXTERN NSString *NSColorSpaceFromDepth (NSWindowDepth depth); //APPKIT_EXTERN NSString *NSDeviceRGBColorSpace;
APPKIT_EXTERN int NSBitsPerSampleFromDepth (NSWindowDepth depth); //APPKIT_EXTERN NSString *NSDeviceCMYKColorSpace;
APPKIT_EXTERN int NSBitsPerPixelFromDepth (NSWindowDepth depth); //APPKIT_EXTERN NSString *NSNamedColorSpace; /* Used for "catalog" colors */
APPKIT_EXTERN int NSNumberOfColorComponents (NSString *colorSpaceName); //APPKIT_EXTERN NSString *NSPatternColorSpace;
APPKIT_EXTERN const NSWindowDepth *NSAvailableWindowDepths (void); /* 0 terminated */ //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 void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, id animationDelegate, SEL didEndSelector, void *contextInfo) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
*/
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 *)
{$endif} {$endif}
{$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}

View File

@ -53,7 +53,7 @@ const
NSImage = class(NSObject) // <NSCopying, NSCoding> NSImage = class(NSObject) // <NSCopying, NSCoding>
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
{ {
+ (id)imageNamed:(NSString *)name; /* If this finds & creates the image, only name is saved when archived */ + (id)imageNamed:(NSString *)name; /* If this finds & creates the image, only name is saved when archived */
@ -167,7 +167,7 @@ const
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSImage.getClass: objc.id; class function NSImage.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSImage); Result := objc_getClass(Str_NSImage);
end; end;

View File

@ -1,3 +1,4 @@
{%mainunit appkit.pas}
{ {
NSResponder.h NSResponder.h
Application Kit Application Kit

View File

@ -35,7 +35,7 @@ const
NSStatusBar = class(NSObject) NSStatusBar = class(NSObject)
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
constructor systemStatusBar(); constructor systemStatusBar();
@ -51,7 +51,7 @@ const
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSStatusBar.getClass: objc.id; class function NSStatusBar.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSStatusBar); Result := objc_getClass(Str_NSStatusBar);
end; end;

View File

@ -43,7 +43,7 @@ const
NSStatusItem = class(NSObject) NSStatusItem = class(NSObject)
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
{- (NSStatusBar*) statusBar; {- (NSStatusBar*) statusBar;
@ -112,7 +112,7 @@ const
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSStatusItem.getClass: objc.id; class function NSStatusItem.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSStatusItem); Result := objc_getClass(Str_NSStatusItem);
end; end;

View File

@ -29,7 +29,7 @@ const
NSTextField = class(NSControl) NSTextField = class(NSControl)
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
{- (void)setBackgroundColor:(NSColor *)color; {- (void)setBackgroundColor:(NSColor *)color;
@ -79,7 +79,7 @@ const
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSTextField.getClass: objc.id; class function NSTextField.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSTextField); Result := objc_getClass(Str_NSTextField);
end; end;

File diff suppressed because it is too large Load Diff

View File

@ -15,13 +15,17 @@ unit appkit;
interface interface
uses ctypes, FPCMacOSAll, objc, foundation; uses ctypes, FPCMacOSAll, objc, foundation, coregraphics;
{$define HEADER} {$define HEADER}
{$include AppKit.inc} {$include AppKit.inc}
{$undef HEADER} {$undef HEADER}
type type
{$define FORWARD}
{$include AppKit.inc}
{$undef FORWARD}
{$define CLASSES} {$define CLASSES}
{$include AppKit.inc} {$include AppKit.inc}
{$undef CLASSES} {$undef CLASSES}

View File

@ -0,0 +1,89 @@
{%MainUnit CoreGraphics.pas}
{
CGWindowLevel.h
CoreGraphics
Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
}
//#include <CoreGraphics/CGBase.h>
//#include <stdint.h>
//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

View File

@ -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 <CoreGraphics/CGBase.h>
#include <CoreGraphics/CGAffineTransform.h>
#include <CoreGraphics/CGBitmapContext.h>
#include <CoreGraphics/CGColor.h>
#include <CoreGraphics/CGColorSpace.h>
#include <CoreGraphics/CGContext.h>
#include <CoreGraphics/CGDataConsumer.h>
#include <CoreGraphics/CGDataProvider.h>
#include <CoreGraphics/CGDirectDisplay.h>
#include <CoreGraphics/CGDirectPalette.h>
#include <CoreGraphics/CGDisplayConfiguration.h>
#include <CoreGraphics/CGDisplayFade.h>
#include <CoreGraphics/CGError.h>
#include <CoreGraphics/CGEvent.h>
#include <CoreGraphics/CGEventSource.h>
#include <CoreGraphics/CGEventTypes.h>
#include <CoreGraphics/CGFont.h>
#include <CoreGraphics/CGFunction.h>
#include <CoreGraphics/CGGLContext.h>
#include <CoreGraphics/CGGeometry.h>
#include <CoreGraphics/CGImage.h>
#include <CoreGraphics/CGLayer.h>
#include <CoreGraphics/CGPDFArray.h>
#include <CoreGraphics/CGPDFContentStream.h>
#include <CoreGraphics/CGPDFContext.h>
#include <CoreGraphics/CGPDFDictionary.h>
#include <CoreGraphics/CGPDFDocument.h>
#include <CoreGraphics/CGPDFObject.h>
#include <CoreGraphics/CGPDFOperatorTable.h>
#include <CoreGraphics/CGPDFPage.h>
#include <CoreGraphics/CGPDFScanner.h>
#include <CoreGraphics/CGPDFStream.h>
#include <CoreGraphics/CGPDFString.h>
#include <CoreGraphics/CGPSConverter.h>
#include <CoreGraphics/CGPath.h>
#include <CoreGraphics/CGPattern.h>
#include <CoreGraphics/CGRemoteOperation.h>
#include <CoreGraphics/CGSession.h>
#include <CoreGraphics/CGShading.h>}
{$include CGWindowLevel.inc}
implementation
end.

View File

@ -11,7 +11,7 @@
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="simplewindow"/> <Title Value="simplewindow"/>
<ActiveEditorIndexAtStart Value="0"/> <ActiveEditorIndexAtStart Value="2"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -33,8 +33,8 @@
<Filename Value="simplewindow.pas"/> <Filename Value="simplewindow.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="simplewindow"/> <UnitName Value="simplewindow"/>
<CursorPos X="105" Y="56"/> <CursorPos X="13" Y="67"/>
<TopLine Value="52"/> <TopLine Value="45"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="106"/> <UsageCount Value="106"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -43,7 +43,7 @@
<Filename Value="../../appkit/appkit.pas"/> <Filename Value="../../appkit/appkit.pas"/>
<UnitName Value="appkit"/> <UnitName Value="appkit"/>
<CursorPos X="102" Y="36"/> <CursorPos X="102" Y="36"/>
<TopLine Value="19"/> <TopLine Value="14"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="42"/> <UsageCount Value="42"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -284,8 +284,8 @@
</Unit37> </Unit37>
<Unit38> <Unit38>
<Filename Value="../../appkit/NSStatusBar.inc"/> <Filename Value="../../appkit/NSStatusBar.inc"/>
<CursorPos X="1" Y="13"/> <CursorPos X="4" Y="10"/>
<TopLine Value="4"/> <TopLine Value="22"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<UsageCount Value="50"/> <UsageCount Value="50"/>
<Loaded Value="True"/> <Loaded Value="True"/>

View File

@ -22,11 +22,12 @@ type
public public
{ Extra binding functions } { Extra binding functions }
constructor Create; override; constructor Create; override;
function getClass: objc.id; override; class function getClass: objc.id; override;
procedure AddMethods; override; procedure AddMethods; override;
{ Objective-c Methods } { Objective-c Methods }
class procedure doShowStatusitem(_self: objc.id; _cmd: SEL; sender: objc.id); cdecl; static; 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 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; class function applicationShouldTerminateAfterLastWindowClosed(_self: objc.id;
_cmd: SEL; theApplication: objc.id): cbool; cdecl; static; _cmd: SEL; theApplication: objc.id): cbool; cdecl; static;
{ Other helper functions } { Other helper functions }
@ -45,11 +46,20 @@ const
Str_doShowStatusitem = 'doShowStatusitem:'; Str_doShowStatusitem = 'doShowStatusitem:';
Str_doHideStatusitem = 'doHideStatusitem:'; Str_doHideStatusitem = 'doHideStatusitem:';
Str_doClose = 'doClose:';
Str_applicationShouldTerminateAfterLastWindowClosed = 'applicationShouldTerminateAfterLastWindowClosed:'; Str_applicationShouldTerminateAfterLastWindowClosed = 'applicationShouldTerminateAfterLastWindowClosed:';
var var
myController: TMyController; myController: TMyController;
{ classes }
pool: NSAutoreleasePool;
MainWindow: NSWindow;
MainWindowView: NSView;
{ strings and sizes}
CFTitle: CFStringRef;
MainWindowRect: NSRect;
implementation implementation
{ TMyController } { TMyController }
@ -67,6 +77,7 @@ procedure TMyController.AddMethods;
begin begin
AddMethod(Str_doShowStatusItem, 'v@:@', Pointer(doShowStatusitem)); AddMethod(Str_doShowStatusItem, 'v@:@', Pointer(doShowStatusitem));
AddMethod(Str_doHideStatusitem, 'v@:@', Pointer(doHideStatusitem)); AddMethod(Str_doHideStatusitem, 'v@:@', Pointer(doHideStatusitem));
AddMethod(Str_doClose, 'v@:@', Pointer(doClose));
AddMethod(Str_applicationShouldTerminateAfterLastWindowClosed, 'b@:@', AddMethod(Str_applicationShouldTerminateAfterLastWindowClosed, 'b@:@',
Pointer(applicationShouldTerminateAfterLastWindowClosed)); Pointer(applicationShouldTerminateAfterLastWindowClosed));
end; end;
@ -88,7 +99,7 @@ begin
image := NSImage.initWithContentsOfFile(fileName); image := NSImage.initWithContentsOfFile(fileName);
end; end;
function TMyController.getClass: objc.id; class function TMyController.getClass: objc.id;
begin begin
Result := objc_getClass(Str_TMyController); Result := objc_getClass(Str_TMyController);
end; end;
@ -112,6 +123,11 @@ begin
myController.item := nil; myController.item := nil;
end; 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; class function TMyController.applicationShouldTerminateAfterLastWindowClosed(_self: objc.id;
_cmd: SEL; theApplication: objc.id): cbool; cdecl; _cmd: SEL; theApplication: objc.id): cbool; cdecl;
begin begin

View File

@ -26,15 +26,15 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<Units Count="49"> <Units Count="53">
<Unit0> <Unit0>
<Filename Value="statusitem.pas"/> <Filename Value="statusitem.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="statusitem"/> <UnitName Value="statusitem"/>
<CursorPos X="19" Y="57"/> <CursorPos X="84" Y="40"/>
<TopLine Value="5"/> <TopLine Value="27"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="51"/> <UsageCount Value="55"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -46,37 +46,38 @@
</Unit1> </Unit1>
<Unit2> <Unit2>
<Filename Value="../../appkit/NSButton.inc"/> <Filename Value="../../appkit/NSButton.inc"/>
<CursorPos X="32" Y="98"/> <CursorPos X="6" Y="339"/>
<TopLine Value="92"/> <TopLine Value="318"/>
<UsageCount Value="21"/> <EditorIndex Value="7"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="../../appkit/NSApplication.inc"/> <Filename Value="../../appkit/NSApplication.inc"/>
<CursorPos X="50" Y="133"/> <CursorPos X="3" Y="109"/>
<TopLine Value="130"/> <TopLine Value="96"/>
<UsageCount Value="15"/> <EditorIndex Value="8"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="../../appkit/NSAlert.inc"/> <Filename Value="../../appkit/NSAlert.inc"/>
<CursorPos X="1" Y="12"/> <CursorPos X="1" Y="12"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="28"/> <UsageCount Value="30"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="../../appkit/NSStatusItem.inc"/> <Filename Value="../../appkit/NSStatusItem.inc"/>
<CursorPos X="1" Y="129"/> <CursorPos X="25" Y="109"/>
<TopLine Value="113"/> <TopLine Value="105"/>
<EditorIndex Value="5"/> <UsageCount Value="22"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<Filename Value="../../appkit/AppKit.inc"/> <Filename Value="../../appkit/AppKit.inc"/>
<CursorPos X="32" Y="27"/> <CursorPos X="17" Y="5"/>
<TopLine Value="21"/> <TopLine Value="1"/>
<UsageCount Value="19"/> <UsageCount Value="19"/>
<Loaded Value="True"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSActionCell.h"/> <Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSActionCell.h"/>
@ -126,8 +127,8 @@
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="../../appkit/NSControl.inc"/> <Filename Value="../../appkit/NSControl.inc"/>
<CursorPos X="45" Y="142"/> <CursorPos X="43" Y="144"/>
<TopLine Value="142"/> <TopLine Value="138"/>
<UsageCount Value="24"/> <UsageCount Value="24"/>
</Unit14> </Unit14>
<Unit15> <Unit15>
@ -139,8 +140,8 @@
</Unit15> </Unit15>
<Unit16> <Unit16>
<Filename Value="../../appkit/NSView.inc"/> <Filename Value="../../appkit/NSView.inc"/>
<CursorPos X="40" Y="101"/> <CursorPos X="38" Y="11"/>
<TopLine Value="97"/> <TopLine Value="2"/>
<UsageCount Value="20"/> <UsageCount Value="20"/>
</Unit16> </Unit16>
<Unit17> <Unit17>
@ -152,23 +153,26 @@
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="../../appkit/NSResponder.inc"/> <Filename Value="../../appkit/NSResponder.inc"/>
<CursorPos X="46" Y="3"/> <CursorPos X="42" Y="8"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="22"/> <UsageCount Value="22"/>
</Unit18> </Unit18>
<Unit19> <Unit19>
<Filename Value="../../appkit/appkit.pas"/> <Filename Value="../../appkit/appkit.pas"/>
<UnitName Value="appkit"/> <UnitName Value="appkit"/>
<CursorPos X="32" Y="27"/> <CursorPos X="32" Y="22"/>
<TopLine Value="21"/> <TopLine Value="10"/>
<UsageCount Value="27"/> <EditorIndex Value="3"/>
<UsageCount Value="29"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit19> </Unit19>
<Unit20> <Unit20>
<Filename Value="../../appkit/NSWindow.inc"/> <Filename Value="../../appkit/NSWindow.inc"/>
<CursorPos X="39" Y="95"/> <CursorPos X="58" Y="1977"/>
<TopLine Value="92"/> <TopLine Value="1971"/>
<UsageCount Value="21"/> <EditorIndex Value="5"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit20> </Unit20>
<Unit21> <Unit21>
<Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h"/> <Filename Value="/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h"/>
@ -186,8 +190,8 @@
</Unit22> </Unit22>
<Unit23> <Unit23>
<Filename Value="../../appkit/NSTextField.inc"/> <Filename Value="../../appkit/NSTextField.inc"/>
<CursorPos X="47" Y="71"/> <CursorPos X="47" Y="73"/>
<TopLine Value="69"/> <TopLine Value="63"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit23> </Unit23>
<Unit24> <Unit24>
@ -216,46 +220,44 @@
</Unit27> </Unit27>
<Unit28> <Unit28>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../foundation/NSObject.inc"/>
<CursorPos X="32" Y="202"/> <CursorPos X="54" Y="10"/>
<TopLine Value="193"/> <TopLine Value="1"/>
<EditorIndex Value="3"/> <UsageCount Value="15"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit28> </Unit28>
<Unit29> <Unit29>
<Filename Value="../../appkit/NSStatusBar.inc"/> <Filename Value="../../appkit/NSStatusBar.inc"/>
<CursorPos X="58" Y="25"/> <CursorPos X="7" Y="55"/>
<TopLine Value="21"/> <TopLine Value="38"/>
<EditorIndex Value="6"/>
<UsageCount Value="21"/> <UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit29> </Unit29>
<Unit30> <Unit30>
<Filename Value="../../foundation/NSAutoreleasePool.inc"/> <Filename Value="../../foundation/NSAutoreleasePool.inc"/>
<CursorPos X="26" Y="19"/> <CursorPos X="50" Y="9"/>
<TopLine Value="13"/> <TopLine Value="1"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit30> </Unit30>
<Unit31> <Unit31>
<Filename Value="../../../objc/objc-class.inc"/> <Filename Value="../../../objc/objc-class.inc"/>
<CursorPos X="11" Y="168"/> <CursorPos X="70" Y="54"/>
<TopLine Value="159"/> <TopLine Value="47"/>
<EditorIndex Value="4"/> <UsageCount Value="14"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit31> </Unit31>
<Unit32> <Unit32>
<Filename Value="../../../objc/objc.inc"/> <Filename Value="../../../objc/objc.inc"/>
<CursorPos X="65" Y="75"/> <CursorPos X="50" Y="53"/>
<TopLine Value="73"/> <TopLine Value="37"/>
<UsageCount Value="16"/> <UsageCount Value="16"/>
</Unit32> </Unit32>
<Unit33> <Unit33>
<Filename Value="controller.pas"/> <Filename Value="controller.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="controller"/> <UnitName Value="controller"/>
<CursorPos X="26" Y="28"/> <CursorPos X="19" Y="128"/>
<TopLine Value="19"/> <TopLine Value="119"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="35"/> <UsageCount Value="39"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit33> </Unit33>
<Unit34> <Unit34>
@ -267,8 +269,8 @@
</Unit34> </Unit34>
<Unit35> <Unit35>
<Filename Value="../../appkit/NSImage.inc"/> <Filename Value="../../appkit/NSImage.inc"/>
<CursorPos X="39" Y="172"/> <CursorPos X="60" Y="170"/>
<TopLine Value="169"/> <TopLine Value="160"/>
<UsageCount Value="28"/> <UsageCount Value="28"/>
</Unit35> </Unit35>
<Unit36> <Unit36>
@ -305,9 +307,9 @@
<Filename Value="../../foundation/foundation.pas"/> <Filename Value="../../foundation/foundation.pas"/>
<UnitName Value="foundation"/> <UnitName Value="foundation"/>
<CursorPos X="16" Y="10"/> <CursorPos X="16" Y="10"/>
<TopLine Value="9"/> <TopLine Value="3"/>
<EditorIndex Value="2"/> <EditorIndex Value="4"/>
<UsageCount Value="11"/> <UsageCount Value="13"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit40> </Unit40>
<Unit41> <Unit41>
@ -364,35 +366,155 @@
<TopLine Value="71"/> <TopLine Value="71"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit48> </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> </Units>
<JumpHistory Count="5" HistoryIndex="4"> <JumpHistory Count="28" HistoryIndex="27">
<Position1> <Position1>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../appkit/NSApplication.inc"/>
<Caret Line="262" Column="13" TopLine="246"/> <Caret Line="109" Column="1" TopLine="96"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../appkit/NSWindow.inc"/>
<Caret Line="215" Column="31" TopLine="206"/> <Caret Line="140" Column="15" TopLine="122"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../appkit/NSWindow.inc"/>
<Caret Line="216" Column="55" TopLine="206"/> <Caret Line="178" Column="3" TopLine="162"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../appkit/NSStatusBar.inc"/>
<Caret Line="207" Column="8" TopLine="195"/> <Caret Line="25" Column="58" TopLine="21"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../foundation/NSObject.inc"/> <Filename Value="../../appkit/NSButton.inc"/>
<Caret Line="204" Column="1" TopLine="194"/> <Caret Line="35" Column="73" TopLine="28"/>
</Position5> </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> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="../../appkit/;../../../objc/;../../foundation/"/> <OtherUnitFiles Value="../../appkit/;../../../objc/;../../foundation/;../../applicationservices/coregraphics/"/>
<SrcPath Value="../../appkit/;../../../objc/;../../foundation/"/> <SrcPath Value="../../appkit/;../../../objc/;../../foundation/;../../applicationservices/coregraphics/"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>

View File

@ -22,14 +22,7 @@ const
Str_Window_Title = 'StatusItem example project'; Str_Window_Title = 'StatusItem example project';
Str_Show_Button = 'Show StatusItem'; Str_Show_Button = 'Show StatusItem';
Str_Hide_Button = 'Hide StatusItem'; Str_Hide_Button = 'Hide StatusItem';
var Str_Close_Button = 'Exit Program';
{ classes }
pool: NSAutoreleasePool;
MainWindow: NSWindow;
MainWindowView: NSView;
{ strings and sizes}
CFTitle: CFStringRef;
MainWindowRect: NSRect;
begin begin
{ Creates the AutoreleasePool } { Creates the AutoreleasePool }
pool := NSAutoreleasePool.Create; pool := NSAutoreleasePool.Create;
@ -44,9 +37,9 @@ begin
MainWindowRect.size.width := 300.0; MainWindowRect.size.width := 300.0;
MainWindowRect.size.height := 500.0; MainWindowRect.size.height := 500.0;
MainWindow := NSWindow.initWithContentRect(MainWindowRect, MainWindow := NSWindow.initWithContentRect_styleMask_backing_defer(MainWindowRect,
NSTitledWindowMask or NSClosableWindowMask or NSMiniaturizableWindowMask or NSResizableWindowMask, NSTitledWindowMask or NSClosableWindowMask or NSMiniaturizableWindowMask or NSResizableWindowMask,
NSBackingStoreBuffered, NO); NSBackingStoreBuffered, LongBool(NO));
MainWindowView := NSView.CreateWithHandle(MainWindow.contentView); MainWindowView := NSView.CreateWithHandle(MainWindow.contentView);
CFTitle := CFStringCreateWithPascalString(nil, Str_Window_Title, kCFStringEncodingUTF8); CFTitle := CFStringCreateWithPascalString(nil, Str_Window_Title, kCFStringEncodingUTF8);
@ -66,6 +59,10 @@ begin
50.0, MainWindowRect.size.height - 100.0, 200.0, 25.0, 50.0, MainWindowRect.size.height - 100.0, 200.0, 25.0,
Str_doHideStatusItem, myController); 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 } { Enters main message loop }
MainWindow.orderFrontRegardless; MainWindow.orderFrontRegardless;

View File

@ -1,3 +1,4 @@
{%MainUnit Foundation.pas}
{ NSAutoreleasePool.h { NSAutoreleasePool.h
Copyright (c) 1994-2005, Apple, Inc. All rights reserved. Copyright (c) 1994-2005, Apple, Inc. All rights reserved.
} }
@ -22,7 +23,7 @@ const
NSAutoreleasePool = class(NSObject) NSAutoreleasePool = class(NSObject)
public public
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; override; class function getClass: objc.id; override;
public public
//+ (void)addObject:(id)anObject; //+ (void)addObject:(id)anObject;
@ -39,7 +40,7 @@ const
{$endif} {$endif}
{$ifdef IMPLEMENTATION} {$ifdef IMPLEMENTATION}
function NSAutoreleasePool.getClass: objc.id; class function NSAutoreleasePool.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSAutoreleasePool); Result := objc_getClass(Str_NSAutoreleasePool);
end; end;

View File

@ -1,3 +1,4 @@
{%MainUnit Foundation.pas}
{ NSObject.h { NSObject.h
Copyright (c) 1994-2005, Apple, Inc. All rights reserved. Copyright (c) 1994-2005, Apple, Inc. All rights reserved.
} }
@ -58,7 +59,7 @@ FOUNDATION_EXPORT unsigned NSExtraRefCount(id object);}
constructor CreateWithHandle(aHandle: objc.id); constructor CreateWithHandle(aHandle: objc.id);
destructor Destroy; override; destructor Destroy; override;
{ Extra binding functions } { Extra binding functions }
function getClass: objc.id; virtual; class function getClass: objc.id; virtual;
procedure AddMethods; virtual; procedure AddMethods; virtual;
{ Class creation methods } { Class creation methods }
procedure AddMethod(aName, aParameters: string; aPointer: Pointer); procedure AddMethod(aName, aParameters: string; aPointer: Pointer);
@ -193,7 +194,7 @@ begin
if Handle <> nil then release; if Handle <> nil then release;
end; end;
function NSObject.getClass: objc.id; class function NSObject.getClass: objc.id;
begin begin
Result := objc_getClass(Str_NSObject); Result := objc_getClass(Str_NSObject);
end; end;

View File

@ -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

View File

@ -7,7 +7,6 @@ ignoreincludes4=ApplicationServices/../FrameWorks/CoreGraphics.framework/Headers
ignoreincludes5=AvailabilityMacros.h ignoreincludes5=AvailabilityMacros.h
[TypeReplace] [TypeReplace]
NSRect=CGRect
NSStringRef=CFStringRef NSStringRef=CFStringRef
NSStringRef*=CFStringRef NSStringRef*=CFStringRef
NSArray=CFArrayRef NSArray=CFArrayRef
@ -40,11 +39,11 @@ NSMutableSet = CFMutableSetRef
NSMutableString = CFMutableStringRef NSMutableString = CFMutableStringRef
NSNumber = CFNumberRef NSNumber = CFNumberRef
NSInputStream = CFReadStreamRef NSInputStream = CFReadStreamRef
NSTimer = CFRunLoopTimerRef NSTimer= CFRunLoopTimerRef
NSSet = CFSetRef NSSet= CFSetRef
NSString = CFStringRef NSString=CFStringRef
NSTimeZone = CFTimeZoneRef NSTimeZone= CFTimeZoneRef
NSURL = CFURLRef NSURL= CFURLRef
NSOutputStream = CFWriteStreamRef NSOutputStream = CFWriteStreamRef
AEDesc*=AEDescPtr AEDesc*=AEDescPtr
NSMutableData*= CFMutableDataRef NSMutableData*= CFMutableDataRef

View File

@ -61,52 +61,7 @@
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
</Units> </Units>
<JumpHistory Count="11" HistoryIndex="10"> <JumpHistory Count="0" HistoryIndex="-1"/>
<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>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>