Improves pascocoa and texteditor example

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@587 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2008-10-06 22:40:47 +00:00
parent 7a4abd677e
commit 630333ac37
11 changed files with 639 additions and 91 deletions

View File

@@ -57,9 +57,9 @@
{#import <AppKit/NSImageCell.h>}
{$include NSImageRep.inc}
{#import <AppKit/NSImageView.h>
#import <AppKit/NSNib.h>
#import <AppKit/NSNibLoading.h>
#import <AppKit/NSPrinter.h>
#import <AppKit/NSNib.h>}
{$include NSNibLoading.inc}
{#import <AppKit/NSPrinter.h>
#import <AppKit/NSSpeechRecognizer.h>
#import <AppKit/NSSpeechSynthesizer.h>
#import <AppKit/NSSpellChecker.h>

View File

@@ -0,0 +1,9 @@
Obj-C parser usage:
objcparser [switches] objcheaderfilename
keys:
-ini=filename.ini config file to use for pascal file generation
multiple "-ini" switches are allowed
-uini=filename.ini config file to update the data
-noout prevents from .inc files generated
-all parses headers (*.h) in the current directory

View File

@@ -0,0 +1,78 @@
{%mainunit appkit.pas}
(*
NSNibLoading.h
Application Kit
Copyright (c) 1994-2005, Apple Computer, Inc.
All rights reserved.
*)
{$ifdef HEADER}
{$ifndef NSNIBLOADING_PAS_H}
{$define NSNIBLOADING_PAS_H}
{@class NSString, NSDictionary;
@interface NSBundle(NSNibLoading)
+ (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
/* This is the primitive that loads the contents of a .nib file. Context holds key value pairs that can name objects that are referenced by the objects within the nib file (e.g., "NSOwner"). Objects from the nib are allocated in zone. */
+ (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner;
/* A cover method where an external name table is created with owner as the only element with key "NSOwner". Objects from the nib are allocated in owner's zone. If there is a bundle for owner's class, this method looks in that bundle for a nib with the given file name. Otherwise, it looks in the mainBundle. */
- (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
/* This is the instance version of the above class method by the same name. */
@end
@interface NSObject (NSNibAwaking)
- (void)awakeFromNib;
@end}
{$endif}
{$endif}
{$ifdef FORWARD}
NSBundleNib = class;
{$endif}
{$ifdef CLASSES}
{$ifndef NSNIBLOADING_PAS_C}
{$define NSNIBLOADING_PAS_C}
{ NSBundleNib }
NSBundleNib = class(NSObject)
public
//class function loadNibFile_externalNameTable_withZone(fileName: CFStringRef; context: NSDictionary; zone: NSZone);
{ This is the primitive that loads the contents of a .nib file. Context holds key value pairs that can name objects that are referenced by the objects within the nib file (e.g., "NSOwner"). Objects from the nib are allocated in zone. }
class function loadNibNamed_owner(nibName: CFStringRef; owner: objc.id): objc.BOOL;
{ A cover method where an external name table is created with owner as the only element with key "NSOwner". Objects from the nib are allocated in owner's zone. If there is a bundle for owner's class, this method looks in that bundle for a nib with the given file name. Otherwise, it looks in the mainBundle. }
//- (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
{ This is the instance version of the above class method by the same name. }
end;
{$endif}
{$endif}
{$ifdef IMPLEMENTATION}
const
StrNSBundle_NSBundle = 'NSBundle';
StrNSBundle_loadNibNamed_owner = 'loadNibNamed:owner:';
class function NSBundleNib.loadNibNamed_owner(nibName: CFStringRef; owner: objc.id): objc.BOOL;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL; nibName: CFStringRef; owner: objc.id): objc.BOOL; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := vmethod(objc_getClass(PChar(StrNSBundle_NSBundle)), sel_registerName(PChar(StrNSBundle_loadNibNamed_owner)), nibName, owner);
end;
{$endif}

View File

@@ -15,8 +15,9 @@ FRAMEWORK="/System/Library/Frameworks/AppKit.framework/Headers"
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSMenu.h > ../appkit/NSMenu.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSMenuItem.h > ../appkit/NSMenuItem.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSNibDeclarations.h > ../appkit/NSNibDeclarations.inc
./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSNibLoading.h > ../appkit/NSNibLoading.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSOpenPanel.h > ../appkit/NSOpenPanel.inc
./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSPanel.h > ../appkit/NSPanel.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSPanel.h > ../appkit/NSPanel.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSSavePanel.h > ../appkit/NSSavePanel.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSSpellProtocol.h > ../appkit/NSSpellProtocol.inc
#./objcparser -ini=$DEFAULT_INI -ini=$APPKIT_INI $FRAMEWORK/NSStatusBar.h > ../appkit/NSStatusBar.inc

View File

@@ -4,8 +4,9 @@ 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/NSArray.h > ../foundation/NSArray.inc
#./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSArray.h > ../foundation/NSArray.inc
./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSBundle.h > ../foundation/NSBundle.inc
#./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSDate.h > ../foundation/NSDate.inc
#./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSRange.h > ../foundation/NSRange.inc
./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSString.h > ../foundation/NSString.inc
#./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSString.h > ../foundation/NSString.inc
#./objcparser -ini=$DEFAULT_INI -ini=$LOCAL_INI $FRAMEWORK/NSValue.h > ../foundation/NSValue.inc

View File

@@ -0,0 +1 @@
fpc -dWITHOUT_PKG -Fu../../appkit -Fu../../foundation -Fu../../../objc texteditor.pas

View File

@@ -6,7 +6,7 @@
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="7"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@@ -30,15 +30,15 @@
<PackageName Value="cocoa_pkg"/>
</Item1>
</RequiredPackages>
<Units Count="12">
<Units Count="18">
<Unit0>
<Filename Value="texteditor.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="texteditor"/>
<CursorPos X="9" Y="15"/>
<TopLine Value="1"/>
<CursorPos X="80" Y="36"/>
<TopLine Value="26"/>
<EditorIndex Value="0"/>
<UsageCount Value="38"/>
<UsageCount Value="40"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@@ -47,8 +47,8 @@
<UnitName Value="model"/>
<CursorPos X="24" Y="32"/>
<TopLine Value="27"/>
<EditorIndex Value="5"/>
<UsageCount Value="38"/>
<EditorIndex Value="6"/>
<UsageCount Value="40"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@@ -57,8 +57,8 @@
<UnitName Value="view"/>
<CursorPos X="49" Y="158"/>
<TopLine Value="146"/>
<EditorIndex Value="7"/>
<UsageCount Value="38"/>
<EditorIndex Value="8"/>
<UsageCount Value="40"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@@ -67,18 +67,18 @@
<UnitName Value="controller"/>
<CursorPos X="1" Y="145"/>
<TopLine Value="130"/>
<EditorIndex Value="6"/>
<UsageCount Value="38"/>
<EditorIndex Value="7"/>
<UsageCount Value="40"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="mytoolbar.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="mytoolbar"/>
<CursorPos X="28" Y="123"/>
<TopLine Value="107"/>
<EditorIndex Value="1"/>
<UsageCount Value="33"/>
<CursorPos X="99" Y="72"/>
<TopLine Value="51"/>
<EditorIndex Value="2"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
@@ -86,8 +86,8 @@
<UnitName Value="objc"/>
<CursorPos X="50" Y="3"/>
<TopLine Value="27"/>
<EditorIndex Value="2"/>
<UsageCount Value="15"/>
<EditorIndex Value="3"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
@@ -114,8 +114,8 @@
<Filename Value="../../../objc/objc.inc"/>
<CursorPos X="13" Y="60"/>
<TopLine Value="46"/>
<EditorIndex Value="3"/>
<UsageCount Value="12"/>
<EditorIndex Value="5"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
@@ -126,134 +126,168 @@
</Unit10>
<Unit11>
<Filename Value="../../appkit/NSAlert.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="28"/>
<CursorPos X="16" Y="8"/>
<TopLine Value="1"/>
<UsageCount Value="12"/>
</Unit11>
<Unit12>
<Filename Value="../../appkit/AppKit.inc"/>
<CursorPos X="18" Y="61"/>
<TopLine Value="49"/>
<EditorIndex Value="1"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
<Filename Value="../../foundation/Foundation.inc"/>
<CursorPos X="48" Y="9"/>
<TopLine Value="5"/>
<UsageCount Value="11"/>
</Unit13>
<Unit14>
<Filename Value="../../appkit/NSBundle.inc"/>
<CursorPos X="34" Y="6"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit14>
<Unit15>
<Filename Value="../../foundation/NSBundle.inc"/>
<CursorPos X="8" Y="424"/>
<TopLine Value="403"/>
<EditorIndex Value="4"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit11>
</Unit15>
<Unit16>
<Filename Value="../../appkit/NSNibLoading.inc"/>
<CursorPos X="41" Y="42"/>
<TopLine Value="33"/>
<UsageCount Value="10"/>
</Unit16>
<Unit17>
<Filename Value="../../foundation/NSObject.inc"/>
<CursorPos X="38" Y="203"/>
<TopLine Value="184"/>
<UsageCount Value="10"/>
</Unit17>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<JumpHistory Count="29" HistoryIndex="28">
<Position1>
<Filename Value="mytoolbar.pas"/>
<Caret Line="65" Column="1" TopLine="58"/>
<Filename Value="view.pas"/>
<Caret Line="20" Column="22" TopLine="9"/>
</Position1>
<Position2>
<Filename Value="mytoolbar.pas"/>
<Caret Line="20" Column="34" TopLine="8"/>
<Filename Value="view.pas"/>
<Caret Line="178" Column="5" TopLine="155"/>
</Position2>
<Position3>
<Filename Value="mytoolbar.pas"/>
<Caret Line="37" Column="22" TopLine="28"/>
<Filename Value="view.pas"/>
<Caret Line="181" Column="5" TopLine="158"/>
</Position3>
<Position4>
<Filename Value="view.pas"/>
<Caret Line="99" Column="12" TopLine="80"/>
<Caret Line="23" Column="27" TopLine="13"/>
</Position4>
<Position5>
<Filename Value="view.pas"/>
<Caret Line="108" Column="1" TopLine="85"/>
<Caret Line="219" Column="1" TopLine="210"/>
</Position5>
<Position6>
<Filename Value="view.pas"/>
<Caret Line="20" Column="22" TopLine="9"/>
<Caret Line="23" Column="8" TopLine="14"/>
</Position6>
<Position7>
<Filename Value="view.pas"/>
<Caret Line="178" Column="5" TopLine="155"/>
<Caret Line="218" Column="1" TopLine="209"/>
</Position7>
<Position8>
<Filename Value="view.pas"/>
<Caret Line="181" Column="5" TopLine="158"/>
<Caret Line="131" Column="1" TopLine="114"/>
</Position8>
<Position9>
<Filename Value="view.pas"/>
<Caret Line="23" Column="27" TopLine="13"/>
<Caret Line="116" Column="44" TopLine="104"/>
</Position9>
<Position10>
<Filename Value="view.pas"/>
<Caret Line="219" Column="1" TopLine="210"/>
<Caret Line="192" Column="35" TopLine="180"/>
</Position10>
<Position11>
<Filename Value="view.pas"/>
<Caret Line="23" Column="8" TopLine="14"/>
<Filename Value="controller.pas"/>
<Caret Line="74" Column="15" TopLine="59"/>
</Position11>
<Position12>
<Filename Value="view.pas"/>
<Caret Line="218" Column="1" TopLine="209"/>
<Filename Value="../../../objc/objc.pas"/>
<Caret Line="27" Column="12" TopLine="19"/>
</Position12>
<Position13>
<Filename Value="view.pas"/>
<Caret Line="131" Column="1" TopLine="114"/>
<Filename Value="mytoolbar.pas"/>
<Caret Line="149" Column="9" TopLine="134"/>
</Position13>
<Position14>
<Filename Value="view.pas"/>
<Caret Line="116" Column="44" TopLine="104"/>
<Caret Line="218" Column="77" TopLine="200"/>
</Position14>
<Position15>
<Filename Value="view.pas"/>
<Caret Line="192" Column="35" TopLine="180"/>
<Filename Value="controller.pas"/>
<Caret Line="132" Column="5" TopLine="109"/>
</Position15>
<Position16>
<Filename Value="controller.pas"/>
<Caret Line="74" Column="15" TopLine="59"/>
<Caret Line="108" Column="1" TopLine="94"/>
</Position16>
<Position17>
<Filename Value="../../../objc/objc.pas"/>
<Caret Line="27" Column="12" TopLine="19"/>
<Filename Value="controller.pas"/>
<Caret Line="51" Column="17" TopLine="39"/>
</Position17>
<Position18>
<Filename Value="mytoolbar.pas"/>
<Caret Line="149" Column="9" TopLine="134"/>
<Filename Value="controller.pas"/>
<Caret Line="123" Column="35" TopLine="118"/>
</Position18>
<Position19>
<Filename Value="view.pas"/>
<Caret Line="218" Column="77" TopLine="200"/>
<Filename Value="controller.pas"/>
<Caret Line="125" Column="61" TopLine="113"/>
</Position19>
<Position20>
<Filename Value="controller.pas"/>
<Caret Line="132" Column="5" TopLine="109"/>
<Caret Line="103" Column="38" TopLine="91"/>
</Position20>
<Position21>
<Filename Value="controller.pas"/>
<Caret Line="108" Column="1" TopLine="94"/>
<Caret Line="126" Column="32" TopLine="113"/>
</Position21>
<Position22>
<Filename Value="controller.pas"/>
<Caret Line="51" Column="17" TopLine="39"/>
<Caret Line="125" Column="1" TopLine="108"/>
</Position22>
<Position23>
<Filename Value="controller.pas"/>
<Caret Line="123" Column="35" TopLine="118"/>
<Caret Line="139" Column="1" TopLine="122"/>
</Position23>
<Position24>
<Filename Value="controller.pas"/>
<Caret Line="125" Column="61" TopLine="113"/>
<Caret Line="144" Column="44" TopLine="132"/>
</Position24>
<Position25>
<Filename Value="controller.pas"/>
<Caret Line="103" Column="38" TopLine="91"/>
</Position25>
<Position26>
<Filename Value="controller.pas"/>
<Caret Line="126" Column="32" TopLine="113"/>
</Position26>
<Position27>
<Filename Value="controller.pas"/>
<Caret Line="125" Column="1" TopLine="108"/>
</Position27>
<Position28>
<Filename Value="controller.pas"/>
<Caret Line="139" Column="1" TopLine="122"/>
</Position28>
<Position29>
<Filename Value="controller.pas"/>
<Caret Line="144" Column="44" TopLine="132"/>
</Position29>
<Position30>
<Filename Value="view.pas"/>
<Caret Line="158" Column="29" TopLine="138"/>
</Position30>
</Position25>
<Position26>
<Filename Value="../../foundation/NSBundle.inc"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position26>
<Position27>
<Filename Value="../../foundation/NSBundle.inc"/>
<Caret Line="56" Column="19" TopLine="49"/>
</Position27>
<Position28>
<Filename Value="../../appkit/AppKit.inc"/>
<Caret Line="24" Column="35" TopLine="21"/>
</Position28>
<Position29>
<Filename Value="../../appkit/AppKit.inc"/>
<Caret Line="61" Column="18" TopLine="49"/>
</Position29>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>

View File

@@ -33,6 +33,8 @@ begin
{ Creates the application NSApp object }
NSApp := NSApplication.sharedApplication;
// NSBundleNib.loadNibNamed_owner(CFStringCreateWithPascalString(nil, 'applemenu', kCFStringEncodingUTF8), NSApp.Handle);
{ Initializes the model object,
must be after the view so that the resources are loaded }

View File

@@ -15,8 +15,8 @@
{$include NSArray.inc}
{#import <Foundation/NSAttributedString.h> }
{$include NSAutoreleasePool.inc}
{#import <Foundation/NSBundle.h>
#import <Foundation/NSByteOrder.h>
{$include NSBundle.inc}
{#import <Foundation/NSByteOrder.h>
#import <Foundation/NSCalendar.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSCharacterSet.h>

View File

@@ -0,0 +1,426 @@
{%mainunit foundation.pas}
(* NSBundle.h
Copyright (c) 1994-2005, Apple, Inc. All rights reserved.
*)
{$ifdef HEADER}
{$ifndef NSBUNDLE_PAS_H}
{$define NSBUNDLE_PAS_H}
{$include NSObject.inc}
{const
NSLocalizedString(key, = comment) \;
NSLocalizedStringFromTable(key, = tbl, comment) \;
NSLocalizedStringFromTableInBundle(key, = tbl, bundle, comment) \;
NSLocalizedStringWithDefaultValue(key, = tbl, bundle, val, comment) \;}
//[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
//[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)]
//[bundle localizedStringForKey:(key) value:@"" table:(tbl)]
//[bundle localizedStringForKey:(key) value:(val) table:(tbl)]
//FOUNDATION_EXPORT NSString * const NSBundleDidLoadNotification;
//FOUNDATION_EXPORT NSString * const NSLoadedClasses; // notification key
{$endif}
{$endif}
{$ifdef FORWARD}
NSBundle = class;
{$endif}
{$ifdef CLASSES}
{$ifndef NSBUNDLE_PAS_C}
{$define NSBUNDLE_PAS_C}
{$include NSObject.inc}
// Because NSBundle caches allocated instances, subclasses should be prepared
// to receive an already initialized object back from [super initWithPath:]
{ NSBundle }
NSBundle = class(NSObject)
public
class function getClass: objc.id; override;
constructor mainBundle;
constructor bundleWithPath(_path: CFStringRef);
constructor initWithPath(_path: CFStringRef);
constructor bundleForClass(_aClass: _Class);
constructor bundleWithIdentifier(_identifier: CFStringRef);
class function allBundles: CFArrayRef;
class function allFrameworks: CFArrayRef;
function load: LongBool;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function isLoaded: LongBool;
{.$endif}
function bundlePath: CFStringRef;
function resourcePath: CFStringRef;
function executablePath: CFStringRef;
function pathForAuxiliaryExecutable(_executableName: CFStringRef): CFStringRef;
function privateFrameworksPath: CFStringRef;
function sharedFrameworksPath: CFStringRef;
function sharedSupportPath: CFStringRef;
function builtInPlugInsPath: CFStringRef;
function bundleIdentifier: CFStringRef;
function classNamed(_className: CFStringRef): _Class;
function principalClass: _Class;
// In the following methods, bundlePath is an absolute path to a bundle, and may not
// be nil; subpath is a relative path to a subdirectory inside the relevant global or
// localized resource directory, and should be nil if the resource file in question
// is not in a subdirectory.
class function pathForResource_ofType_inDirectory_(_name: CFStringRef; _ext: CFStringRef; _bundlePath: CFStringRef): CFStringRef;
function pathForResource_ofType(_name: CFStringRef; _ext: CFStringRef): CFStringRef;
function pathForResource_ofType_inDirectory(_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef): CFStringRef;
function pathForResource_ofType_inDirectory_forLocalization(_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFStringRef;
class function pathsForResourcesOfType_inDirectory_(_ext: CFStringRef; _bundlePath: CFStringRef): CFArrayRef;
function pathsForResourcesOfType_inDirectory(_ext: CFStringRef; _subpath: CFStringRef): CFArrayRef;
function pathsForResourcesOfType_inDirectory_forLocalization(_ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFArrayRef;
function localizedStringForKey_value_table(_key: CFStringRef; _value: CFStringRef; _tableName: CFStringRef): CFStringRef;
function infoDictionary: CFDictionaryRef;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function localizedInfoDictionary: CFDictionaryRef;
function objectForInfoDictionaryKey(_key: CFStringRef): objc.id;
{.$endif}
function localizations: CFArrayRef;
function preferredLocalizations: CFArrayRef;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function developmentLocalization: CFStringRef;
{.$endif}
class function preferredLocalizationsFromArray(_localizationsArray: CFArrayRef): CFArrayRef;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
class function preferredLocalizationsFromArray_forPreferences(_localizationsArray: CFArrayRef; _preferencesArray: CFArrayRef): CFArrayRef;
{.$endif}
end;
{$endif}
{$endif}
{$ifdef IMPLEMENTATION}
const
StrNSBundle_NSBundle = 'NSBundle';
StrNSBundle_mainBundle = 'mainBundle';
StrNSBundle_bundleWithPath = 'bundleWithPath:';
StrNSBundle_initWithPath = 'initWithPath:';
StrNSBundle_bundleForClass = 'bundleForClass:';
StrNSBundle_bundleWithIdentifier = 'bundleWithIdentifier:';
StrNSBundle_allBundles = 'allBundles';
StrNSBundle_allFrameworks = 'allFrameworks';
StrNSBundle_load = 'load';
StrNSBundle_isLoaded = 'isLoaded';
StrNSBundle_bundlePath = 'bundlePath';
StrNSBundle_resourcePath = 'resourcePath';
StrNSBundle_executablePath = 'executablePath';
StrNSBundle_pathForAuxiliaryExecutable = 'pathForAuxiliaryExecutable:';
StrNSBundle_privateFrameworksPath = 'privateFrameworksPath';
StrNSBundle_sharedFrameworksPath = 'sharedFrameworksPath';
StrNSBundle_sharedSupportPath = 'sharedSupportPath';
StrNSBundle_builtInPlugInsPath = 'builtInPlugInsPath';
StrNSBundle_bundleIdentifier = 'bundleIdentifier';
StrNSBundle_classNamed = 'classNamed:';
StrNSBundle_principalClass = 'principalClass';
StrNSBundle_pathForResource_ofType_inDirectory = 'pathForResource:ofType:inDirectory:';
StrNSBundle_pathForResource_ofType = 'pathForResource:ofType:';
StrNSBundle_pathForResource_ofType_inDirectory_forLocalization = 'pathForResource:ofType:inDirectory:forLocalization:';
StrNSBundle_pathsForResourcesOfType_inDirectory = 'pathsForResourcesOfType:inDirectory:';
StrNSBundle_pathsForResourcesOfType_inDirectory_forLocalization = 'pathsForResourcesOfType:inDirectory:forLocalization:';
StrNSBundle_localizedStringForKey_value_table = 'localizedStringForKey:value:table:';
StrNSBundle_infoDictionary = 'infoDictionary';
StrNSBundle_localizedInfoDictionary = 'localizedInfoDictionary';
StrNSBundle_objectForInfoDictionaryKey = 'objectForInfoDictionaryKey:';
StrNSBundle_localizations = 'localizations';
StrNSBundle_preferredLocalizations = 'preferredLocalizations';
StrNSBundle_developmentLocalization = 'developmentLocalization';
StrNSBundle_preferredLocalizationsFromArray = 'preferredLocalizationsFromArray:';
StrNSBundle_preferredLocalizationsFromArray_forPreferences = 'preferredLocalizationsFromArray:forPreferences:';
{ NSBundle }
class function NSBundle.getClass: objc.id;
begin
Result := objc_getClass(StrNSBundle_NSBundle);
end;
constructor NSBundle.mainBundle;
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(StrNSBundle_mainBundle)));
end;
constructor NSBundle.bundleWithPath(_path: CFStringRef);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_path: CFStringRef): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSBundle_bundleWithPath)), _path);
end;
constructor NSBundle.initWithPath(_path: CFStringRef);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_path: CFStringRef): 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(StrNSBundle_initWithPath)), _path);
end;
constructor NSBundle.bundleForClass(_aClass: _Class);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_aClass: _Class): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSBundle_bundleForClass)), _aClass);
end;
constructor NSBundle.bundleWithIdentifier(_identifier: CFStringRef);
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_identifier: CFStringRef): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID, sel_registerName(PChar(StrNSBundle_bundleWithIdentifier)), _identifier);
end;
class function NSBundle.allBundles: CFArrayRef;
begin
Result := CFArrayRef(objc_msgSend(getClass, sel_registerName(PChar(StrNSBundle_allBundles)), []));
end;
class function NSBundle.allFrameworks: CFArrayRef;
begin
Result := CFArrayRef(objc_msgSend(getClass, sel_registerName(PChar(StrNSBundle_allFrameworks)), []));
end;
function NSBundle.load: LongBool;
begin
Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_load)), []));
end;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function NSBundle.isLoaded: LongBool;
begin
Result := LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_isLoaded)), []));
end;
{.$endif}
function NSBundle.bundlePath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_bundlePath)), []));
end;
function NSBundle.resourcePath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_resourcePath)), []));
end;
function NSBundle.executablePath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_executablePath)), []));
end;
function NSBundle.pathForAuxiliaryExecutable(_executableName: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_executableName: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathForAuxiliaryExecutable)), _executableName));
end;
function NSBundle.privateFrameworksPath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_privateFrameworksPath)), []));
end;
function NSBundle.sharedFrameworksPath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_sharedFrameworksPath)), []));
end;
function NSBundle.sharedSupportPath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_sharedSupportPath)), []));
end;
function NSBundle.builtInPlugInsPath: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_builtInPlugInsPath)), []));
end;
function NSBundle.bundleIdentifier: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_bundleIdentifier)), []));
end;
function NSBundle.classNamed(_className: CFStringRef): _Class;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_className: CFStringRef): _Class; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := _Class(vmethod(Handle, sel_registerName(PChar(StrNSBundle_classNamed)), _className));
end;
function NSBundle.principalClass: _Class;
begin
Result := _Class(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_principalClass)), []));
end;
class function NSBundle.pathForResource_ofType_inDirectory_(_name: CFStringRef; _ext: CFStringRef; _bundlePath: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef; _ext: CFStringRef; _bundlePath: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(getClass, sel_registerName(PChar(StrNSBundle_pathForResource_ofType_inDirectory)), _name, _ext, _bundlePath));
end;
function NSBundle.pathForResource_ofType(_name: CFStringRef; _ext: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef; _ext: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathForResource_ofType)), _name, _ext));
end;
function NSBundle.pathForResource_ofType_inDirectory(_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathForResource_ofType_inDirectory)), _name, _ext, _subpath));
end;
function NSBundle.pathForResource_ofType_inDirectory_forLocalization(_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_name: CFStringRef; _ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathForResource_ofType_inDirectory_forLocalization)), _name, _ext, _subpath, _localizationName));
end;
class function NSBundle.pathsForResourcesOfType_inDirectory_(_ext: CFStringRef; _bundlePath: CFStringRef): CFArrayRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_ext: CFStringRef; _bundlePath: CFStringRef): CFArrayRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFArrayRef(vmethod(getClass, sel_registerName(PChar(StrNSBundle_pathsForResourcesOfType_inDirectory)), _ext, _bundlePath));
end;
function NSBundle.pathsForResourcesOfType_inDirectory(_ext: CFStringRef; _subpath: CFStringRef): CFArrayRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_ext: CFStringRef; _subpath: CFStringRef): CFArrayRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFArrayRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathsForResourcesOfType_inDirectory)), _ext, _subpath));
end;
function NSBundle.pathsForResourcesOfType_inDirectory_forLocalization(_ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFArrayRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_ext: CFStringRef; _subpath: CFStringRef; _localizationName: CFStringRef): CFArrayRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFArrayRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_pathsForResourcesOfType_inDirectory_forLocalization)), _ext, _subpath, _localizationName));
end;
function NSBundle.localizedStringForKey_value_table(_key: CFStringRef; _value: CFStringRef; _tableName: CFStringRef): CFStringRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_key: CFStringRef; _value: CFStringRef; _tableName: CFStringRef): CFStringRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSBundle_localizedStringForKey_value_table)), _key, _value, _tableName));
end;
function NSBundle.infoDictionary: CFDictionaryRef;
begin
Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_infoDictionary)), []));
end;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function NSBundle.localizedInfoDictionary: CFDictionaryRef;
begin
Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_localizedInfoDictionary)), []));
end;
function NSBundle.objectForInfoDictionaryKey(_key: CFStringRef): objc.id;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_key: CFStringRef): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := objc.id(vmethod(Handle, sel_registerName(PChar(StrNSBundle_objectForInfoDictionaryKey)), _key));
end;
{.$endif}
function NSBundle.localizations: CFArrayRef;
begin
Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_localizations)), []));
end;
function NSBundle.preferredLocalizations: CFArrayRef;
begin
Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_preferredLocalizations)), []));
end;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
function NSBundle.developmentLocalization: CFStringRef;
begin
Result := CFStringRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSBundle_developmentLocalization)), []));
end;
{.$endif}
class function NSBundle.preferredLocalizationsFromArray(_localizationsArray: CFArrayRef): CFArrayRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_localizationsArray: CFArrayRef): CFArrayRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFArrayRef(vmethod(getClass, sel_registerName(PChar(StrNSBundle_preferredLocalizationsFromArray)), _localizationsArray));
end;
{.$ifdef MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
class function NSBundle.preferredLocalizationsFromArray_forPreferences(_localizationsArray: CFArrayRef; _preferencesArray: CFArrayRef): CFArrayRef;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL;_localizationsArray: CFArrayRef; _preferencesArray: CFArrayRef): CFArrayRef; cdecl;
var
vmethod: TmsgSendWrapper;
begin
vmethod := TmsgSendWrapper(@objc_msgSend);
Result := CFArrayRef(vmethod(getClass, sel_registerName(PChar(StrNSBundle_preferredLocalizationsFromArray_forPreferences)), _localizationsArray, _preferencesArray));
end;
{.$endif}
{$endif}

View File

@@ -10,7 +10,6 @@
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="1"/>
</General>
@@ -89,10 +88,7 @@
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Version Value="8"/>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>