├── .clang-format ├── .gitattributes ├── .gitignore ├── Documentation └── FScriptGuide.pdf ├── F-Script 10.9 copy-Info.plist ├── F-Script ├── DemoAssistant.xib ├── English.lproj │ ├── fs.xib │ ├── fs~.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── keyedobjects.nib │ └── fs~.xib ├── FSDemoAssistant.h ├── FSDemoAssistant.m ├── FSNewlyAllocatedObject.h ├── FSNewlyAllocatedObject.m ├── FScriptAppController.h ├── FScriptAppController.m ├── FScriptAppPreference.xib ├── fs.icns └── fs_main.m ├── FSTest1 ├── DOCustom.h ├── DOCustom.m ├── MainMenu.nib │ ├── classes.nib │ ├── info.nib │ └── objects.nib ├── MainMenu.xib └── main.m ├── FScript.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ ├── F-Script 10.10.xcscheme │ ├── F-Script 10.7.xcscheme │ ├── F-Script 10.8.xcscheme │ └── F-Script 10.9.xcscheme ├── FScriptFramework 10.9 copy-Info.plist ├── FScriptFramework ├── Array.m ├── ArrayPrivate.h ├── ArrayRep.h ├── ArrayRepBoolean.h ├── ArrayRepBoolean.m ├── ArrayRepBooleanAltivec.h ├── ArrayRepBooleanAltivec.m ├── ArrayRepBooleanPacked.h ├── ArrayRepBooleanPacked.m ├── ArrayRepDouble.h ├── ArrayRepDouble.m ├── ArrayRepEmpty.h ├── ArrayRepEmpty.m ├── ArrayRepFetchRequest.h ├── ArrayRepFetchRequest.m ├── ArrayRepId.h ├── ArrayRepId.m ├── ArrayTableView.xib ├── Array_fscript.h ├── BigBrowserToolbar.m ├── Block.m ├── BlockInspector.h ├── BlockInspector.m ├── BlockPrivate.h ├── BlockRep.h ├── BlockRep.m ├── BlockSignature.h ├── BlockStackElem.h ├── BlockStackElem.m ├── Block_fscript.h ├── CLIView.h ├── CLIView.m ├── CompiledCodeNode.h ├── CompiledCodeNode.m ├── DOTest.h ├── DOTest.m ├── Employee.xcdatamodel │ ├── elements │ └── layout ├── FSAirplane.h ├── FSAirplane.m ├── FSArchiver.h ├── FSArchiver.m ├── FSArray.h ├── FSArray.m ├── FSArrayEnumerator.h ├── FSArrayEnumerator.m ├── FSAssociation.h ├── FSAssociation.m ├── FSAttributedStringInspector.h ├── FSAttributedStringInspector.m ├── FSAttributedStringInspector.xib ├── FSAttributedStringInspector_alternate.nib │ ├── classes.nib │ ├── info.nib │ └── keyedobjects.nib ├── FSAttributedStringInspector_alternate.xib ├── FSBlock.h ├── FSBlock.m ├── FSBlockCompilationResult.h ├── FSBlockCompilationResult.m ├── FSBoolean.h ├── FSBoolean.m ├── FSBooleanPrivate.h ├── FSCNArray.h ├── FSCNArray.m ├── FSCNAssignment.h ├── FSCNAssignment.m ├── FSCNBase.h ├── FSCNBase.m ├── FSCNBinaryMessage.h ├── FSCNBinaryMessage.m ├── FSCNBlock.h ├── FSCNBlock.m ├── FSCNCascade.h ├── FSCNCascade.m ├── FSCNCategory.h ├── FSCNCategory.m ├── FSCNClassDefinition.h ├── FSCNClassDefinition.m ├── FSCNDictionary.h ├── FSCNDictionary.m ├── FSCNIdentifier.h ├── FSCNIdentifier.m ├── FSCNKeywordMessage.h ├── FSCNKeywordMessage.m ├── FSCNMessage.h ├── FSCNMessage.m ├── FSCNMethod.h ├── FSCNMethod.m ├── FSCNPrecomputedObject.h ├── FSCNPrecomputedObject.m ├── FSCNReturn.h ├── FSCNReturn.m ├── FSCNStatementList.h ├── FSCNStatementList.m ├── FSCNSuper.h ├── FSCNSuper.m ├── FSCNUnaryMessage.h ├── FSCNUnaryMessage.m ├── FSCNUnaryMessageWithPattern.h ├── FSCNUnaryMessageWithPattern.m ├── FSClassDefinition.h ├── FSClassDefinition.m ├── FSCollectionInspector.h ├── FSCollectionInspector.m ├── FSCollectionInspector.xib ├── FSCollectionInspectorTableView.h ├── FSCollectionInspectorTableView.m ├── FSCollectionInspectorView.h ├── FSCollectionInspectorView.m ├── FSCollectionInspectorView.xib ├── FSColorWell.h ├── FSColorWell.m ├── FSCommandHistory.h ├── FSCommandHistory.m ├── FSCompilationResult.h ├── FSCompilationResult.m ├── FSCompiler.h ├── FSCompiler.m ├── FSConsole.nib │ ├── designable.nib │ └── keyedobjects.nib ├── FSConsole.xib ├── FSConstantListBuilder.h ├── FSConstantListBuilder.m ├── FSConstantsDictionaryGenerator.h ├── FSConstantsDictionaryGenerator.m ├── FSConstantsInitialization.h ├── FSConstantsInitialization.m ├── FSCoreDataSample.h ├── FSCoreDataSample.m ├── FSDemoController.h ├── FSDemoController.m ├── FSDetailedObjectInspector.h ├── FSDetailedObjectInspector.m ├── FSError.h ├── FSError.m ├── FSExecEngine.h ├── FSExecEngine.m ├── FSExecutor.h ├── FSExecutor.m ├── FSFlight.h ├── FSFlight.m ├── FSGenericObjectInspector.h ├── FSGenericObjectInspector.m ├── FSGenericPointer.h ├── FSGenericPointer.m ├── FSGenericPointerPrivate.h ├── FSGlobalScope.h ├── FSGlobalScope.m ├── FSIdentifierFormatter.h ├── FSIdentifierFormatter.m ├── FSImageInspector.h ├── FSImageInspector.m ├── FSImageInspector.xib ├── FSInspectorUniquier.h ├── FSInspectorUniquier.m ├── FSInterpreter.h ├── FSInterpreter.m ├── FSInterpreterPrivate.h ├── FSInterpreterResult.h ├── FSInterpreterResult.m ├── FSInterpreterResultPrivate.h ├── FSInterpreterView.h ├── FSInterpreterView.m ├── FSInterpreterViewIBHeader.h ├── FSInterpreterViewPrivate.h ├── FSKeyedArchiver.h ├── FSKeyedArchiver.m ├── FSKeyedUnarchiver.h ├── FSKeyedUnarchiver.m ├── FSManagedObjectContextInspector.h ├── FSManagedObjectContextInspector.m ├── FSManagedObjectContextInspector.xib ├── FSMethod.h ├── FSMethod.m ├── FSMiscTools.h ├── FSMiscTools.m ├── FSMovieInspector.nib │ ├── classes.nib │ ├── data.dependency │ ├── info.nib │ └── keyedobjects.nib ├── FSMsgContext.h ├── FSMsgContext.m ├── FSNSAffineTransform.h ├── FSNSAffineTransform.m ├── FSNSArray.h ├── FSNSArray.m ├── FSNSArrayPrivate.h ├── FSNSAttributedString.h ├── FSNSAttributedString.m ├── FSNSDate.h ├── FSNSDate.m ├── FSNSDictionary.h ├── FSNSDictionary.m ├── FSNSDistantObject.h ├── FSNSDistantObject.m ├── FSNSFileHandle.h ├── FSNSFileHandle.m ├── FSNSFont.h ├── FSNSFont.m ├── FSNSImage.h ├── FSNSImage.m ├── FSNSManagedObjectContext.h ├── FSNSManagedObjectContext.m ├── FSNSMutableArray.h ├── FSNSMutableArray.m ├── FSNSMutableDictionary.h ├── FSNSMutableDictionary.m ├── FSNSMutableString.h ├── FSNSMutableString.m ├── FSNSNumber.h ├── FSNSNumber.m ├── FSNSObject.h ├── FSNSObject.m ├── FSNSObjectPrivate.h ├── FSNSProtocolChecker.h ├── FSNSProtocolChecker.m ├── FSNSProxy.h ├── FSNSProxy.m ├── FSNSSet.h ├── FSNSSet.m ├── FSNSString.h ├── FSNSString.m ├── FSNSStringPrivate.h ├── FSNSValue.h ├── FSNSValue.m ├── FSNamedNumber.h ├── FSNamedNumber.m ├── FSNewlyAllocatedObjectHolder.h ├── FSNewlyAllocatedObjectHolder.m ├── FSNumber.h ├── FSNumber.m ├── FSObjectBrowser.h ├── FSObjectBrowser.m ├── FSObjectBrowser.xib ├── FSObjectBrowserArgumentPanel.h ├── FSObjectBrowserArgumentPanel.m ├── FSObjectBrowserBottomBarTextDisplay.h ├── FSObjectBrowserBottomBarTextDisplay.m ├── FSObjectBrowserButtonCtxBlock.h ├── FSObjectBrowserButtonCtxBlock.m ├── FSObjectBrowserButtonsInspector.h ├── FSObjectBrowserButtonsInspector.m ├── FSObjectBrowserButtonsInspector.nib │ ├── classes.nib │ ├── info.nib │ └── keyedobjects.nib ├── FSObjectBrowserButtonsInspector.xib ├── FSObjectBrowserCell.h ├── FSObjectBrowserCell.m ├── FSObjectBrowserMatrix.h ├── FSObjectBrowserMatrix.m ├── FSObjectBrowserNamedObjectWrapper.h ├── FSObjectBrowserNamedObjectWrapper.m ├── FSObjectBrowserSearchField.h ├── FSObjectBrowserSearchField.m ├── FSObjectBrowserToolbarButton.h ├── FSObjectBrowserToolbarButton.m ├── FSObjectBrowserToolbarItem.h ├── FSObjectBrowserToolbarItem.m ├── FSObjectBrowserView.h ├── FSObjectBrowserView.m ├── FSObjectBrowserViewObjectInfo.h ├── FSObjectBrowserViewObjectInfo.m ├── FSObjectBrowserWindow.h ├── FSObjectBrowserWindow.m ├── FSObjectEnumInfo.h ├── FSObjectEnumInfo.m ├── FSObjectFormatter.h ├── FSObjectFormatter.m ├── FSObjectInspectorBackgroundView.h ├── FSObjectInspectorBackgroundView.m ├── FSObjectInspectorOptionsViewController.h ├── FSObjectInspectorOptionsViewController.m ├── FSObjectInspectorOptionsViewController.xib ├── FSObjectInspectorOutlineView.h ├── FSObjectInspectorOutlineView.m ├── FSObjectInspectorViewController+NonArc.h ├── FSObjectInspectorViewController+NonArc.m ├── FSObjectInspectorViewController.h ├── FSObjectInspectorViewController.m ├── FSObjectInspectorViewController.xib ├── FSObjectInspectorViewModelItem.h ├── FSObjectInspectorViewModelItem.m ├── FSObjectPointer.h ├── FSObjectPointer.m ├── FSObjectPointerPrivate.h ├── FSPattern.h ├── FSPattern.m ├── FSPilot.h ├── FSPilot.m ├── FSPointer.h ├── FSPointer.m ├── FSPointerPrivate.h ├── FSPredicateTextView.h ├── FSPredicateTextView.m ├── FSReplacementForCoderForClass.h ├── FSReplacementForCoderForClass.m ├── FSReplacementForCoderForNilInArray.h ├── FSReplacementForCoderForNilInArray.m ├── FSReturnSignal.h ├── FSReturnSignal.m ├── FSSymbolTable.h ├── FSSymbolTable.m ├── FSSystem.h ├── FSSystem.m ├── FSSystemPrivate.h ├── FSTestClasses.txt ├── FSTestObjCClass1.h ├── FSTestObjCClass1.m ├── FSTestObjCClass2.h ├── FSTestObjCClass2.m ├── FSTranscript.h ├── FSTranscript.m ├── FSUnarchiver.h ├── FSUnarchiver.m ├── FSUtils.h ├── FSUtils.m ├── FSVoid.h ├── FSVoid.m ├── FSVoidPrivate.h ├── FSWorksWhenModalWindow.h ├── FSWorksWhenModalWindow.m ├── FScript.h ├── FScriptDict.dic ├── FScriptFunctions.h ├── FScriptFunctions.m ├── FScriptMenuItem.h ├── FScriptMenuItem.m ├── FScriptPreferences.nib │ ├── classes.nib │ ├── info.nib │ └── keyedobjects.nib ├── FScriptPreferences.xib ├── FScriptTextView.h ├── FScriptTextView.m ├── FlightTutorial.txt ├── KTest.txt ├── KTestManager.h ├── KTestManager.m ├── MessagePatternCodeNode.h ├── MessagePatternCodeNode.m ├── Number.m ├── NumberPrivate.h ├── Number_fscript.h ├── Pointer.h ├── Pointer.m ├── PointerPrivate.h ├── Resources │ ├── view.png │ └── window.png ├── ShellView.h ├── ShellView.m ├── Space.h ├── Space.m ├── TestFS.h ├── TestFS.m ├── blockInspector.xib ├── build.tiff ├── build_config.h ├── constantsDictionary ├── genObjInspector.nib │ ├── designable.nib │ └── keyedobjects.nib ├── genObjInspector.xib ├── gram.txt ├── license.txt ├── metamacros.h ├── metamacrosorig.h ├── run.tiff └── unusedCode │ ├── BigBrowserView.h │ ├── BigBrowserView.m │ ├── ExecutionControl.h │ ├── ExecutionControl.m │ ├── FSString.h │ ├── NSBitmapImageRepFScriptHelper.h │ ├── NSBitmapImageRepFScriptHelper.m │ ├── NSBrowserBugFix.h │ ├── NSBrowserBugFix.m │ ├── SpaceInspector.h │ ├── SpaceInspector.m │ ├── String.m │ ├── StringPrivate.h │ ├── SymbolTableOld.h │ ├── SymbolTableOld.m │ ├── SymbolTableView.h │ └── SymbolTableView.m ├── FScriptIBPlugin ├── English.lproj │ ├── FScriptIBPluginInspector.xib │ ├── FScriptIBPluginLibrary.xib │ └── InfoPlist.strings └── FScriptIBPlugin.xcodeproj │ └── project.pbxproj ├── Info-FSTest1_2.plist ├── Info-FScript.plist ├── Info-FScriptFramework.plist ├── JGAdditions ├── FSEvalCommand.h ├── FSEvalCommand.m ├── FSObjectBrowserToolbar.h ├── FSObjectBrowserToolbar.m ├── FSServicesProvider.h ├── FSServicesProvider.m ├── FSTask.h ├── FSTask.m ├── ReadMe.txt ├── fs.scriptSuite └── fs.scriptTerminology ├── README.md └── build ├── F-Script.zip └── FScript.framework.zip /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -crlf -diff -merge -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | *.pbxuser 3 | !default.pbxuser 4 | *.mode1v3 5 | !default.mode1v3 6 | *.mode2v3 7 | !default.mode2v3 8 | *.perspectivev3 9 | !default.perspectivev3 10 | *.xcworkspace 11 | !default.xcworkspace 12 | xcuserdata/ 13 | profile 14 | *.moved-aside 15 | 16 | ## Ignore incredibly annoying .DS_Store files 17 | .DS_Store 18 | 19 | ## Ignore temporary files 20 | *~.nib 21 | -------------------------------------------------------------------------------- /Documentation/FScriptGuide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/Documentation/FScriptGuide.pdf -------------------------------------------------------------------------------- /F-Script/English.lproj/fs~.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | {CLASS = FSInterpreterView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, 4 | { 5 | ACTIONS = { 6 | myAction = id; 7 | newBigBrowser = id; 8 | newKVBrowser = id; 9 | showConsole = id; 10 | showInfoPanel = id; 11 | showPreferencePanel = id; 12 | updatePreference = id; 13 | }; 14 | CLASS = FScriptAppControler; 15 | LANGUAGE = ObjC; 16 | OUTLETS = { 17 | confirmWhenQuittingUI = NSButton; 18 | displayObjectBrowserAtLaunchTimeUI = NSButton; 19 | fontSizeUI = NSTextField; 20 | infoPanel = NSPanel; 21 | interpreterView = FSInterpreterView; 22 | preferencePanel = NSPanel; 23 | shouldJournalUI = NSButton; 24 | }; 25 | SUPERCLASS = NSObject; 26 | }, 27 | { 28 | ACTIONS = { 29 | enterSelection = id; 30 | findNext = id; 31 | findPrevious = id; 32 | newBigBrowser = id; 33 | orderFrontFindPanel = id; 34 | }; 35 | CLASS = FirstResponder; 36 | LANGUAGE = ObjC; 37 | SUPERCLASS = NSObject; 38 | }, 39 | { 40 | ACTIONS = {test = id; }; 41 | CLASS = Test; 42 | LANGUAGE = ObjC; 43 | OUTLETS = {field = id; }; 44 | SUPERCLASS = NSObject; 45 | } 46 | ); 47 | IBVersion = 1; 48 | } -------------------------------------------------------------------------------- /F-Script/English.lproj/fs~.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 116 30 540 350 0 0 1440 878 7 | IBEditorPositions 8 | 9 | 44 10 | 60 754 398 44 0 0 1440 878 11 | 12 | IBFramework Version 13 | 428.0 14 | IBOldestOS 15 | 2 16 | IBOpenObjects 17 | 18 | 44 19 | 21 20 | 21 | IBSystem Version 22 | 8A369 23 | 24 | 25 | -------------------------------------------------------------------------------- /F-Script/English.lproj/fs~.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/F-Script/English.lproj/fs~.nib/keyedobjects.nib -------------------------------------------------------------------------------- /F-Script/FSDemoAssistant.h: -------------------------------------------------------------------------------- 1 | /* FSDemoController.h Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSInterpreterView.h" 6 | 7 | 8 | @interface FSDemoAssistant : NSObject 9 | { 10 | IBOutlet FSInterpreterView *interpreterView; 11 | NSTextView *loadImage; 12 | NSTextView *displayImage; 13 | NSTextView *lockFocus; 14 | NSTextView *perspective; 15 | NSTextView *hueAdjust; 16 | NSTextView *bump; 17 | NSTextView *bumpAnimate; 18 | 19 | NSTextView *horloge; 20 | 21 | NSTextView *connectToITunes; 22 | NSTextView *volumeRamp; 23 | } 24 | 25 | @property (retain) IBOutlet NSTextView *loadImage; 26 | @property (retain) IBOutlet NSTextView *displayImage; 27 | @property (retain) IBOutlet NSTextView *lockFocus; 28 | @property (retain) IBOutlet NSTextView *perspective; 29 | @property (retain) IBOutlet NSTextView *hueAdjust; 30 | @property (retain) IBOutlet NSTextView *bump; 31 | @property (retain) IBOutlet NSTextView *bumpAnimate; 32 | 33 | @property (retain) IBOutlet NSTextView *horloge; 34 | 35 | @property (retain) IBOutlet NSTextView *connectToITunes; 36 | @property (retain) IBOutlet NSTextView *volumeRamp; 37 | 38 | - (void)activate; 39 | - (id)initWithInterpreterView:(FSInterpreterView *)theInterpreterView; 40 | - (IBAction)loadCode:sender; 41 | - (void)putCommand:(NSString *)command; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /F-Script/FSNewlyAllocatedObject.h: -------------------------------------------------------------------------------- 1 | /* FSNewlyAllocatedObject.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSNewlyAllocatedObject : NSProxy 8 | { 9 | NSUInteger retainCount; 10 | id target; 11 | } 12 | 13 | + (id)newlyAllocatedObjectWithTarget:(id)theTarget; 14 | 15 | - (NSString *)description; 16 | - (void)forwardInvocation:(NSInvocation *)anInvocation; 17 | - (id)initWithTarget:(id)theTarget; 18 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector; 19 | - (void)release; 20 | - (id)retain; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /F-Script/FScriptAppController.h: -------------------------------------------------------------------------------- 1 | /* FScriptAppController.h Copyright 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSInterpreterView; 7 | @class NSPanel; 8 | @class NSTextField; 9 | @class NSButton; 10 | @class NSApplication; 11 | 12 | @interface FScriptAppController : NSObject 13 | { 14 | IBOutlet FSInterpreterView *interpreterView; 15 | IBOutlet NSPanel *infoPanel; 16 | IBOutlet NSPanel *preferencePanel; 17 | IBOutlet NSTextField *fontSizeUI; 18 | IBOutlet NSButton *shouldJournalUI; 19 | IBOutlet NSButton *confirmWhenQuittingUI; 20 | IBOutlet NSButton *displayObjectBrowserAtLaunchTimeUI; 21 | IBOutlet NSButton *automaticallyIntrospectDeclaredPropertiesUI; 22 | 23 | NSMenuItem *showConsoleMenuItem; 24 | 25 | BOOL quitConfirmed; 26 | } 27 | 28 | - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename; 29 | - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; 30 | 31 | - (void)newObjectBrowser:sender; 32 | - (void)showConsole:(id)sender; 33 | - (void)newDemoAssistant:(id)sender; 34 | - (void)showInfoPanel:(id)sender; 35 | - (void)showPreferencePanel:(id)sender; 36 | - (void)updatePreference:(id)sender; 37 | 38 | - (void)windowWillClose:(NSNotification *)aNotification; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /F-Script/fs.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/F-Script/fs.icns -------------------------------------------------------------------------------- /F-Script/fs_main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FScriptAppController.h" 3 | 4 | int main(int argc, const char **argv) 5 | { 6 | return NSApplicationMain(argc, argv); 7 | } 8 | -------------------------------------------------------------------------------- /FSTest1/DOCustom.h: -------------------------------------------------------------------------------- 1 | /* DOCustom.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface DOCustom : NSObject 8 | { 9 | NSInteger i; 10 | } 11 | 12 | - (NSInteger) getValue; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FSTest1/DOCustom.m: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "DOCustom.h" 4 | 5 | @implementation DOCustom : NSObject 6 | 7 | -(NSInteger)echoInt:(NSInteger)arg 8 | { 9 | return arg; 10 | } 11 | 12 | - (NSInteger) getValue 13 | { 14 | return i; 15 | } 16 | 17 | - (byref NSArray*)getNSArrayByRef 18 | { 19 | return [NSArray arrayWithObjects:[NSScanner scannerWithString:@"hello"], [NSProcessInfo processInfo], nil]; 20 | } 21 | 22 | - (byref NSNumber*)getNSNumberByRef 23 | { 24 | return [NSNumber numberWithDouble:30]; 25 | } 26 | 27 | - (byref NSString*)getNSStringByRef 28 | { 29 | return @"I am an NSString passed by ref"; 30 | } 31 | 32 | - (void) incr 33 | { 34 | i++; 35 | } 36 | 37 | -(BOOL)isEqual:(id)object 38 | { 39 | return [object isKindOfClass:[DOCustom class]] && i == [object getValue]; 40 | } 41 | 42 | -(id)perform:(SEL)selector on:(id)target with:(id)argument 43 | { 44 | return [target performSelector:selector withObject:argument]; 45 | } 46 | 47 | -(oneway void) quit 48 | { 49 | exit(0); 50 | } 51 | 52 | -(void) setValue:(NSInteger)value 53 | { 54 | i = value; 55 | } 56 | 57 | - testTimeout 58 | { 59 | while(1); 60 | } 61 | 62 | - (id) testStr 63 | { 64 | return @"toto"; 65 | } 66 | 67 | -(SEL) test2 68 | { 69 | return @selector(class); 70 | } 71 | 72 | @end 73 | 74 | -------------------------------------------------------------------------------- /FSTest1/MainMenu.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); 3 | IBVersion = 1; 4 | } -------------------------------------------------------------------------------- /FSTest1/MainMenu.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 205.0 7 | IBUserGuides 8 | 9 | Window 10 | 11 | guideLocations 12 | 13 | guidesLocked 14 | NO 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /FSTest1/MainMenu.nib/objects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FSTest1/MainMenu.nib/objects.nib -------------------------------------------------------------------------------- /FSTest1/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DOCustom.h" 3 | 4 | int main(int argc, const char *argv[]) 5 | { 6 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 7 | NSString *o1 = @"hello"; 8 | DOCustom *o2 = [[DOCustom alloc] init]; 9 | NSConnection *connection1 = [[NSConnection alloc] init]; 10 | NSConnection *connection2 = [[NSConnection alloc] init]; 11 | 12 | [connection1 setRootObject:o1]; 13 | if ([connection1 registerName:@"FSTest1_o1"] == NO) 14 | { 15 | [connection1 release]; 16 | NSLog(@"FSTest1 error: unable to register the object"); 17 | } 18 | 19 | [connection2 setRootObject:o2]; 20 | if ([connection2 registerName:@"FSTest1_o2"] == NO) 21 | { 22 | [connection2 release]; 23 | NSLog(@"FSTest1 error: unable to register the object"); 24 | } 25 | 26 | [pool release]; 27 | 28 | return NSApplicationMain(argc, argv); 29 | } 30 | -------------------------------------------------------------------------------- /FScriptFramework 10.9 copy-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | FScript 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | F-Script Framework 19 | CFBundlePackageType 20 | FMWK 21 | CFBundleShortVersionString 22 | Version 2.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 2.2 27 | 28 | 29 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayPrivate.h: -------------------------------------------------------------------------------- 1 | /* ArrayPrivate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSArray.h" 5 | #import "ArrayRep.h" 6 | 7 | ///////////////////////////////////// 8 | 9 | //enum ArrayRepType {FS_ID, DOUBLE, EMPTY, BOOLEAN , FETCH_REQUEST}; // These enums are used in a char instance variable of FSArray, so there must be less than 127 possible values (!) or char will have to be changed to something larger. 10 | 11 | @interface FSArray(ArrayPrivate) 12 | 13 | + (FSArray *)arrayWithRep:(id)theRep; 14 | 15 | - (id)arrayRep; 16 | - (void)becomeArrayOfId; 17 | - (void *)dataPtr; 18 | - (id)initFrom:(NSUInteger)from to:(NSUInteger)to step:(NSUInteger)step; 19 | - (id)initFilledWith:(id)elem count:(NSUInteger)nb; 20 | - (FSArray *)initWithRep:(id)theRep; 21 | - (FSArray *)initWithRepNoRetain:(id)theRep; 22 | - (enum ArrayRepType)type; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRep.h: -------------------------------------------------------------------------------- 1 | /* ArrayRep.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSArray; 7 | @class ArrayRepId; 8 | @class FSBlock; 9 | 10 | @protocol ArrayRep 11 | 12 | @required 13 | - (ArrayRepId *) asArrayRepId; 14 | - (enum ArrayRepType)repType; 15 | 16 | @optional 17 | - (NSUInteger)count; 18 | - (NSString *)descriptionLimited:(NSUInteger)nbElem; 19 | - (FSArray *) distinctId; 20 | - (NSUInteger)indexOfObject:(id)anObject inRange:(NSRange)range identical:(BOOL)identical; 21 | - (id)indexWithArray:(FSArray *)index; 22 | - (id)operator_backslash:(FSBlock*)bl; // precond: ![bl isProxy] && count != 0 23 | - (void)removeLastElem; 24 | - (void)removeElemAtIndex:(NSUInteger)index; 25 | - (FSArray *)replicateWithArray:(FSArray *)operand; 26 | - (FSArray *)reverse; 27 | - (FSArray *)rotatedBy:(NSNumber *)operand; 28 | - (FSArray *)sort; 29 | - (NSArray *)subarrayWithRange:(NSRange)range; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepBoolean.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepBoolean.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "ArrayRep.h" 6 | 7 | @interface ArrayRepBoolean : NSObject 8 | { 9 | NSUInteger retainCount; 10 | @public 11 | char *t; // the booleans, represented by an array of char 12 | NSUInteger count; 13 | NSUInteger capacity; 14 | } 15 | 16 | 17 | - (void)addBoolean:(char)aBoolean; 18 | - (char *)booleansPtr; 19 | - (NSUInteger)indexOfObject:(id)anObject inRange:(NSRange)range identical:(BOOL)identical; 20 | - (id)init; 21 | - (id)initFilledWithBoolean:(char)elem count:(NSUInteger)nb; // contract: a return value of nil means not enough memory 22 | - (id)initWithCapacity:(NSUInteger)aNumItems; // contract: a return value of nil means not enough memory 23 | - (id)initWithBooleans:(char *)elems count:(NSUInteger)nb; 24 | - (id)initWithBooleansNoCopy:(char *)tab count:(NSUInteger)nb; 25 | - (id)copyWithZone:(NSZone *)zone; 26 | - (void)replaceBooleanAtIndex:(NSUInteger)index withBoolean:(char)aBoolean; 27 | - (enum ArrayRepType)repType; 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepBooleanAltivec.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepBoolean.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "ArrayRep.h" 6 | 7 | /*typedef union 8 | { 9 | vector bool char vec; 10 | BOOL elements[16]; 11 | } booleanVector;*/ 12 | 13 | @interface ArrayRepBoolean : NSObject /* */ 14 | { 15 | NSUInteger retainCount; 16 | @public 17 | char *t; // the booleans, represented by an array of chars 18 | NSUInteger count; 19 | NSUInteger capacity; 20 | } 21 | 22 | - (void)addBoolean:(char)aBoolean; 23 | - (char *)booleansPtr; 24 | - init; 25 | - initFilledWithBoolean:(char)elem count:(NSUInteger)nb; // contract: a return value of nil means not enough memory 26 | - initWithCapacity:(NSUInteger)aNumItems; // contract: a return value of nil means not enough memory 27 | - initWithBooleans:(char *)elems count:(NSUInteger)nb; 28 | - initWithBooleansNoCopy:(char *)tab count:(NSUInteger)nb; 29 | - copyWithZone:(NSZone *)zone; 30 | - (void)replaceBooleanAtIndex:(NSUInteger)index withBoolean:(char)aBoolean; 31 | - (enum ArrayRepType)repType; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepBooleanPacked.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepBoolean.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "ArrayRep.h" 6 | 7 | @interface ArrayRepBoolean : NSObject 8 | { 9 | NSUInteger retainCount; 10 | @public 11 | NSUInteger *t; // the booleans, represented by an array of unsigned 12 | NSUInteger count; 13 | NSUInteger capacity; 14 | } 15 | 16 | 17 | - (void)addBoolean:(char)aBoolean; 18 | - (char *)booleansPtr; 19 | - init; 20 | - initFilledWithBoolean:(char)elem count:(NSUInteger)nb; // contract: a return value of nil means not enough memory 21 | - initWithCapacity:(NSUInteger)aNumItems; // contract: a return value of nil means not enough memory 22 | - initWithBooleans:(NSUInteger *)elems count:(NSUInteger)nb; 23 | - initWithBooleansNoCopy:(char *)tab count:(NSUInteger)nb; 24 | - copyWithZone:(NSZone *)zone; 25 | - (void)replaceBooleanAtIndex:(NSUInteger)index withBoolean:(char)aBoolean; 26 | - (enum ArrayRepType)repType; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepDouble.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepDouble.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "ArrayRep.h" 6 | 7 | @interface ArrayRepDouble : NSObject 8 | { 9 | NSUInteger retainCount; 10 | @public 11 | double *t; // the doubles 12 | NSUInteger count; 13 | NSUInteger capacity; 14 | } 15 | 16 | 17 | + (id)arrayRepDoubleWithCapacity:(NSUInteger)aNumItems; 18 | 19 | - (void)addDouble:(double)aDouble; 20 | - (void)addDoublesFromFSArray:(FSArray *)otherArray; 21 | - (NSString *)descriptionLimited:(NSUInteger)nbElem; 22 | - (NSUInteger)indexOfObject:(id)anObject inRange:(NSRange)range identical:(BOOL)identical; 23 | - (id)init; 24 | - (id)initFilledWithDouble:(double)elem count:(NSUInteger)nb; // contract: a return value of nil means not enough memory 25 | - (id)initFrom:(NSUInteger)from to:(NSUInteger)to step:(NSUInteger)step; // contract: a return value of nil means not enough memory 26 | - (id)initWithCapacity:(NSUInteger)aNumItems; // contract: a return value of nil means not enough memory 27 | - (id)initWithDoubles:(double *)elems count:(NSUInteger)nb; 28 | - (id)initWithDoublesNoCopy:(double *)tab count:(NSUInteger)nb; 29 | - (void)insertDouble:(double)aDouble atIndex:(NSUInteger)index; 30 | - (id)copyWithZone:(NSZone *)zone; 31 | - (double *)doublesPtr; 32 | - (void)replaceDoubleAtIndex:(NSUInteger)index withDouble:(double)aDouble; 33 | - (enum ArrayRepType)repType; 34 | - (FSArray *)where:(NSArray *)booleans; // precondition: booleans is actualy an array and is of same size as the receiver 35 | @end 36 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepEmpty.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepEmpty.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | /* 5 | 6 | Provides the class for the internal representation of empty FSArray. 7 | 8 | */ 9 | 10 | #import 11 | #import "ArrayRep.h" 12 | 13 | @class ArrayRepDouble; 14 | @class ArrayRepBoolean; 15 | 16 | @interface ArrayRepEmpty : NSObject 17 | { 18 | NSUInteger retainCount; // optimized reference counting 19 | @public 20 | NSUInteger capacity; // used when generating a not empty FSArray representation from this empty one. Equal to the capacity given at creation time using the standard NSArray initializer 21 | } 22 | 23 | - (ArrayRepDouble *) asArrayRepDouble; 24 | - (ArrayRepBoolean *) asArrayRepBoolean; 25 | - (id)init; 26 | - (id)initWithCapacity:(NSUInteger)aNumItems; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepFetchRequest.h: -------------------------------------------------------------------------------- 1 | /* ArrayRepFetchRequest.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | #import "ArrayRep.h" 7 | 8 | @interface ArrayRepFetchRequest : NSObject 9 | { 10 | NSFetchRequest *fetchRequest; 11 | NSManagedObjectContext *objectContext; 12 | } 13 | 14 | + (ArrayRepFetchRequest *) arrayRepFetchRequestWithFetchRequest:(NSFetchRequest *)theFetchRequest objectContext:(NSManagedObjectContext *)theObjectContext; 15 | 16 | - (ArrayRepId *) asArrayRepId; 17 | - (id)copyWithZone:(NSZone *)zone; 18 | - (void)dealloc; 19 | - (id)initWithFetchRequest:(NSFetchRequest *)theFetchRequest objectContext:(NSManagedObjectContext *)theObjectContext; 20 | - (enum ArrayRepType) repType; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FScriptFramework/ArrayRepFetchRequest.m: -------------------------------------------------------------------------------- 1 | /* ArrayRepFetchRequest.m Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "ArrayRepFetchRequest.h" 5 | #import "ArrayRepId.h" 6 | #import "FSArray.h" 7 | 8 | @implementation ArrayRepFetchRequest 9 | 10 | + (ArrayRepFetchRequest *) arrayRepFetchRequestWithFetchRequest:(NSFetchRequest *)theFetchRequest objectContext:(NSManagedObjectContext *)theObjectContext 11 | { 12 | return [[[self alloc] initWithFetchRequest:theFetchRequest objectContext:theObjectContext] autorelease]; 13 | } 14 | 15 | - (ArrayRepId *) asArrayRepId 16 | { 17 | NSError *error = nil; 18 | NSArray *objects; 19 | 20 | objects = [objectContext executeFetchRequest:fetchRequest error:&error]; 21 | 22 | if (error) 23 | { 24 | NSLog(@"Error when fetching an ArrayRepFetchRequest: %@", error); 25 | objects = [NSArray array]; 26 | } 27 | 28 | return [ArrayRepId arrayWithArray:objects]; 29 | } 30 | 31 | - (id)copyWithZone:(NSZone *)zone 32 | { 33 | return [[ArrayRepFetchRequest allocWithZone:zone] initWithFetchRequest:fetchRequest objectContext:objectContext]; 34 | } 35 | 36 | - (void)dealloc 37 | { 38 | [fetchRequest release]; 39 | [objectContext release]; 40 | [super dealloc]; 41 | } 42 | 43 | - (id)initWithFetchRequest:(NSFetchRequest *)theFetchRequest objectContext:(NSManagedObjectContext *)theObjectContext 44 | { 45 | if ((self = [super init])) 46 | { 47 | fetchRequest = [theFetchRequest retain]; 48 | objectContext = [theObjectContext retain]; 49 | } 50 | return self; 51 | } 52 | 53 | - (enum ArrayRepType)repType {return FETCH_REQUEST;} 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /FScriptFramework/BlockInspector.h: -------------------------------------------------------------------------------- 1 | /* BlockInspector.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class NSMutableString; 7 | @class FSBlock; 8 | @class NSString; 9 | @class NSSplitView; 10 | @class NSScrollView; 11 | @class NSButton; 12 | 13 | @interface BlockInspector : NSObject 14 | { 15 | FSBlock *inspectedObject; 16 | IBOutlet NSSplitView *splitView; 17 | IBOutlet NSScrollView *sourceView; 18 | IBOutlet NSScrollView *messageView; 19 | BOOL edited; 20 | NSWindow *argumentsWindow; 21 | } 22 | 23 | 24 | - (id)activate; 25 | - (IBAction)compil:sender; 26 | - (BOOL)edited; 27 | - (id)initWithBlock:(FSBlock*)bl; 28 | - (IBAction)run:sender; 29 | - (void)setEdited:(BOOL)newVal; 30 | - (void)showError:(NSString*)errorMessage; 31 | - (void)showError:(NSString*)errorMessage start:(NSInteger)firstCharacterIndex end:(NSInteger)lastCharacterIndex; 32 | - (NSString *)source; 33 | - (id)update; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FScriptFramework/BlockPrivate.h: -------------------------------------------------------------------------------- 1 | /* BlockPrivate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSBlock.h" 5 | 6 | @class FSInterpreterResult; 7 | @class FSBlockCompilationResult; 8 | 9 | @interface FSBlock (BlockPrivate) 10 | 11 | - (BlockRep *)blockRep; 12 | - (id)body_compact_valueArgs:(id*)args count:(NSUInteger)count; 13 | - (id)body_notCompact_valueArgs:(id*)args count:(NSUInteger)count; 14 | - (FSBlockCompilationResult *)compilation; // Compil the receiver if needed. Return the result of the compilation. 15 | - (void)evaluateWithDoubleFrom:(double)start to:(double)stop by:(double)step; 16 | - (BlockInspector *)inspector; 17 | - (SEL)messageToArgumentSelector; 18 | - (FSBlock *)totalCopy; 19 | - (void)setNewRepAfterCompilation:(BlockRep*)newRep; 20 | - (id)sync; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FScriptFramework/BlockSignature.h: -------------------------------------------------------------------------------- 1 | /* BlockSignature.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | struct BlockSignature 5 | { 6 | int argumentCount; 7 | BOOL hasLocals; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /FScriptFramework/BlockStackElem.h: -------------------------------------------------------------------------------- 1 | /* BlockStackElem.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBlock; 7 | 8 | @interface BlockStackElem : NSObject 9 | { 10 | NSInteger firstCharIndex; 11 | NSInteger lastCharIndex; 12 | NSString *errorStr; 13 | FSBlock *block; 14 | } 15 | 16 | + (BlockStackElem *)blockStackElemWithBlock:(FSBlock *)theBlock errorStr:(NSString *)theErrorStr firstCharIndex:(NSInteger)first lastCharIndex:(NSInteger)last; 17 | 18 | - (FSBlock *)block; 19 | - (void)dealloc; 20 | - (void)encodeWithCoder:(NSCoder *)aCoder; 21 | - (NSString *)errorStr; 22 | - (NSInteger) firstCharIndex; 23 | - (BlockStackElem *)initWithBlock:(FSBlock *)theBlock errorStr:(NSString *)theErrorStr firstCharIndex:(NSInteger)first lastCharIndex:(NSInteger)last; 24 | - (id)initWithCoder:(NSCoder *)aDecoder; 25 | - (NSInteger) lastCharIndex; 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/DOTest.h: -------------------------------------------------------------------------------- 1 | /* DOTest.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface DOTest : NSObject 8 | { 9 | id object; 10 | } 11 | 12 | 13 | -(void)setObject:(id)theObject; 14 | -(void)setObjectByCopy:(bycopy id)theObject; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/DOTest.m: -------------------------------------------------------------------------------- 1 | /* DOTest.m Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "DOTest.h" 5 | 6 | 7 | @implementation DOTest 8 | 9 | -(void)setObject:(id)theObject 10 | { 11 | [theObject retain]; 12 | [object release]; 13 | object = theObject; 14 | } 15 | 16 | -(void)setObjectByCopy:(bycopy id)theObject; 17 | { 18 | [self setObject:theObject]; 19 | } 20 | 21 | - (id)object 22 | { 23 | return object; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/Employee.xcdatamodel/elements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/Employee.xcdatamodel/elements -------------------------------------------------------------------------------- /FScriptFramework/Employee.xcdatamodel/layout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/Employee.xcdatamodel/layout -------------------------------------------------------------------------------- /FScriptFramework/FSAirplane.h: -------------------------------------------------------------------------------- 1 | /* FSAirplane.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSAirplane : NSObject 7 | { 8 | id ident; 9 | id model; 10 | id capacity; 11 | id location; 12 | } 13 | 14 | ////////////////////////////////// User methods //////////////////////////////// 15 | 16 | + (id) airplaneWithIdent:(id)theIdent model:(id)theModel capacity:(id)theCapacity location:(id)theLocation; 17 | 18 | - (id) capacity; 19 | - (void) setCapacity:(id)theCapacity; 20 | - (id) ident; 21 | - (void) setIdent:(id)theIdent; 22 | - (id) location; 23 | - (void) setLocation:(id)theLocation; 24 | - (id) model; 25 | - (void) setModel:(id)theModel; 26 | 27 | 28 | ////////////////////////////////// Programmer methods //////////////////////////////// 29 | 30 | - (void)dealloc; 31 | - (NSString *)description; 32 | - (void)encodeWithCoder:(NSCoder *)aCoder; 33 | - (id)initWithCoder:(NSCoder *)aDecoder; 34 | - (id) initWithIdent:(id)theIdent model:(id)theModel capacity:(id)theCapacity location:(id)theLocation; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /FScriptFramework/FSArchiver.h: -------------------------------------------------------------------------------- 1 | /* FSArchiver.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSArchiver : NSArchiver 8 | {} 9 | 10 | - (void)encodeValueOfObjCType:(const char *)valueType at:(const void *)address; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSArrayEnumerator.h: -------------------------------------------------------------------------------- 1 | // FSArrayEnumerator.h Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @class FSArray; 7 | 8 | @interface FSArrayEnumerator : NSEnumerator 9 | { 10 | FSArray *array; 11 | NSUInteger next; 12 | NSUInteger last; 13 | char increment; 14 | BOOL iterationCompleted; 15 | } 16 | 17 | - (void) dealloc; 18 | - (FSArrayEnumerator *)initWithArray:(FSArray *)theArray reverse:(BOOL)reverse; 19 | - (id)nextObject; 20 | - (FSArray *)allObjects; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FScriptFramework/FSArrayEnumerator.m: -------------------------------------------------------------------------------- 1 | // FSArrayEnumerator.m Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSArrayEnumerator.h" 5 | #import "FSArray.h" 6 | 7 | @implementation FSArrayEnumerator 8 | 9 | - (void) dealloc 10 | { 11 | [array release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (FSArrayEnumerator *)initWithArray:(FSArray *)theArray reverse:(BOOL)reverse 16 | { 17 | if ((self = [super init])) 18 | { 19 | NSUInteger count = [theArray count]; 20 | iterationCompleted = (count == 0); 21 | array = [theArray retain]; 22 | next = reverse ? count-1 : 0; 23 | increment = reverse ? -1 : 1; 24 | last = reverse ? 0 : count-1; 25 | return self; 26 | } 27 | return nil; 28 | } 29 | 30 | - (id)nextObject 31 | { 32 | if (iterationCompleted) 33 | return nil; 34 | else 35 | { 36 | id r = [array objectAtIndex:next]; 37 | iterationCompleted = (next == last); 38 | next += increment; 39 | return r; 40 | } 41 | } 42 | 43 | - (FSArray *)allObjects 44 | { 45 | if (iterationCompleted) 46 | return [FSArray array]; 47 | else 48 | { 49 | iterationCompleted = YES; 50 | if (increment == 1) 51 | return (FSArray *)[array subarrayWithRange:NSMakeRange(next, (last-next)+1)]; 52 | else 53 | return [(FSArray *)[array subarrayWithRange:NSMakeRange(0, next+1)] reverse]; 54 | } 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FScriptFramework/FSAssociation.h: -------------------------------------------------------------------------------- 1 | /* FSAssociation.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBoolean; 7 | 8 | @interface FSAssociation : NSObject 9 | { 10 | id key; 11 | id value; 12 | } 13 | 14 | + (id) associationWithKey:(id)theKey value:(id)theValue; 15 | 16 | - (NSString *) description; 17 | - (void) encodeWithCoder:(NSCoder *)coder; 18 | - (id) initWithCoder:(NSCoder *)coder; 19 | - (id) initWithKey:(id)theKey value:(id)theValue; 20 | - (BOOL) isEqual:(id)anObject; 21 | - (id) key; 22 | - (FSBoolean *) operator_equal:(id)operand; 23 | - (FSBoolean *) operator_tilde_equal:(id)operand; 24 | - (id) value; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSAttributedStringInspector.h: -------------------------------------------------------------------------------- 1 | // FSAttributedStringInspector.h Copyright (c) 2004-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @interface FSAttributedStringInspector : NSObject 7 | { 8 | id inspectedObject; 9 | IBOutlet NSWindow *window; 10 | IBOutlet NSTextView *printStringView; 11 | IBOutlet NSTextView *attributedStringView; 12 | } 13 | 14 | + (FSAttributedStringInspector *)attributedStringInspectorWithAttributedString:(NSAttributedString *)object; 15 | - (FSAttributedStringInspector *)initWithAttributedString:(NSAttributedString *)object; 16 | - (IBAction)updateAction:(id)sender; 17 | 18 | - (void)windowWillClose:(NSNotification *)aNotification; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSAttributedStringInspector_alternate.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | { 4 | ACTIONS = {updateAction = id; }; 5 | CLASS = FSAttributedStringInspector; 6 | LANGUAGE = ObjC; 7 | OUTLETS = { 8 | attributedStringView = NSTextView; 9 | printStringView = NSTextView; 10 | window = NSWindow; 11 | }; 12 | SUPERCLASS = NSObject; 13 | }, 14 | { 15 | ACTIONS = {updateAction = id; }; 16 | CLASS = FSGenericObjectInspector; 17 | LANGUAGE = ObjC; 18 | OUTLETS = {printStringView = NSTextView; window = NSWindow; }; 19 | }, 20 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } 21 | ); 22 | IBVersion = 1; 23 | } -------------------------------------------------------------------------------- /FScriptFramework/FSAttributedStringInspector_alternate.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 28 25 441 242 0 0 1440 878 7 | IBFramework Version 8 | 349.0 9 | IBOpenObjects 10 | 11 | 5 12 | 13 | IBSystem Version 14 | 7D24 15 | 16 | 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSAttributedStringInspector_alternate.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FSAttributedStringInspector_alternate.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/FSBlockCompilationResult.h: -------------------------------------------------------------------------------- 1 | /* FSBlockCompilationResult.m Copyright (c) 2006 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | 5 | #import 6 | 7 | enum FSBlockCompilationResultType {FSOKBlockCompilationResultType, FSErrorBlockCompilationResultType}; 8 | 9 | @interface FSBlockCompilationResult : NSObject 10 | { 11 | @public 12 | enum FSBlockCompilationResultType type; 13 | NSString *errorMessage; 14 | NSInteger errorFirstCharacterIndex; 15 | NSInteger errorLastCharacterIndex; 16 | } 17 | 18 | 19 | + (id)blockCompilationResultWithType:(enum FSBlockCompilationResultType)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last; 20 | 21 | - (void)dealloc; 22 | - (id)initWithType:(enum FSBlockCompilationResultType)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSBlockCompilationResult.m: -------------------------------------------------------------------------------- 1 | /* FSBlockCompilationResult.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSBlockCompilationResult.h" 5 | 6 | @implementation FSBlockCompilationResult 7 | 8 | + (id)blockCompilationResultWithType:(enum FSBlockCompilationResultType)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last 9 | { 10 | return [[[self alloc] initWithType:theType errorMessage:theErrorMessage errorFirstCharacterIndex:first errorLastCharacterIndex:last] autorelease]; 11 | } 12 | 13 | - (void)dealloc 14 | { 15 | [errorMessage release]; 16 | [super dealloc]; 17 | } 18 | 19 | - (id)initWithType:(enum FSBlockCompilationResultType)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last 20 | { 21 | if ((self = [super init])) 22 | { 23 | type = theType; 24 | errorMessage = [theErrorMessage retain]; 25 | errorFirstCharacterIndex = first; 26 | errorLastCharacterIndex = last; 27 | return self; 28 | } 29 | return nil; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /FScriptFramework/FSBoolean.h: -------------------------------------------------------------------------------- 1 | /* FSBoolean.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSObject.h" 5 | 6 | @class True; 7 | @class False; 8 | @class FSBlock; 9 | 10 | @interface FSBoolean : NSObject 11 | {} 12 | 13 | + (FSBoolean *) booleanWithBool:(BOOL)theBool; 14 | + (FSBoolean *) fsFalse; 15 | + (FSBoolean *) fsTrue; 16 | - (FSBoolean *) and:(FSBlock *)operand; 17 | - (id) autorelease; 18 | - (FSBoolean *) clone __attribute__((deprecated)); 19 | - (id) copy; 20 | - (id) copyWithZone:(NSZone *)zone; 21 | - (NSUInteger) hash; 22 | - (id) ifFalse:(FSBlock *)falseBlock; 23 | - (id) ifFalse:(FSBlock *)falseBlock ifTrue:(FSBlock *)trueBlock; 24 | - (id) ifTrue:(FSBlock *)trueBlock; 25 | - (id) ifTrue:(FSBlock *)trueBlock ifFalse:(FSBlock *)falseBlock; 26 | - (FSBoolean *) not; 27 | - (FSBoolean *) operator_ampersand:(FSBoolean *)operand; 28 | - (FSBoolean *) operator_bar:(FSBoolean *)operand; 29 | - (FSBoolean *) operator_less:(id)operand; 30 | - (NSNumber *) operator_plus:(id)operand; 31 | - (FSBoolean *) operator_equal:(id)operand; 32 | - (FSBoolean *) operator_tilde_equal:(id)operand; 33 | - (FSBoolean *) or:(FSBlock *)operand; 34 | - (void) release; 35 | - (id) retain; 36 | - (NSUInteger) retainCount; 37 | @end 38 | 39 | @interface True: FSBoolean 40 | {} 41 | @end 42 | 43 | @interface False: FSBoolean 44 | {} 45 | @end 46 | -------------------------------------------------------------------------------- /FScriptFramework/FSBooleanPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSBooleanPrivate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSBoolean.h" 5 | 6 | extern FSBoolean *fsTrue; 7 | extern FSBoolean *fsFalse; 8 | 9 | @interface FSBoolean(FSBooleanPrivate) 10 | 11 | - (double)doubleValue; 12 | - (BOOL) isTrue; 13 | 14 | @end 15 | 16 | @interface False(FalsePrivate) 17 | 18 | - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; 19 | 20 | @end 21 | 22 | @interface True(TruePrivate) 23 | 24 | - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNArray.h: -------------------------------------------------------------------------------- 1 | /* FSCNArray.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | 7 | @interface FSCNArray : FSCNBase 8 | { 9 | @public 10 | unsigned count; 11 | __strong FSCNBase **elements; 12 | } 13 | 14 | - (void)dealloc; 15 | - (void)encodeWithCoder:(NSCoder *)coder; 16 | - (id)initWithCoder:(NSCoder *)coder; 17 | - (id)initWithElements:(NSArray *)theElements; 18 | - (void)translateCharRange:(int32_t)translation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNArray.m: -------------------------------------------------------------------------------- 1 | /* FSCNArray.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNArray.h" 5 | 6 | @implementation FSCNArray 7 | 8 | - (void)dealloc 9 | { 10 | for (NSUInteger i = 0; i < count; i++) [elements[i] release]; 11 | free(elements); 12 | [super dealloc]; 13 | } 14 | 15 | - (NSString *)description 16 | { 17 | return @"Array literal"; 18 | } 19 | 20 | - (void)encodeWithCoder:(NSCoder *)coder 21 | { 22 | [super encodeWithCoder:coder]; 23 | [coder encodeObject:[NSArray arrayWithObjects:elements count:count] forKey:@"elements"]; 24 | } 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | nodeType = ARRAY; 30 | NSArray *theElements = [coder decodeObjectForKey:@"elements"]; 31 | count = [theElements count]; 32 | elements = NSAllocateCollectable(count * sizeof(id), NSScannedOption); 33 | [theElements getObjects:elements]; 34 | [theElements makeObjectsPerformSelector:@selector(retain)]; 35 | 36 | return self; 37 | } 38 | 39 | - (id)initWithElements:(NSArray *)theElements 40 | { 41 | self = [super init]; 42 | if (self != nil) 43 | { 44 | nodeType = ARRAY; 45 | count = [theElements count]; 46 | elements = NSAllocateCollectable(count * sizeof(id), NSScannedOption); 47 | [theElements getObjects:elements]; 48 | [theElements makeObjectsPerformSelector:@selector(retain)]; 49 | } 50 | return self; 51 | } 52 | 53 | - (void)translateCharRange:(int32_t)translation 54 | { 55 | [super translateCharRange:translation]; 56 | 57 | for (NSUInteger i = 0; i < count; i++) [elements[i] translateCharRange:translation]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNAssignment.h: -------------------------------------------------------------------------------- 1 | /* FSCNAssignment.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @interface FSCNAssignment : FSCNBase 7 | { 8 | @public 9 | FSCNBase *left; 10 | FSCNBase *right; 11 | } 12 | 13 | - (void)dealloc; 14 | - (void)encodeWithCoder:(NSCoder *)aCoder; 15 | - (id)initWithCoder:(NSCoder *)aDecoder; 16 | - (id)initWithLeft:(FSCNBase *)l right:(FSCNBase *)r; 17 | - (void)translateCharRange:(int32_t)translation; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNAssignment.m: -------------------------------------------------------------------------------- 1 | /* FSCNAssignment.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNAssignment.h" 5 | 6 | @implementation FSCNAssignment 7 | 8 | - (void)dealloc 9 | { 10 | [left release]; 11 | [right release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (NSString *)description 16 | { 17 | return @"Assignment"; 18 | } 19 | 20 | - (void)encodeWithCoder:(NSCoder *)coder 21 | { 22 | [super encodeWithCoder:coder]; 23 | [coder encodeObject:left forKey:@"left"]; 24 | [coder encodeObject:right forKey:@"right"]; 25 | } 26 | 27 | - (id)initWithCoder:(NSCoder *)coder 28 | { 29 | self = [super initWithCoder:coder]; 30 | nodeType = ASSIGNMENT; 31 | left = [[coder decodeObjectForKey:@"left"] retain]; 32 | right = [[coder decodeObjectForKey:@"right"] retain]; 33 | return self; 34 | } 35 | 36 | - (id)initWithLeft:(FSCNBase *)l right:(FSCNBase *)r 37 | { 38 | self = [super init]; 39 | if (self != nil) 40 | { 41 | nodeType = ASSIGNMENT; 42 | left = [l retain]; 43 | right = [r retain]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)translateCharRange:(int32_t)translation 49 | { 50 | [super translateCharRange:translation]; 51 | [left translateCharRange:translation]; 52 | [right translateCharRange:translation]; 53 | } 54 | 55 | @end -------------------------------------------------------------------------------- /FScriptFramework/FSCNBase.h: -------------------------------------------------------------------------------- 1 | /* FSCNBase.h Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSArray.h" 6 | #import "FSMsgContext.h" 7 | 8 | enum FSCNType {IDENTIFIER, MESSAGE, STATEMENT_LIST, OBJECT, ARRAY, TEST_ABORT, BLOCK, ASSIGNMENT, NUMBER, CASCADE, 9 | UNARY_MESSAGE, BINARY_MESSAGE, KEYWORD_MESSAGE, SUPER, CLASS_DEFINITION, CATEGORY, METHOD, RETURN, DICTIONARY}; 10 | // Note: in older versions of F-Script, the node type was archived directly as its FSCNType integer value. 11 | // Therefore, for backward compatibility with older archives, the order of this enum should not be modified. 12 | 13 | @interface FSCNBase : NSObject 14 | { 15 | @public 16 | enum FSCNType nodeType; 17 | int32_t firstCharIndex; 18 | int32_t lastCharIndex; 19 | } 20 | 21 | - (void)encodeWithCoder:(NSCoder *)aCoder; 22 | - (id)initWithCoder:(NSCoder *)aDecoder; 23 | - (id)init; 24 | - (void)setFirstCharIndex:(int32_t)first lastCharIndex:(int32_t)last; 25 | - (void)translateCharRange:(int32_t)translation; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNBase.m: -------------------------------------------------------------------------------- 1 | /* FSCNBase.m Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | 7 | @implementation FSCNBase 8 | 9 | - (void)encodeWithCoder:(NSCoder *)coder 10 | { 11 | if ( [coder allowsKeyedCoding] ) 12 | { 13 | [coder encodeInt32:firstCharIndex forKey:@"firstCharIndex"]; 14 | [coder encodeInt32:lastCharIndex forKey:@"lastCharIndex"]; 15 | } 16 | else [NSException raise:NSInvalidArchiveOperationException format:@"FSCNBase only supports keyed coding"]; 17 | } 18 | 19 | - (id)initWithCoder:(NSCoder *)coder 20 | { 21 | self = [super init]; 22 | 23 | if ( [coder allowsKeyedCoding] ) 24 | { 25 | firstCharIndex = [coder decodeInt32ForKey:@"firstCharIndex"]; 26 | lastCharIndex = [coder decodeInt32ForKey:@"lastCharIndex"]; 27 | } 28 | else [NSException raise:NSInvalidArchiveOperationException format:@"FSCNBase only supports keyed coding"]; 29 | 30 | return self; 31 | } 32 | 33 | - (id)init 34 | { 35 | if ((self = [super init])) 36 | { 37 | firstCharIndex = -1; 38 | lastCharIndex = -1; 39 | return self; 40 | } 41 | return nil; 42 | } 43 | 44 | - (void)setFirstCharIndex:(int32_t)first lastCharIndex:(int32_t)last 45 | { 46 | firstCharIndex = first; 47 | lastCharIndex = last; 48 | } 49 | 50 | -(void)translateCharRange:(int32_t)translation 51 | { 52 | firstCharIndex += translation; 53 | lastCharIndex += translation; 54 | } 55 | 56 | @end -------------------------------------------------------------------------------- /FScriptFramework/FSCNBinaryMessage.h: -------------------------------------------------------------------------------- 1 | /* FSCNBinaryMessage.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNMessage.h" 5 | 6 | @interface FSCNBinaryMessage : FSCNMessage 7 | { 8 | @public 9 | FSCNBase *argument; 10 | } 11 | 12 | - (void)dealloc; 13 | - (void)encodeWithCoder:(NSCoder *)aCoder; 14 | - (id)initWithCoder:(NSCoder *)aDecoder; 15 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern argument:(FSCNBase *)theArgument; 16 | - (void)translateCharRange:(int32_t)translation; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNBinaryMessage.m: -------------------------------------------------------------------------------- 1 | /* FSCNBinaryMessage.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBinaryMessage.h" 5 | 6 | 7 | @implementation FSCNBinaryMessage 8 | 9 | - (void)dealloc 10 | { 11 | [argument release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (void)encodeWithCoder:(NSCoder *)coder 16 | { 17 | [super encodeWithCoder:coder]; 18 | [coder encodeObject:argument forKey:@"argument"]; 19 | } 20 | 21 | - (id)initWithCoder:(NSCoder *)coder 22 | { 23 | self = [super initWithCoder:coder]; 24 | nodeType = BINARY_MESSAGE; 25 | argument = [[coder decodeObjectForKey:@"argument"] retain]; 26 | return self; 27 | } 28 | 29 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern argument:(FSCNBase *)theArgument 30 | { 31 | self = [super initWithReceiver:theReceiver selectorString:theSelectorString pattern:thePattern]; 32 | if (self != nil) 33 | { 34 | nodeType = BINARY_MESSAGE; 35 | argument = [theArgument retain]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)translateCharRange:(int32_t)translation 41 | { 42 | [super translateCharRange:translation]; 43 | [argument translateCharRange:translation]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNBlock.h: -------------------------------------------------------------------------------- 1 | /* FSCNBlock.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @class BlockRep; 7 | 8 | 9 | @interface FSCNBlock : FSCNBase 10 | { 11 | @public 12 | BlockRep *blockRep; 13 | } 14 | 15 | - (void)dealloc; 16 | - (void)encodeWithCoder:(NSCoder *)coder; 17 | - (id)initWithCoder:(NSCoder *)coder; 18 | - (id)initWithBlockRep:(BlockRep *)theBlockRep; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNBlock.m: -------------------------------------------------------------------------------- 1 | /* FSCNBlock.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBlock.h" 5 | #import "BlockRep.h" 6 | 7 | @implementation FSCNBlock 8 | 9 | -(void)dealloc 10 | { 11 | [blockRep release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (NSString *)description 16 | { 17 | return [NSString stringWithFormat:@"Block literal: %@", [blockRep source]]; 18 | } 19 | 20 | 21 | - (void)encodeWithCoder:(NSCoder *)coder 22 | { 23 | [super encodeWithCoder:coder]; 24 | [coder encodeObject:blockRep forKey:@"blockRep"]; 25 | } 26 | 27 | - (id)initWithCoder:(NSCoder *)coder 28 | { 29 | self = [super initWithCoder:coder]; 30 | nodeType = BLOCK; 31 | blockRep = [[coder decodeObjectForKey:@"blockRep"] retain]; 32 | return self; 33 | } 34 | 35 | - (id)initWithBlockRep:(BlockRep *)theBlockRep 36 | { 37 | self = [super init]; 38 | if (self != nil) 39 | { 40 | nodeType = BLOCK; 41 | blockRep = [theBlockRep retain]; 42 | } 43 | return self; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNCascade.h: -------------------------------------------------------------------------------- 1 | /* FSCNCascade.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNMessage.h" 5 | 6 | @interface FSCNCascade : FSCNBase 7 | { 8 | @public 9 | FSCNBase *receiver; 10 | unsigned messageCount; 11 | __strong FSCNMessage **messages; 12 | } 13 | 14 | - (void)encodeWithCoder:(NSCoder *)coder; 15 | - (id)initWithCoder:(NSCoder *)coder; 16 | - (id)initWithReceiver:(FSCNBase *)theReceiver messages:(NSArray *)msgs; 17 | - (void)translateCharRange:(int32_t)translation; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNCategory.h: -------------------------------------------------------------------------------- 1 | /* FSCNCategory.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @interface FSCNCategory : FSCNBase 7 | { 8 | @public 9 | NSString *className; 10 | NSArray *methods; 11 | } 12 | 13 | - (NSString *) className; 14 | - (void) dealloc; 15 | - (void) encodeWithCoder:(NSCoder *)coder; 16 | - (id) initWithCoder:(NSCoder *)coder; 17 | - (id) initWithClassName:(NSString *)theClassName methods:(NSArray *)theMethods; 18 | - (void)translateCharRange:(long)translation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNCategory.m: -------------------------------------------------------------------------------- 1 | /* FSCNCategory.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNCategory.h" 5 | #import "FSCNMethod.h" 6 | 7 | @implementation FSCNCategory 8 | 9 | - (NSString *)className 10 | { 11 | return className; 12 | } 13 | 14 | -(void)dealloc 15 | { 16 | [className release]; 17 | [methods release]; 18 | [super dealloc]; 19 | } 20 | 21 | - (NSString *)description 22 | { 23 | return @"Category"; 24 | } 25 | 26 | 27 | - (void)encodeWithCoder:(NSCoder *)coder 28 | { 29 | [super encodeWithCoder:coder]; 30 | [coder encodeObject:className forKey:@"className"]; 31 | [coder encodeObject:methods forKey:@"methods"]; 32 | } 33 | 34 | - (id) initWithClassName:(NSString *)theClassName methods:(NSArray *)theMethods 35 | { 36 | self = [super init]; 37 | if (self != nil) 38 | { 39 | nodeType = CATEGORY; 40 | className = [theClassName retain]; 41 | methods = [theMethods retain]; 42 | } 43 | return self; 44 | } 45 | 46 | - (id)initWithCoder:(NSCoder *)coder 47 | { 48 | self = [super initWithCoder:coder]; 49 | className = [[coder decodeObjectForKey:@"className"] retain]; 50 | methods = [[coder decodeObjectForKey:@"methods"] retain]; 51 | return self; 52 | } 53 | 54 | - (void)translateCharRange:(long)translation 55 | { 56 | [super translateCharRange:translation]; 57 | 58 | for (FSCNMethod *method in methods) 59 | { 60 | [method translateCharRange:translation]; 61 | } 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNClassDefinition.h: -------------------------------------------------------------------------------- 1 | /* FSCNClassDefinition.h Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @interface FSCNClassDefinition : FSCNBase 7 | { 8 | @public 9 | NSString *className; 10 | NSString *superclassName; 11 | NSArray *civarNames; 12 | NSArray *ivarNames; 13 | NSArray *methods; 14 | } 15 | 16 | - (NSString *) className; 17 | - (NSArray *) civarNames; 18 | - (void) dealloc; 19 | - (void) encodeWithCoder:(NSCoder *)coder; 20 | - (id) initWithCoder:(NSCoder *)coder; 21 | - (id) initWithClassName:(NSString *)theClassName superclassName:(NSString *)theSuperclassName civarNames:(NSArray *)theCIvarNames ivarNames:(NSArray *)theIvarNames methods:(NSArray *)theMethods; 22 | - (NSArray *) ivarNames; 23 | - (NSString *) superclassName; 24 | - (void)translateCharRange:(long)translation; 25 | 26 | @end -------------------------------------------------------------------------------- /FScriptFramework/FSCNDictionary.h: -------------------------------------------------------------------------------- 1 | /* FSCNDictionary.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @interface FSCNDictionary : FSCNBase 7 | { 8 | @public 9 | unsigned count; 10 | __strong FSCNBase **entries; 11 | } 12 | 13 | - (void)dealloc; 14 | - (void)encodeWithCoder:(NSCoder *)coder; 15 | - (id)initWithCoder:(NSCoder *)coder; 16 | - (id)initWithEntries:(NSArray *)theElements; 17 | - (void)translateCharRange:(long)translation; 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNIdentifier.h: -------------------------------------------------------------------------------- 1 | /* FSCNIdentifier.h Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | #import "FSSymbolTable.h" 6 | 7 | @interface FSCNIdentifier : FSCNBase 8 | { 9 | @public 10 | NSString *identifierString; 11 | struct FSContextIndex locationInContext; 12 | } 13 | 14 | - (void)dealloc; 15 | - (void)encodeWithCoder:(NSCoder *)coder; 16 | - (id)initWithCoder:(NSCoder *)coder; 17 | - (id)initWithIdentifierString:(NSString *)theIdentifierString locationInContext:(struct FSContextIndex)theLocationInContext; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNKeywordMessage.h: -------------------------------------------------------------------------------- 1 | /* FSCNKeywordMessage.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNMessage.h" 5 | 6 | @interface FSCNKeywordMessage : FSCNMessage 7 | { 8 | @public 9 | char argumentCount; 10 | __strong FSCNBase **arguments; 11 | } 12 | 13 | - (void)dealloc; 14 | - (void)encodeWithCoder:(NSCoder *)coder; 15 | - (id)initWithCoder:(NSCoder *)coder; 16 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern arguments:(NSArray *)args; 17 | - (void)translateCharRange:(int32_t)translation; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNMessage.h: -------------------------------------------------------------------------------- 1 | /* FSCNMessage.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | #import "FSMsgContext.h" 6 | #import "FSPattern.h" 7 | 8 | @interface FSCNMessage : FSCNBase 9 | { 10 | @public 11 | FSCNBase *receiver; 12 | SEL selector; 13 | NSString *selectorString; // We need to keep the selector string because, in GC mode, SELs for retain, release, etc. are all represented by a special unusable SEL (i.e. "") 14 | FSPattern *pattern; 15 | FSMsgContext *msgContext; 16 | } 17 | 18 | - (void)dealloc; 19 | - (void)encodeWithCoder:(NSCoder *)coder; 20 | - (id)initWithCoder:(NSCoder *)coder; 21 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern; // theSelectorString is the representation of the real selector (e.g., "operator_plus" instead of "+") 22 | - (void)translateCharRange:(int32_t)translation; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNMethod.h: -------------------------------------------------------------------------------- 1 | /* FSCNMethod.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | #import "FSMethod.h" 6 | 7 | @interface FSCNMethod : FSCNBase 8 | { 9 | @public 10 | FSMethod *method; 11 | BOOL isClassMethod; 12 | } 13 | 14 | - (void)dealloc; 15 | - (void)encodeWithCoder:(NSCoder *)coder; 16 | - (id)initWithCoder:(NSCoder *)coder; 17 | - (id)initWithMethod:(FSMethod *)theMethod isClassMethod:(BOOL)classMethod; 18 | - (void)translateCharRange:(long)translation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNPrecomputedObject.h: -------------------------------------------------------------------------------- 1 | /* FSCNPrecomputedObject.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | @interface FSCNPrecomputedObject : FSCNBase 7 | { 8 | @public 9 | id object; 10 | } 11 | 12 | - (void)dealloc; 13 | - (void)encodeWithCoder:(NSCoder *)coder; 14 | - (id)initWithCoder:(NSCoder *)coder; 15 | - (id)initWithObject:(id)theObject; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNPrecomputedObject.m: -------------------------------------------------------------------------------- 1 | /* FSCNPrecomputedObject.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNPrecomputedObject.h" 5 | #import "FSMiscTools.h" 6 | 7 | @implementation FSCNPrecomputedObject 8 | 9 | -(void)dealloc 10 | { 11 | [object release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (NSString *)description 16 | { 17 | return [NSString stringWithFormat:@"Precomputed object: %@", printString(object)]; 18 | } 19 | 20 | - (void)encodeWithCoder:(NSCoder *)coder 21 | { 22 | [super encodeWithCoder:coder]; 23 | [coder encodeObject:object forKey:@"object"]; 24 | } 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | nodeType = OBJECT; 30 | object = [[coder decodeObjectForKey:@"object"] retain]; 31 | return self; 32 | } 33 | 34 | - (id)initWithObject:(id)theObject 35 | { 36 | self = [super init]; 37 | if (self != nil) 38 | { 39 | nodeType = OBJECT; 40 | object = [theObject retain]; 41 | } 42 | return self; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNReturn.h: -------------------------------------------------------------------------------- 1 | /* FSCNReturn.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | 7 | @interface FSCNReturn : FSCNBase 8 | { 9 | @public 10 | FSCNBase *expression; 11 | } 12 | 13 | - (void)encodeWithCoder:(NSCoder *)coder; 14 | - (id)initWithCoder:(NSCoder *)coder; 15 | - (id)initWithExpression:(FSCNBase *)theExpression; 16 | - (void)translateCharRange:(long)translation; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNReturn.m: -------------------------------------------------------------------------------- 1 | /* FSCNReturn.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNReturn.h" 5 | 6 | 7 | @implementation FSCNReturn 8 | 9 | - (void)dealloc 10 | { 11 | [expression release]; 12 | [super dealloc]; 13 | } 14 | 15 | - (NSString *)description 16 | { 17 | return @"Return statement"; 18 | } 19 | 20 | - (void)encodeWithCoder:(NSCoder *)coder 21 | { 22 | [super encodeWithCoder:coder]; 23 | [coder encodeObject:expression forKey:@"expression"]; 24 | } 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | nodeType = RETURN; 30 | expression = [[coder decodeObjectForKey:@"expression"] retain]; 31 | return self; 32 | } 33 | 34 | - (id)initWithExpression:(FSCNBase *)theExpression 35 | { 36 | self = [super init]; 37 | if (self != nil) 38 | { 39 | nodeType = RETURN; 40 | expression = [theExpression retain]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)translateCharRange:(long)translation 46 | { 47 | [super translateCharRange:translation]; 48 | [expression translateCharRange:translation]; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNStatementList.h: -------------------------------------------------------------------------------- 1 | /* FSCNStatementList.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | 7 | @interface FSCNStatementList : FSCNBase 8 | { 9 | @public 10 | unsigned statementCount; 11 | __strong FSCNBase **statements; 12 | } 13 | 14 | - (void)encodeWithCoder:(NSCoder *)coder; 15 | - (id)initWithCoder:(NSCoder *)coder; 16 | - (id)initWithStatements:(NSArray *)theStatements; 17 | - (void)translateCharRange:(int32_t)translation; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNSuper.h: -------------------------------------------------------------------------------- 1 | /* FSCNSuper.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNIdentifier.h" 5 | 6 | @interface FSCNSuper : FSCNIdentifier 7 | { 8 | @public 9 | NSString *className; 10 | BOOL isInClassMethod; 11 | } 12 | 13 | - (void)dealloc; 14 | - (id)initWithCoder:(NSCoder *)coder; 15 | - (id)initWithLocationInContext:(struct FSContextIndex)theLocationInContext className:(NSString *)theClassName isInClassMethod:(BOOL)incm; 16 | - (void)encodeWithCoder:(NSCoder *)coder; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNSuper.m: -------------------------------------------------------------------------------- 1 | /* FSCNSuper.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNSuper.h" 5 | 6 | @implementation FSCNSuper 7 | 8 | 9 | - (void)dealloc 10 | { 11 | [className release]; 12 | [super dealloc]; 13 | } 14 | 15 | 16 | - (NSString *)description 17 | { 18 | return @"keyword \"super\""; 19 | } 20 | 21 | 22 | - (id)initWithCoder:(NSCoder *)coder 23 | { 24 | self = [super initWithCoder:coder]; 25 | nodeType = SUPER; 26 | className = [[coder decodeObjectForKey:@"className"] retain]; 27 | isInClassMethod = [coder decodeBoolForKey:@"isInClassMethod"]; 28 | return self; 29 | } 30 | 31 | - (id)initWithLocationInContext:(struct FSContextIndex)theLocationInContext className:(NSString *)theClassName isInClassMethod:(BOOL)incm 32 | { 33 | self = [super initWithIdentifierString:@"self" locationInContext:theLocationInContext]; 34 | 35 | if (self != nil) 36 | { 37 | nodeType = SUPER; 38 | className = [theClassName retain]; 39 | isInClassMethod = incm; 40 | } 41 | return self; 42 | } 43 | 44 | - (void)encodeWithCoder:(NSCoder *)coder 45 | { 46 | [super encodeWithCoder:coder]; 47 | [coder encodeObject:className forKey:@"className"]; 48 | [coder encodeBool:isInClassMethod forKey:@"isInClassMethod"]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNUnaryMessage.h: -------------------------------------------------------------------------------- 1 | /* FSCNUnaryMessage.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNMessage.h" 5 | 6 | @interface FSCNUnaryMessage : FSCNMessage 7 | {} 8 | 9 | - (id)initWithCoder:(NSCoder *)coder; 10 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNUnaryMessage.m: -------------------------------------------------------------------------------- 1 | /* FSCNUnaryMessage.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNUnaryMessage.h" 5 | 6 | @implementation FSCNUnaryMessage 7 | 8 | - (id)initWithCoder:(NSCoder *)coder 9 | { 10 | self = [super initWithCoder:coder]; 11 | nodeType = UNARY_MESSAGE; 12 | return self; 13 | } 14 | 15 | - (id)initWithReceiver:(FSCNBase *)theReceiver selectorString:(NSString *)theSelectorString pattern:(FSPattern *)thePattern 16 | { 17 | self = [super initWithReceiver:theReceiver selectorString:theSelectorString pattern:thePattern]; 18 | if (self != nil) 19 | { 20 | nodeType = UNARY_MESSAGE; 21 | } 22 | return self; 23 | } 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNUnaryMessageWithPattern.h: -------------------------------------------------------------------------------- 1 | /* FSCNUnaryMessageWithPattern.h Copyright (c) 2008 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNUnaryMessage.h" 5 | 6 | @interface FSCNUnaryMessageWithPattern : FSCNUnaryMessage 7 | { 8 | @public 9 | FSPattern *pattern; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSCNUnaryMessageWithPattern.m: -------------------------------------------------------------------------------- 1 | /* FSCNUnaryMessageWithPattern.m Copyright (c) 2008 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNUnaryMessageWithPattern.h" 5 | 6 | @implementation FSCNUnaryMessageWithPattern 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /FScriptFramework/FSClassDefinition.h: -------------------------------------------------------------------------------- 1 | /* FSClassDefinition.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSClassDefinition : NSObject 7 | { 8 | @package 9 | NSMutableArray *methodHolders; 10 | NSSet *ivarNames; 11 | } 12 | 13 | + (id)classDefinition; 14 | - (NSSet *)ivarNames; 15 | - (NSMutableArray *)methodHolders; 16 | - (void)setIvarNames:(NSSet *)theIvarNames; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSClassDefinition.m: -------------------------------------------------------------------------------- 1 | /* FSClassDefinition.m Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSClassDefinition.h" 5 | 6 | @implementation FSClassDefinition 7 | 8 | + (id)classDefinition 9 | { 10 | return [[[self alloc] init] autorelease]; 11 | } 12 | 13 | - (void) dealloc 14 | { 15 | [ivarNames release]; 16 | [methodHolders release]; 17 | [super dealloc]; 18 | } 19 | 20 | - (id)init 21 | { 22 | self = [super init]; 23 | if (self != nil) 24 | { 25 | methodHolders = [[NSMutableArray alloc] init]; 26 | ivarNames = [[NSSet alloc] init]; 27 | } 28 | return self; 29 | } 30 | 31 | - (NSSet *)ivarNames 32 | { 33 | return ivarNames; 34 | } 35 | 36 | - (NSMutableArray *)methodHolders 37 | { 38 | return methodHolders; 39 | } 40 | 41 | - (void)setIvarNames:(NSSet *)theIvarNames 42 | { 43 | [theIvarNames retain]; 44 | [ivarNames release]; 45 | ivarNames = theIvarNames; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /FScriptFramework/FSCollectionInspector.h: -------------------------------------------------------------------------------- 1 | /* FSCollectionInspector.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class NTableView; 7 | @class NSTableColumn; 8 | @class FSInterpreter; 9 | @class FSCollectionInspectorView; 10 | 11 | @interface FSCollectionInspector : NSObject 12 | { 13 | IBOutlet FSCollectionInspectorView *collectionInspectorView; 14 | } 15 | 16 | // You can pass nil for blocks. In this case the inspector will use a default block set. 17 | 18 | + (FSCollectionInspector *)collectionInspectorWithCollection:(id)theCollection interpreter:(FSInterpreter *)theInterpreter blocks:(NSArray *)blocks; 19 | + (FSCollectionInspector *)collectionInspectorWithCollection:(id)theCollection interpreter:(FSInterpreter *)theInterpreter blocks:(NSArray *)blocks showExternals:(BOOL)showExternals; 20 | 21 | - (FSCollectionInspector *)initWithCollection:(id)theCollection interpreter:(FSInterpreter *)theInterpreter blocks:(NSArray *)blocks showExternals:(BOOL)showExternals; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FScriptFramework/FSCollectionInspectorTableView.h: -------------------------------------------------------------------------------- 1 | // FSCollectionInspectorTableView.h Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | 7 | @interface FSCollectionInspectorTableView : NSTableView { 8 | 9 | } 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSCollectionInspectorTableView.m: -------------------------------------------------------------------------------- 1 | // FSCollectionInspectorTableView.m Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSCollectionInspectorTableView.h" 5 | 6 | 7 | #define BACKSPACE @"\177" 8 | 9 | @implementation FSCollectionInspectorTableView 10 | 11 | /*- (BOOL)respondsToSelector:(SEL)selector 12 | { 13 | NSLog(NSStringFromSelector(selector)); 14 | return [super respondsToSelector:selector]; 15 | }*/ 16 | 17 | 18 | - (void)keyDown:(NSEvent *)theEvent 19 | { 20 | if ([[theEvent characters] isEqualToString:BACKSPACE] || [[theEvent characters] characterAtIndex:0] == NSDeleteFunctionKey) 21 | [[self target] remove:self]; 22 | else 23 | [super keyDown:theEvent]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSCollectionInspectorView.h: -------------------------------------------------------------------------------- 1 | /* FSCollectionInspectorView.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSInterpreter; 7 | 8 | @interface FSCollectionInspectorView : NSView 9 | { 10 | IBOutlet NSView *contentView; 11 | IBOutlet NSTableView *tableView; 12 | IBOutlet NSButton *modifyButton; 13 | IBOutlet NSButton *removeButton; 14 | IBOutlet NSButton *sortButton; 15 | IBOutlet NSButton *inspectButton; 16 | IBOutlet NSButton *narrowButton; 17 | IBOutlet NSButton *browseButton; 18 | IBOutlet id searchField; 19 | 20 | id model; 21 | NSArray *sortedModelArray; 22 | NSArray *sortedExternals; 23 | NSArray *filteredSortedModelArray; 24 | NSArray *filteredSortedExternals; 25 | NSTableColumn *sortColumn; 26 | FSInterpreter *interpreter; 27 | NSString *filterString; 28 | } 29 | 30 | + (NSArray *)blocksForEntity:(NSEntityDescription *)entity interpreter:(FSInterpreter *)interpreter; 31 | 32 | - (id) initWithFrame:(NSRect)frame; 33 | 34 | - (void) setCollection:(id)theCollection interpreter:(FSInterpreter *)theInterpreter blocks:(NSArray *)blocks showExternals:(BOOL)showExternals; 35 | // You can pass nil for blocks. In this case the view will use a default block set. 36 | 37 | - (IBAction)add:(id)sender; 38 | - (IBAction)browse:(id)sender; 39 | - (IBAction)filter:(id)sender; 40 | - (IBAction)inspect:(id)sender; 41 | - (IBAction)modify:(id)sender; 42 | - (IBAction)narrow:(id)sender; 43 | - (IBAction)refresh:(id)sender; 44 | - (IBAction)remove:(id)sender; 45 | - (IBAction)sort:(id)sender; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /FScriptFramework/FSColorWell.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSColorWell.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 20/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FSColorWell : NSColorWell 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSColorWell.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSColorWell.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 20/11/2014. 6 | // 7 | // 8 | 9 | #import "FSColorWell.h" 10 | 11 | @implementation FSColorWell 12 | 13 | - (void)drawRect:(NSRect)dirtyRect 14 | { 15 | [super drawRect:dirtyRect]; 16 | 17 | // Drawing code here. 18 | } 19 | 20 | - (void)mouseDown:(NSEvent*)theEvent 21 | { 22 | [self sendAction:self.action to:self.target]; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSCompilationResult.h: -------------------------------------------------------------------------------- 1 | /* CompilationResult.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCNBase.h" 5 | 6 | enum CompilationResult_type {OK,ERROR}; 7 | 8 | @interface FSCompilationResult : NSObject 9 | { 10 | @public 11 | enum CompilationResult_type type; 12 | NSString *errorMessage; 13 | NSInteger errorFirstCharacterIndex; 14 | NSInteger errorLastCharacterIndex; 15 | FSCNBase *code; 16 | } 17 | 18 | + (id)compilationResultWithType:(enum CompilationResult_type)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last code:(FSCNBase *)theCode; 19 | 20 | - (void)dealloc; 21 | - (id)initWithType:(enum CompilationResult_type)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last code:(FSCNBase *)theCode; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FScriptFramework/FSCompilationResult.m: -------------------------------------------------------------------------------- 1 | /* CompilationResult.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSCompilationResult.h" 5 | #import 6 | 7 | @implementation FSCompilationResult 8 | 9 | + (id)compilationResultWithType:(enum CompilationResult_type)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last code:(FSCNBase *)theCode 10 | { 11 | return [[[self alloc] initWithType:theType errorMessage:theErrorMessage errorFirstCharacterIndex:first errorLastCharacterIndex:last code:theCode] autorelease]; 12 | } 13 | 14 | - (void)dealloc 15 | { 16 | [errorMessage release]; 17 | [code release]; 18 | [super dealloc]; 19 | } 20 | 21 | - (id)initWithType:(enum CompilationResult_type)theType errorMessage:(NSString *)theErrorMessage errorFirstCharacterIndex:(NSInteger)first errorLastCharacterIndex:(NSInteger)last code:(FSCNBase *)theCode 22 | { 23 | if ((self = [super init])) 24 | { 25 | type = theType; 26 | errorMessage = [theErrorMessage retain]; 27 | errorFirstCharacterIndex = first; 28 | errorLastCharacterIndex = last; 29 | code = [theCode retain]; 30 | return self; 31 | } 32 | return nil; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FScriptFramework/FSConsole.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FSConsole.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/FSConstantListBuilder.h: -------------------------------------------------------------------------------- 1 | /* FSConstantListBuilder.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the licence. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSConstantListBuilder : NSObject 8 | { 9 | NSMutableString *constantsInitializerString; 10 | } 11 | 12 | -(void)analyseFileAtPath:(NSString *)path; 13 | -(void)analyseDirectoryAtPath:(NSString *)path; 14 | -(NSString *)constantsInitializerString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSConstantsDictionaryGenerator.h: -------------------------------------------------------------------------------- 1 | /* ConstantsDictionaryGenerator.h Copyright (c) 2003-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSConstantsDictionaryGenerator : NSObject { 8 | 9 | } 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSConstantsInitialization.h: -------------------------------------------------------------------------------- 1 | /* FSConstantsInitialization.h Copyright (c) 1999-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | extern void FSConstantsInitialization(NSMutableDictionary *constant_dict); 7 | 8 | 9 | -------------------------------------------------------------------------------- /FScriptFramework/FSCoreDataSample.h: -------------------------------------------------------------------------------- 1 | /* FSCoreDataSample.h Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the licence. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSCoreDataSample : NSObject { 8 | 9 | } 10 | 11 | + (id)managedObject; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FScriptFramework/FSDemoController.h: -------------------------------------------------------------------------------- 1 | /* FSDemoController.h Copyright (c) 2007 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSInterpreterView.h" 6 | 7 | 8 | @interface FSDemoController : NSObject 9 | { 10 | IBOutlet FSInterpreterView *interpreterView; 11 | } 12 | 13 | 14 | - (IBAction)drawLine:sender; 15 | - (IBAction)drawCircle:sender; 16 | - (IBAction)converter:sender; 17 | - (IBAction)loadImage:sender; 18 | - (IBAction)displayImage:sender; 19 | - (IBAction)perspective:sender; 20 | - (IBAction)hueAdjust:sender; 21 | - (IBAction)bump:sender; 22 | - (IBAction)eges:sender; 23 | - (IBAction)bumpAnimate:sender; 24 | 25 | - (void)putCommand:(NSString *)command; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FScriptFramework/FSDetailedObjectInspector.h: -------------------------------------------------------------------------------- 1 | // FSGenericObjectInspector.h Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @class FSObjectInspectorViewModelItem; 7 | @class FSInterpreter; 8 | 9 | @interface FSDetailedObjectInspector : NSObject 10 | @property (strong,nonatomic) id inspectedObject; 11 | @property (readonly,nonatomic) NSWindow *window; 12 | @property (strong,nonatomic) FSInterpreter* interpreter; 13 | 14 | + (FSDetailedObjectInspector*)detailedObjectInspectorWithObject:(id)object interpreter:(FSInterpreter*)interpreter; 15 | - (FSDetailedObjectInspector *)initWithObject:(id)object interpreter:(FSInterpreter*)interpreter; 16 | 17 | - (void)windowWillClose:(NSNotification *)aNotification; 18 | -(IBAction)refreshModel:(id)sender; 19 | - (IBAction)browseAction:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FScriptFramework/FSError.h: -------------------------------------------------------------------------------- 1 | /* FSError.h Copyright (c) 2002-2006 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBoolean; 7 | 8 | @interface FSError : NSObject // NSCopying is needed to be an object value in an NSCell 9 | { 10 | NSString *description; 11 | } 12 | 13 | + (FSError *) errorWithDescription:(NSString*)desc; 14 | 15 | - (id)copyWithZone:(NSZone *)zone; 16 | - (NSString *)description; 17 | - (void) dealloc; 18 | - initWithDescription:(NSString*)desc; 19 | - (FSBoolean *)operator_less:(id)operand; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FScriptFramework/FSError.m: -------------------------------------------------------------------------------- 1 | /* FSError.m Copyright (c) 2002-2006 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSError.h" 5 | #import "FSBoolean.h" 6 | 7 | @implementation FSError 8 | 9 | + (FSError *) errorWithDescription:(NSString*)desc { return [[self alloc] initWithDescription:desc]; } 10 | 11 | - (id)copyWithZone:(NSZone *)zone { return [self retain]; } 12 | 13 | - (NSString *)description { return description; } 14 | 15 | - (void) dealloc 16 | { 17 | [description release]; 18 | [super dealloc]; 19 | } 20 | 21 | - initWithDescription:(NSString*)desc 22 | { 23 | if ((self = [super init])) 24 | { 25 | description = [desc retain]; 26 | return self; 27 | } 28 | return nil; 29 | } 30 | 31 | - (FSBoolean *)operator_less:(id)operand 32 | { 33 | if ([operand isKindOfClass:[self class]]) return [FSBoolean fsFalse]; 34 | else return [FSBoolean fsTrue]; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /FScriptFramework/FSExecutor.h: -------------------------------------------------------------------------------- 1 | /* Executor.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSArray.h" 6 | 7 | @class Space; 8 | @class FSCompiler; 9 | @class FSSymbolTable; 10 | @class FSInterpreter; 11 | @class FSInterpreterResult; 12 | 13 | @interface FSExecutor:NSObject 14 | { 15 | FSInterpreter *interpreter; 16 | // WARNING: No retain done on this pointer, in order to avoid a cycle. 17 | // I add this ivar in order for a FSSystem object to be able to implement the object browser opening. 18 | 19 | BOOL should_journal; 20 | NSInteger verboseLevel; 21 | NSFileHandle *journal; 22 | NSString *journalName; 23 | FSSymbolTable *localSymbolTable; 24 | FSCompiler *compiler; 25 | } 26 | 27 | - (FSArray *) allDefinedSymbols; 28 | - (void)breakCycles; 29 | - (FSInterpreterResult *)execute:(NSString *)command; 30 | - (id)initWithInterpreter:(FSInterpreter *)theInterpreter; 31 | - (void)installFlightTutorial; 32 | - (FSInterpreter *)interpreter; // Will return nil if the associated interpreter no longer exists 33 | - (void)interpreterIsDeallocating; 34 | - (id)objectForSymbol:(NSString *)symbol found:(BOOL *)found; // found may be passed as NULL 35 | - (BOOL)setJournalName:(NSString *)filename; 36 | - (void)setShouldJournal:(BOOL)shouldJournal; 37 | - (void)setObject:(id)object forSymbol:(NSString *)symbol; 38 | - (void)setVerboseLevel:(NSInteger)theVerboseLevel; 39 | - (BOOL)shouldJournal; 40 | 41 | // ULSYSTEM PROTOCOL (informal) 42 | 43 | - (void)setSpace:(Space*)space; 44 | - (Space*)space; 45 | - (FSSymbolTable *)symbolTable; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /FScriptFramework/FSFlight.h: -------------------------------------------------------------------------------- 1 | /* FSFlight.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSFlight : NSObject 7 | { 8 | id ident; 9 | id pilot; 10 | id airplane; 11 | id departureDate; 12 | id arrivalDate; 13 | id departureLocation; 14 | id arrivalLocation; 15 | } 16 | 17 | ////////////////////////////////// User methods //////////////////////////////// 18 | 19 | + (id) flightWithIdent:(id)theIdent pilot:(id)thePilot airplane:(id)theAirplane departureDate:(id)theDepartureDate arrivalDate:(id)theArrivalDate departureLocation:(id)theDepartureLocation arrivalLocation:(id)theArrivalLocation; 20 | 21 | - (id) airplane; 22 | - (void) setAirplane:(id)theAirplane; 23 | - (id) arrivalDate; 24 | - (void) setArrivalDate:(id)theArrivalDate; 25 | - (id) arrivalLocation; 26 | - (void) setArrivalLocation:(id)theArrivalLocation; 27 | - (id) departureDate; 28 | - (void) setDepartureDate:(id)theDepartureDate; 29 | - (id) departureLocation; 30 | - (void) setDepartureLocation:(id)theDepartureLocation; 31 | - (id) ident; 32 | - (void) setIdent:(id)theIdent; 33 | - (id) pilot; 34 | - (void) setPilot:(id)thePilot; 35 | 36 | 37 | ////////////////////////////////// Programmer methods //////////////////////////////// 38 | 39 | - (void)dealloc; 40 | - (NSString *)description; 41 | - (void)encodeWithCoder:(NSCoder *)aCoder; 42 | - (id)initWithCoder:(NSCoder *)aDecoder; 43 | - (id) initWithIdent:(id)theIdent pilot:(id)thePilot airplane:(id)theAirplane departureDate:(id)theDepartureDate arrivalDate:(id)theArrivalDate departureLocation:(id)theDepartureLocation arrivalLocation:(id)theArrivalLocation; 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FScriptFramework/FSGenericObjectInspector.h: -------------------------------------------------------------------------------- 1 | // FSGenericObjectInspector.h Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @interface FSGenericObjectInspector : NSObject 7 | { 8 | id inspectedObject; 9 | IBOutlet NSWindow *window; 10 | IBOutlet NSTextView *printStringView; 11 | } 12 | 13 | + (FSGenericObjectInspector *)genericObjectInspectorWithObject:(id)object; 14 | - (FSGenericObjectInspector *)initWithObject:(id)object; 15 | - (void)updateAction:(id)sender; 16 | 17 | - (void)windowWillClose:(NSNotification *)aNotification; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSGenericObjectInspector.m: -------------------------------------------------------------------------------- 1 | // FSGenericObjectInspector.m Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSGenericObjectInspector.h" 5 | #import "FSMiscTools.h" 6 | 7 | static NSPoint topLeftPoint = {0,0}; // Used for cascading windows. 8 | 9 | @implementation FSGenericObjectInspector 10 | 11 | +(FSGenericObjectInspector *)genericObjectInspectorWithObject:(id)object 12 | { 13 | return [[[self alloc] initWithObject:object] autorelease]; 14 | } 15 | 16 | -(FSGenericObjectInspector *)initWithObject:(id)object 17 | { 18 | if ((self = [super init])) 19 | { 20 | inspectedObject = [object retain]; 21 | [NSBundle loadNibNamed:@"genObjInspector.nib" owner:self]; 22 | [self retain]; // To balance the autorelease in windowWillClose: 23 | [self updateAction:nil]; 24 | topLeftPoint = [window cascadeTopLeftFromPoint:topLeftPoint]; 25 | [window makeKeyAndOrderFront:nil]; 26 | return self; 27 | } 28 | return nil; 29 | } 30 | 31 | -(void) dealloc 32 | { 33 | //NSLog(@"\n FSGenericObjectInspector dealloc\n"); 34 | [inspectedObject release]; 35 | [super dealloc]; 36 | } 37 | 38 | - (void)updateAction:(id)sender 39 | { 40 | [window setTitle:[NSString stringWithFormat:@"Inspecting %@ at address %p",descriptionForFSMessage(inspectedObject), inspectedObject]]; 41 | [printStringView setFont:[NSFont userFixedPitchFontOfSize:userFixedPitchFontSize()]]; 42 | [printStringView setString:printString(inspectedObject)]; 43 | } 44 | 45 | /////////////////// Window delegate callbacks 46 | 47 | - (void)windowWillClose:(NSNotification *)aNotification 48 | { 49 | [self autorelease]; 50 | } 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /FScriptFramework/FSGenericPointer.h: -------------------------------------------------------------------------------- 1 | /* FSGenericPointer.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSPointer.h" 5 | 6 | @interface FSGenericPointer : FSPointer 7 | { 8 | BOOL freeWhenDone; 9 | BOOL freed; 10 | __strong char *type; 11 | char fsEncodedType; 12 | } 13 | 14 | - (id) at:(id)i; 15 | - (id) at:(id)i put:(id)elem; 16 | - (void) free; 17 | - (void) setFreeWhenDone:(BOOL)fr; 18 | - (void) setType:(NSString *)theType; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSGenericPointerPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSGenericPointerPrivate.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSGenericPointer.h" 5 | 6 | @interface FSGenericPointer (Private) 7 | - (id) initWithCPointer:(void *)p freeWhenDone:(BOOL)free type:(const char *)t; // designated initializer. t is copied. 8 | - (NSArray *)memoryContent; 9 | - (NSString *)memoryContentUTF8; 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSGlobalScope.h: -------------------------------------------------------------------------------- 1 | /* FSGlobalScope.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSGlobalScope; 7 | 8 | extern FSGlobalScope *FSSharedGlobalScope; 9 | 10 | @interface FSGlobalScope : NSObject 11 | { 12 | NSMutableDictionary *globals; 13 | } 14 | 15 | - (id) objectForSymbol:(NSString *)symbol found:(BOOL *)found; // found may be passed as NULL 16 | - (void) setObject:(id)object forSymbol:(NSString *)symbol; // object must ne non-nil (current implementation does not support storing nil in the global scope) 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSIdentifierFormatter.h: -------------------------------------------------------------------------------- 1 | /* FSIdentifierFormatter.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSIdentifierFormatter : NSFormatter { 8 | 9 | } 10 | 11 | 12 | 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSIdentifierFormatter.m: -------------------------------------------------------------------------------- 1 | /* FSIdentifierFormatter.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSIdentifierFormatter.h" 5 | #import "FSCompiler.h" 6 | 7 | 8 | @implementation FSIdentifierFormatter 9 | 10 | - (NSString *)stringForObjectValue:(id)anObject 11 | { 12 | return anObject; 13 | } 14 | 15 | - (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error 16 | { 17 | //NSLog(@"getObjectValue:"); 18 | //NSLog(string); 19 | *anObject = [string copy]; 20 | 21 | if ([FSCompiler isValidIdentifier:string] || [string length] == 0) return YES; 22 | else return NO; 23 | 24 | } 25 | 26 | - (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error 27 | { 28 | //NSLog(*partialStringPtr); 29 | 30 | if ([FSCompiler isValidIdentifier:*partialStringPtr] || [*partialStringPtr length] == 0) return YES; 31 | else return NO; 32 | } 33 | 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FScriptFramework/FSImageInspector.h: -------------------------------------------------------------------------------- 1 | // FSImageInspector.h Copyright (c) 2002-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @interface FSImageInspector : NSObject 7 | { 8 | NSImage *inspectedObject; 9 | IBOutlet NSWindow *window; 10 | IBOutlet NSImageView *imageView; 11 | } 12 | 13 | + (FSImageInspector *)imageInspectorWithImage:(id)object; 14 | 15 | - (FSImageInspector *)initWithImage:(id)object; 16 | 17 | - (void)windowWillClose:(NSNotification *)aNotification; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSInspectorUniquier.h: -------------------------------------------------------------------------------- 1 | // FSInspectorUniquier.h Copyright (c) 2005-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | 7 | @interface FSInspectorUniquier : NSObject { 8 | 9 | } 10 | 11 | + (void)initialize; 12 | + (void)addObject:(id)model inspector:(id)inspector; 13 | + (id)inspectorForObject:(id)model; 14 | + (void)removeEntryForInspector:(id)inspector; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSInspectorUniquier.m: -------------------------------------------------------------------------------- 1 | // FSInspectorUniquier.m Copyright (c) 2005-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSInspectorUniquier.h" 5 | 6 | static NSMutableArray *inspectedObjects; 7 | static NSMutableArray *inspectors; 8 | 9 | @implementation FSInspectorUniquier 10 | 11 | + (void)initialize 12 | { 13 | static BOOL tooLate = NO; 14 | if ( !tooLate ) 15 | { 16 | inspectedObjects = [[NSMutableArray alloc] init]; 17 | inspectors = [[NSMutableArray alloc] init]; 18 | tooLate = YES; 19 | } 20 | } 21 | 22 | + (void)addObject:(id)inspectedObject inspector:(id)inspector 23 | { 24 | [inspectedObjects addObject:inspectedObject]; 25 | [inspectors addObject:inspector]; 26 | } 27 | 28 | + (id)inspectorForObject:(id)inspectedObject 29 | { 30 | NSUInteger index = [inspectedObjects indexOfObject:inspectedObject]; 31 | if (index == NSNotFound) return nil; 32 | else return [inspectors objectAtIndex:index]; 33 | } 34 | 35 | + (void)removeEntryForInspector:(id)inspector 36 | { 37 | NSUInteger index = [inspectors indexOfObject:inspector]; 38 | [inspectors removeObjectAtIndex:index]; 39 | [inspectedObjects removeObjectAtIndex:index]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreter.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreter.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSInterpreterResult.h" 6 | 7 | @class FSExecutor; 8 | 9 | @interface FSInterpreter : NSObject 10 | { 11 | FSExecutor *executor; 12 | } 13 | 14 | + (FSInterpreter *)interpreter; 15 | + (BOOL) validateSyntaxForIdentifier:(NSString *)identifier; 16 | 17 | - (void) browse; 18 | - (void) browse:(id)anObject; 19 | - (NSArray *) identifiers; 20 | - (FSInterpreterResult *) execute:(NSString *)command; 21 | - (void) installFlightTutorial; 22 | - (id) objectForIdentifier:(NSString *)identifier found:(BOOL *)found; // found may be passed as NULL 23 | - (void) setObject:(id)object forIdentifier:(NSString *)identifier; 24 | - (BOOL) setJournalName:(NSString *)filename; 25 | - (void) setShouldJournal:(BOOL)shouldJournal; 26 | - (BOOL) shouldJournal; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterPrivate.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSInterpreter.h" 5 | #import "FSObjectBrowserButtonCtxBlock.h" 6 | 7 | @interface FSInterpreter(FSInterpreterPrivate) 8 | 9 | - (FSObjectBrowserButtonCtxBlock *)objectBrowserButtonCtxBlockFromString:(NSString *)source; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterResult.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterResult.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | #import 4 | 5 | extern NSString *FSInterpreterResultIllegalCallException; 6 | 7 | @interface FSInterpreterResult : NSObject 8 | { 9 | enum e_status {FS_OK,FS_SYNTAX_ERROR,FS_EXECUTION_ERROR} status; 10 | NSRange errorRange; 11 | NSString *errorMessage; 12 | id result; 13 | NSArray *callStack; 14 | } 15 | 16 | -(NSArray *)callStack; 17 | -(NSRange)errorRange; 18 | -(NSString *)errorMessage; 19 | -(void)inspectBlocksInCallStack; 20 | -(BOOL)isOk; // Spelling mistake. Will be deprecated in favor of isOK, but will still be suported. 21 | -(BOOL)isOK; 22 | -(BOOL)isExecutionError; 23 | -(BOOL)isSyntaxError; 24 | -(id)result; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterResultPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterResultPrivate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSInterpreterResult.h" 5 | 6 | @interface FSInterpreterResult (FSInterpreterResultPrivate) 7 | 8 | // This method may return an object initialized with other values than the ones provided. This happens when an error occurs while trying to retain the "theResult" parameter. In this case, this method returns an object representing an F-Script execution error. 9 | + (FSInterpreterResult *)interpreterResultWithStatus:(enum e_status)theStatus result:(id)theResult errorRange:(NSRange)theErrorRange errorMessage:(NSString *)theErrorMessage callStack:(NSArray *)theCallStack; 10 | 11 | // This method may return an object initialized with other values than the ones provided. This happens when an error occurs while trying to retain the "theResult" parameter. In this case, this method returns an object representing an F-Script execution error. 12 | - (FSInterpreterResult *)initWithStatus:(enum e_status)theStatus result:(id)theResult errorRange:(NSRange)theErrorRange errorMessage:(NSString *)theErrorMessage callStack:(NSArray *)theCallStack; 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterView.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterView.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSInterpreter; 7 | 8 | @interface FSInterpreterView : NSView 9 | { 10 | FSInterpreter *interpreter; 11 | } 12 | 13 | - (CGFloat)fontSize; 14 | - (FSInterpreter *)interpreter; 15 | - (void)notifyUser:(NSString *)message; 16 | - (void)putCommand:(NSString *)command; 17 | - (void)setFontSize:(CGFloat)theSize; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterViewIBHeader.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterViewIBHeader.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | /* This is not he real header for FSInterpreterView. 5 | Instead,this is the header to parse in IB, to inform 6 | IB of object1, object2 etc.. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface FSInterpreterView : NSView 13 | { 14 | FSInterpreter *interpreter; 15 | id object1; 16 | id object2; 17 | id object3; 18 | id object4; 19 | id object5; 20 | id object6; 21 | id object7; 22 | id object8; 23 | id object9; 24 | } 25 | 26 | - (CGFloat)fontSize; 27 | - (FSInterpreter *)interpreter; 28 | - (void)notifyUser:(NSString *)message; 29 | - (void)putCommand:(NSString *)command; 30 | - (void)setFontSize:(CGFloat)theSize; 31 | 32 | @end -------------------------------------------------------------------------------- /FScriptFramework/FSInterpreterViewPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSInterpreterViewPrivate.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSInterpreterView.h" 5 | 6 | @interface FSInterpreterView (FSInterpreterViewPrivate) 7 | 8 | -(void) setInterpreter:(FSInterpreter *)theInterpreter; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSKeyedArchiver.h: -------------------------------------------------------------------------------- 1 | /* FSKeyedArchiver.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSKeyedArchiver : NSKeyedArchiver 7 | {} 8 | 9 | - (void)encodeObject:(id)object; 10 | - (void)encodeObject:(id)object forKey:(NSString *)key; 11 | - (void)encodeValueOfObjCType:(const char *)valueType at:(const void *)address; 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSKeyedUnarchiver.h: -------------------------------------------------------------------------------- 1 | /* FSKeyedUnarchiver.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSSymbolTable; 7 | 8 | @interface FSKeyedUnarchiver:NSKeyedUnarchiver 9 | { 10 | FSSymbolTable *loaderEnvironmentSymbolTable; 11 | FSSymbolTable *symbolTableForCompiledCodeNode; 12 | NSString *source; 13 | } 14 | 15 | - (void)dealloc; 16 | - (id)initForReadingWithData:(NSData *)theData loaderEnvironmentSymbolTable:(FSSymbolTable*)theLoaderEnvironmentSymbolTable symbolTableForCompiledCodeNode:theSymbolTableForCompiledCodeNode; 17 | - (FSSymbolTable *)loaderEnvironmentSymbolTable; 18 | - (void)setSource:(NSString*)theSource; 19 | - (void)setSymbolTableForCompiledCodeNode:(FSSymbolTable *)theSymbolTableForCompiledCodeNode; 20 | - (NSString *)source; 21 | - (FSSymbolTable *)symbolTableForCompiledCodeNode; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FScriptFramework/FSManagedObjectContextInspector.h: -------------------------------------------------------------------------------- 1 | /* FSManagedObjectContextInspector.h Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSInterpreter.h" 6 | #import "FSCollectionInspectorView.h" 7 | 8 | @class NSManagedObjectContext; 9 | 10 | @interface FSManagedObjectContextInspector : NSObject 11 | { 12 | NSManagedObjectContext *model; 13 | FSInterpreter *interpreter; 14 | NSEntityDescription *lastFetchedEntity; 15 | NSMutableArray *fetchedObjects; 16 | 17 | IBOutlet NSTabView *tabView; 18 | IBOutlet FSCollectionInspectorView *collectionInspectorView; 19 | IBOutlet NSTextView *messageTextView; 20 | IBOutlet NSTextView *predicateTextView; 21 | IBOutlet NSPopUpButton *entityList; 22 | IBOutlet NSButton *fetchAutomaticallyButton; 23 | IBOutlet NSObjectController *controller; 24 | } 25 | 26 | + (FSManagedObjectContextInspector *)managedObjectContextInspectorWithmanagedObjectContext:(id)theContext interpreter:(FSInterpreter *)theInterpreter; 27 | 28 | - (IBAction)changeEntity:(id)sender; 29 | 30 | - (IBAction)changeFetchAutomatically:(id)sender; 31 | 32 | - (void)executeRequest; 33 | 34 | - (IBAction)executeRequest:(id)sender; 35 | 36 | - (BOOL)fetchAutomatically; 37 | 38 | - (FSManagedObjectContextInspector *)initWithmanagedObjectContext:(id)theContext interpreter:(FSInterpreter *)theInterpreter; 39 | 40 | - (IBAction)newInspector:(id)sender; 41 | 42 | - (void) setLastFetchedEntity:(NSEntityDescription *)entity; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FScriptFramework/FSMethod.h: -------------------------------------------------------------------------------- 1 | /* FSMethod.h Copyright (c) 2007-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #include 6 | 7 | @class FSBlock, FSSymbolTable, FSCNBase; 8 | 9 | id fscript_dynamicIvarValue(id instance, NSString *ivarName, BOOL *found); 10 | NSSet *fscript_dynamicIvarNames(Class class); 11 | BOOL fscript_isFScriptClass(Class class); 12 | void fscript_registerFScriptClassPair(Class class); 13 | BOOL fscript_setDynamicIvarValue(id instance, NSString *ivarName, id value); 14 | void fscript_setDynamicIvarNames(Class class, NSSet *ivarNames); 15 | 16 | @interface FSMethod : NSObject 17 | { 18 | @package 19 | SEL selector; 20 | FSSymbolTable *symbolTable; 21 | FSCNBase *code; 22 | NSUInteger argumentCount; // Number of arguments, including the two hidden arguments 23 | __strong char *fsEncodedTypes; 24 | __strong char *types; 25 | __strong char **typesByArgument; 26 | } 27 | 28 | - (BOOL) addToClass:(Class)class; 29 | 30 | - (id) initWithSelector:(SEL)theSelector fsEncodedTypes:(NSString *)theFSEncodedTypes types:(NSString *)theTypes typesByArgument:(NSArray *)theTypesByArgument argumentCount:(NSUInteger)theArgumentCount code:(FSCNBase *)theCode symbolTable:(FSSymbolTable *)theSymbolTable; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /FScriptFramework/FSMovieInspector.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | { 4 | CLASS = FSMovieInspector; 5 | LANGUAGE = ObjC; 6 | OUTLETS = {movieView = QTMovieView; window = NSWindow; }; 7 | SUPERCLASS = NSObject; 8 | }, 9 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 10 | {CLASS = NSMovie; LANGUAGE = ObjC; SUPERCLASS = NSObject; } 11 | ); 12 | IBVersion = 1; 13 | } -------------------------------------------------------------------------------- /FScriptFramework/FSMovieInspector.nib/data.dependency: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBPaletteDependency 6 | 7 | QTKit 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSMovieInspector.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 69 10 356 240 0 0 1440 878 7 | IBFramework Version 8 | 428.0 9 | IBOpenObjects 10 | 11 | 6 12 | 13 | IBSystem Version 14 | 8A369 15 | 16 | 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSMovieInspector.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FSMovieInspector.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/FSMsgContext.h: -------------------------------------------------------------------------------- 1 | /* MsgContext.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSMsgContext:NSObject 7 | { 8 | @public 9 | BOOL initialized; 10 | BOOL return_void; 11 | BOOL shouldConvertArguments; 12 | BOOL specialReturnType; 13 | BOOL unsuportedReturnType; 14 | char returnType; 15 | __strong char *argumentTypes; 16 | NSMethodSignature *signature; 17 | } 18 | 19 | + (FSMsgContext *) msgContext; 20 | 21 | - (void)dealloc; 22 | - (id)init; 23 | - (void)prepareForMessageWithReceiver:(id)receiver selector:(SEL)selector; // May raise 24 | - (NSInteger)unsuportedArgumentIndex; 25 | - (BOOL)unsuportedReturnType; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSAffineTransform.h: -------------------------------------------------------------------------------- 1 | /* FSNSAffineTransform.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface NSAffineTransform (FSNSAffineTransform) 7 | 8 | - (float)m11; 9 | - (float)m12; 10 | - (float)m21; 11 | - (float)m22; 12 | - (void) setM11:(float)m11 m12:(float)m12 m21:(float)m21 m22:(float)m22 tX:(float)tX tY:(float)tY; 13 | - (float)tX; 14 | - (float)tY; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSAffineTransform.m: -------------------------------------------------------------------------------- 1 | /* FSNSAffineTransform.m Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSAffineTransform.h" 5 | 6 | @implementation NSAffineTransform (FSNSAffineTransform) 7 | 8 | - (float)m11 { return [self transformStruct].m11; } 9 | 10 | - (float)m12 { return [self transformStruct].m12; } 11 | 12 | - (float)m21 { return [self transformStruct].m21; } 13 | 14 | - (float)m22 { return [self transformStruct].m22; } 15 | 16 | - (void) setM11:(float)m11 m12:(float)m12 m21:(float)m21 m22:(float)m22 tX:(float)tX tY:(float)tY 17 | { 18 | [self setTransformStruct:(NSAffineTransformStruct){m11, m12, m21, m22, tX, tY}]; 19 | } 20 | 21 | - (float)tX { return [self transformStruct].tX; } 22 | 23 | - (float)tY { return [self transformStruct].tY; } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSArray.h: -------------------------------------------------------------------------------- 1 | /* FSNSArray.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | #import 4 | 5 | @class FSBlock, FSArray, FSSystem; 6 | 7 | @interface NSArray(FSNSArray) 8 | 9 | // User methods 10 | - (id)at:(id)index; 11 | - (id)clone __attribute__((deprecated)); 12 | - (FSArray *)difference:(NSArray *)operand; 13 | - (FSArray *)distinct; 14 | - (FSArray *)distinctId; 15 | - (void) do:(FSBlock *)operation; 16 | - (FSArray *)index; 17 | - (void)inspect; 18 | - (void)inspectIn:(FSSystem *)system __attribute__((deprecated)); // use inspectWithSystem: instead 19 | - (void)inspectWithSystem:(FSSystem *)system; 20 | - (void)inspectIn:(FSSystem *)system with:(NSArray *)blocks __attribute__((deprecated)); // use inspectWithSystem:blocks: instead 21 | - (void)inspectWithSystem:(FSSystem *)system blocks:(NSArray *)blocks; 22 | - (FSArray *)intersection:(NSArray *)operand; 23 | - (id)operator_backslash:(FSBlock*)operand; 24 | - (NSNumber *)operator_exclam:(id)anObject; 25 | - (NSNumber *)operator_exclam_exclam:(id)anObject; 26 | - (FSArray *)operator_greater_less:(id)operand; 27 | - (FSArray *)operator_plus_plus:(NSArray *)operand; 28 | - (FSArray *)prefixes; 29 | - (NSString *)printString; 30 | - (FSArray *)replicate:(NSArray *)operand; 31 | - (FSArray *)reverse; 32 | - (FSArray *)rotatedBy:(NSNumber *)operand; 33 | - (FSArray *)scan:(FSBlock*)operand; 34 | - (FSArray *)sort; 35 | - (FSArray *)subpartsOfSize:(NSNumber *)operand; 36 | - (FSArray *)transposedBy:(NSArray *)operand; 37 | - (FSArray *)union:(NSArray *)operand; 38 | - (FSArray *)where:(NSArray *)booleans; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSArrayPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSNSArray.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSArray.h" 5 | 6 | ///////////////////////////////////// MACROS 7 | #define VERIF_OP_NSARRAY(METHOD) {if (![operand isKindOfClass:[NSArray class]]) FSArgumentError(operand,1,@"NSArray",METHOD);} 8 | 9 | 10 | @interface NSArray(FSNSArrayPrivate) 11 | 12 | - (NSString *)descriptionLimited:(NSUInteger)nbElem; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSAttributedString.h: -------------------------------------------------------------------------------- 1 | /* FSNSAttributedString.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface NSAttributedString (FSNSAttributedString) 8 | 9 | -(void)inspect; 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSAttributedString.m: -------------------------------------------------------------------------------- 1 | /* FSNSAttributedString.m Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSAttributedString.h" 5 | #import "FSAttributedStringInspector.h" 6 | 7 | @implementation NSAttributedString (FSNSAttributedString) 8 | 9 | -(void)inspect 10 | { 11 | [FSAttributedStringInspector attributedStringInspectorWithAttributedString:self]; 12 | } 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSDate.h: -------------------------------------------------------------------------------- 1 | /* FSNSDate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBoolean; 7 | 8 | @interface NSDate (FSNSDate) 9 | 10 | ////////////////////////// USER METHODS 11 | 12 | + (NSDate *) now; 13 | 14 | - (id)clone __attribute__((deprecated)); 15 | - (id)max:(NSDate *)operand; 16 | - (id)min:(NSDate *)operand; 17 | - (FSBoolean *)operator_greater:(NSDate *)operand; 18 | - (FSBoolean *)operator_greater_equal:(NSDate *)operand; 19 | - (NSNumber *) operator_hyphen:(NSDate *)operand; 20 | - (FSBoolean *)operator_less:(NSDate *)operand; 21 | - (FSBoolean *)operator_less_equal:(NSDate *)operand; 22 | - (FSBoolean *)operator_equal:(id)operand; 23 | - (FSBoolean *)operator_tilde_equal:(id)operand; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSDictionary.h: -------------------------------------------------------------------------------- 1 | /* FSNSDictionary.h Copyright (c) 2000-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSSystem; 7 | 8 | @interface NSDictionary(FSNSDictionary) 9 | 10 | - (id)at:(id)aKey; 11 | - (void)inspect; 12 | - (void)inspectIn:(FSSystem *)system __attribute__((deprecated)); // use inspectWithSystem: instead 13 | - (void)inspectWithSystem:(FSSystem *)system; 14 | - (void)inspectIn:(FSSystem *)system with:(NSArray *)blocks __attribute__((deprecated)); // use inspectWithSystem:blocks: instead 15 | - (void)inspectWithSystem:(FSSystem *)system blocks:(NSArray *)blocks; 16 | - (NSString *)printString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSDistantObject.h: -------------------------------------------------------------------------------- 1 | /* FSNSDistantObject.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSNSObject.h" 6 | 7 | @class FSBlock; 8 | 9 | @interface NSDistantObject(FSNSDistantObject) 10 | 11 | + (NSMethodSignature *)methodSignatureForSelector:(SEL)selector; 12 | 13 | - (NSString *)descriptionLimited:(NSUInteger)nbElem; 14 | 15 | ///////////////// USER METHODS ////////////// 16 | 17 | /* FSNSObject support */ 18 | 19 | - (FSBoolean *)operator_equal_equal:(id)operand; 20 | - (FSBoolean *)operator_tilde_tilde:(id)operand; 21 | 22 | - (id)applyBlock:(FSBlock *)block; 23 | - (FSArray *)enlist; 24 | - (FSArray *)enlist:(NSNumber*)operand; 25 | - (NSString *)printString; 26 | 27 | - (NSConnection *)vend:(NSString *)operand __attribute__((deprecated)); 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSFileHandle.h: -------------------------------------------------------------------------------- 1 | /* FSNSFileHandle.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface NSFileHandle (FSNSFileHandle) 8 | 9 | - (void) print:(NSString *)string; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSFileHandle.m: -------------------------------------------------------------------------------- 1 | /* FSNSFileHandle.m Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSFileHandle.h" 5 | #import "FScriptFunctions.h" 6 | 7 | @implementation NSFileHandle (FSNSFileHandle) 8 | 9 | - (void) print:(NSString *)string 10 | { 11 | FSVerifClassArgsNoNil(@"print:", 1, string, [NSString class]); 12 | [self writeData:[string dataUsingEncoding:NSUTF8StringEncoding]]; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSFont.h: -------------------------------------------------------------------------------- 1 | /* FSNSFont.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface NSFont (FSNSFont) 8 | 9 | -(void)inspect; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSFont.m: -------------------------------------------------------------------------------- 1 | /* FSNSFont.m Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSFont.h" 5 | 6 | 7 | @implementation NSFont (FSNSFont) 8 | 9 | -(void)inspect 10 | { 11 | [[NSFontManager sharedFontManager] setSelectedFont:self isMultiple:NO]; 12 | [[NSFontManager sharedFontManager] orderFrontFontPanel:self]; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSImage.h: -------------------------------------------------------------------------------- 1 | /* FSNSImage.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface NSImage (FSNSImage) 8 | 9 | -(void)inspect; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSImage.m: -------------------------------------------------------------------------------- 1 | /* FSNSImage.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSImage.h" 5 | #import "FSImageInspector.h" 6 | 7 | @implementation NSImage (FSNSImage) 8 | 9 | -(void)inspect 10 | { 11 | [FSImageInspector imageInspectorWithImage:self]; 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSManagedObjectContext.h: -------------------------------------------------------------------------------- 1 | /* FSNSManagedObjectContext.h Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSSystem; 7 | 8 | @interface NSManagedObjectContext(FSNSManagedObjectContext) 9 | 10 | - (void)inspectWithSystem:(FSSystem *)system; 11 | 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSManagedObjectContext.m: -------------------------------------------------------------------------------- 1 | /* FSNSManagedObjectContext.m Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSManagedObjectContext.h" 5 | #import "FSManagedObjectContextInspector.h" 6 | #import "FScriptFunctions.h" 7 | #import "FSSystemPrivate.h" 8 | 9 | @implementation NSManagedObjectContext(FSNSManagedObjectContext) 10 | 11 | - (void)inspectWithSystem:(FSSystem *)system 12 | { 13 | FSVerifClassArgsNoNil(@"inspectWithSystem:",1,system,[FSSystem class]); 14 | if (![system interpreter]) FSExecError(@"Sorry, can't open the inspector because there is no FSInterpreter associated with the FSSystem object passed as argument"); 15 | 16 | [FSManagedObjectContextInspector managedObjectContextInspectorWithmanagedObjectContext:self interpreter:[system interpreter]]; 17 | } 18 | 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSMutableArray.h: -------------------------------------------------------------------------------- 1 | /* FSNSMutableArray.h Copyright (c) 2003-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface NSMutableArray(FSNSMutableArray) 8 | 9 | // User methods 10 | - (void)add:(id)elem; 11 | - (id)at:(id)index put:(id)elem; 12 | - (void)insert:(id)obj at:(NSNumber *)index; 13 | - (void)removeAt:(id)index; 14 | - (void)setValue:(NSArray *)operand; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSMutableDictionary.h: -------------------------------------------------------------------------------- 1 | /* FSNSMutableDictionary.h Copyright (c) 2010 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface NSMutableDictionary(FSNSMutableDictionary) 7 | 8 | - (void)at:(id)aKey put:(id)anObject; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSMutableDictionary.m: -------------------------------------------------------------------------------- 1 | /* FSNSMutableDictionary.m Copyright (c) 2010 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSMutableDictionary.h" 5 | #import "FScriptFunctions.h" 6 | 7 | @implementation NSMutableDictionary(FSNSMutableDictionary) 8 | 9 | - (void)at:(id)aKey put:(id)anObject 10 | { 11 | if (aKey == nil) 12 | FSExecError(@"argument 1 of method \"at:put:\" must not be nil"); 13 | else if (anObject == nil) 14 | FSExecError(@"argument 2 of method \"at:put:\" must not be nil"); 15 | else 16 | [self setObject:anObject forKey:aKey]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSMutableString.h: -------------------------------------------------------------------------------- 1 | /* FSNSMutableString.h Copyright (c) 2000 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface NSMutableString (FSNSMutableString) 7 | 8 | - (NSString *)clone __attribute__((deprecated)); 9 | - (void)insert:(NSString *)str at:(NSNumber *)index; 10 | - (void)setValue:(id)operand; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSMutableString.m: -------------------------------------------------------------------------------- 1 | /* FSNSMutableString.m Copyright (c) 2000 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSNSMutableString.h" 6 | #import "Number_fscript.h" 7 | #import "FScriptFunctions.h" 8 | #import "FSNSStringPrivate.h" 9 | 10 | @implementation NSMutableString (FSNSMutableString) 11 | 12 | - (NSString *) clone 13 | { 14 | return [[self mutableCopy] autorelease]; 15 | } 16 | 17 | - (void)insert:(NSString *)str at:(NSNumber *)index 18 | { 19 | double ind; 20 | 21 | FSVerifClassArgsNoNil(@"insert:at:",2,str,[NSString class],index,[NSNumber class]); 22 | 23 | ind = [index doubleValue]; 24 | 25 | if (ind < 0) 26 | FSExecError(@"argument 2 of method \"insert:at:\" must be a number " 27 | @"greater or equal to 0"); 28 | if (ind > [self length]) 29 | FSExecError(@"argument 2 of method \"insert:at:\" must be a number " 30 | @"less or equal to the length of the string"); 31 | if (ind != (NSInteger)ind) 32 | FSExecError(@"argument 2 of method \"insert:at:\" must be an integer"); 33 | 34 | 35 | [self insertString:str atIndex:(NSUInteger)ind]; 36 | } 37 | 38 | - (void)setValue:(id)operand 39 | { 40 | VERIF_OP_NSSTRING(@"setValue:") 41 | [self setString:operand]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSObject.h: -------------------------------------------------------------------------------- 1 | 2 | /* FSNSObject.m Copyright (c) 1998-2009 Philippe Mougin. */ 3 | /* This software is open source. See the license. */ 4 | 5 | #import 6 | 7 | @class FSArray, FSBoolean, NSString, NSConnection, FSBlock, FSAssociation; 8 | 9 | @protocol FSNSObject 10 | 11 | // USER METHODS 12 | - (id)applyBlock:(FSBlock *)block; 13 | - (id)classOrMetaclass; 14 | - (FSArray *)enlist; 15 | - (FSArray *)enlist:(NSNumber *)operand; 16 | - (FSBoolean *)operator_equal_equal:(id)operand; 17 | - (FSAssociation *)operator_hyphen_greater:(id)operand; 18 | - (FSBoolean *)operator_tilde_tilde:(id)operand; 19 | - (NSString *)printString; 20 | @end 21 | 22 | @interface NSObject(FSNSObject) 23 | 24 | // USER METHODS 25 | 26 | - (id)applyBlock:(FSBlock *)block; 27 | - (FSArray *)enlist; 28 | - (FSArray *)enlist:(NSNumber *)operand; 29 | - (FSBoolean *)operator_equal_equal:(id)operand; 30 | - (FSAssociation *)operator_hyphen_greater:(id)operand; 31 | - (FSBoolean *)operator_tilde_tilde:(id)operand; 32 | - (NSString *)printString; 33 | - (void)save; // may raise 34 | - (void)save:(NSString *)operand; // may raise 35 | - (void)throw __attribute__((deprecated)); 36 | - (NSConnection *)vend:(NSString *)operand __attribute__((deprecated)); 37 | 38 | // OTHER METHODS 39 | 40 | + (id)replacementObjectForCoder:(NSCoder *)encoder; 41 | - (id)classOrMetaclass; 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSObjectPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSNSObjectPrivate.h Copyright (c) 2003-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSObject.h" 5 | 6 | @interface NSObject(FSNSObjectPrivate) 7 | @end 8 | 9 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSProtocolChecker.h: -------------------------------------------------------------------------------- 1 | /* FSNSProtocolChecker.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface NSProtocolChecker(FSNSProtocolChecker) 7 | 8 | + (NSMethodSignature *)methodSignatureForSelector:(SEL)selector; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSProtocolChecker.m: -------------------------------------------------------------------------------- 1 | /* FSNSProtocolChecker.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSProtocolChecker.h" 5 | 6 | @interface NSMethodSignature(UndocumentedNSMethodSignature) 7 | + (NSMethodSignature*) signatureWithObjCTypes:(char *)types; 8 | @end 9 | 10 | @implementation NSProtocolChecker(FSNSProtocolChecker) 11 | 12 | + (NSMethodSignature *)methodSignatureForSelector:(SEL)selector 13 | { 14 | // Partial fix for broken Mac OS X implementation of NSProxy meta-class level. 15 | // Limitation: this is all hard wired here, and thus will not work for methods added in new categories or new subclasses. 16 | 17 | if (selector == @selector(protocolCheckerWithTarget:protocol:)) return [NSMethodSignature signatureWithObjCTypes:"@@:@@"]; 18 | else return [[NSProxy class] methodSignatureForSelector:selector]; 19 | // A strange bug in GCC3 (beta) makes using "super" seemingly impossible here. 20 | // We can't use [self superclass] instead because it's buggy too (it returns NSProxy meta class)! 21 | // So we hard-wire the use of NSProxy. 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSProxy.h: -------------------------------------------------------------------------------- 1 | /* FSNSProxy.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | 5 | #import "FSNSObject.h" 6 | #import 7 | 8 | @class FSBlock; 9 | 10 | 11 | @interface NSProxy(FSNSProxy) 12 | 13 | ///////////////// USER METHODS ////////////// 14 | 15 | + (id)classOrMetaclass; 16 | + (FSBoolean *)operator_equal_equal:(id)operand; 17 | + (FSBoolean *)operator_tilde_tilde:(id)operand; 18 | + (NSString *)printString; 19 | 20 | - (id)classOrMetaclass; 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSSet.h: -------------------------------------------------------------------------------- 1 | /* FSNSSet.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSSystem; 7 | 8 | @interface NSSet(FSNSSet) 9 | 10 | - (void) inspect; 11 | - (void)inspectIn:(FSSystem *)system __attribute__((deprecated)); // use inspectWithSystem: instead 12 | - (void)inspectWithSystem:(FSSystem *)system; 13 | - (void)inspectIn:(FSSystem *)system with:(NSArray *)blocks __attribute__((deprecated)); // use inspectWithSystem:blocks: instead 14 | - (void)inspectWithSystem:(FSSystem *)system blocks:(NSArray *)blocks; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSSet.m: -------------------------------------------------------------------------------- 1 | /* FSNSSet.m Copyright (c) 2000-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSSet.h" 5 | #import "FSBlock.h" 6 | #import "FSMiscTools.h" 7 | #import "FScriptFunctions.h" 8 | #import "FSSystemPrivate.h" 9 | 10 | @implementation NSSet(FSNSSet) 11 | 12 | - (void) inspect 13 | { 14 | [self inspectWithSystem:nil]; 15 | } 16 | 17 | - (void)inspectWithSystem:(FSSystem *)system 18 | { 19 | FSVerifClassArgs(@"inspectWithSystem:",1,system,[FSSystem class],(NSInteger)1); 20 | [self inspectWithSystem:system blocks:nil]; 21 | } 22 | 23 | - (void)inspectWithSystem:(FSSystem *)system blocks:(NSArray *)blocks; 24 | { 25 | inspectCollection(self, system, blocks); 26 | } 27 | 28 | - (void) inspectIn:(FSSystem *)system 29 | { 30 | FSVerifClassArgsNoNil(@"inspectIn:",1,system,[FSSystem class]); 31 | [self inspectWithSystem:system]; 32 | } 33 | 34 | - (void) inspectIn:(FSSystem *)system with:(NSArray *)blocks 35 | { 36 | [self inspectWithSystem:system blocks:blocks]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSString.h: -------------------------------------------------------------------------------- 1 | /* FSNSString.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #ifndef __FScript_FSNSString_H__ 5 | #define __FScript_FSNSString_H__ 6 | 7 | #import 8 | 9 | @class FSBlock; 10 | @class FSArray; 11 | @class FSBoolean; 12 | 13 | @interface NSString (FSNSString) 14 | 15 | - (FSArray *) asArray; 16 | - (FSArray *) asArrayOfCharacters; 17 | - (FSBlock *) asBlock; 18 | - (FSBlock *) asBlockOnError:(FSBlock *)errorBlock; 19 | - (id) asClass; 20 | - (NSDate *) asDate; 21 | - (NSString *)at:(NSNumber *)operand; 22 | - (NSString *)clone __attribute__((deprecated)); 23 | - (id) connect __attribute__((deprecated)); 24 | - (id) connectOnHost:(NSString *)operand __attribute__((deprecated)); 25 | - (NSString *)max:(NSString *)operand; 26 | - (NSString *)min:(NSString *)operand; 27 | - (FSBoolean *)operator_equal:(id)operand; 28 | - (FSBoolean *)operator_tilde_equal:(id)operand; 29 | - (FSBoolean *)operator_greater:(NSString *)operand; 30 | - (FSBoolean *)operator_greater_equal:(NSString *)operand; 31 | - (FSBoolean *)operator_less:(id)operand; 32 | - (FSBoolean *)operator_less_equal:(NSString *)operand; 33 | - (NSString *)operator_plus_plus:(NSString *)operand; 34 | - (NSString *)printString; 35 | - (NSString *)reverse; 36 | 37 | @end 38 | 39 | #endif /* __FScript_FSNSString_H__ */ 40 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSStringPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSNSStringPrivate.h Copyright (c) 2000-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | ////////////// MACROS 5 | 6 | #define VERIF_OP_NSSTRING(METHOD) {if (![operand isKindOfClass:[NSString class]]) FSArgumentError(operand,1,@"NSString",METHOD);} 7 | -------------------------------------------------------------------------------- /FScriptFramework/FSNSValue.h: -------------------------------------------------------------------------------- 1 | /* FSNSValue.h Copyright (c) 2003-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBoolean; 7 | 8 | @interface NSValue (FSNSValue) 9 | 10 | ///////////////////////////////// USER METHODS ///////////////////////// 11 | 12 | // Common 13 | 14 | - (id)clone __attribute__((deprecated)); 15 | - (FSBoolean *)operator_equal:(id)operand; 16 | - (FSBoolean *)operator_tilde_equal:(id)operand; 17 | - (NSString *)printString; 18 | 19 | // NSPoint 20 | 21 | - (NSRect)corner:(NSPoint)operand; 22 | - (NSRect)extent:(NSPoint)operand; 23 | - (CGFloat)x; 24 | - (CGFloat)y; 25 | 26 | // NSRange 27 | 28 | + (NSRange)rangeWithLocation:(NSUInteger)location length:(NSUInteger)length; 29 | - (NSUInteger)length; 30 | - (NSUInteger)location; 31 | 32 | // NSRect 33 | 34 | - (NSPoint)corner; 35 | - (NSPoint)extent; 36 | - (NSPoint)origin; 37 | 38 | // NSSize 39 | 40 | + (NSSize)sizeWithWidth:(CGFloat)width height:(CGFloat)height; 41 | - (CGFloat)height; 42 | - (CGFloat)width; 43 | 44 | + (NSEdgeInsets)edgeInsetsWithTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right; 45 | -(CGFloat)top; 46 | -(CGFloat)left; 47 | -(CGFloat)bottom; 48 | -(CGFloat)right; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /FScriptFramework/FSNamedNumber.h: -------------------------------------------------------------------------------- 1 | /* NamedNumber Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSNamedNumber : NSNumber 7 | { 8 | double value; 9 | NSString *name; 10 | } 11 | 12 | + (id)namedNumberWithDouble:(double)val name:(NSString *)theName; 13 | - (id)initWithDouble:(double)val name:(NSString *)theName; //designated initializer 14 | - (void) dealloc; 15 | - (NSString *)description; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FScriptFramework/FSNamedNumber.m: -------------------------------------------------------------------------------- 1 | /* NamedNumber.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNamedNumber.h" 5 | 6 | 7 | @implementation FSNamedNumber 8 | 9 | + (id)namedNumberWithDouble:(double)val name:(NSString *)theName 10 | { 11 | return [[[self alloc] initWithDouble:val name:theName] autorelease]; 12 | } 13 | 14 | - (void) dealloc 15 | { 16 | [name release]; 17 | [super dealloc]; 18 | } 19 | 20 | - (NSString *)description 21 | { 22 | if (name) return name; 23 | else return [super description]; 24 | } 25 | 26 | - (double) doubleValue 27 | { 28 | return value; 29 | } 30 | 31 | - (id)initWithDouble:(double)val name:(NSString *)theName //designated initializer 32 | { 33 | if ((self = [super init])) 34 | { 35 | value = val; 36 | name = [theName retain]; 37 | return self; 38 | } 39 | return nil; 40 | } 41 | 42 | 43 | ///////////////// NSValue Class cluster primitives methods are implemented here 44 | 45 | - (void)getValue:(void *)buffer 46 | { 47 | *(double *)buffer = value; 48 | } 49 | 50 | - (const char *)objCType 51 | { 52 | return @encode(__typeof__(value)); 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /FScriptFramework/FSNewlyAllocatedObjectHolder.h: -------------------------------------------------------------------------------- 1 | /* FSNewlyAllocatedObjectHolder.h Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSNewlyAllocatedObjectHolder : NSObject 7 | { 8 | id object; 9 | } 10 | 11 | + (id)newlyAllocatedObjectHolderWithObject:(id)theObject; 12 | 13 | - (id)initWithObject:(id)theObject; 14 | - (id)object; 15 | - (NSString *)printString; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FScriptFramework/FSNewlyAllocatedObjectHolder.m: -------------------------------------------------------------------------------- 1 | /* FSNewlyAllocatedObjectHolder.m Copyright (c) 2001-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNewlyAllocatedObjectHolder.h" 5 | #import 6 | 7 | @implementation FSNewlyAllocatedObjectHolder 8 | 9 | + (id)newlyAllocatedObjectHolderWithObject:(id)theObject 10 | { 11 | return [[[self alloc] initWithObject:theObject] autorelease]; 12 | } 13 | 14 | - (id)initWithObject:(id)theObject 15 | { 16 | if ((self = [super init])) 17 | { 18 | object = theObject; 19 | return self; 20 | } 21 | return nil; 22 | } 23 | 24 | - (id)object {return object;} 25 | 26 | - (NSString *)printString 27 | { 28 | return [[@"Holder for a newly allocated " stringByAppendingString:NSStringFromClass(object_getClass(object))] stringByAppendingString:@". Don't forget to initialize it (use an init... method) and to use the object returned by the init... method instead of this holder." ]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowser.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowser.h Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @class FSInterpreter; 7 | @class FSObjectBrowserView; 8 | 9 | @interface FSObjectBrowser : NSWindowController 10 | 11 | + (FSObjectBrowser *)objectBrowserWithRootObject:(id)object interpreter:(FSInterpreter *)interpreter; 12 | - (void) browseWorkspace; 13 | - (void)dealloc; 14 | - (FSObjectBrowser *)initWithRootObject:(id)object interpreter:(FSInterpreter *)interpreter; 15 | 16 | @property (strong,nonatomic) IBOutlet id rootObject; 17 | @property (strong,nonatomic) IBOutlet FSInterpreter* interpreter; 18 | @property (weak,nonatomic) IBOutlet FSObjectBrowserView *objectBrowserView; 19 | -(IBAction)floatWindow:(id)sender; 20 | @end 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserArgumentPanel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FSObjectBrowserArgumentPanel.h -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserArgumentPanel.m: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserArgumentPanel.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSObjectBrowserArgumentPanel.h" 5 | #import "FScriptTextView.h" 6 | 7 | @implementation FSObjectBrowserArgumentPanel 8 | 9 | - (NSText *)fieldEditor:(BOOL)createFlag forObject:(id)anObject 10 | { 11 | if (createFlag && !editor) editor = [[FScriptTextView alloc] initWithFrame:NSMakeRect(0,0,400,400)]; 12 | return editor; 13 | } 14 | 15 | - (void) dealloc 16 | { 17 | [editor release]; 18 | [super dealloc]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserBottomBarTextDisplay.h: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserBottomBarTextDisplay.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSObjectBrowserBottomBarTextDisplay : NSButton { 7 | 8 | } 9 | 10 | - (id)initWithFrame:(NSRect)frameRect; 11 | - (void)setString:(NSString *)string; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserBottomBarTextDisplay.m: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserBottomBarTextDisplay.m Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSObjectBrowserBottomBarTextDisplay.h" 5 | 6 | @implementation FSObjectBrowserBottomBarTextDisplay 7 | 8 | - (id)initWithFrame:(NSRect)frameRect 9 | { 10 | self = [super initWithFrame:frameRect]; 11 | if (self) 12 | { 13 | [self setBezelStyle:NSTexturedRoundedBezelStyle]; 14 | [self setBordered:NO]; 15 | [self setAlignment:NSLeftTextAlignment]; 16 | [self setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; 17 | [self setTitle:@""]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)setString:(NSString *)string 23 | { 24 | [self setTitle:[string stringByReplacingOccurrencesOfString:@"\n" withString:@" "]]; 25 | } 26 | 27 | - (BOOL)mouseDownCanMoveWindow 28 | { 29 | return YES; 30 | } 31 | 32 | - (void)mouseDown:(NSEvent *)theEvent 33 | { 34 | // We want to avoid the button highlighting 35 | return; 36 | } 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserButtonCtxBlock.h: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserButtonCtxBlock.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "BlockPrivate.h" 6 | 7 | @interface FSObjectBrowserButtonCtxBlock : FSBlock 8 | { 9 | FSBlock *master; 10 | } 11 | 12 | - (void)dealloc; 13 | - (BlockInspector *)inspector; 14 | - (void)setMaster:(FSBlock *)theMaster; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserButtonCtxBlock.m: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserButtonCtxBlock.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSObjectBrowserButtonCtxBlock.h" 5 | 6 | 7 | @implementation FSObjectBrowserButtonCtxBlock 8 | 9 | - (void)dealloc 10 | { 11 | //NSLog(@"FSObjectBrowserButtonCtxBlock dealloc"); 12 | [master release]; 13 | [super dealloc]; 14 | } 15 | 16 | - (BlockInspector *)inspector { return [master inspector]; } 17 | 18 | - (void) setMaster:(FSBlock *)theMaster 19 | { 20 | [theMaster retain]; 21 | [master release]; 22 | master = theMaster; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserButtonsInspector.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserButtonsInspector.h Copyright (c) 2002-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @interface FSObjectBrowserButtonsInspector : NSObject 7 | { 8 | IBOutlet NSWindow *window; 9 | 10 | IBOutlet NSTextField *t1; 11 | IBOutlet NSTextField *t2; 12 | IBOutlet NSTextField *t3; 13 | IBOutlet NSTextField *t4; 14 | IBOutlet NSTextField *t5; 15 | IBOutlet NSTextField *t6; 16 | IBOutlet NSTextField *t7; 17 | IBOutlet NSTextField *t8; 18 | IBOutlet NSTextField *t9; 19 | IBOutlet NSTextField *t10; 20 | 21 | IBOutlet NSButton *b1; 22 | IBOutlet NSButton *b2; 23 | IBOutlet NSButton *b3; 24 | IBOutlet NSButton *b4; 25 | IBOutlet NSButton *b5; 26 | IBOutlet NSButton *b6; 27 | IBOutlet NSButton *b7; 28 | IBOutlet NSButton *b8; 29 | IBOutlet NSButton *b9; 30 | IBOutlet NSButton *b10; 31 | } 32 | 33 | -(void) activate; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserButtonsInspector.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 677 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9G55 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserButtonsInspector.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FSObjectBrowserButtonsInspector.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserCell.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserCell.h Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | enum FSObjectBrowserCellType {FSOBOBJECT, FSOBCLASS, FSOBMETHOD, FSOBUNKNOWN}; 7 | 8 | // The BBCLASS type is used to store a class lazily (only the name of the class is stored) in order to not initialize it if not needed. 9 | // The actual initialization will take place when the class object is needed, in the -representedObject method. 10 | 11 | @interface FSObjectBrowserCell : NSBrowserCell 12 | { 13 | enum FSObjectBrowserCellType objectBrowserCellType; 14 | NSString *classLabel; 15 | NSString *label; 16 | } 17 | 18 | + (NSImage *)branchImage; 19 | 20 | - (enum FSObjectBrowserCellType) objectBrowserCellType; 21 | - (NSString *)classLabel; 22 | - (NSString *)label; 23 | - (id)representedObject; 24 | - (void) setObjectBrowserCellType:(enum FSObjectBrowserCellType)theObjectBrowserCellType; 25 | - (void) setClassLabel:(NSString *)theClassLabel; 26 | - (void) setLabel:(NSString *)theLabel; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserMatrix.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserMatrix.h Copyright (c) 2002-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @class FSObjectInspectorViewModelItem; 7 | 8 | @interface FSObjectBrowserMatrix : NSMatrix 9 | @property (strong,nonatomic) FSObjectInspectorViewModelItem *rootViewModelItem; 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserMatrix.m: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserMatrix.m Copyright (c) 2002-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | #import "FSObjectBrowserMatrix.h" 6 | 7 | 8 | @implementation FSObjectBrowserMatrix 9 | 10 | -(void)encodeWithCoder:(NSCoder *)aCoder 11 | { 12 | [super encodeWithCoder:aCoder]; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserNamedObjectWrapper.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserNamedObjectWrapper.h Copyright (c) 2005-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | 7 | @interface FSObjectBrowserNamedObjectWrapper : NSObject 8 | { 9 | NSString *name; 10 | id object; 11 | } 12 | 13 | + (id)namedObjectWrapperWithObject:(id)theObject name:(NSString *)theName; 14 | 15 | - (id)initWithObject:(id)theObject name:(NSString *)theName; 16 | - (id)object; 17 | - (NSString *)description; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserNamedObjectWrapper.m: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserNamedObjectWrapper.m Copyright (c) 2005-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSObjectBrowserNamedObjectWrapper.h" 5 | 6 | @implementation FSObjectBrowserNamedObjectWrapper 7 | 8 | + (id)namedObjectWrapperWithObject:(id)theObject name:(NSString *)theName 9 | { 10 | return [[[self alloc] initWithObject:theObject name:theName] autorelease]; 11 | } 12 | 13 | - (void)dealloc 14 | { 15 | [name release]; 16 | [object release]; 17 | [super dealloc]; 18 | } 19 | 20 | - (id)initWithObject:(id)theObject name:(NSString *)theName 21 | { 22 | if ((self = [super init])) 23 | { 24 | object = [theObject retain]; 25 | name = [theName retain]; 26 | return self; 27 | } 28 | return nil; 29 | } 30 | 31 | - (id)object { return object; } 32 | 33 | - (NSString *)description 34 | { 35 | return name; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserSearchField.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserSearchField.h Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | 7 | @interface FSObjectBrowserSearchField : NSSearchField { 8 | 9 | } 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserToolbarButton.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserToolbarButton.h Copyright (c) 2002-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @class FSBlock; 7 | 8 | @interface FSObjectBrowserToolbarButton : NSSegmentedControl 9 | { 10 | FSBlock *block; 11 | NSString *identifier; 12 | NSToolbarItem *toolbarItem; 13 | } 14 | 15 | - (id) initWithFrame:(NSRect)frameRect; 16 | - (FSBlock *) block; 17 | - (void) configure:(id)sender; 18 | - (id)copyWithZone:(NSZone *)zone; 19 | - (NSString *) identifier; 20 | - (void) inspectBlock:(id)sender; 21 | - (NSString *) name; 22 | - (void) setBlock:(FSBlock *)theBlock; 23 | - (void) setIdentifier:(NSString *)theIdentifier; 24 | - (void) setToolbarItem:(NSToolbarItem *)item; 25 | - (void) takeNameFrom:(id)sender; 26 | - (void) setName:(NSString *)name; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserToolbarItem.h: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserToolbarItem.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSObjectBrowserToolbarItem : NSToolbarItem 7 | {} 8 | @end 9 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserToolbarItem.m: -------------------------------------------------------------------------------- 1 | /* FSObjectBrowserToolbarItem.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSObjectBrowserToolbarItem.h" 5 | #import "FSObjectBrowserToolbarButton.h" 6 | #import "FSBlock.h" 7 | #import "FSObjectBrowserView.h" 8 | 9 | @implementation FSObjectBrowserToolbarItem 10 | 11 | - (void)validate 12 | { 13 | NSInteger argumentCount = 0; // intitialization of argumentCount in order to avoid a warning 14 | NSString *identifier = [self itemIdentifier]; 15 | 16 | [self setEnabled:YES]; 17 | 18 | if ([[self view] isKindOfClass:[FSObjectBrowserToolbarButton class]]) 19 | { 20 | @try 21 | { 22 | argumentCount = [[(FSObjectBrowserToolbarButton *)[self view] block] argumentCount]; 23 | } 24 | @catch (id exception) 25 | { 26 | argumentCount = 0; 27 | } 28 | } 29 | 30 | if ( [identifier isEqualToString:@"Name"] 31 | || [identifier isEqualToString:@"Self"] 32 | || [identifier isEqualToString:@"Inspect"] 33 | || [identifier isEqualToString:@"Browse"] 34 | || ([[self view] isKindOfClass:[FSObjectBrowserToolbarButton class]] && argumentCount != 0)) 35 | { 36 | if ([[(NSButton *)[self view] target] selectedObject] == nil) 37 | [self setEnabled:NO]; 38 | } 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserViewObjectInfo.h: -------------------------------------------------------------------------------- 1 | // FSObjectBrowserViewObjectInfo.h Copyright (c) 2001-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | #import "FSObjectBrowserView.h" 6 | 7 | @interface FSObjectBrowserView (FSObjectBrowserViewObjectInfo) 8 | 9 | - (void)fillMatrix:(NSMatrix*)m column:(NSUInteger)col withObject:(id)object; 10 | 11 | @end 12 | 13 | @interface FSObjectBrowserViewObjectHelper : NSObject 14 | @property (nonatomic, retain) FSObjectInspectorViewModelItem* rootViewModelItem; 15 | + (NSArray*)baseClasses; 16 | -(void)introspectPropertiesOfObject:(id)object; 17 | -(void)populateModelWithObject:(id)object; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectBrowserWindow.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 08/12/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class FSObjectBrowserButtonsInspector; 12 | 13 | @interface FSObjectBrowserWindow : NSWindow 14 | @property (strong,nonatomic) NSSearchField *visibleSearchField; 15 | @property (strong,nonatomic) FSObjectBrowserButtonsInspector *buttonsInspector; 16 | @end 17 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectBrowserWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectBrowserWindow.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 08/12/2014. 6 | // 7 | // 8 | 9 | #import "FSObjectBrowserWindow.h" 10 | #import "FSObjectBrowserButtonsInspector.h" 11 | 12 | @implementation FSObjectBrowserWindow 13 | 14 | - (void)sendEvent:(NSEvent *)theEvent 15 | { 16 | // Goal: route most key events directly to the searchfield 17 | 18 | if ([theEvent type] == NSKeyDown) 19 | { 20 | unichar character = [[theEvent characters] characterAtIndex:0]; 21 | if (character != NSLeftArrowFunctionKey && character != NSRightArrowFunctionKey && character != NSUpArrowFunctionKey && character != NSDownArrowFunctionKey) 22 | { 23 | NSSearchField *searchField = [self visibleSearchField]; 24 | if (searchField && [searchField currentEditor] == nil) // If the searchfield is not already active then we make it become the first responder 25 | [self makeFirstResponder:searchField]; 26 | } 27 | } 28 | [super sendEvent:theEvent]; 29 | } 30 | 31 | - (void)runToolbarCustomizationPalette:(id)sender 32 | { 33 | if (!self.buttonsInspector) { 34 | self.buttonsInspector = [[FSObjectBrowserButtonsInspector alloc] init]; 35 | } 36 | [super runToolbarCustomizationPalette:sender]; 37 | [self.buttonsInspector activate]; 38 | } 39 | 40 | - (BOOL)worksWhenModal 41 | { 42 | // Since F-Script is often used as a debugging tool, we want it to 43 | // continue working even when some other window is being run modally 44 | return YES; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectFormatter.h: -------------------------------------------------------------------------------- 1 | /* FSObjectFormatter.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSObjectFormatter : NSFormatter { 8 | 9 | } 10 | 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectFormatter.m: -------------------------------------------------------------------------------- 1 | /* FSObjectFormatter.m Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import "FSObjectFormatter.h" 6 | #import "FSNSObject.h" 7 | #import "FSMiscTools.h" 8 | #import "Number_fscript.h" 9 | 10 | 11 | @implementation FSObjectFormatter 12 | 13 | - (NSString *)stringForObjectValue:(id)anObject 14 | // Precondition: [anObject isKindOfClass:[NSString class]] || [anObject isKindOfClass:[Number class]] 15 | { 16 | if ([anObject isKindOfClass:[NSNumber class]]) 17 | { 18 | return [NSString stringWithFormat:@"% 10g", [anObject doubleValue]]; 19 | } 20 | return anObject; 21 | } 22 | 23 | - (NSAttributedString *)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(NSDictionary *)attributes 24 | { 25 | if ([anObject isKindOfClass:[NSAttributedString class]]) return anObject; 26 | else return nil; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorBackgroundView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorBackgroundView.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 17/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FSObjectInspectorBackgroundView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorBackgroundView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorBackgroundView.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 17/11/2014. 6 | // 7 | // 8 | 9 | #import "FSObjectInspectorBackgroundView.h" 10 | 11 | @implementation FSObjectInspectorBackgroundView 12 | 13 | -(BOOL)allowsVibrancy { return YES; } 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorOptionsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorOptionsViewController.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 21/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FSObjectInspectorOptionsViewController : NSViewController 12 | @property (assign) IBOutlet NSArrayController *optionsArrayController; 13 | @property (copy,nonatomic) NSArray *optionItems; 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorOptionsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorOptionsViewController.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 21/11/2014. 6 | // 7 | // 8 | 9 | #import "FSObjectInspectorOptionsViewController.h" 10 | 11 | @interface FSObjectInspectorOptionsViewController () 12 | 13 | @end 14 | 15 | @implementation FSObjectInspectorOptionsViewController 16 | 17 | -(NSString *)nibName 18 | { 19 | return @"FSObjectInspectorOptionsViewController"; 20 | } 21 | 22 | -(NSBundle *)nibBundle 23 | { 24 | return [NSBundle bundleForClass:self.class]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorOutlineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorOutlineView.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 21/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FSObjectInspectorOutlineView : NSOutlineView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorOutlineView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorOutlineView.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 21/11/2014. 6 | // 7 | // 8 | 9 | #import "FSObjectInspectorOutlineView.h" 10 | 11 | @implementation FSObjectInspectorOutlineView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | } 18 | 19 | // Allow stepper views to work properly 20 | - (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event { 21 | return YES; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorViewController+NonArc.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorViewController+NonArc.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 18/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | #import "FSObjectInspectorViewController.h" 11 | 12 | @class FSArray, FSBlock; 13 | @interface FSObjectInspectorViewController (NonArc) 14 | - (void)applyBlock:(FSBlock*)block withObject:(id)selectedObject newValue:(id)value; 15 | - (BOOL)sendMessageTo:(id)receiver selectorString:(NSString*)selectorStr arguments:(FSArray*)arguments column:(NSUInteger)column putResultInMatrix:(NSMatrix*)matrix; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectInspectorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSObjectInspectorViewController.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 17/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class FSObjectInspectorViewModelItem; 12 | @class FSInterpreter; 13 | @class FSDetailedObjectInspector; 14 | 15 | @interface FSObjectInspectorViewController : NSViewController 16 | @property (assign) IBOutlet NSPathControl *viewPathControl; 17 | @property (assign) IBOutlet NSOutlineView *outlineView; 18 | @property (weak,nonatomic) FSDetailedObjectInspector *inspector; 19 | @property (strong,nonatomic) FSObjectInspectorViewModelItem *rootViewModelItem; 20 | @property (weak,nonatomic) FSObjectInspectorViewModelItem *selectedViewModelItem; 21 | @property (readonly,nonatomic) NSSize desiredSize; 22 | @property (strong,nonatomic) FSInterpreter *interpreter; 23 | @property (strong,nonatomic) NSMenu *viewPathMenu; 24 | @property (strong,nonatomic) NSArray *pathControlItems; 25 | -(IBAction)showColorPanel:(id)sender; 26 | -(IBAction)showOptionsPopover:(id)sender; 27 | -(IBAction)inspectAction:(id)sender; 28 | -(IBAction)viewPathClicked:(id)sender; 29 | @end 30 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectPointer.h: -------------------------------------------------------------------------------- 1 | /* FSObjectPointer.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSPointer.h" 5 | 6 | @interface FSObjectPointer : FSPointer 7 | { 8 | size_t count; 9 | } 10 | 11 | - (id)at:(id)i; 12 | - (id)at:(id)i put:(id)elem; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FSObjectPointerPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSObjectPointerPrivate.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSObjectPointer.h" 5 | 6 | @interface FSObjectPointer (Private) 7 | - (void) autoreleaseAll; 8 | - (id) initWithCPointer:(void *)p count:(size_t)c; // designated initializer 9 | - (NSArray *)memoryContent; 10 | - (void) retainAll; 11 | @end 12 | -------------------------------------------------------------------------------- /FScriptFramework/FSPattern.h: -------------------------------------------------------------------------------- 1 | /* FSPattern.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSArray; 7 | 8 | @interface FSPattern:NSObject 9 | { 10 | int deep; 11 | __strong int *level; 12 | unsigned levelCount; 13 | FSPattern *nextPattern; 14 | } 15 | 16 | + (id)patternWithDeep:(int)theDeep level:(FSArray *)theLevel nextPattern:(FSPattern*)theNextPattern; 17 | + (id)patternFromIntermediateRepresentation:(NSArray *)ap; 18 | 19 | - (id)initWithDeep:(int)theDeep level:(FSArray *)theLevel nextPattern:(FSPattern*)theNextPatter; 20 | - (int)deep; 21 | - (BOOL)isDoubleLoop; 22 | - (BOOL)isSimpleLoopOnReceiver; 23 | - (int *)level; 24 | - (unsigned int)levelCount; 25 | - (FSPattern *)nextPattern; 26 | - (void) setNextPattern:(FSPattern *)theNextPattern; 27 | 28 | - (void)dealloc; 29 | - (void)encodeWithCoder:(NSCoder *)coder; 30 | - (id)initWithCoder:(NSCoder *)coder; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /FScriptFramework/FSPilot.h: -------------------------------------------------------------------------------- 1 | /* FSPilot.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSPilot : NSObject 7 | { 8 | id name; 9 | id address; 10 | id salary; 11 | id age; 12 | } 13 | 14 | ////////////////////////////////// User methods //////////////////////////////// 15 | 16 | + (id) pilotWithName:(id)theName address:(id)theAddress salary:(id)theSalary; 17 | + (id) pilotWithName:(id)theName address:(id)theAddress salary:(id)theSalary age:(id)theAge; 18 | 19 | - (id) address; 20 | - (void) setAddress:(id)theAddress; 21 | - (id) age; 22 | - (void) setAge:(id)theAge; 23 | - (id) name; 24 | - (void) setName:(id)theName; 25 | - (id) salary; 26 | - (void) setSalary:(id)theSalary; 27 | 28 | - (void) sendMail:(NSString *)mailContent; 29 | 30 | ////////////////////////////////// Other methods //////////////////////////////// 31 | 32 | - (void)dealloc; 33 | - (NSString *)description; 34 | - (void)encodeWithCoder:(NSCoder *)aCoder; 35 | - (id)initWithCoder:(NSCoder *)aDecoder; 36 | - (id) initWithName:(id)theName address:(id)theAddress salary:(id)theSalary; 37 | - (id) initWithName:(id)theName address:(id)theAddress salary:(id)theSalary age:(id)theAge;; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FScriptFramework/FSPointer.h: -------------------------------------------------------------------------------- 1 | /* FSPointer.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import 6 | 7 | @class FSGenericPointer; 8 | @class FSObjectPointer; 9 | @class FSBoolean; 10 | 11 | @interface FSPointer : NSObject 12 | { 13 | NSUInteger retainCount; 14 | __strong void *cPointer; 15 | } 16 | 17 | + (FSGenericPointer *) allocateCollectable:(NSUInteger)size; 18 | + (FSGenericPointer *) allocateCollectable:(NSUInteger)size options:(NSUInteger)options; 19 | + (FSGenericPointer *) malloc:(size_t)size; 20 | + (FSObjectPointer *) objectPointer; 21 | + (FSObjectPointer *) objectPointer:(size_t)count; 22 | 23 | - (NSNumber *) address; 24 | - (void *) cPointer; 25 | - (BOOL) isEqual:(id)anObject; 26 | - (FSBoolean *)operator_equal:(id)operand; 27 | - (FSBoolean *)operator_tilde_equal:(id)operand; 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /FScriptFramework/FSPointerPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSPointerPrivate.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | @interface FSPointer (Private) 5 | - (id) initWithCPointer:(void *)p; // designated initializer 6 | @end 7 | 8 | extern void FSPointer_validateDereferencingWithSelector_index(FSPointer *s, SEL selector, id i); 9 | -------------------------------------------------------------------------------- /FScriptFramework/FSPredicateTextView.h: -------------------------------------------------------------------------------- 1 | /* FSPredicateTextView.h Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSPredicateTextView : NSTextView 8 | {} 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSPredicateTextView.m: -------------------------------------------------------------------------------- 1 | /* FSPredicateTextView.m Copyright (c) 2005-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSPredicateTextView.h" 5 | 6 | static NSAttributedString *predicatePrompt; 7 | 8 | @implementation FSPredicateTextView 9 | 10 | +(void)initialize 11 | { 12 | static BOOL initialized = NO; 13 | if (!initialized) 14 | { 15 | NSColor *txtColor = [NSColor grayColor]; 16 | NSDictionary *txtDict = [NSDictionary dictionaryWithObjectsAndKeys:txtColor, NSForegroundColorAttributeName, nil]; 17 | predicatePrompt = [[NSAttributedString alloc] initWithString:@" " attributes:txtDict]; 18 | } 19 | } 20 | 21 | - (BOOL)becomeFirstResponder 22 | { 23 | [self setNeedsDisplay:YES]; 24 | return [super becomeFirstResponder]; 25 | } 26 | 27 | - (void)drawRect:(NSRect)rect 28 | { 29 | [super drawRect:rect]; 30 | if ([[self string] isEqualToString:@""] && self != [[self window] firstResponder]) 31 | [predicatePrompt drawAtPoint:NSMakePoint(0,0)]; 32 | } 33 | 34 | - (BOOL)resignFirstResponder 35 | { 36 | [self setNeedsDisplay:YES]; 37 | return [super resignFirstResponder]; 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /FScriptFramework/FSReplacementForCoderForClass.h: -------------------------------------------------------------------------------- 1 | /* ReplacementForCoderForClass.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class NSString; 7 | 8 | @interface FSReplacementForCoderForClass : NSObject 9 | { 10 | NSString *className; 11 | } 12 | 13 | - (id)awakeAfterUsingCoder:(NSCoder *)aCoder; 14 | - (void)dealloc; 15 | - (void)encodeWithCoder:(NSCoder *)aCoder; 16 | - (id)initWithClass:(Class)theClass; 17 | - (id)initWithCoder:(NSCoder *)aDecoder; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FScriptFramework/FSReplacementForCoderForNilInArray.h: -------------------------------------------------------------------------------- 1 | // ReplacementForCoderForNilInArray.h Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | @interface FSReplacementForCoderForNilInArray : NSObject 7 | {} 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /FScriptFramework/FSReplacementForCoderForNilInArray.m: -------------------------------------------------------------------------------- 1 | // ReplacementForCoderForNilInArray.m Copyright (c) 2003-2009 Philippe Mougin. 2 | // This software is open source. See the license. 3 | 4 | #import "FSReplacementForCoderForNilInArray.h" 5 | 6 | void __attribute__ ((constructor)) initializeFSReplacementForCoderForNilInArray(void) 7 | { 8 | [NSKeyedUnarchiver setClass:[FSReplacementForCoderForNilInArray class] forClassName:@"ReplacementForCoderForNilInArray"]; 9 | [NSUnarchiver decodeClassName:@"ReplacementForCoderForNilInArray" asClassName:@"FSReplacementForCoderForNilInArray"]; 10 | } 11 | 12 | @implementation FSReplacementForCoderForNilInArray 13 | 14 | - (void)encodeWithCoder:(NSCoder *)encoder {} 15 | 16 | - (id)initWithCoder:(NSCoder *)decoder { return [super init]; } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FScriptFramework/FSReturnSignal.h: -------------------------------------------------------------------------------- 1 | /* FSReturnSignal.h Copyright (c) 2006 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSBlock, FSSymbolTable; 7 | 8 | @interface FSReturnSignal : NSException 9 | { 10 | FSBlock *block; 11 | FSSymbolTable *symbolTable; 12 | id result; 13 | } 14 | 15 | + (FSReturnSignal *)returnSignalWithBlock:(FSBlock *)theBlock result:(id)theResult; 16 | + (FSReturnSignal *)returnSignalWithSymbolTable:(FSSymbolTable *)theSymbolTable result:(id)theResult; 17 | 18 | - (FSBlock *) block; 19 | - (void) dealloc; 20 | - (FSReturnSignal *) initWithBlock:(FSBlock *)theBlock result:(id)theResult; 21 | - (FSReturnSignal *) initWithSymbolTable:(FSSymbolTable *)theSymbolTable result:(id)theResult; 22 | 23 | - (id) result; 24 | - (FSSymbolTable *)symbolTable; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/FSReturnSignal.m: -------------------------------------------------------------------------------- 1 | /* FSReturnSignal.m Copyright (c) 2006 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSReturnSignal.h" 5 | 6 | @implementation FSReturnSignal 7 | 8 | + (FSReturnSignal *)returnSignalWithBlock:(FSBlock *)theBlock result:(id)theResult 9 | { 10 | return [[[self alloc] initWithBlock:theBlock result:(id)theResult] autorelease]; 11 | } 12 | 13 | + (FSReturnSignal *)returnSignalWithSymbolTable:(FSSymbolTable *)theSymbolTable result:(id)theResult 14 | { 15 | return [[[self alloc] initWithSymbolTable:theSymbolTable result:(id)theResult] autorelease]; 16 | } 17 | 18 | - (FSBlock *)block 19 | { 20 | return block; 21 | } 22 | 23 | - (void) dealloc 24 | { 25 | [block release]; 26 | [symbolTable release]; 27 | [result release]; 28 | [super dealloc]; 29 | } 30 | 31 | - (FSReturnSignal *)initWithBlock:(FSBlock *)theBlock result:(id)theResult 32 | { 33 | self = [super initWithName:@"FSReturnSignal" reason:@"" userInfo:nil]; 34 | if (self != nil) 35 | { 36 | block = [theBlock retain]; 37 | result = [theResult retain]; 38 | } 39 | return self; 40 | } 41 | 42 | - (FSReturnSignal *) initWithSymbolTable:(FSSymbolTable *)theSymbolTable result:(id)theResult 43 | { 44 | self = [super initWithName:@"FSReturnSignal" reason:@"" userInfo:nil]; 45 | if (self != nil) 46 | { 47 | symbolTable = [theSymbolTable retain]; 48 | result = [theResult retain]; 49 | } 50 | return self; 51 | } 52 | 53 | - (id) result 54 | { 55 | return result; 56 | } 57 | 58 | - (FSSymbolTable *)symbolTable 59 | { 60 | return symbolTable; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /FScriptFramework/FSSystemPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSSystemPrivate.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSSystem.h" 5 | 6 | @interface FSSystem (FSSystemPrivate) 7 | 8 | - (FSInterpreter *)interpreter; // Will return nil if the associated interpreter no longer exists 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSTestObjCClass1.h: -------------------------------------------------------------------------------- 1 | /* FSTestObjCClass1.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSTestObjCClass1 : NSObject 8 | { 9 | _Bool iv__Bool; 10 | char iv_char; 11 | unsigned char iv_unsigned_char; 12 | short iv_short; 13 | unsigned short iv_unsigned_short; 14 | int iv_int; 15 | unsigned int iv_unsigned_int; 16 | long iv_long; 17 | unsigned long iv_unsigned_long; 18 | long long iv_long_long; 19 | unsigned long long iv_unsigned_long_long; 20 | id iv_id; 21 | Class iv_Class; 22 | float iv_float; 23 | double iv_double; 24 | SEL iv_SEL; 25 | NSRange iv_NSRange; 26 | NSSize iv_NSSize; 27 | CGSize iv_CGSize; 28 | NSPoint iv_NSPoint; 29 | CGPoint iv_CGPoint; 30 | NSRect iv_NSRect; 31 | CGRect iv_CGRect; 32 | void * iv_voidPtr; 33 | 34 | NSMutableString *deallocationProof; 35 | } 36 | 37 | - (id) init; 38 | - (void) dealloc; 39 | - (id)tags; 40 | - (void) setDeallocationProof:(NSMutableString *)proof; 41 | - (void *) voidPtr; 42 | 43 | @end -------------------------------------------------------------------------------- /FScriptFramework/FSTestObjCClass2.h: -------------------------------------------------------------------------------- 1 | /* FSTestObjCClass2.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSTestObjCClass1.h" 5 | 6 | @interface FSTestObjCClass2 : FSTestObjCClass1 7 | { 8 | _Bool iv__Bool2; 9 | char iv_char2; 10 | unsigned char iv_unsigned_char2; 11 | short iv_short2; 12 | unsigned short iv_unsigned_short2; 13 | int iv_int2; 14 | unsigned int iv_unsigned_int2; 15 | long iv_long2; 16 | unsigned long iv_unsigned_long2; 17 | long long iv_long_long2; 18 | unsigned long long iv_unsigned_long_long2; 19 | id iv_id2; 20 | Class iv_Class2; 21 | float iv_float2; 22 | double iv_double2; 23 | SEL iv_SEL2; 24 | NSRange iv_NSRange2; 25 | NSSize iv_NSSize2; 26 | CGSize iv_CGSize2; 27 | NSPoint iv_NSPoint2; 28 | CGPoint iv_CGPoint2; 29 | NSRect iv_NSRect2; 30 | CGRect iv_CGRect2; 31 | void * iv_voidPtr2; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /FScriptFramework/FSTranscript.h: -------------------------------------------------------------------------------- 1 | /* FSTranscript.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FSTranscript : NSObject { 7 | 8 | } 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /FScriptFramework/FSTranscript.m: -------------------------------------------------------------------------------- 1 | /* FSTranscript.h Copyright (c) 2008-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSTranscript.h" 5 | 6 | static FSTranscript *sharedTranscript = nil; 7 | 8 | @implementation FSTranscript 9 | 10 | + (void)initialize 11 | { 12 | static BOOL tooLate = NO; 13 | if ( !tooLate ) 14 | { 15 | tooLate = YES; 16 | sharedTranscript = [[FSTranscript alloc] init]; 17 | } 18 | } 19 | 20 | + (FSTranscript *)sharedTranscript 21 | { 22 | return sharedTranscript; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FScriptFramework/FSUnarchiver.h: -------------------------------------------------------------------------------- 1 | /* FSUnarchiver.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSSymbolTable; 7 | 8 | @interface FSUnarchiver:NSUnarchiver 9 | { 10 | FSSymbolTable *loaderEnvironmentSymbolTable; 11 | FSSymbolTable *symbolTableForCompiledCodeNode; 12 | NSString *source; 13 | } 14 | 15 | - (void)dealloc; 16 | - (id)initForReadingWithData:(NSData *)theData loaderEnvironmentSymbolTable:(FSSymbolTable*)theLoaderEnvironmentSymbolTable symbolTableForCompiledCodeNode:theSymbolTableForCompiledCodeNode; 17 | - (FSSymbolTable *)loaderEnvironmentSymbolTable; 18 | - (void)setSource:(NSString*)theSource; 19 | - (void)setSymbolTableForCompiledCodeNode:(FSSymbolTable *)theSymbolTableForCompiledCodeNode; 20 | - (NSString *)source; 21 | - (FSSymbolTable *)symbolTableForCompiledCodeNode; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FScriptFramework/FSUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // FSUtils.h 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 18/11/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FSUtils : NSObject 12 | 13 | @end 14 | 15 | 16 | static inline NSRect rectWithWidthAndHeight(CGFloat width, CGFloat height) 17 | { 18 | return NSMakeRect(0.0, 0.0, width, height); 19 | } 20 | static inline NSRect rectWithSize(NSSize size) 21 | { 22 | return NSMakeRect(0.0, 0.0, size.width, size.height); 23 | } 24 | 25 | static inline NSSize addSizes(NSSize size1, NSSize size2) 26 | { 27 | return NSMakeSize(size1.width + size2.width, size1.height + size2.height); 28 | } 29 | @class FSInterpreterResult; 30 | BOOL checkInterpreterResult(FSInterpreterResult *result); -------------------------------------------------------------------------------- /FScriptFramework/FSUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // FSUtils.m 3 | // FScript 4 | // 5 | // Created by Anthony Dervish on 18/11/2014. 6 | // 7 | // 8 | 9 | #import "FSUtils.h" 10 | #import "FSInterpreterResult.h" 11 | #import 12 | 13 | @implementation FSUtils 14 | @end 15 | 16 | BOOL checkInterpreterResult(FSInterpreterResult* interpreterResult) 17 | { 18 | if (![interpreterResult isOK]) { 19 | NSRunAlertPanel(@"Error", [interpreterResult errorMessage], @"OK", nil, nil, nil); 20 | [interpreterResult inspectBlocksInCallStack]; 21 | return NO; 22 | } 23 | return YES; 24 | } 25 | -------------------------------------------------------------------------------- /FScriptFramework/FSVoid.h: -------------------------------------------------------------------------------- 1 | /* FSVoid.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSNSObject.h" 5 | 6 | @interface FSVoid : NSObject 7 | 8 | + (FSVoid*) fsVoid; 9 | 10 | - (id)autorelease; 11 | - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder; 12 | - (id) copy; 13 | - (id) copyWithZone:(NSZone *)zone; 14 | - (NSString *) printString; 15 | - (void) release; 16 | - (id) retain; 17 | - (NSUInteger) retainCount; 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /FScriptFramework/FSVoid.m: -------------------------------------------------------------------------------- 1 | /* FSVoid.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | 5 | #import "FSVoid.h" 6 | #import "build_config.h" 7 | 8 | FSVoid *fsVoid; 9 | 10 | @implementation FSVoid 11 | 12 | + (FSVoid *)fsVoid 13 | { 14 | return fsVoid; 15 | } 16 | 17 | + (void)initialize 18 | { 19 | static BOOL tooLate = NO; 20 | if ( !tooLate ) 21 | { 22 | fsVoid = [[FSVoid alloc] init]; 23 | tooLate = YES; 24 | } 25 | } 26 | 27 | -(id)autorelease {return self;} 28 | 29 | - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder 30 | { 31 | [self release]; 32 | return fsVoid; 33 | } 34 | 35 | -(id)copy {return self;} 36 | 37 | -(id)copyWithZone:(NSZone *)zone {return self;} 38 | 39 | -(void)encodeWithCoder:(NSCoder *)coder {} 40 | 41 | -(id)initWithCoder:(NSCoder *)coder {self = [super init]; return self;} 42 | 43 | - (NSString *) printString {return [NSMutableString stringWithString:@""]; } 44 | 45 | - (void) release {} 46 | 47 | - (id) retain {return self;} 48 | 49 | - (NSUInteger) retainCount {return UINT_MAX;} 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FScriptFramework/FSVoidPrivate.h: -------------------------------------------------------------------------------- 1 | /* FSVoidPrivate.h created by Philippe Mougin on Mon 15-May-2000 */ 2 | /* FSVoidPrivate.h Copyright (c) 2000 Philippe Mougin. */ 3 | /* This software is open source. See the license. */ 4 | 5 | #import "FSVoid.h" 6 | 7 | extern FSVoid *fsVoid; 8 | -------------------------------------------------------------------------------- /FScriptFramework/FSWorksWhenModalWindow.h: -------------------------------------------------------------------------------- 1 | /* FSWorksWhenModalWindow.h Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | 7 | @interface FSWorksWhenModalWindow : NSWindow 8 | {} 9 | 10 | - (BOOL) worksWhenModal; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /FScriptFramework/FSWorksWhenModalWindow.m: -------------------------------------------------------------------------------- 1 | /* FSWorksWhenModalWindow.m Copyright (c) 2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSWorksWhenModalWindow.h" 5 | 6 | 7 | @implementation FSWorksWhenModalWindow 8 | 9 | - (BOOL) worksWhenModal; 10 | { 11 | return YES; 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/FScript.h: -------------------------------------------------------------------------------- 1 | /* FScript.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | // This file import all F-Script public headers you need 5 | // in order to work with the F-Script framework 6 | 7 | 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | #import 41 | 42 | // For backward compatibility with F-Script 1.x 43 | #import 44 | #import 45 | #import 46 | -------------------------------------------------------------------------------- /FScriptFramework/FScriptFunctions.h: -------------------------------------------------------------------------------- 1 | /* FScriptFunctions.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | extern NSString *FSExecutionErrorException; 7 | extern NSString *FSUserAbortedException; 8 | 9 | void FSVerifClassArgs(NSString *methodName, NSInteger nbArgrs, ...); 10 | void FSVerifClassArgsNoNil(NSString *methodName, NSInteger nbArgrs, ...); 11 | 12 | void FSArgumentError(id argument, NSInteger index, NSString *expectedClass, NSString *methodName) __attribute__ ((noreturn)); 13 | 14 | void FSExecError(NSString *errorStr) __attribute__ ((noreturn)); 15 | 16 | void FSUserAborted(void) __attribute__ ((noreturn)); 17 | -------------------------------------------------------------------------------- /FScriptFramework/FScriptMenuItem.h: -------------------------------------------------------------------------------- 1 | /* FScriptMenuItem.h Copyright (c) 2004-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @class FSInterpreterView; 7 | 8 | @interface FScriptMenuItem : NSMenuItem 9 | { 10 | IBOutlet FSInterpreterView *interpreterView; 11 | IBOutlet NSPanel *preferencePanel; 12 | IBOutlet NSTextField *fontSizeUI; 13 | IBOutlet NSButton *automaticallyIntrospectDeclaredPropertiesUI; 14 | } 15 | 16 | - (FSInterpreterView *)interpreterView; 17 | - (IBAction)openObjectBrowser:(id)sender; 18 | - (IBAction)showConsole:(id)sender; 19 | - (IBAction)showPreferencePanel:(id)sender; 20 | - (IBAction)updatePreference:(id)sender; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /FScriptFramework/FScriptPreferences.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 677 7 | IBLastKnownRelativeProjectPath 8 | ../FScript.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 25 14 | 15 | IBSystem Version 16 | 9G55 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /FScriptFramework/FScriptPreferences.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/FScriptPreferences.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/FScriptTextView.h: -------------------------------------------------------------------------------- 1 | /* FScriptTextView.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | 6 | @interface FScriptTextView : NSTextView { 7 | 8 | } 9 | 10 | + (void)initialize; 11 | 12 | + (void)registerClassNameForCompletion: (NSString *)className; 13 | + (void)registerMethodNameForCompletion:(NSString *)methodName; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/MessagePatternCodeNode.h: -------------------------------------------------------------------------------- 1 | /* MessagePatternCodeNode.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "CompiledCodeNode.h" 5 | 6 | @class FSPattern; 7 | 8 | @interface MessagePatternCodeNode: CompiledCodeNode 9 | { 10 | @public 11 | FSPattern *pattern; 12 | } 13 | 14 | - (void)dealloc; 15 | - (void)encodeWithCoder:(NSCoder *)coder; 16 | - (id)initWithCoder:(NSCoder *)coder; 17 | - (id)setMessageWithReceiver:(CompiledCodeNode *) theReceiver 18 | selector:(NSString *) theSelector 19 | operatorSymbols:(NSString *) theOperatorSymbols 20 | pattern:(FSPattern *) thePattern; 21 | 22 | - (FSPattern*)pattern; 23 | 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FScriptFramework/MessagePatternCodeNode.m: -------------------------------------------------------------------------------- 1 | /* MessagePatternCodeNode.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "MessagePatternCodeNode.h" 5 | #import 6 | #import "FSNumber.h" 7 | #import "FSPattern.h" 8 | #import "FSArray.h" 9 | 10 | @implementation MessagePatternCodeNode 11 | 12 | -(void)dealloc 13 | { 14 | [pattern release]; 15 | [super dealloc]; 16 | } 17 | 18 | - (void)encodeWithCoder:(NSCoder *)coder 19 | { 20 | [super encodeWithCoder:coder]; 21 | if ([coder allowsKeyedCoding]) 22 | { 23 | [coder encodeObject:pattern forKey:@"pattern"]; 24 | } 25 | else 26 | { 27 | [coder encodeObject:pattern]; 28 | } 29 | } 30 | 31 | - (id)initWithCoder:(NSCoder *)coder 32 | { 33 | self = [super initWithCoder:coder]; 34 | if ([coder allowsKeyedCoding]) 35 | { 36 | pattern = [[coder decodeObjectForKey:@"pattern"] retain]; 37 | } 38 | else 39 | { 40 | pattern = [[coder decodeObject] retain]; 41 | } 42 | return self; 43 | } 44 | 45 | - (id)setMessageWithReceiver:(CompiledCodeNode *) theReceiver 46 | selector:(NSString *) theSelector 47 | operatorSymbols:(NSString*) theOperatorSymbols 48 | pattern:(FSPattern *) thePattern 49 | { 50 | pattern = [thePattern retain]; 51 | return [super setMessageWithReceiver:theReceiver selector:theSelector operatorSymbols:theOperatorSymbols]; 52 | } 53 | 54 | - (FSPattern *)pattern 55 | { return pattern; } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FScriptFramework/NumberPrivate.h: -------------------------------------------------------------------------------- 1 | /* NumberPrivate.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | extern id FSNumberClass; 5 | extern id NSNumberClass; 6 | 7 | // MACROS 8 | #define VERIF_OP_NSNUMBER(METHOD) {if (![operand isKindOfClass:NSNumberClass]) FSArgumentError(operand,1,@"NSNumber",METHOD);} 9 | -------------------------------------------------------------------------------- /FScriptFramework/Pointer.h: -------------------------------------------------------------------------------- 1 | /* Pointer.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import 5 | #import 6 | 7 | @interface Pointer : NSObject 8 | { 9 | void *cPointer; 10 | char *type; 11 | char fsEncodedType; 12 | } 13 | 14 | - (BOOL) isEqual:anObject; 15 | 16 | 17 | 18 | /////////////////////////// USER METHODS //////////////////////////// 19 | 20 | + (Pointer *) malloc:(size_t)size; 21 | 22 | - (Pointer *) asPointerForType:(NSString *)theType; 23 | - (id) at:(id)i; 24 | - (id) at:(id)i put:(id)elem; 25 | - (id) clone __attribute__((deprecated)); 26 | - (void) free; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FScriptFramework/PointerPrivate.h: -------------------------------------------------------------------------------- 1 | /* PointerPrivate.h Copyright (c) 2002-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "Pointer.h" 5 | 6 | @interface Pointer(PointerPrivate) 7 | 8 | + (Pointer *) pointerWithCPointer:(void *)p type:(const char *)t; // t is copied. 9 | - (id) copyWithZone:(NSZone *)zone; 10 | - (void *) cPointer; 11 | - (Pointer *) initWithCPointer:(void *)p type:(const char *)t; // t is copied. 12 | - (char *) pointerType; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FScriptFramework/Resources/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/Resources/view.png -------------------------------------------------------------------------------- /FScriptFramework/Resources/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/Resources/window.png -------------------------------------------------------------------------------- /FScriptFramework/Space.h: -------------------------------------------------------------------------------- 1 | /* Space.h Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "FSExecutor.h" 5 | #import "FSNSObject.h" 6 | 7 | @class FSSymbolTable; 8 | 9 | @interface Space:NSObject 10 | { 11 | @public 12 | FSSymbolTable *localSymbolTable; 13 | } 14 | 15 | 16 | //////////////////////// SYSTEM METHODS //////////////////////////// 17 | 18 | 19 | 20 | 21 | - (void)dealloc; 22 | - (void)encodeWithCoder:(NSCoder *)coder; 23 | - (id)initSymbolTableLocale:(FSSymbolTable*)symb_loc; // Will point to symb_loc 24 | - (id)initWithCoder:(NSCoder *)coder; 25 | - (FSSymbolTable*)localSymbolTable; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FScriptFramework/Space.m: -------------------------------------------------------------------------------- 1 | /* Space.m Copyright (c) 1998-2009 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "Space.h" 5 | #import "FScriptFunctions.h" 6 | #import 7 | #import "FSUnarchiver.h" 8 | 9 | @implementation Space 10 | 11 | //////////////////////// USER METHODS //////////////////////////// 12 | 13 | /*- (void) inspect 14 | { 15 | [SpaceInspector spaceInspectorWithSpace:self]; 16 | } 17 | */ 18 | 19 | //////////////////////// SYSTEM METHODS //////////////////////////// 20 | 21 | - (void)dealloc 22 | { 23 | //printf("\n Space dealloc\n"); 24 | [localSymbolTable release]; 25 | [super dealloc]; 26 | } 27 | 28 | - (void)encodeWithCoder:(NSCoder *)coder 29 | { 30 | if ([coder allowsKeyedCoding]) 31 | { 32 | [coder encodeObject:localSymbolTable forKey:@"localSymbolTable"]; 33 | } 34 | else 35 | { 36 | [coder encodeObject:localSymbolTable]; 37 | } 38 | } 39 | 40 | - (id)initWithCoder:(NSCoder *)coder 41 | { 42 | self = [super init]; 43 | if ([coder allowsKeyedCoding]) 44 | { 45 | localSymbolTable = [[coder decodeObjectForKey:@"localSymbolTable"] retain]; 46 | } 47 | else 48 | { 49 | localSymbolTable = [[coder decodeObject] retain]; 50 | } 51 | return self; 52 | } 53 | 54 | - (id)initSymbolTableLocale:(FSSymbolTable*)symb_loc 55 | { 56 | if ((self = [super init])) 57 | { 58 | localSymbolTable = [symb_loc retain]; 59 | return self; 60 | } 61 | return nil; 62 | } 63 | 64 | - (FSSymbolTable*)localSymbolTable 65 | { return localSymbolTable;} 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /FScriptFramework/TestFS.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef struct {int a; int b;} fsstruct; 4 | 5 | @interface TestFS : NSObject 6 | { 7 | NSString *str1, *str2, *str3, *str4; 8 | NSInteger total; 9 | float p_p1; 10 | BOOL p_toto; 11 | id p_tutu; 12 | fsstruct p_zozo; 13 | double ddd; 14 | } 15 | 16 | @property float p1; 17 | @property BOOL toto; 18 | //@property fsstruct zozo; 19 | @property(retain) id tutu; 20 | //@property id dynamicProperty; 21 | 22 | @end 23 | 24 | 25 | @interface TestFSSub : TestFS 26 | { 27 | } 28 | @end -------------------------------------------------------------------------------- /FScriptFramework/build.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/build.tiff -------------------------------------------------------------------------------- /FScriptFramework/build_config.h: -------------------------------------------------------------------------------- 1 | /* build_config.h Copyright (c) 1999 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | /* Some parameters in order to control the build process of the F-Script framework itself */ 5 | 6 | 7 | // In order to force the interpreter to always use NSInvocation when sending 8 | // a F-Script message to an object. 9 | //#define MESSAGING_USES_NSINVOCATION 10 | 11 | -------------------------------------------------------------------------------- /FScriptFramework/constantsDictionary: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/constantsDictionary -------------------------------------------------------------------------------- /FScriptFramework/genObjInspector.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/genObjInspector.nib/keyedobjects.nib -------------------------------------------------------------------------------- /FScriptFramework/license.txt: -------------------------------------------------------------------------------- 1 | April 26, 2010 2 | 3 | This is the legal notice for F-Script: 4 | -------------------------------------- 5 | 6 | F-Script. Copyright (c) 1997, 2010, Philippe Mougin. All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | - The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17 | 18 | -------------------------------------------------------------------------------- /FScriptFramework/run.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptFramework/run.tiff -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/BigBrowserView.h: -------------------------------------------------------------------------------- 1 | // BigBrowserView.h Copyright 2000 Philippe Mougin. 2 | // This software is Open Source. See the license. 3 | 4 | #import "build_config.h" 5 | 6 | #ifdef BUILD_WITH_APPKIT 7 | 8 | #import 9 | #import 10 | 11 | @class FSInterpreter; 12 | 13 | 14 | @interface BigBrowserView : NSView 15 | { 16 | NSArray *rootObject; 17 | BOOL isDisabled; // When the user is entering the arguments, we should 18 | // disable the user interaction with the BigBrowserView 19 | FSInterpreter *interpreter; 20 | NSWindow *argumentsWindow; 21 | NSBrowser *b1; 22 | NSBrowser *b2; 23 | BOOL twoLevelsEnabled; 24 | } 25 | 26 | -(id) initWithFrame:(NSRect)frameRect; 27 | -(void) setInterpreter:(FSInterpreter *)theInterpreter; 28 | -(void) setRootObject:(NSArray *)theRootObject; 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/ExecutionControl.h: -------------------------------------------------------------------------------- 1 | /* ExecutionControl.h Copyright (c) 1998-2001 Philippe Mougin. */ 2 | /* This software is Open Source. See the license. */ 3 | 4 | #import "FSNSObject.h" 5 | 6 | @class ExecEngine; 7 | @class Block; 8 | 9 | @interface ExecutionControl : NSObject 10 | { 11 | ExecEngine *execEngine; 12 | Block *block; 13 | } 14 | 15 | + executionControlWithExecEngine:(ExecEngine *)e block:(Block*)b; 16 | + (void)initialize; 17 | 18 | - copy; 19 | - copyWithZone:(NSZone *)zone; 20 | - (void)dealloc; 21 | - (void)encodeWithCoder:(NSCoder *)aCoder; 22 | - (ExecEngine *)execEngine; 23 | - (void)executionDidEnd; 24 | - initWithExecEngine:(ExecEngine *)e block:(Block*)b; 25 | - (id)initWithCoder:(NSCoder *)aDecoder; 26 | 27 | ///////////////////////////////// USER METHODS //////////////////////// 28 | 29 | - (Block*) block; 30 | - (ExecutionControl*) clone; 31 | - (ExecutionControl*) dup; 32 | - (void) return; 33 | - (void) return:(id)rv; 34 | - (void)setValue:(id)operand2; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/NSBitmapImageRepFScriptHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBitmapImageRepFScriptHelper.h 3 | // NSBitmapImageRepFScriptHelper 4 | // 5 | // Created by Philippe Mougin on Thu Jun 12 2003-2004. 6 | // Copyright (c) 2003-2004 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSBitmapImageRep(NSBitmapImageRepFScriptHelper) 13 | 14 | -(NSArray *)bitmapDataAsArray; 15 | -(void)setBitmapDataFromArray:(NSArray *)bitmapArray; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/NSBrowserBugFix.h: -------------------------------------------------------------------------------- 1 | /* NSBrowserBugFix.h Copyright (c) 2000 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | // Provide a replacement for the buggy setEnabled method of NSBrowser 5 | 6 | #import 7 | #import 8 | 9 | @interface NSBrowser(NSBrowserBugFix) 10 | 11 | - (void) replacementForBuggySetEnabled:(BOOL)shouldEnable; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/NSBrowserBugFix.m: -------------------------------------------------------------------------------- 1 | /* NSBrowserBugFix.m Copyright (c) 2000 Philippe Mougin. */ 2 | /* This software is open source. See the license. */ 3 | 4 | #import "NSBrowserBugFix.h" 5 | 6 | @implementation NSBrowser(NSBrowserBugFix) 7 | 8 | - (void) replacementForBuggySetEnabled:(BOOL)shouldEnable 9 | { 10 | NSInteger i,nb; 11 | for (i = 0, nb = [self lastColumn]+1; i < nb; i++) [[self matrixInColumn:i] setEnabled:shouldEnable]; 12 | [self display]; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/SpaceInspector.h: -------------------------------------------------------------------------------- 1 | /* SpaceInspector.h Copyright 1998,1999 Philippe Mougin. */ 2 | /* This software is Open Source. See the license. */ 3 | 4 | #import "Space.h" 5 | #import "SymbolTableView.h" 6 | 7 | @class NSWindow; 8 | 9 | @interface SpaceInspector:NSObject 10 | { 11 | Space *inspectedObj; 12 | NSWindow *window; // outlet 13 | SymbolTableView *localView; // outlet 14 | } 15 | 16 | //////// USER METHODS 17 | 18 | + spaceInspectorWithSpace:(Space*)space; 19 | 20 | - (void) activate; 21 | 22 | ///////// SYSTEM METHOD 23 | 24 | - (void) dealloc; 25 | - initWithSpace:(Space*)space; 26 | 27 | - (void)windowWillClose:(NSNotification *)aNotification; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/SpaceInspector.m: -------------------------------------------------------------------------------- 1 | /* SpaceInspector.m Copyright 1998,1999 Philippe Mougin. */ 2 | /* This software is Open Source. See the license. */ 3 | 4 | #import "SpaceInspector.h" 5 | #import "SymbolTableView.h" 6 | #import 7 | #import "String.h" 8 | #import 9 | 10 | @implementation SpaceInspector 11 | 12 | //////// USER METHODS 13 | 14 | + spaceInspectorWithSpace:(Space*)space 15 | { 16 | return [[[self alloc] initWithSpace:space] autorelease]; 17 | } 18 | 19 | - (void) activate 20 | { 21 | if (!window) 22 | { 23 | [NSBundle loadNibNamed:@"spaceInspector.nib" owner:self]; 24 | [localView setModel:[inspectedObj localSymbolTable]]; 25 | [self retain]; // We are the window delegate and thus we must stay alaive at least as long as the window. But the delegate is not retained, so we do put a retain here // TODO_TAG 26 | } 27 | [window makeKeyAndOrderFront:self]; 28 | } 29 | 30 | ////////////// OTHER METHODS 31 | 32 | - (void)dealloc 33 | { 34 | //printf("\n SpaceInspector dealloc\n"); 35 | assert(window == nil); 36 | [inspectedObj release]; 37 | [super dealloc]; 38 | } 39 | 40 | - initWithSpace:(Space*)space 41 | { 42 | assert([space isKindOfClass:[Space class]]); 43 | if ([super init]) 44 | { 45 | inspectedObj = [space retain]; 46 | window = nil; 47 | [self activate]; 48 | 49 | return self; 50 | } 51 | return nil; 52 | } 53 | 54 | - (void)windowWillClose:(NSNotification *)aNotification 55 | { 56 | [window setDelegate:nil]; 57 | window = nil; 58 | //[self release]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/StringPrivate.h: -------------------------------------------------------------------------------- 1 | /* StringPrivate.h Copyright 1998,1999 Philippe Mougin. */ 2 | /* This software is Open Source. See the license. */ 3 | 4 | ////////////// MACROS 5 | 6 | #define VERIF_OP2_STRING(METHOD) {if (![operand2 isKindOfClass:[String class]]) FSArgumentError(operand2,1,@"String",METHOD);} 7 | -------------------------------------------------------------------------------- /FScriptFramework/unusedCode/SymbolTableView.h: -------------------------------------------------------------------------------- 1 | /* SymbolTableView.h Copyright 1998,1999 Philippe Mougin. */ 2 | /* This software is Open Source. See the license. */ 3 | 4 | #import 5 | #import "SymbolTable.h" 6 | #import 7 | 8 | @interface SymbolTableView:NSBrowser 9 | { 10 | SymbolTable *model; 11 | BOOL isValid; 12 | } 13 | 14 | - (BOOL)browser:(NSBrowser *)sender isColumnValid:(NSInteger)column; 15 | - (void)browser:(NSBrowser *)sender createRowsForColumn:(NSInteger)column inMatrix:(NSMatrix *)matrix; 16 | - (void)dealloc; 17 | - (id)initWithFrame:(NSRect)frameRect; 18 | - (void)setModel:(SymbolTable *)theModel; 19 | - update:(NSNotification*)notification; 20 | 21 | - rowSelected:sender; 22 | 23 | @end -------------------------------------------------------------------------------- /FScriptIBPlugin/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/FScriptIBPlugin/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Info-FSTest1_2.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | FSTest1 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 0.0.1d1 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Info-FScriptFramework.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | FScript 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | org.fscript.fscriptframework 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | F-Script Framework 19 | CFBundlePackageType 20 | FMWK 21 | CFBundleShortVersionString 22 | 2.3 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 2.3 27 | 28 | 29 | -------------------------------------------------------------------------------- /JGAdditions/FSEvalCommand.h: -------------------------------------------------------------------------------- 1 | // FSEvalScriptCommand.h Copyright (c) 2002 Joerg Garbers. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | 6 | 7 | @interface FSEvalCommand : NSScriptCommand { 8 | 9 | } 10 | - (id)performDefaultImplementation; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /JGAdditions/FSObjectBrowserToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // DistributorToolbar.h 3 | // RubatoFrameworks 4 | // 5 | // FSObjectBrowserToolbar.h Copyright (c) 2002 Joerg Garbers. 6 | // This software is open source. See the license. 7 | 8 | #import 9 | #import "FSObjectBrowserView.h" 10 | 11 | @interface FSObjectBrowserView (ToolbarController) 12 | 13 | - (BOOL)doSetupToolbar; 14 | - (BOOL)doSetupOldToolbar; 15 | 16 | - (void) setupToolbarWithWindow:(NSWindow *)window; 17 | - (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted; 18 | - (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar; 19 | - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar; 20 | - (void)toolbarDidRemoveItem:(NSNotification *)notification; 21 | 22 | // There will be the same Menu for all Windows. It contains only titles, no targets. 23 | // [self is called with customBlockMenuAction:sender] 24 | // self uses title to identify a block, which must be defined in its interpreter. 25 | // (can be different for different interpreters) 26 | // The result is: [block value], which should have side effects. 27 | // Example: Type this in Interpreter window: 28 | // accumulator:={}. collectSelection := [:browser | accumulator addObject:(browser selectedObject)]. FSObjectBrowserView addCustomBlockMenuIdentifier:'collectSelection'. 29 | 30 | + (NSMenu *) customBlockMenu; 31 | + (void) addCustomBlockMenuIdentifier:(NSString *)blockIdentifier; 32 | + (void) removeCustomBlockMenuIdentifier:(NSString *)blockIdentifier; 33 | - (void) customBlockMenuAction:(id)sender; 34 | @end 35 | -------------------------------------------------------------------------------- /JGAdditions/FSServicesProvider.h: -------------------------------------------------------------------------------- 1 | // FSServicesProvider.h Copyright (c) 2002 Joerg Garbers. 2 | // This software is open source. See the license. 3 | 4 | #import 5 | @class NSPasteboard; 6 | 7 | @protocol InterpreterViewProvider 8 | -(id)interpreterView; 9 | @end 10 | 11 | @interface FSServicesProvider : NSObject 12 | { 13 | id interpreterViewProvider; // must respond to -(id)interpreterView; 14 | } 15 | + (id)globalServicesProvider; 16 | + (void)updateDynamicServices; 17 | - (id)initWithFScriptInterpreterViewProvider:(id)controller; 18 | // convenience for registering distributed objects and Services 19 | - (id)interpreterViewProvider; 20 | - (void)registerExports; 21 | // distributed objects 22 | - (void)registerServerConnection:(NSString *)connectionName; 23 | // helpers 24 | - (void)doLog; 25 | //- (void)putCommand:(NSString *)command parserMode:(T_parser_mode)mode useCurrent:(BOOL)useCurrent; 26 | - (NSString *)execute:(NSString *)command; // also used by FSEvalCommand 27 | // services 28 | - (void)registerServicesProvider; 29 | - (void)putCommand:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 30 | - (void)execute:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 31 | 32 | - (NSString *)executeText:(NSString *)commandsString; // jg moved from FSEvalCommand 33 | @end 34 | -------------------------------------------------------------------------------- /JGAdditions/ReadMe.txt: -------------------------------------------------------------------------------- 1 | JGAdditions for the FScript-Distribution 2 | ==================================== 3 | Added 4 | servicesProvider=[[FSServicesProvider alloc] initWithFScriptInterpreterViewProvider:self]; 5 | [servicesProvider registerExports]; 6 | to method in FScriptAppController (Application fs) 7 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification; 8 | Added - (id)interpreterView; to FScriptAppController 9 | 10 | FSServicesProvider is the main entrance point for services provided to other applications. 3 different Service-handlers are used by example: 11 | 12 | DistributedObject connections are enabled by 13 | - (void)registerServerConnection:(NSString *)connectionName; 14 | 15 | Service-Menu services are enabled by 16 | - (void)registerServicesProvider; 17 | - (void)putCommand:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 18 | - (void)execute:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 19 | and by NSServices entry in Info.plist (Expert-Mode in Application Settings Tab in ProjectBuilder) 20 | 21 | Apple-Script events are enabled by FSEvalCommand.m and the Entries in fs.scriptSuite,fs.scriptTerminology and the NSAppleScriptEnabled setting in Info.plist 22 | 23 | 24 | Extensions that have few to do with FScript, but with my Projects: 25 | ======================================================================== 26 | 27 | FSTask is a wrapper for input-output based command line programs. Makes those programs easily available in FScript-Browser and through apple events for Programs, that run in the classic box. 28 | 29 | -------------------------------------------------------------------------------- /JGAdditions/fs.scriptSuite: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AppleEventCode 6 | fsfs 7 | Commands 8 | 9 | Eval 10 | 11 | AppleEventClassCode 12 | misc 13 | AppleEventCode 14 | eval 15 | CommandClass 16 | FSEvalCommand 17 | ResultAppleEventCode 18 | **** 19 | Type 20 | NSObject 21 | 22 | 23 | Name 24 | fs 25 | 26 | 27 | -------------------------------------------------------------------------------- /JGAdditions/fs.scriptTerminology: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Commands 6 | 7 | Eval 8 | 9 | Description 10 | Evaluate an object. 11 | Name 12 | eval 13 | 14 | 15 | Description 16 | Commands for fs. 17 | Name 18 | FScript Suite 19 | 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## F-Script 2 | 3 | F-Script is a set of open source tools for dynamic introspection, manipulation and scripting of Cocoa objects on Mac OS X. 4 | 5 | ## Build 6 | 7 | F-Script heavily depends on frameworks available in the system. There is a scheme for each release of Mac OS X: 8 | 9 | - 10.7 10 | - 10.8 11 | - 10.9 12 | - 10.10 13 | 14 | Each scheme consists of app and frameworks that a linked against all relevent frameworks available in the system. It is *highly* suggest that you to use app that is specifically build for you version of Mac OS X. 15 | 16 | ## Paid Support 17 | If functionality you need is missing but you're ready to pay for it, feel free to contact me. If not, create an issue anyway, I'll take a look as soon as I can. 18 | 19 | -------------------------------------------------------------------------------- /build/F-Script.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/build/F-Script.zip -------------------------------------------------------------------------------- /build/FScript.framework.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/F-Script/4f16ab0139acc0418a72ee40cb31e3e2ff7030fd/build/FScript.framework.zip --------------------------------------------------------------------------------