Improves the PasCocoa frameworks.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@449 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2008-05-09 22:53:04 +00:00
parent b5df402efa
commit f5cee353e4
12 changed files with 615 additions and 84 deletions

View File

@ -0,0 +1 @@

View File

@ -1,3 +1,4 @@
{%mainunit appkit.pas}
(* (*
NSButton.h NSButton.h
Application Kit Application Kit
@ -11,8 +12,6 @@
{$include NSControl.inc} {$include NSControl.inc}
{$include NSButtonCell.inc} {$include NSButtonCell.inc}
{$include NSImage.inc}
{$endif} {$endif}
{$endif} {$endif}
@ -21,7 +20,6 @@
{$define NSBUTTON_PAS__FORWARD} {$define NSBUTTON_PAS__FORWARD}
NSButton = class; NSButton = class;
{$endif} {$endif}
{$endif} {$endif}
@ -31,7 +29,6 @@
{$include NSControl.inc} {$include NSControl.inc}
{$include NSButtonCell.inc} {$include NSButtonCell.inc}
{$include NSImage.inc}
{ NSButton } { NSButton }
@ -42,10 +39,10 @@
procedure setTitle(_aString: CFStringRef); procedure setTitle(_aString: CFStringRef);
function alternateTitle: CFStringRef; function alternateTitle: CFStringRef;
procedure setAlternateTitle(_aString: CFStringRef); procedure setAlternateTitle(_aString: CFStringRef);
function image: NSImage; function image: objc.id;{NSImage}
procedure setImage(_image: NSImage); procedure setImage(_image: objc.id {NSImage});
function alternateImage: NSImage; function alternateImage: objc.id;{NSImage}
procedure setAlternateImage(_image: NSImage); procedure setAlternateImage(_image: objc.id {NSImage});
function imagePosition: NSCellImagePosition; function imagePosition: NSCellImagePosition;
procedure setImagePosition(_aPosition: NSCellImagePosition); procedure setImagePosition(_aPosition: NSCellImagePosition);
procedure setButtonType(_aType: NSButtonType); procedure setButtonType(_aType: NSButtonType);
@ -62,7 +59,7 @@
function keyEquivalentModifierMask: LongWord; function keyEquivalentModifierMask: LongWord;
procedure setKeyEquivalentModifierMask(_mask: LongWord); procedure setKeyEquivalentModifierMask(_mask: LongWord);
procedure highlight(_flag: LongBool); procedure highlight(_flag: LongBool);
// function performKeyEquivalent(_key: NSEvent): LongBool; function performKeyEquivalent(_key: objc.id {NSEvent}): LongBool;
procedure setTitleWithMnemonic(_stringWithAmpersand: CFStringRef); procedure setTitleWithMnemonic(_stringWithAmpersand: CFStringRef);
function attributedTitle: objc.id;{NSAttributedString} function attributedTitle: objc.id;{NSAttributedString}
procedure setAttributedTitle(_aString: objc.id {NSAttributedString}); procedure setAttributedTitle(_aString: objc.id {NSAttributedString});
@ -168,14 +165,14 @@ begin
vmethod(Handle, sel_registerName(PChar(StrNSButton_setAlternateTitle)), _aString); vmethod(Handle, sel_registerName(PChar(StrNSButton_setAlternateTitle)), _aString);
end; end;
function NSButton.image: NSImage; function NSButton.image: objc.id;
begin begin
Result := NSImage(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_image)), [])); Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_image)), []));
end; end;
procedure NSButton.setImage(_image: NSImage); procedure NSButton.setImage(_image: objc.id {NSImage});
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: NSImage); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: objc.id {NSImage}); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
@ -183,14 +180,14 @@ begin
vmethod(Handle, sel_registerName(PChar(StrNSButton_setImage)), _image); vmethod(Handle, sel_registerName(PChar(StrNSButton_setImage)), _image);
end; end;
function NSButton.alternateImage: NSImage; function NSButton.alternateImage: objc.id;
begin begin
Result := NSImage(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_alternateImage)), [])); Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSButton_alternateImage)), []));
end; end;
procedure NSButton.setAlternateImage(_image: NSImage); procedure NSButton.setAlternateImage(_image: objc.id {NSImage});
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: NSImage); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_image: objc.id {NSImage}); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
@ -328,15 +325,15 @@ begin
vmethod(Handle, sel_registerName(PChar(StrNSButton_highlight)), _flag); vmethod(Handle, sel_registerName(PChar(StrNSButton_highlight)), _flag);
end; end;
{function NSButton.performKeyEquivalent(_key: NSEvent): LongBool; function NSButton.performKeyEquivalent(_key: objc.id {NSEvent}): LongBool;
type type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_key: NSEvent): LongBool; cdecl; TmsgSendWrapper = function (param1: objc.id; param2: SEL;_key: objc.id {NSEvent}): LongBool; cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
vmethod := TmsgSendWrapper(@objc_msgSend); vmethod := TmsgSendWrapper(@objc_msgSend);
Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSButton_performKeyEquivalent)), _key)); Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSButton_performKeyEquivalent)), _key));
end;} end;
procedure NSButton.setTitleWithMnemonic(_stringWithAmpersand: CFStringRef); procedure NSButton.setTitleWithMnemonic(_stringWithAmpersand: CFStringRef);
type type

View File

@ -1,3 +1,4 @@
{%mainunit appkit.pas}
(* (*
NSGraphics.h NSGraphics.h
Application Kit Application Kit
@ -9,8 +10,7 @@
{$ifndef NSGRAPHICS_PAS_H} {$ifndef NSGRAPHICS_PAS_H}
{$define NSGRAPHICS_PAS_H} {$define NSGRAPHICS_PAS_H}
{.$include NSGeometry.inc} {$include AppKitDefines.inc}
{.$include AppKitDefines.inc}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
@ -151,8 +151,7 @@ type
{$ifndef NSGRAPHICS_PAS_C} {$ifndef NSGRAPHICS_PAS_C}
{$define NSGRAPHICS_PAS_C} {$define NSGRAPHICS_PAS_C}
{.$include NSGeometry.inc} {$include AppKitDefines.inc}
{.$include AppKitDefines.inc}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}

View File

@ -1,3 +1,4 @@
{%mainunit appkit.pas}
(* (*
NSWindow.h NSWindow.h
Application Kit Application Kit
@ -9,11 +10,9 @@
{$ifndef NSWINDOW_PAS_H} {$ifndef NSWINDOW_PAS_H}
{$define NSWINDOW_PAS_H} {$define NSWINDOW_PAS_H}
{.$include NSGeometry.inc} {$include NSResponder.inc}
{.$include NSResponder.inc}
{$include NSGraphics.inc} {$include NSGraphics.inc}
{.$include AppKitDefines.inc} {$include AppKitDefines.inc}
{.$include NSDate.inc}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
@ -118,11 +117,9 @@ type
{$ifndef NSWINDOW_PAS_C} {$ifndef NSWINDOW_PAS_C}
{$define NSWINDOW_PAS_C} {$define NSWINDOW_PAS_C}
{.$include NSGeometry.inc} {$include NSResponder.inc}
{.$include NSResponder.inc}
{$include NSGraphics.inc} {$include NSGraphics.inc}
{.$include AppKitDefines.inc} {$include AppKitDefines.inc}
{.$include NSDate.inc}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
@ -172,7 +169,7 @@ type
// subclasses can override animationResizeTime: to control the total time for the frame // subclasses can override animationResizeTime: to control the total time for the frame
// change. // change.
// newFrame is the rect passed into setFrame:display:animate: // newFrame is the rect passed into setFrame:display:animate:
// function animationResizeTime(_newFrame: NSRect): NSTimeInterval; function animationResizeTime(_newFrame: NSRect): NSTimeInterval;
// setFrame:display:animate: is equivalent to setFrame:display: if animateFlag is NO // 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, // 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: // where the total time for the resize is specified by -animationResizeTime:
@ -207,8 +204,8 @@ type
procedure setPreservesContentDuringLiveResize(_flag: LongBool); procedure setPreservesContentDuringLiveResize(_flag: LongBool);
{.$endif} {.$endif}
procedure update; procedure update;
function makeFirstResponder(_aResponder: NSResponder): LongBool; function makeFirstResponder(_aResponder: objc.id {NSResponder}): LongBool;
function firstResponder: NSResponder; function firstResponder: objc.id;{NSResponder}
function resizeFlags: Integer; function resizeFlags: Integer;
procedure keyDown(_theEvent: objc.id {NSEvent}); procedure keyDown(_theEvent: objc.id {NSEvent});
procedure close; procedure close;
@ -344,21 +341,21 @@ type
function deviceDescription: CFDictionaryRef; function deviceDescription: CFDictionaryRef;
procedure sendEvent(_theEvent: objc.id {NSEvent}); procedure sendEvent(_theEvent: objc.id {NSEvent});
function mouseLocationOutsideOfEventStream: NSPoint; function mouseLocationOutsideOfEventStream: NSPoint;
// class procedure menuChanged(_menu: NSMenu); class procedure menuChanged(_menu: objc.id {NSMenu});
function windowController: objc.id; function windowController: objc.id;
procedure setWindowController(_windowController: objc.id {NSWindowController}); procedure setWindowController(_windowController: objc.id {NSWindowController});
function isSheet: LongBool; function isSheet: LongBool;
function attachedSheet: NSWindow; function attachedSheet: objc.id;{NSWindow}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
class function standardWindowButton_forStyleMask(_b: NSWindowButton; _styleMask: LongWord): objc.id;{NSButton} class function standardWindowButton_forStyleMask(_b: NSWindowButton; _styleMask: LongWord): objc.id;{NSButton}
function standardWindowButton(_b: NSWindowButton): objc.id;{NSButton} function standardWindowButton(_b: NSWindowButton): objc.id;{NSButton}
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
procedure addChildWindow_ordered(_childWin: NSWindow; _place: NSWindowOrderingMode); procedure addChildWindow_ordered(_childWin: objc.id {NSWindow}; _place: NSWindowOrderingMode);
procedure removeChildWindow(_childWin: NSWindow); procedure removeChildWindow(_childWin: objc.id {NSWindow});
function childWindows: CFArrayRef; function childWindows: CFArrayRef;
function parentWindow: NSWindow; function parentWindow: objc.id;{NSWindow}
procedure setParentWindow(_window: NSWindow); procedure setParentWindow(_window: objc.id {NSWindow});
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4} {.$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 // Returns NSGraphicsContext used to render the receiver's content on the screen for
@ -900,7 +897,7 @@ begin
objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_frame)), []); objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_frame)), []);
end; end;
{function NSWindow.animationResizeTime(_newFrame: NSRect): NSTimeInterval; function NSWindow.animationResizeTime(_newFrame: NSRect): NSTimeInterval;
type type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_newFrame: NSRect): NSTimeInterval; cdecl; TmsgSendWrapper = function (param1: objc.id; param2: SEL;_newFrame: NSRect): NSTimeInterval; cdecl;
var var
@ -908,7 +905,7 @@ var
begin begin
vmethod := TmsgSendWrapper(@objc_msgSend_stret); vmethod := TmsgSendWrapper(@objc_msgSend_stret);
Result := vmethod(Handle, sel_registerName(PChar(StrNSWindow_animationResizeTime)), _newFrame); Result := vmethod(Handle, sel_registerName(PChar(StrNSWindow_animationResizeTime)), _newFrame);
end;} end;
procedure NSWindow.setFrame_display_animate(_frameRect: NSRect; _displayFlag: LongBool; _animateFlag: LongBool); procedure NSWindow.setFrame_display_animate(_frameRect: NSRect; _displayFlag: LongBool; _animateFlag: LongBool);
type type
@ -1094,9 +1091,9 @@ begin
objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_update)), []); objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_update)), []);
end; end;
function NSWindow.makeFirstResponder(_aResponder: NSResponder): LongBool; function NSWindow.makeFirstResponder(_aResponder: objc.id {NSResponder}): LongBool;
type type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_aResponder: NSResponder): LongBool; cdecl; TmsgSendWrapper = function (param1: objc.id; param2: SEL;_aResponder: objc.id {NSResponder}): LongBool; cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
@ -1104,9 +1101,9 @@ begin
Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_makeFirstResponder)), _aResponder)); Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSWindow_makeFirstResponder)), _aResponder));
end; end;
function NSWindow.firstResponder: NSResponder; function NSWindow.firstResponder: objc.id;
begin begin
Result := NSResponder(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_firstResponder)), [])); Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_firstResponder)), []));
end; end;
function NSWindow.resizeFlags: Integer; function NSWindow.resizeFlags: Integer;
@ -1981,15 +1978,15 @@ begin
objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_mouseLocationOutsideOfEventStream)), []); objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSWindow_mouseLocationOutsideOfEventStream)), []);
end; end;
{class procedure NSWindow.menuChanged(_menu: NSMenu); class procedure NSWindow.menuChanged(_menu: objc.id {NSMenu});
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_menu: NSMenu); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_menu: objc.id {NSMenu}); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
vmethod := TmsgSendWrapper(@objc_msgSend); vmethod := TmsgSendWrapper(@objc_msgSend);
vmethod(getClass, sel_registerName(PChar(StrNSWindow_menuChanged)), _menu); vmethod(getClass, sel_registerName(PChar(StrNSWindow_menuChanged)), _menu);
end;} end;
function NSWindow.windowController: objc.id; function NSWindow.windowController: objc.id;
begin begin
@ -2011,9 +2008,9 @@ begin
Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isSheet)), [])); Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_isSheet)), []));
end; end;
function NSWindow.attachedSheet: NSWindow; function NSWindow.attachedSheet: objc.id;
begin begin
Result := NSWindow(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_attachedSheet)), [])); Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_attachedSheet)), []));
end; end;
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
@ -2039,9 +2036,9 @@ end;
{.$endif} {.$endif}
{.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2} {.$ifdef MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2}
procedure NSWindow.addChildWindow_ordered(_childWin: NSWindow; _place: NSWindowOrderingMode); procedure NSWindow.addChildWindow_ordered(_childWin: objc.id {NSWindow}; _place: NSWindowOrderingMode);
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: NSWindow; _place: NSWindowOrderingMode); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: objc.id {NSWindow}; _place: NSWindowOrderingMode); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
@ -2049,9 +2046,9 @@ begin
vmethod(Handle, sel_registerName(PChar(StrNSWindow_addChildWindow_ordered)), _childWin, _place); vmethod(Handle, sel_registerName(PChar(StrNSWindow_addChildWindow_ordered)), _childWin, _place);
end; end;
procedure NSWindow.removeChildWindow(_childWin: NSWindow); procedure NSWindow.removeChildWindow(_childWin: objc.id {NSWindow});
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: NSWindow); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_childWin: objc.id {NSWindow}); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin
@ -2064,14 +2061,14 @@ begin
Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_childWindows)), [])); Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_childWindows)), []));
end; end;
function NSWindow.parentWindow: NSWindow; function NSWindow.parentWindow: objc.id;
begin begin
Result := NSWindow(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_parentWindow)), [])); Result := objc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSWindow_parentWindow)), []));
end; end;
procedure NSWindow.setParentWindow(_window: NSWindow); procedure NSWindow.setParentWindow(_window: objc.id {NSWindow});
type type
TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_window: NSWindow); cdecl; TmsgSendWrapper = procedure (param1: objc.id; param2: SEL;_window: objc.id {NSWindow}); cdecl;
var var
vmethod: TmsgSendWrapper; vmethod: TmsgSendWrapper;
begin begin

View File

@ -1,7 +1,6 @@
[Common] [Common]
mainunit=appkit.pas mainunit=appkit.pas
ignoreincludes="CoreFoundation/ CoreData/ QuartzCore/ Foundation/ IOKit/" ignoreincludes="Foundation/ CoreData/ QuartzCore/ CoreFoundation/ IOKit/"
ignoreincludes2="Foundation/ IOKit/"
[TypeDefs] [TypeDefs]
NSObject=objcclass NSObject=objcclass

View File

@ -1,7 +1,8 @@
cd .. cd ..
cd parser cd parser
DEFAULT_INI="../parser/default.ini" DEFAULT_INI="default.ini"
APPKIT_INI="../build/appkit.ini"
FRAMEWORK="/System/Library/Frameworks/AppKit.framework/Headers" FRAMEWORK="/System/Library/Frameworks/AppKit.framework/Headers"
./objcparser -ini=$DEFAULT_INI -ini=appkit.ini $FRAMEWORK/NSButton.h > ../appkit/NSButton.inc ./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSButton.h > ../appkit/NSButton.inc
./objcparser -ini=$DEFAULT_INI -ini=appkit.ini $FRAMEWORK/NSWindow.h > ../appkit/NSWindow.inc ./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSWindow.h > ../appkit/NSWindow.inc
./objcparser -ini=$DEFAULT_INI -ini=appkit.ini $FRAMEWORK/NSGraphics.h > ../appkit/NSGraphics.inc ./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSGraphics.h > ../appkit/NSGraphics.inc

View File

@ -0,0 +1,7 @@
cd ..
cd parser
DEFAULT_INI="default.ini"
LOCAL_INI="../build/foundation.ini"
FRAMEWORK="/System/Library/Frameworks/Foundation.framework/Headers"
./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSObjCRuntime.h > ../foundation/NSObjCRuntime.inc
./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSDate.h > ../foundation/NSDate.inc

View File

@ -0,0 +1,176 @@
[Common]
mainunit=foundation.pas
ignoreincludes=AvailabiltyMacros.h
ignoreincludes2=objc/
ignoreincludes3=CoreFoundation/
[TypeDefs]
NSAffineTransform=objcclass
NSAppleEventDescriptor=objcclass
NSAppleEventManager=objcclass
NSAppleScript=objcclass
NSArchiver=objcclass
NSUnarchiver=objcclass
NSObject=objcclass
NSArray=objcclass
NSMutableArray=objcclass
NSAttributedString=objcclass
NSMutableAttributedString=objcclass
NSAutoreleasePool=objcclass
NSBundle=objcclass
NSCalendar=objcclass
NSDateComponents=objcclass
NSCalendarDate=objcclass
NSDate=objcclass
NSCharacterSet=objcclass
NSMutableCharacterSet=objcclass
NSClassDescription=objcclass
NSCoder=objcclass
NSComparisonPredicate=objcclass
NSCompoundPredicate=objcclass
NSConnection=objcclass
NSDistantObjectRequest=objcclass
NSData=objcclass
NSMutableData=objcclass
NSTimeInterval=float
NSDateFormatter=objcclass
NSDecimalNumber=objcclass
NSDecimalNumberHandler=objcclass
NSNumber=objcclass
NSScanner=objcclass
NSDictionary=objcclass
NSMutableDictionary=objcclass
NSDistantObject=objcclass
NSDistributedLock=objcclass
NSDistributedNotificationCenter=objcclass
NSEnumerator=objcclass
NSError=objcclass
NSException=objcclass
NSAssertionHandler=objcclass
NSExpression=objcclass
NSFileHandle=objcclass
NSPipe=objcclass
NSFileManager=objcclass
NSDirectoryEnumerator=objcclass
NSFormatter=objcclass
NSGarbageCollector=objcclass
NSValue=objcclass
NSHashTable=objcclass
NSHost=objcclass
NSHTTPCookie=objcclass
NSHTTPCookieStorage=objcclass
NSIndexPath=objcclass
NSIndexSet=objcclass
NSMutableIndexSet=objcclass
NSInvocation=objcclass
NSKeyedArchiver=objcclass
NSKeyedUnarchiver=objcclass
NSSet=objcclass
NSLocale=objcclass
NSLock=objcclass
NSConditionLock=objcclass
NSRecursiveLock=objcclass
NSCondition=objcclass
NSMapTable=objcclass
NSMetadataQuery=objcclass
NSMetadataItem=objcclass
NSMetadataQueryAttributeValueTuple=objcclass
NSMetadataQueryResultGroup=objcclass
NSMethodSignature=objcclass
NSNetService=objcclass
NSNetServiceBrowser=objcclass
NSNotification=objcclass
NSNotificationCenter=objcclass
NSNotificationQueue=objcclass
NSNull=objcclass
NSNumberFormatter=objcclass
NSOperation=objcclass
NSInvocationOperation=objcclass
NSOperationQueue=objcclass
NSString=objcclass
NSPointerArray=objcclass
NSPointerFunctions=objcclass
NSPort=objcclass
NSMachPort=objcclass
NSMessagePort=objcclass
NSSocketPort=objcclass
NSPortCoder=objcclass
NSPortMessage=objcclass
NSPortNameServer=objcclass
NSMachBootstrapServer=objcclass
NSMessagePortNameServer=objcclass
NSSocketPortNameServer=objcclass
NSPredicate=objcclass
NSMutableSet=objcclass
NSProcessInfo=objcclass
NSPropertyListSerialization=objcclass
NSProtocolChecker=objcclass
NSProxy=objcclass
NSRunLoop=objcclass
NSScriptClassDescription=objcclass
NSScriptCoercionHandler=objcclass
NSScriptCommand=objcclass
NSScriptCommandDescription=objcclass
NSScriptExecutionContext=objcclass
NSScriptObjectSpecifier=objcclass
NSIndexSpecifier=objcclass
NSMiddleSpecifier=objcclass
NSNameSpecifier=objcclass
NSPositionalSpecifier=objcclass
NSPropertySpecifier=objcclass
NSRandomSpecifier=objcclass
NSRangeSpecifier=objcclass
NSRelativeSpecifier=objcclass
NSUniqueIDSpecifier=objcclass
NSWhoseSpecifier=objcclass
NSCloneCommand=objcclass
NSCloseCommand=objcclass
NSCountCommand=objcclass
NSCreateCommand=objcclass
NSDeleteCommand=objcclass
NSExistsCommand=objcclass
NSGetCommand=objcclass
NSMoveCommand=objcclass
NSQuitCommand=objcclass
NSSetCommand=objcclass
NSScriptSuiteRegistry=objcclass
NSScriptWhoseTest=objcclass
NSLogicalTest=objcclass
NSSpecifierTest=objcclass
NSCountedSet=objcclass
NSSortDescriptor=objcclass
NSSpellServer=objcclass
NSStream=objcclass
NSInputStream=objcclass
NSOutputStream=objcclass
NSMutableString=objcclass
NSSimpleCString=objcclass
NSConstantString=objcclass
NSTask=objcclass
NSThread=objcclass
NSTimer=objcclass
NSTimeZone=objcclass
NSUndoManager=objcclass
NSURL=objcclass
NSURLAuthenticationChallenge=objcclass
NSCachedURLResponse=objcclass
NSURLCache=objcclass
NSURLConnection=objcclass
NSURLCredential=objcclass
NSURLCredentialStorage=objcclass
NSURLDownload=objcclass
NSURLHandle=objcclass
NSURLProtectionSpace=objcclass
NSURLProtocol=objcclass
NSURLRequest=objcclass
NSMutableURLRequest=objcclass
NSURLResponse=objcclass
NSHTTPURLResponse=objcclass
NSUserDefaults=objcclass
NSValueTransformer=objcclass
NSXMLDocument=objcclass
NSXMLDTD=objcclass
NSXMLDTDNode=objcclass
NSXMLElement=objcclass
NSXMLNode=objcclass
NSXMLParser=objcclass

View File

@ -7,7 +7,7 @@
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="4"/> <ActiveEditorIndexAtStart Value="8"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -26,7 +26,7 @@
<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="53"> <Units Count="56">
<Unit0> <Unit0>
<Filename Value="statusitem.pas"/> <Filename Value="statusitem.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -34,7 +34,7 @@
<CursorPos X="84" Y="40"/> <CursorPos X="84" Y="40"/>
<TopLine Value="27"/> <TopLine Value="27"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="55"/> <UsageCount Value="56"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -48,7 +48,7 @@
<Filename Value="../../appkit/NSButton.inc"/> <Filename Value="../../appkit/NSButton.inc"/>
<CursorPos X="3" Y="109"/> <CursorPos X="3" Y="109"/>
<TopLine Value="96"/> <TopLine Value="96"/>
<EditorIndex Value="8"/> <EditorIndex Value="9"/>
<UsageCount Value="22"/> <UsageCount Value="22"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
@ -56,7 +56,7 @@
<Filename Value="../../appkit/NSApplication.inc"/> <Filename Value="../../appkit/NSApplication.inc"/>
<CursorPos X="3" Y="109"/> <CursorPos X="3" Y="109"/>
<TopLine Value="96"/> <TopLine Value="96"/>
<EditorIndex Value="8"/> <EditorIndex Value="9"/>
<UsageCount Value="16"/> <UsageCount Value="16"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit3> </Unit3>
@ -168,8 +168,8 @@
</Unit19> </Unit19>
<Unit20> <Unit20>
<Filename Value="../../appkit/NSWindow.inc"/> <Filename Value="../../appkit/NSWindow.inc"/>
<CursorPos X="58" Y="1977"/> <CursorPos X="26" Y="8"/>
<TopLine Value="1971"/> <TopLine Value="1"/>
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<UsageCount Value="23"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -228,7 +228,7 @@
<Filename Value="../../appkit/NSStatusBar.inc"/> <Filename Value="../../appkit/NSStatusBar.inc"/>
<CursorPos X="7" Y="55"/> <CursorPos X="7" Y="55"/>
<TopLine Value="38"/> <TopLine Value="38"/>
<EditorIndex Value="7"/> <EditorIndex Value="8"/>
<UsageCount Value="21"/> <UsageCount Value="21"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit29> </Unit29>
@ -257,7 +257,7 @@
<CursorPos X="19" Y="128"/> <CursorPos X="19" Y="128"/>
<TopLine Value="119"/> <TopLine Value="119"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="39"/> <UsageCount Value="40"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit33> </Unit33>
<Unit34> <Unit34>
@ -390,18 +390,50 @@
</Unit51> </Unit51>
<Unit52> <Unit52>
<Filename Value="../../appkit/NSGraphics.inc"/> <Filename Value="../../appkit/NSGraphics.inc"/>
<CursorPos X="117" Y="60"/> <CursorPos X="14" Y="11"/>
<TopLine Value="52"/> <TopLine Value="3"/>
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit52> </Unit52>
<Unit53>
<Filename Value="../../foundation/Foundation.inc"/>
<CursorPos X="40" Y="9"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit53>
<Unit54>
<Filename Value="../../foundation/NSDate.inc"/>
<CursorPos X="30" Y="39"/>
<TopLine Value="32"/>
<UsageCount Value="10"/>
</Unit54>
<Unit55>
<Filename Value="../../foundation/NSObjCRuntime.inc"/>
<CursorPos X="25" Y="188"/>
<TopLine Value="179"/>
<UsageCount Value="10"/>
</Unit55>
</Units> </Units>
<JumpHistory Count="1" HistoryIndex="0"> <JumpHistory Count="4" HistoryIndex="3">
<Position1> <Position1>
<Filename Value="../../appkit/NSGraphics.inc"/> <Filename Value="../../appkit/NSGraphics.inc"/>
<Caret Line="138" Column="24" TopLine="136"/> <Caret Line="60" Column="117" TopLine="52"/>
</Position1> </Position1>
<Position2>
<Filename Value="../../appkit/NSGraphics.inc"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="../../appkit/NSWindow.inc"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="../../appkit/NSWindow.inc"/>
<Caret Line="164" Column="25" TopLine="159"/>
</Position4>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -9,8 +9,8 @@
#import <objc/objc.h> #import <objc/objc.h>
#import <objc/objc-auto.h>} #import <objc/objc-auto.h>}
{#import <Foundation/NSObjCRuntime.h> {$include NSObjCRuntime.inc}
#import <Foundation/NSAffineTransform.h> {#import <Foundation/NSAffineTransform.h>
#import <Foundation/NSArchiver.h> #import <Foundation/NSArchiver.h>
#import <Foundation/NSArray.h> #import <Foundation/NSArray.h>
#import <Foundation/NSAttributedString.h> } #import <Foundation/NSAttributedString.h> }
@ -23,9 +23,9 @@
#import <Foundation/NSClassDescription.h> #import <Foundation/NSClassDescription.h>
#import <Foundation/NSCoder.h> #import <Foundation/NSCoder.h>
#import <Foundation/NSConnection.h> #import <Foundation/NSConnection.h>
#import <Foundation/NSData.h> #import <Foundation/NSData.h>}
#import <Foundation/NSDate.h> {$include NSDate.inc}
#import <Foundation/NSDateFormatter.h> {#import <Foundation/NSDateFormatter.h>
#import <Foundation/NSDecimal.h> #import <Foundation/NSDecimal.h>
#import <Foundation/NSDecimalNumber.h> #import <Foundation/NSDecimalNumber.h>
#import <Foundation/NSDictionary.h> #import <Foundation/NSDictionary.h>

View File

@ -0,0 +1,296 @@
{%mainunit foundation.pas}
(* NSDate.h
Copyright (c) 1994-2005, Apple, Inc. All rights reserved.
*)
{$ifdef HEADER}
{$ifndef NSDATE_PAS_H}
{$define NSDATE_PAS_H}
{$include NSObject.inc}
const
NSTimeIntervalSince1970 = 978307200.0;
type
NSTimeInterval = double;
{$endif}
{$endif}
{$ifdef FORWARD}
{$ifndef NSDATE_PAS__FORWARD}
{$define NSDATE_PAS__FORWARD}
NSDate = class;
{$endif}
{$endif}
{$ifdef CLASSES}
{$ifndef NSDATE_PAS_C}
{$define NSDATE_PAS_C}
{$include NSObject.inc}
{ NSDate }
NSDate = class(NSObject)
public
class function getClass: objc.id; override;
function timeIntervalSinceReferenceDate: NSTimeInterval;
function timeIntervalSinceDate(_anotherDate: CFDateRef): NSTimeInterval;
function timeIntervalSinceNow: NSTimeInterval;
function timeIntervalSince1970: NSTimeInterval;
function addTimeInterval(_seconds: NSTimeInterval): objc.id;
function earlierDate(_anotherDate: CFDateRef): CFDateRef;
function laterDate(_anotherDate: CFDateRef): CFDateRef;
function compare(_other: CFDateRef): NSComparisonResult;
function description: CFStringRef;
function isEqualToDate(_otherDate: CFDateRef): LongBool;
class function timeIntervalSinceReferenceDate_: NSTimeInterval;
constructor date;
constructor dateWithTimeIntervalSinceNow(_secs: NSTimeInterval);
constructor dateWithTimeIntervalSinceReferenceDate(_secs: NSTimeInterval);
constructor dateWithTimeIntervalSince1970(_secs: NSTimeInterval);
constructor distantFuture;
constructor distantPast;
constructor init;
constructor initWithTimeIntervalSinceReferenceDate(_secsToBeAdded: NSTimeInterval);
constructor initWithTimeInterval_sinceDate(_secsToBeAdded: NSTimeInterval; _anotherDate: CFDateRef);
constructor initWithTimeIntervalSinceNow(_secsToBeAddedToNow: NSTimeInterval);
end;
{$endif}
{$endif}
{$ifdef IMPLEMENTATION}
const
StrNSDate_NSDate = 'NSDate';
StrNSDate_timeIntervalSinceReferenceDate = 'timeIntervalSinceReferenceDate';
StrNSDate_timeIntervalSinceDate = 'timeIntervalSinceDate:';
StrNSDate_timeIntervalSinceNow = 'timeIntervalSinceNow';
StrNSDate_timeIntervalSince1970 = 'timeIntervalSince1970';
StrNSDate_addTimeInterval = 'addTimeInterval:';
StrNSDate_earlierDate = 'earlierDate:';
StrNSDate_laterDate = 'laterDate:';
StrNSDate_compare = 'compare:';
StrNSDate_description = 'description';
StrNSDate_isEqualToDate = 'isEqualToDate:';
StrNSDate_date = 'date';
StrNSDate_dateWithTimeIntervalSinceNow = 'dateWithTimeIntervalSinceNow:';
StrNSDate_dateWithTimeIntervalSinceReferenceDate = 'dateWithTimeIntervalSinceReferenceDate:';
StrNSDate_dateWithTimeIntervalSince1970 = 'dateWithTimeIntervalSince1970:';
StrNSDate_distantFuture = 'distantFuture';
StrNSDate_distantPast = 'distantPast';
StrNSDate_init = 'init';
StrNSDate_initWithTimeIntervalSinceReferenceDate = 'initWithTimeIntervalSinceReferenceDate:';
StrNSDate_initWithTimeInterval_sinceDate = 'initWithTimeInterval:sinceDate:';
StrNSDate_initWithTimeIntervalSinceNow = 'initWithTimeIntervalSinceNow:';
{ NSDate }
class function NSDate.getClass: objc.id;
begin
Result := objc_getClass(StrNSDate_NSDate);
end;
function NSDate.timeIntervalSinceReferenceDate: NSTimeInterval;
begin
Result := objc_msgSend_fpret(Handle, sel_registerName(PChar(StrNSDate_timeIntervalSinceReferenceDate)), []);
end;
function NSDate.timeIntervalSinceDate(_anotherDate: CFDateRef): NSTimeInterval;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_anotherDate: CFDateRef): NSTimeInterval; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend_stret);
Result := vmethod(Handle, sel_registerName(PChar(StrNSDate_timeIntervalSinceDate)), _anotherDate);
end;
function NSDate.timeIntervalSinceNow: NSTimeInterval;
begin
Result := objc_msgSend_fpret(Handle, sel_registerName(PChar(StrNSDate_timeIntervalSinceNow)), []);
end;
function NSDate.timeIntervalSince1970: NSTimeInterval;
begin
Result := objc_msgSend_fpret(Handle, sel_registerName(PChar(StrNSDate_timeIntervalSince1970)), []);
end;
function NSDate.addTimeInterval(_seconds: NSTimeInterval): objc.id;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_seconds: NSTimeInterval): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSDate_addTimeInterval)), _seconds));
end;
function NSDate.earlierDate(_anotherDate: CFDateRef): CFDateRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_anotherDate: CFDateRef): CFDateRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFDateRef(vmethod(Handle, sel_registerName(PChar(StrNSDate_earlierDate)), _anotherDate));
end;
function NSDate.laterDate(_anotherDate: CFDateRef): CFDateRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_anotherDate: CFDateRef): CFDateRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFDateRef(vmethod(Handle, sel_registerName(PChar(StrNSDate_laterDate)), _anotherDate));
end;
function NSDate.compare(_other: CFDateRef): NSComparisonResult;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_other: CFDateRef): NSComparisonResult; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := NSComparisonResult(vmethod(Handle, sel_registerName(PChar(StrNSDate_compare)), _other));
end;
function NSDate.description: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSDate_description)), []));
end;
function NSDate.isEqualToDate(_otherDate: CFDateRef): LongBool;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_otherDate: CFDateRef): LongBool; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSDate_isEqualToDate)), _otherDate));
end;
class function NSDate.timeIntervalSinceReferenceDate_: NSTimeInterval;
begin
Result := objc_msgSend_fpret(getClass, sel_registerName(PChar(StrNSDate_timeIntervalSinceReferenceDate)), []);
end;
constructor NSDate.date;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_date)));
end;
constructor NSDate.dateWithTimeIntervalSinceNow(_secs: NSTimeInterval);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secs: NSTimeInterval): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_dateWithTimeIntervalSinceNow)), _secs);
end;
constructor NSDate.dateWithTimeIntervalSinceReferenceDate(_secs: NSTimeInterval);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secs: NSTimeInterval): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_dateWithTimeIntervalSinceReferenceDate)), _secs);
end;
constructor NSDate.dateWithTimeIntervalSince1970(_secs: NSTimeInterval);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secs: NSTimeInterval): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_dateWithTimeIntervalSince1970)), _secs);
end;
constructor NSDate.distantFuture;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_distantFuture)));
end;
constructor NSDate.distantPast;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSDate_distantPast)));
end;
constructor NSDate.init;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL): 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(StrNSDate_init)));
end;
constructor NSDate.initWithTimeIntervalSinceReferenceDate(_secsToBeAdded: NSTimeInterval);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secsToBeAdded: NSTimeInterval): 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(StrNSDate_initWithTimeIntervalSinceReferenceDate)), _secsToBeAdded);
end;
constructor NSDate.initWithTimeInterval_sinceDate(_secsToBeAdded: NSTimeInterval; _anotherDate: CFDateRef);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secsToBeAdded: NSTimeInterval; _anotherDate: CFDateRef): 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(StrNSDate_initWithTimeInterval_sinceDate)), _secsToBeAdded, _anotherDate);
end;
constructor NSDate.initWithTimeIntervalSinceNow(_secsToBeAddedToNow: NSTimeInterval);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_secsToBeAddedToNow: NSTimeInterval): 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(StrNSDate_initWithTimeIntervalSinceNow)), _secsToBeAddedToNow);
end;
{$endif}

View File

@ -0,0 +1,26 @@
{%mainunit foundation.pas}
(* NSObjCRuntime.h
Copyright (c) 1994-2007, Apple Inc. All rights reserved.
*)
{$ifdef HEADER}
{$ifndef NSOBJCRUNTIME_PAS_H}
{$define NSOBJCRUNTIME_PAS_H}
type
NSInteger = Integer;
NSUInteger = LongWord;
const
NSOrderedAscending = 1;
NSOrderedSame = 2;
NSOrderedDescending = 3;
type
NSComparisonResult = Integer;
const
NSNotFound = MaxInt;
{$endif}
{$endif}