steptalk-0.10.0/0000755000175000000000000000000010365363613012444 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/0000775000175000000000000000000010132015524016557 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/ChangeLog0000644000175000000000000000546210132015522020334 0ustar gurkanroot2003 May 2 Stefan Urbanek * Added 'Objects' searching in application. * Added ScriptingInfo.plist template * GNUmakefile: removed inclusion of source-distribution.make 2003 May 1 Stefan Urbanek * Support: updated files to use #include instead of #import 2003 Apr 04 David Ayers * GNUmakefile: Added flags to be able to compile from the building directories and show all warnings except for import. * NSApplication+additions.h: Added missing declaration. * NSApplication+additions.m: Added import of needed headers. Removed and commented unused variables to supress compiler warnings. Corrected variable types and added necessary casts. * NSObject+NibLoading.m: Added missing import. * NSTextView+ScriptExecution.m: Removed unused variables. * STAppScriptingSupport.m: Added missing import. * STApplicationScriptingController.m: Ditto. * STEnvironment+additions.m: Ditto. * STScriptsPanel.h: Added missing declarations. * STScriptsPanel.m: Added missing imports. Removed unused variables. * STScriptingSupport.m: Added interface declaraions to supress compiler warnings. * STTranscript.h: Added missing declarations. * STTranscript.m: Added missing imports. 2003 Mar 27 Stefan Urbanek * ScriptsPanel.gorm: disallow multiple selection in scripts list. It was not possible to get index of selected cell, because of -gui b0rk. 2003 Mar 24 Stefan Urbanek * GNUmakefile*: Removed unnecessary stuff * Documentation: Moved relevant docs into StepTalk documentation. Removed the directory. 2003 Mar 23 Stefan Urbanek * Added ScriptingMenu.gorm * NSApplication: new methods: scriptingMenu and setScriptingMenu: * Added 'Do selection' and 'Do and show selection' methods for NSTextView 2003 Mar 23 Stefan Urbanek * Rewritten and changed from library to bundle. 2002 Jun 18 Stefan Urbanek * STScriptsManager: removed methods that are implemented in StepTalk * STScript: moved to StepTalk 2002 May 24 Stefan Urbanek * STScriptsManager: reflex renamed method in StepTalk 2002 Apr 13 Stefan Urbanek * Created ScriptingSupport bundle * Created Support/ScriptingSupport.m for loading application scripting support * Updated Ink.app example to use loading of scripting support 2002 Apr 12 Stefan Urbanek * STScriptsManager: Look for scripts also in all loaded bundles * NSApplication+additions: Update scripting information from all bundles. Read scripting info when new bundle is loaded. 2002 Apr 12 Stefan Urbanek * ChangeLog started steptalk-0.10.0/ApplicationScripting/GNUmakefile0000644000175000000000000000216310132015522020627 0ustar gurkanroot# # Main Makefile for the StepTalk # # Copyright (C) 2000 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make include Version PACKAGE_NAME = ApplicationScripting SUBPROJECTS = \ Source -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/ApplicationScripting/GNUmakefile.postamble0000644000175000000000000000323710132015522022617 0ustar gurkanroot# # GNUmakefile.postamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: steptalk-0.10.0/ApplicationScripting/NEWS0000644000175000000000000000066710132015522017263 0ustar gurkanroot0.2.0 * Bundles loaded by the application now can provide additional scripts and additional scripting capabilities (new scriptable objects) * Application is looking for scripting information and scripts in all loaded bundles. Documentation: * Scripts.txt: updated information about scrip search locations * ApplicationScripting.txt: updated information about optional scripting using bundle steptalk-0.10.0/ApplicationScripting/README0000644000175000000000000000225310132015522017435 0ustar gurkanrootApplication Scripting bundle ---------------------------- Ahthor: Stefan Urbanek NOTE: this bundle wants another name and cleanup. What is Application Scripting Bundle ? -------------------------------------- Bundle that allows users to 'script' applications. In other words, for example, users can: - extend the behaviour of application by adding their own functionality - automate tasks in the application - create a batch task How to make applications scriptable is described in StepTalk/Documentation. It can be done very easily in less than five minutes. Where to get it? ---------------- Application Scripting Bundle is part of the StepTalk and you can download it from: http://steptalk.host.sk/download.html Installation ------------ Application Scripting Bundle is automatically installed with StepTalk. You can install it separately by doing: > make > make install Scripts ------- Scripts are stored per application domain in */Library/StepTalk/Scripts/application_name. For example GNUmail is searhing for scripts in */Library/StepTalk/Scripts/GNUmail. Feedback -------- Any bug reports and comments are welcome at urbanek@host.sk steptalk-0.10.0/ApplicationScripting/Source/0000775000175000000000000000000010365363565020042 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Source/English.lproj/0000775000175000000000000000000010132015522022533 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptingMenu.gorm/0000775000175000000000000000000010132015522026265 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptingMenu.gorm/data.classes0000644000175000000000000000724410132015522030562 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "executeSelectionScript:", "executeAndShowSelectionScript:" ); Super = NSObject; }; STApplicationScriptingController = { Actions = ( "orderFrontScriptsPanel:", "orderFrontTranscriptWindow:", "executeSelection:", "displaySelection:" ); Outlets = ( scriptingMenu ); Super = NSObject; }; }steptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptingMenu.gorm/objects.gorm0000644000175000000000000000374110132015522030607 0ustar gurkanrootGNUstep archive00002905:0000000d:00000043:00000000:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString& %  MenuItem401 NSMenuItem0&% Do & Show Selection0&&&%01NSImage0&% common_2DCheckMark0 0 & %  common_2DDash%0 & %  MenuItem50 0 &% Item0&&&% %0&% NSOwner0& %  STApplicationScriptingController0& %  MenuItem600&% Scripts panel...0&&&% %0& %  MenuItem700& %  Transcript...0&&&% %0& %  MenuItem800& %  Do Selection0&&&% %0& %  GormNSMenu01NSMenu0&% Submenu0 1 NSMutableArray1 NSArray& 0!0"&% Item0#&&&% %0$&% NSMenu0%0&& %  Scripting0' &0(&% GSCustomClassMap0)&0*& %  NSVisible0+ &0,& %  MenuItem10-& %  MenuItem2!0.& %  MenuItem30/&% MenuItem00 &  011 NSNibConnector$02&% NSOwner03 /$04 ,$05 06 -07 .$08 $091 NSNibControlConnector/20:&% orderFrontScriptsPanel:0; ,20<&% orderFrontTranscriptWindow:0= .0>&% NSFirst0?&% executeSelectionScript:0@ >0A&% executeAndShowSelectionScript:0B1 NSNibOutletConnector2$0C& %  scriptingMenusteptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptsPanel.gorm/0000775000175000000000000000000010132015522026105 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptsPanel.gorm/data.classes0000644000175000000000000000711010132015522030372 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; STScriptsPanel = { Actions = ( "run:", "command:", "selectScript:" ); Outlets = ( scriptList, descriptionText, runButton, commandMenu, _panel ); Super = NSPanel; }; }steptalk-0.10.0/ApplicationScripting/Source/English.lproj/ScriptsPanel.gorm/objects.gorm0000644000175000000000000001265710132015522030435 0ustar gurkanrootGNUstep archive00002905:00000024:00000093:00000004:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary& 01NSString&% NSOwner0&% STScriptsPanel0& %  GormNSBrowser01 NSBrowser1 NSControl1NSView1 NSResponder%  C5 C  C5 C&01 NSMutableArray1 NSArray&01 NSScrollView%  C5 C  C5 C&0 &0 1 NSClipView% A @ C B  C B&0 &0 1NSMatrix%  C B  C B&0 &%01 NSActionCell1NSCell0&01NSFont0& %  Helvetica A`A`&&&&&&&&%% C B 01NSColor0&% NSNamedColorSpace0&% System0&% controlBackgroundColor0& %  NSBrowserCell01 NSBrowserCell0&&&&&&&&&%%0 &2doClick:2doDoubleClick:00&% System0&% controlBackgroundColor01 NSScroller% @ @ A B  A B&0 &%0&&&&&&&&&2 _doScroll:v12@0:4@8 % A A A A %0 &&&&&&&&0!&% NSMatrix0"&% /% B0#% @ ? C/ A  C/ A&0$ &%0%&&&&&&&&&2 scrollViaScroller:v12@0:4@8   C5 C0& &0'1NSBrowserColumn %"%%0(& %  ScrollView0) % C C5 B  C5 B&0* &0+ % A @ C B A  C B&0, &0-1 NSTextView1NSText% A  C B  C B&0. &0/00&% System01&% textBackgroundColor  K K02003& %  textColor C K/04% @ @ A B  A B&05 &%0607&&&&&&&&&&)+% A A A A 408& %  GormNSWindow091NSWindow%  CF C&% ? C0:%  CF C  CF C&0; &0<1NSButton% C A B` A  B` A&!0= &%0>1 NSButtonCell0?&% Run&&&&&&&&%<0@&0A&&&&0B1 NSPopUpButton% A A B A  B A&$0C &%0D1NSPopUpButtonCell1NSMenuItemCell0E&% Button&&&&&&&&0F1NSMenu0G&0H &0I1 NSMenuItem0J&% Commands0K&&&%0L1 NSImage0M&% common_3DArrowDown%0N0O& %  Update listK&&%%0P0Q&% BrowseK&&%%%B0R&0S&&&&FI%%%%%0T1! NSSplitView% A B C5 Cp  C5 Cp&0U &)0V 0W&% common_Dimple.tiff0X0Y&% System0Z&% controlBackgroundColor0[Y0\&% controlShadowColor%A0]0^&% System0_&% windowBackgroundColor0`&% Window0a&% Scriptsa ? A F@ F@%0b 0c&% NSApplicationIcon0d&% TextView-0e& %  SplitView1T0f&% GSCustomClassMap0g&0h&% GormNSPopUpButtonB0i& %  MenuItem1N0j& %  SplitView0k!% A B C5 Cu  C5 Cu&0l &V0m^0n&% controlBackgroundColor0o^0p&% controlShadowColor%A0q& %  MenuItem2P0r&% MenuItemI0s&% Button1<0t &0u1"NSNibConnector80v&% NSOwner0w"(e0x"de0y"s0z"j0{"h0|"r0}"i0~"q01#NSNibOutletConnectorvd0&% descriptionText0#vs0& %  runButton0#vh0& %  commandMenu0#v80&% _panel01$NSNibControlConnectorhv0&% command:0$sv0&% run:0"e0#v0&% delegate0#v0& %  scriptList0"esteptalk-0.10.0/ApplicationScripting/Source/English.lproj/TranscriptWindow.gorm/0000775000175000000000000000000010132015522027017 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Source/English.lproj/TranscriptWindow.gorm/data.classes0000644000175000000000000000673210132015522031315 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; STTranscript = { Actions = ( ); Outlets = ( textView, window ); Super = NSObject; }; }steptalk-0.10.0/ApplicationScripting/Source/English.lproj/TranscriptWindow.gorm/objects.gorm0000644000175000000000000000373210132015522031341 0ustar gurkanrootGNUstep archive00002905:00000016:00000032:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% NSOwner0& %  STTranscript0&% GSCustomClassMap0&0&% TextView01 NSTextView1NSText1NSView1 NSResponder% A  C B  C B&0 1 NSMutableArray1 NSArray&0 1 NSColor0 &% NSNamedColorSpace0 &% System0 &% textBackgroundColor  K K0 0& %  textColor C K0& %  ScrollView01 NSScrollView%  C B  C B&0 &01 NSClipView% A  C B A  C B&0 & 01 NSScroller1 NSControl%  A B  A B&0 &%01NSCell0&01NSFont0& %  Helvetica A`A`&&&&&&&&&2 _doScroll:v12@0:4@8% A A A A 0& %  GormNSWindow01NSWindow%  C B& % C C,0%  C B  C B&0 &0 0 &% System0!&% windowBackgroundColor0"&% Window0#& %  Transcript# ? A F@ F@%0$1NSImage0%&% NSApplicationIcon0& &0'1NSNibConnector0(&% NSOwner0)0*0+1NSNibOutletConnector(0,&% window0-(0.&% textView0/(00&% delegate0102&% initialFirstRespondersteptalk-0.10.0/ApplicationScripting/Source/GNUmakefile0000644000175000000000000000401010132015522022060 0ustar gurkanroot# # GNUmakefile # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. include $(GNUSTEP_MAKEFILES)/common.make include $(GNUSTEP_MAKEFILES)/Additional/gui.make include ../Version BUNDLE_NAME = ApplicationScripting ApplicationScripting_OBJC_FILES = \ NSApplication+additions.m \ NSObject+NibLoading.m \ STAppScriptingSupport.m \ STApplicationScriptingController.m \ STEnvironment+additions.m \ STScriptsPanel.m \ NSTextView+ScriptExecution.m \ STTranscript.m ApplicationScripting_BUNDLE_LIBS = -lStepTalk $(GUI_LIBS) ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) ApplicationScripting_LANGUAGES = English ApplicationScripting_RESOURCE_FILES = ScriptingInfo.plist ApplicationScripting_LOCALIZED_RESOURCE_FILES = \ ScriptsPanel.gorm \ TranscriptWindow.gorm \ ScriptingMenu.gorm \ # ApplicationScripting.xlp \ # StepTalk.tiff ADDITIONAL_INCLUDE_DIRS += -I../../Source/Headers ADDITIONAL_TOOL_LIBS += -lStepTalk ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble steptalk-0.10.0/ApplicationScripting/Source/NSApplication+additions.h0000644000175000000000000000252410132015522024645 0ustar gurkanroot/** NSApplication additions Copyright (c) 2000 Stefan Urbanek Written by: Stefan Urbanek Date: 2001 Nov 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STEnvironment; @class STApplicationScriptingController; @interface NSApplication(STAppScriptingAdditions) - (STEnvironment *)scriptingEnvironment; - (STApplicationScriptingController *)scriptingController; - (void)orderFrontScriptsPanel:(id)sender; - (void)orderFrontTranscriptWindow:(id)sender; - (NSMenu *)scriptingMenu; - (void)setScriptingMenu:(NSMenu *)menu; @end steptalk-0.10.0/ApplicationScripting/Source/NSApplication+additions.m0000644000175000000000000001561210132015522024654 0ustar gurkanroot/** NSApplication additions Copyright (c) 2000 Stefan Urbanek Written by: Stefan Urbanek Date: 2001 Nov 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSApplication+additions.h" #import "STScriptsPanel.h" #import "STTranscript.h" #import "STEnvironment+additions.h" #import #import #import #import #import #import #import #import #import #import "STApplicationScriptingController.h" static STEnvironment *scriptingEnvironment = nil; static NSMutableSet *scannedBundles; static STApplicationScriptingController *scriptingController = nil; @interface NSApplication (STPrivateMethods) - (void)updateScriptingInfoFromBundles; - (void)_createDefaultScriptingEnvironment; @end @implementation NSApplication(STAppScriptingAdditions) /** Method for preventing multiple initialization. It will show alert panel on invocation. You should not invoke this method.*/ - (BOOL)initializeApplicationScripting { /* FIXME: make it more human-readable */ NSRunAlertPanel(@"Scripting is already initialized", @"[NSApp initializeApplicationScripting] is called more than once.", @"Cancel", nil, nil); return YES; } /** Do real initialization of application scripting. You should not invoke this method directly. */ - (BOOL)setUpApplicationScripting { // STBundleInfo *info; // info = [STBundleInfo infoForBundle:[NSBundle mainBundle]]; /* FIXME: use info */ scriptingController = [[STApplicationScriptingController alloc] init]; return YES; } /** Return shared scripting environment. If there is none, create one. */ - (STEnvironment *)scriptingEnvironment { if(!scriptingEnvironment) { [self _createDefaultScriptingEnvironment]; } return scriptingEnvironment; } /** Create shared scripting environment. */ - (void)_createDefaultScriptingEnvironment { STEnvironment *env = nil; STBundleInfo *info; //NSString *path; NSString *str = nil; //NSString *reference; //NSDictionary *dict; //id object; NSDebugLog(@"Creating scripting environment"); scannedBundles = [[NSMutableSet alloc] init]; info = [STBundleInfo infoForBundle:[NSBundle mainBundle]]; if(!info) { NSRunAlertPanel(@"Application does not provide scripting capabilities", @"This application was designed to support " @"scripting, but something went wrong. " @"Check if the file ScriptingInfo.plist exists " @"in application's bundle directory.", @"Cancel", nil, nil); return; } [scannedBundles addObject:[NSBundle mainBundle]]; /* FIXME: use scripting environment from application bundle */ /* str = [info objectForKey:@"STEnvironmentDescription"]; */ if(str && ![str isEqualToString:@""]) { env = [STEnvironment environmentWithDescriptionName:str]; } if(!env) { NSDebugLog(@"Using default scripting environment"); env = [STEnvironment defaultScriptingEnvironment]; } [env loadModule:@"AppKit"]; [env includeBundle:[NSBundle mainBundle]]; [env setObject:self forName:@"Application"]; [env setObject:self forName:[self applcationNameForScripting]]; [env setObject:[STTranscript sharedTranscript] forName:@"Transcript"]; scriptingEnvironment = RETAIN(env); [self updateScriptingInfoFromBundles]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateScriptingInfoOnBundleLoad:) name:NSBundleDidLoadNotification object:nil]; } /** Include information from loaded modules and bundles. */ - (void)updateScriptingInfoFromBundles { STEnvironment *env = [self scriptingEnvironment]; NSEnumerator *enumerator; //NSDictionary *info; //NSString *path; NSBundle *bundle; NSMutableSet *bundles; NSDebugLog(@"Updating scripting info from bundles"); bundles = (id)[NSMutableSet setWithArray:[NSBundle allBundles]]; [bundles minusSet:scannedBundles]; enumerator = [bundles objectEnumerator]; while( (bundle = [enumerator nextObject]) ) { /* If bundle provides scripting capabilities, try to include it. */ if([bundle scriptingInfoDictionary]) { if(![env includeBundle:bundle]) { NSLog(@"Failed to include bundle scripting of '%@'.", [bundle bundlePath]); } } } [scannedBundles unionSet:bundles]; } /** Called on NSBundleDidLoad notification. You */ - (void)updateScriptingInfoOnBundleLoad:(NSNotification *)notif { [self updateScriptingInfoFromBundles]; } /** Name of application object */ - (NSString *)applcationNameForScripting { return [[NSProcessInfo processInfo] processName]; } /** Order the scripts panel into the front. */ - (void)orderFrontScriptsPanel:(id)sender { [scriptingController orderFrontScriptsPanel:nil]; } /** Return scripting menu. The default menu is provided by STApplicationScriptingController */ - (NSMenu *)scriptingMenu { return [scriptingController scriptingMenu]; } /** Set application Scripting menu */ - (void)setScriptingMenu:(NSMenu *)menu { [scriptingController setScriptingMenu:menu]; } /** Order the Transcript window into the front. */ - (void)orderFrontTranscriptWindow:(id)sender { [scriptingController orderFrontTranscriptWindow:nil]; } /** Return YES if scripting is supported, otherwise returns NO. Because this method is called when framework is loaded, allways returns YES. */ - (BOOL)isScriptingSupported { return YES; } /** Return object that is responsible for controlling application scriptign */ - (STApplicationScriptingController *)scriptingController { return scriptingController; } @end steptalk-0.10.0/ApplicationScripting/Source/NSObject+NibLoading.h0000644000175000000000000000200310132015522023630 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This file is part of the StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSObject(AFNibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName; @end steptalk-0.10.0/ApplicationScripting/Source/NSObject+NibLoading.m0000644000175000000000000000330710132015522023645 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This file is part of the StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSObject+NibLoading.h" #import #import #import @implementation NSObject(AFNibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName { NSDictionary *dict; NSBundle *bundle; BOOL flag; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, @"NSOwner", nil, nil]; bundle = [NSBundle bundleForClass:[self class]]; flag = [bundle loadNibFile:aName externalNameTable:dict withZone:[self zone]]; if(!flag) { NSRunAlertPanel(@"Unable to load resources", @"Unable to load '%@' resources", @"Cancel", nil, nil, aName); } return flag; } @end steptalk-0.10.0/ApplicationScripting/Source/NSTextView+ScriptExecution.h0000644000175000000000000000224510132015522025333 0ustar gurkanroot/** NSTextView+ScriptExecution Application Scripting support - execution of selected text Copyright (c)2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Mar 23 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSTextView(STScriptExecution) - (void)executeSelectionScript:(id)sender; - (void)executeAndShowSelectionScript:(id)sender; @end steptalk-0.10.0/ApplicationScripting/Source/NSTextView+ScriptExecution.m0000644000175000000000000000447410132015522025346 0ustar gurkanroot/** NSTextView+ScriptExecution Application Scripting support - execution of selected text Copyright (c)2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Mar 23 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSTextView+ScriptExecution.h" #import "NSApplication+additions.h" #import "STApplicationScriptingController.h" @implementation NSTextView(STScriptExecution) - (void)executeSelectionScript:(id)sender { STEnvironment *env; NSString *selectedString; NSRange range = [self selectedRange]; NSLog(@"Do!"); env = [NSApp scriptingEnvironment]; selectedString = [[self attributedSubstringFromRange:range] string]; [[NSApp scriptingController] executeScriptString:selectedString inEnvironment:env]; } - (void)executeAndShowSelectionScript:(id)sender { STEnvironment *env; NSString *selectedString; NSRange range = [self selectedRange]; id retval = nil; NSLog(@"Do and Show!"); env = [NSApp scriptingEnvironment]; selectedString = [[self attributedSubstringFromRange:range] string]; retval = [[NSApp scriptingController] executeScriptString:selectedString inEnvironment:env]; NSLog(@"Returned %@",retval); if([self isEditable]) { [self insertText:[retval description]]; } else { NSLog(@"Text is not editable!"); } } @end steptalk-0.10.0/ApplicationScripting/Source/STAppScriptingSupport.h0000644000175000000000000000200510132015522024430 0ustar gurkanroot/** AppScriptingSupport Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Jan 26 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STAppScriptingSupport:NSObject { } @end steptalk-0.10.0/ApplicationScripting/Source/STAppScriptingSupport.m0000644000175000000000000000242610132015522024444 0ustar gurkanroot/** AppScriptingSupport Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Jan 26 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STAppScriptingSupport.h" #import #import #import @implementation STAppScriptingSupport + (void)initialize { [STEnvironment class]; [STScriptsManager class]; } + (NSDictionary *)namedObjectsForScripting { return [NSDictionary dictionary]; } @end steptalk-0.10.0/ApplicationScripting/Source/STApplicationScriptingController.h0000644000175000000000000000302210132015522026622 0ustar gurkanroot/** STApplicationScriptingController Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Jan 26 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STScriptsPanel; @class STScript; @class STEnvironment; @class NSMenu; @class NSDictionary; @interface STApplicationScriptingController:NSObject { NSDictionary *objectRefereceDict; STScriptsPanel *scriptsPanel; NSMenu *scriptingMenu; } - (void)setScriptingMenu:(NSMenu *)menu; - (NSMenu *)scriptingMenu; - (void)orderFrontScriptsPanel:(id)sender; - (void)orderFrontTranscriptWindow:(id)sender; - (id)executeScript:(STScript *)script; - (id)executeScriptString:(NSString *)source inEnvironment:(STEnvironment *)env; @end steptalk-0.10.0/ApplicationScripting/Source/STApplicationScriptingController.m0000644000175000000000000001460410307113257026647 0ustar gurkanroot/** STApplicationScriptingController Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Jan 26 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STApplicationScriptingController.h" #import #import #import #import #import #import #import #import #import #import #import "STScriptsPanel.h" #import "STTranscript.h" #import "NSObject+NibLoading.h" #import "NSApplication+additions.h" @implementation STApplicationScriptingController - init { STBundleInfo *info; [super init]; info = [STBundleInfo infoForBundle:[NSBundle mainBundle]]; objectRefereceDict = RETAIN([info objectReferenceDictionary]); return self; } - (void)dealloc { RELEASE(objectRefereceDict); [super dealloc]; } - (void)createScriptsPanel { scriptsPanel = [[STScriptsPanel alloc] init]; [scriptsPanel setDelegate:self]; } - (void)orderFrontScriptsPanel:(id)sender { if(!scriptsPanel) { [self createScriptsPanel]; } [scriptsPanel makeKeyAndOrderFront:self]; } - (void)orderFrontTranscriptWindow:(id)sender { [[[STTranscript sharedTranscript] window] makeKeyAndOrderFront:self]; } - (STEnvironment *)actualScriptingEnvironment { SEL sel = @selector(scriptingEnvironment); id target; target = [NSApp delegate]; if( ! [target respondsToSelector:sel] ) { if( [NSApp respondsToSelector:sel] ) { target = NSApp; } else { NSLog(@"Application is not scriptable"); return nil; } } return [target scriptingEnvironment]; } - (void)setScriptingMenu:(NSMenu *)menu { ASSIGN(scriptingMenu, menu); } - (NSMenu *)scriptingMenu { if(!scriptingMenu) { if(![self loadMyNibNamed:@"ScriptingMenu"]) { return nil; } } return scriptingMenu; } /** Execute script script in actual scripting environment. If an exception occured, it will be logged into the Transcript window. */ - (id)executeScript:(STScript *)script { STEnvironment *env = [self actualScriptingEnvironment]; STEngine *engine; NSString *error; id retval; NSDebugLog(@"Execute a script '%@'", [script localizedName]); engine = [STEngine engineForLanguageWithName:[script language]]; if(!engine) { NSLog(@"Unable to get scripting engine for language '%@'", [script language]); return nil; } if(!env) { NSLog(@"No scripting environment"); return nil; } NSDebugLog(@"Updating references"); [self updateObjectReferences]; #ifndef DEBUG_EXCEPTIONS NS_DURING #endif retval = [engine executeCode:[script source] inEnvironment:env]; #ifndef DEBUG_EXCEPTIONS NS_HANDLER error = [NSString stringWithFormat: @"Error: " @"Execution of script '%@' failed. %@. (%@)", [script localizedName], [localException reason], [localException name]]; [[STTranscript sharedTranscript] showError:error]; retval = nil; NS_ENDHANDLER #endif return retval; } /** Execute script string source in environment env. */ - (id)executeScriptString:(NSString *)source inEnvironment:(STEnvironment *)env { STEngine *engine; NSString *error; id retval = nil; engine = [STEngine engineForLanguageWithName: [[STLanguageManager defaultManager] defaultLanguageName]]; if(!engine) { NSLog(@"Unable to get scripting engine."); return nil; } if(!env) { NSLog(@"No scripting environment"); return nil; } NSLog(@"Updating references"); [self updateObjectReferences]; NS_DURING retval = [engine executeCode:source inEnvironment:env]; NS_HANDLER error = [NSString stringWithFormat: @"Error: " @"Execution of script failed. %@. (%@)", [localException reason], [localException name]]; [[STTranscript sharedTranscript] showError:error]; NSLog(@"Script exception: %@", error); retval = nil; NS_ENDHANDLER return retval; } /* FIXME: rewrite this */ - (void)updateObjectReferences { STEnvironment *env = [self actualScriptingEnvironment]; NSEnumerator *enumerator; NSString *name; NSString *object = nil; NSString *reference; id target; target = [NSApp delegate]; enumerator = [objectRefereceDict keyEnumerator]; while( (name = [enumerator nextObject]) ) { reference = [objectRefereceDict objectForKey:name]; NSLog(@"Adding reference '%@' object '%@'", name, reference); NS_DURING object = [target valueForKeyPath:reference]; [env setObject:object forName:name]; NS_HANDLER if([[localException name] isEqualToString:NSUndefinedKeyException]) { NSLog(@"Warning: Invalid object reference '%@'.", reference); } else { [localException raise]; } NS_ENDHANDLER } } @end steptalk-0.10.0/ApplicationScripting/Source/STEnvironment+additions.h0000644000175000000000000000217010132015522024711 0ustar gurkanroot/** STEnvironment additions Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STEnvironment(AppTalkAdditions) - (void)updateReferencesFromDictionary:(NSDictionary *)dict target:(id)target; @end steptalk-0.10.0/ApplicationScripting/Source/STEnvironment+additions.m0000644000175000000000000000320710132015522024720 0ustar gurkanroot/** STEnvironment additions Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STEnvironment+additions.h" #import #import #import #import @implementation STEnvironment(AppTalkAdditions) - (void)updateReferencesFromDictionary:(NSDictionary *)dict target:(id)target { NSEnumerator *enumerator; NSString *name; NSString *object = nil; enumerator = [dict keyEnumerator]; while( (name = [enumerator nextObject]) ) { object = [target valueForKeyPath:[dict objectForKey:name]]; NSLog(@"Adding reference '%@' object '%@'", name, object); [self setObject:object forName:name]; } } @end steptalk-0.10.0/ApplicationScripting/Source/STScriptsPanel.h0000644000175000000000000000304010132015522023037 0ustar gurkanroot/** STScriptsPanel Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STScriptsManager; @class STScript; @class NSPopUpButton; @interface STScriptsPanel : NSPanel { id scriptList; id descriptionText; id runButton; NSPopUpButton *commandMenu; id _panel; id delegate; STScriptsManager *scriptsManager; NSArray *scripts; } - (void) run: (id)sender; - (void) command: (id)sender; - (void) update: (id)sender; - (void) browse: (id)sender; - (void) showHelp: (id)sender; - (STScript *) selectedScript; - (void) setDelegate: (id)anObject; - (id) delegate; @end steptalk-0.10.0/ApplicationScripting/Source/STScriptsPanel.m0000644000175000000000000001200610132015522023046 0ustar gurkanroot/** STScriptsPanel Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STScriptsPanel.h" #import #import #import #import #import #import #import #import #import "NSObject+NibLoading.h" #import "STApplicationScriptingController.h" STScriptsPanel *sharedScriptsPanel = nil; @implementation STScriptsPanel + sharedScriptsPanel { if(!sharedScriptsPanel) { sharedScriptsPanel = [[STScriptsPanel alloc] init]; } return sharedScriptsPanel; } - init { NSView *view; if(![self loadMyNibNamed:@"ScriptsPanel"]) { [self dealloc]; return nil; } self = [super initWithContentRect:[[(NSPanel *)_panel contentView] frame] styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask backing:NSBackingStoreRetained defer:NO]; [self setTitle:[_panel title]]; [self setFrame:[_panel frame] display:YES]; [self setHidesOnDeactivate:YES]; view = RETAIN([_panel contentView]); [_panel setContentView:nil]; [self setContentView:view]; RELEASE(view); RELEASE(_panel); [self setFrameUsingName:@"STScriptsPanel"]; [self setFrameAutosaveName:@"STScriptsPanel"]; [scriptList setTarget:self]; [scriptList setAction:@selector(selectScript:)]; [scriptList setDoubleAction:@selector(run:)]; [scriptList setMaxVisibleColumns:1]; scriptsManager = [STScriptsManager defaultManager]; [self update:nil]; return self; } - (void) setDelegate:(id)anObject { ASSIGN(delegate, anObject); } - (id)delegate { return delegate; } - (void)setScriptsManager:(STScriptsManager *)aManager { ASSIGN(scriptsManager,aManager); } - (STScriptsManager *)scriptsManager { return scriptsManager; } - (void) run: (id)sender { STScript *script = [self selectedScript]; if(script) { [delegate executeScript:script]; } } - (void) selectScript: (id)sender { STScript *script = [self selectedScript]; [descriptionText setString:[script scriptDescription]]; } - (void)command:(id)sender { switch([commandMenu indexOfSelectedItem]) { case 1: [self update:nil]; break; case 2: [self browse:nil]; break; case 3: [self showHelp:nil]; break; } } - (void)browse:(id)sender { NSWorkspace *ws = [NSWorkspace sharedWorkspace]; STScript *script = [self selectedScript]; NSString *path = [[script fileName] stringByDeletingLastPathComponent]; if(script) { [ws selectFile:[script fileName] inFileViewerRootedAtPath:path]; } } - (void)update:(id)sender { RELEASE(scripts); scripts = [scriptsManager allScripts]; scripts = [scripts sortedArrayUsingSelector: @selector(compareByLocalizedName:)]; RETAIN(scripts); [scriptList reloadColumn:0]; [self selectScript:nil]; } - (STScript *)selectedScript { if([scriptList selectedCell]) { return [scripts objectAtIndex:[scriptList selectedRowInColumn:0]]; } else { return 0; } } - (int) browser: (NSBrowser *) sender numberOfRowsInColumn: (int) column { return [scripts count]; } - (void) browser: (NSBrowser *) sender willDisplayCell: (NSBrowserCell *) cell atRow: (int) row column: (int) column { NSString *name; if(sender != scriptList) { NSLog(@"Invalid browser, not scriptList"); return; } [cell setLeaf:YES]; name = [[scripts objectAtIndex:row] localizedName]; [cell setStringValue:name]; } - (void)showHelp:(id)sender { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *file; file = [bundle pathForResource: @"ApplicationScripting" ofType: @"xlp"]; if (file) { [[NSWorkspace sharedWorkspace] openFile: file]; return; } else { NSBeep(); } } @end steptalk-0.10.0/ApplicationScripting/Source/STTranscript.h0000644000175000000000000000226110132015522022565 0ustar gurkanroot/** STTranscript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 20 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSWindow; @class NSTextView; @interface STTranscript:NSObject { NSWindow *window; NSTextView *textView; } + sharedTranscript; - show:(id)anObject; - showLine:(id)anObject; - showError:(NSString *)errorText; @end steptalk-0.10.0/ApplicationScripting/Source/STTranscript.m0000644000175000000000000000716410307113311022600 0ustar gurkanroot/** STTranscript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 20 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STTranscript.h" #import #import #import #import #import #import #import #import #import #import #import "NSObject+NibLoading.h" static STTranscript *sharedTranscript; static Class NSString_class; static Class NSNumber_class; static NSDictionary *errorTextAttributes; static NSDictionary *normalTextAttributes; @implementation STTranscript + (void)initialize { NSString_class = [NSString class]; NSNumber_class = [NSNumber class]; errorTextAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor redColor], NSForegroundColorAttributeName, nil, nil]; normalTextAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor blackColor], NSForegroundColorAttributeName, nil, nil]; } + sharedTranscript { if(!sharedTranscript) { sharedTranscript = [[STTranscript alloc] init]; [sharedTranscript showLine:@"Shared scripting transcript."]; } return sharedTranscript; } - init { if(![self loadMyNibNamed:@"TranscriptWindow"]) { [self dealloc]; return nil; } [window setTitle:@"Scripting Transcript"]; [window setFrameUsingName:@"STTranscriptWindow"]; [window setFrameAutosaveName:@"STTranscriptWindow"]; /* FIXME: Fix Gorm autoresizing */ // [textView setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; return self; } - show:(id)anObject { NSString *string; if( [anObject isKindOfClass:NSString_class] ) { string = anObject; } else if ( [anObject isKindOfClass:NSNumber_class] ) { string = [anObject stringValue]; } else { string = [anObject description]; } [textView insertText:string]; return self; } - showLine:(id)anObject { [self show:anObject]; [textView insertText:@"\n"]; return self; } - (NSWindow *)window { return window; } - showError:(NSString *)errorText { NSAttributedString *astring; astring = [[NSAttributedString alloc] initWithString:errorText attributes:errorTextAttributes]; [textView insertText:astring]; astring = [[NSAttributedString alloc] initWithString:@"\n" attributes:normalTextAttributes]; [textView insertText:astring]; RELEASE(astring); return self; } @end steptalk-0.10.0/ApplicationScripting/Support/0000775000175000000000000000000010132015524020233 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Support/STScriptingSupport.h0000644000175000000000000000257610132015524024222 0ustar gurkanroot/** ScriptingSupport Code for loading scripting NOTE: Copy and include this file into your application project. Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _STScriptingSupport_h #define _STScriptingSupport_h #include @interface NSApplication(STApplicationScripting) - (BOOL)initializeScripting; - (BOOL)isScriptingSupported; /* User interface */ - (void)orderFrontScriptsPanel:(id)sender; - (void)orderFrontTranscriptWindow:(id)sender; - (NSMenu *) scriptingMenu; @end #endif steptalk-0.10.0/ApplicationScripting/Support/STScriptingSupport.m0000644000175000000000000001152310132015524024217 0ustar gurkanroot/** ScriptingSupport Code for loading scripting Copy and include this file into your application project. NOTE: Please, do not modify this file. It is part of the StepTalk and depends on its interface. Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "STScriptingSupport.h" #include #include #include #include #include #include #include #include @interface NSApplication (STPrivateMethods) - (BOOL)setUpApplicationScripting; - (NSBundle *) _applicationScriptingBundle; @end @implementation NSApplication(STApplicationScriptingInit) - (BOOL)initializeApplicationScripting { NSBundle *bundle; if(![self isScriptingSupported]) { NSRunAlertPanel(@"Invalid usage of scripting support", @"Please, contact the author of this application " @"and let him know about this error. The author forgot " @"to check whether the scripting is supported or not.", @"Cancel", nil, nil); return NO; } NSLog(@"Loading application scripting support"); bundle = [self _applicationScriptingBundle]; if(bundle) { /* Load the bundle! */ [[bundle principalClass] class]; if([self respondsToSelector:@selector(setUpApplicationScripting)]) { return [self setUpApplicationScripting]; } else { NSRunAlertPanel(@"Broken scripting support", @"Scripting support cannot be loaded, because " @"the application scripting bundle is broken.", @"Cancel", nil, nil); return NO; } } else { NSRunAlertPanel(@"Broken scripting support", @"Application scripting bundle cannot be loaded.", @"Cancel", nil, nil); return NO; } } - (BOOL)isScriptingSupported { return ([self _applicationScriptingBundle] != nil); } - (NSBundle *)_applicationScriptingBundle { NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSString *path; NSArray *paths; BOOL isDir; paths = NSStandardLibraryPaths(); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:@"Bundles"]; path = [path stringByAppendingPathComponent:@"ApplicationScripting"]; path = [path stringByAppendingPathExtension:@"bundle"]; if( [manager fileExistsAtPath:path isDirectory:&isDir] && isDir) { return [NSBundle bundleWithPath:path]; } } return nil; } - (void)_loadAppTalkAndRetryAction:(SEL)sel with:(id)anObject { static BOOL isIn = NO; if(isIn) { NSLog(@"Error occured while loading application scripting support"); isIn = NO; return; } isIn = YES; if([self initializeApplicationScripting]) { [self performSelector:sel withObject:anObject]; } isIn = NO; } - (id)_loadAppTalkAndRetryAction:(SEL)sel { static BOOL isIn = NO; id retval = nil; if(isIn) { NSLog(@"Error occured while loading application scripting support"); isIn = NO; return nil; } isIn = YES; if([self initializeApplicationScripting]) { retval = [self performSelector:sel]; } isIn = NO; return retval; } - (void)orderFrontScriptsPanel:(id)sender { [self _loadAppTalkAndRetryAction:_cmd with:sender]; } - (void)orderFrontTranscriptWindow:(id)sender { [self _loadAppTalkAndRetryAction:_cmd with:sender]; } - (NSMenu *)scriptingMenu { return [self _loadAppTalkAndRetryAction:_cmd]; } @end steptalk-0.10.0/ApplicationScripting/Support/ScriptingInfo.plist0000644000175000000000000000105510132015524024065 0ustar gurkanroot/* ScriptingSupport.plist This is a template file for application scripting support description. You can take and modify this file. */ { Classes = ( /* List public classes from your application here */ ); Objects = { /* Put a dictionary of public objects here. Key is object name used in scripts and value is a path to that object relative to application delegate. For example: CurrentMessage = "lastMailWindowOnTop.delegate.selectedMessage"; */ }; } steptalk-0.10.0/ApplicationScripting/Support/test/0000775000175000000000000000000010132015524021212 5ustar gurkanrootsteptalk-0.10.0/ApplicationScripting/Support/test/STScriptingSupport.h0000644000175000000000000000257610132015524025201 0ustar gurkanroot/** ScriptingSupport Code for loading scripting NOTE: Copy and include this file into your application project. Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _STScriptingSupport_h #define _STScriptingSupport_h #include @interface NSApplication(STApplicationScripting) - (BOOL)initializeScripting; - (BOOL)isScriptingSupported; /* User interface */ - (void)orderFrontScriptsPanel:(id)sender; - (void)orderFrontTranscriptWindow:(id)sender; - (NSMenu *) scriptingMenu; @end #endif steptalk-0.10.0/ApplicationScripting/Support/test/STScriptingSupport.m0000644000175000000000000001152710132015524025202 0ustar gurkanroot/** ScriptingSupport Code for loading scripting Copy and include this file into your application project. NOTE: Please, do not modify this file. It is part of the StepTalk and depends on its interface. Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "STScriptingSupport.h" #include #include #include #include #include #include #include #include @interface NSApplication (STPrivateMethods) - (BOOL)setUpApplicationScripting; - (NSBundle *) _applicationScriptingBundle; @end @implementation NSApplication(STApplicationScriptingInit) - (BOOL)initializeApplicationScripting { NSBundle *bundle; if(![self isScriptingSupported]) { NSRunAlertPanel(@"Invalid usage of scripting support", @"Please, contact the author of this application " @"and let him know about this error. The author forgot " @"to check whether the scripting is supported or not.", @"Cancel", nil, nil); return NO; } NSLog(@"Loading application scripting support"); bundle = [self _applicationScriptingBundle]; if(bundle) { /* Load the bundle! */ [[bundle principalClass] class]; if([self respondsToSelector:@selector(setUpApplicationScripting)]) { return [self setUpApplicationScripting]; } else { NSRunAlertPanel(@"Broken scripting support", @"Scripting support cannot be loaded, because " @"the application scripting bundle is broken.", @"Cancel", nil, nil); return NO; } } else { NSRunAlertPanel(@"Broken scripting support", @"Application scripting bundle cannot be loaded.", @"Cancel", nil, nil); return NO; } } - (BOOL)isScriptingSupported { return ([self _applicationScriptingBundle] != nil); } - (NSBundle *)_applicationScriptingBundle { NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSString *path; NSArray *paths; BOOL isDir; paths = NSStandardLibraryPaths(); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:@"Bundles"]; path = [path stringByAppendingPathComponent:@"ApplicationScripting"]; path = [path stringByAppendingPathExtension:@"bundle"]; if( [manager fileExistsAtPath:path isDirectory:&isDir] && isDir) { return [NSBundle bundleWithPath:path]; } } return nil; } - (void)_loadAppTalkAndRetryAction:(SEL)sel with:(id)anObject { static BOOL isIn = NO; if(isIn) { NSLog(@"Error occured while loading application scripting support"); isIn = NO; return; } isIn = YES; if([self initializeApplicationScripting]) { [self performSelector:sel withObject:anObject]; } isIn = NO; } - (id)_loadAppTalkAndRetryAction:(SEL)sel { static BOOL isIn = NO; id retval = nil; if(isIn) { NSLog(@"Error occured while loading application scripting support"); isIn = NO; return nil; } isIn = YES; if([self initializeApplicationScripting]) { retval = [self performSelector:sel]; } isIn = NO; return retval; } - (void)orderFrontScriptsPanel:(id)sender { [self _loadAppTalkAndRetryAction:_cmd with:sender]; } - (void)orderFrontTranscriptWindow:(id)sender { [self _loadAppTalkAndRetryAction:_cmd with:sender]; } - (NSMenu *)scriptingMenu { return [self _loadAppTalkAndRetryAction:_cmd]; } @end steptalk-0.10.0/ApplicationScripting/Support/test/download.st0000644000175000000000000000157510132015524023377 0ustar gurkanroot" NSURL example " [| main | string result | ((Args count) < 1 ) ifTrue: [ Transcript showLine:'Please specify an URL to download.' ] ifFalse: [ Args do: [ :str | self download:str ] ]. ^self ! download:str | url | url := NSURL URLWithString:str. Transcript showLine:('Downloading ', (url description)). url loadResourceDataNotifyingClient:self usingCache:YES. NSRunLoop currentRunLoop run. ^self ! URLHandleResourceDidBeginLoading:sender Transcript showLine:'begin'. ^self ! URLHandle:handle resourceDataDidBecomeAvailable:data Transcript showLine:('available ', (data length stringValue)). ^self ! URLHandleResourceDidFinishLoading:sender Transcript showLine:'done'. ^self ] steptalk-0.10.0/ApplicationScripting/Support/update_scripting.st0000644000175000000000000000151210132015524024144 0ustar gurkanroot" update_scripting.st Automatically update scripting support source files. Date: 2003 May 4 Author: Stefan Urbanek " [| :root main | url | " Source files to be updated " files := #('STScriptingSupport.h' 'STScriptingSupport.m'). " Root URL of sources " root := NSURL URLWithString:'http://steptalk.host.sk/Download/'. Transcript showLine:'Downloading files from ', (root description). files do: [ :file | self download: file. ]. Transcript showLine:'Done.'. ^self ! download:file | url data path | Transcript showLine:' ', file. url := NSURL URLWithString:file relativeToURL:root. url := url absoluteURL. data := url resourceDataUsingCache:YES. data writeToFile:file atomically:YES. ^self ] steptalk-0.10.0/ApplicationScripting/Support/upload0000755000175000000000000000007110132015524021441 0ustar gurkanroot#!/bin/csh # scp *.[hm] steptalk@creon.host.sk:Download steptalk-0.10.0/ApplicationScripting/Version0000644000175000000000000000051410132015522020123 0ustar gurkanroot# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The version number of this release. MAJOR_VERSION=0 MINOR_VERSION=2 SUBMINOR_VERSION=0 APPTALK_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} VERSION=${APPTALK_VERSION} steptalk-0.10.0/Applications/0000775000175000000000000000000010261060413015057 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/0000755000175000000000000000000010167717636017554 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/AppController.h0000600000175000000000000000174010132015545022461 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface AppController : NSObject { } @end steptalk-0.10.0/Applications/Conversation/AppController.m0000600000175000000000000000306310132015545022466 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "AppController.h" #import #import #import #import #import #import "ConversationController.h" @interface AppController(Private) @end @implementation AppController - (void)applicationDidFinishLaunching:(id)notif { [self newDocument:nil]; /* Go to known state of application */ } - (void)newDocument:(id)sender { ConversationController *controller; /* FIXME: add it to some list of controllers */ controller = [[ConversationController alloc] init]; [[controller window] makeKeyAndOrderFront:nil]; } @end steptalk-0.10.0/Applications/Conversation/ConversationController.h0000644000175000000000000000062210140331173024416 0ustar gurkanroot#import @class NSTextView; @class NSPopUpButton; @class NSWindow; @class STConversation; @class STContext; @class InputText; @interface ConversationController:NSObject { InputText *inputText; NSTextView *dialogText; NSPopUpButton *languageList; NSWindow *window; STConversation *conversation; STContext *context; } @end steptalk-0.10.0/Applications/Conversation/ConversationController.m0000644000175000000000000001530610140331616024432 0ustar gurkanroot#import "ConversationController.h" #import "NSObject+NibLoading.h" #import #import #import #import #import #import #import #import #import static NSDictionary *userAttributes; static NSDictionary *outputAttributes; static NSDictionary *errorAttributes; @implementation ConversationController + (void)initialize { userAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor blackColor], NSForegroundColorAttributeName, [NSFont systemFontOfSize:0], NSFontAttributeName, nil, nil]; outputAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor blackColor], NSForegroundColorAttributeName, [NSFont boldSystemFontOfSize:0], NSFontAttributeName, nil, nil]; errorAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor redColor], NSForegroundColorAttributeName, [NSFont boldSystemFontOfSize:0], NSFontAttributeName, nil, nil]; } - init { self = [super init]; if(![self loadMyNibNamed:@"ConversationWindow"]) { [NSException raise:@"ConversationException" format:@"Unable to load Conversation Window resources"]; [self dealloc]; return nil; } context = [STEnvironment environmentWithDefaultDescription]; [self defineStandardObjects]; RETAIN(context); conversation = [[STConversation alloc] initWithContext:context language:nil]; [self updateLanguageList]; [inputText setController:self]; return self; } - (void)dealloc { RELEASE(context); RELEASE(conversation); [super dealloc]; } - (void)defineStandardObjects { [context setObject:self forName:@"Shell"]; [context setObject:self forName:@"Transcript"]; [context setObject:[NSFileManager defaultManager] forName:@"FileManager"]; [context setObject:[NSWorkspace sharedWorkspace] forName:@"Workspace"]; [context setObject:context forName:@"Environment"]; [context setObject:context forName:@"Context"]; } - (void)updateLanguageList { NSEnumerator *enumerator; NSString *languageName; enumerator = [[conversation knownLanguages] objectEnumerator]; [languageList removeAllItems]; while( (languageName = [enumerator nextObject]) ) { [languageList addItemWithTitle:languageName]; } } - (NSWindow *)window { return window; } - (void)say:(id)sender { NSString *script = [inputText string]; id result; result = [self executeScript:script]; [self displayString:[script stringByAppendingString:@"\n"] attributes:userAttributes]; [self displayResult:result]; [inputText setString:@""]; } - (id)executeScript:(NSString *)script { STEnvironment *env = [conversation context]; NSString *cmd; id result = nil; /* FIXME: why? */ cmd = [script stringByAppendingString:@" "]; NS_DURING result = [conversation runScriptFromString:cmd]; NS_HANDLER [self showException:localException]; NS_ENDHANDLER [env setObject:script forName:@"LastCommand"]; [env setObject:result forName:@"LastObject"]; return result; } - (void)updateLanguage:(id)sender { NSLog(@"Change language (not implemented)."); } - (void)displayResult:(id)obj { NSMutableString *result = [NSMutableString string]; NSString *className = NSStringFromClass([obj class]); int i; if(obj) { if([obj isKindOfClass:[NSArray class]]) { [result appendFormat:@"(%@)\n", className]; for(i = 0; i<[obj count]; i++) { [result appendFormat:@"%i %@\n", i, [self displayStringForObject:[obj objectAtIndex:i]]]; } } else if([obj isKindOfClass:[NSSet class]]) { [result appendFormat:@"(%@)\n", className]; obj = [[obj allObjects] sortedArrayUsingSelector:@selector(compare:)]; for(i = 0;i<[obj count]; i++) { [result appendFormat:@"%@\n", [self displayStringForObject:[obj objectAtIndex:i]]]; } } else if([obj isKindOfClass:[NSDictionary class]]) { NSString *key; NSArray *keys; [result appendFormat:@"(%@)\n", className]; keys = [[obj allKeys] sortedArrayUsingSelector:@selector(compare:)]; for(i = 0;i<[keys count]; i++) { key = [keys objectAtIndex:i]; [result appendFormat:@"%@ : %@\n", [self displayStringForObject:key], [self displayStringForObject:[obj objectForKey:key]]]; } } else { [result appendFormat:@"%@\n", [self displayStringForObject:obj]]; } } [result appendString:@"\n"]; [self displayString:result attributes:outputAttributes]; } - (NSString *)displayStringForObject:(id)object { NSString *str = [object description]; /* FIXME: be more intelligent */ if( [str length] > 60 ) { str = [str substringToIndex:60]; str = [str stringByAppendingString:@"..."]; } return str; } - (void)showException:(NSException *)exception { NSString *string; string = [NSString stringWithFormat:@"ERROR (%@): %@\n", [exception name], [exception reason]]; [self displayString:string attributes:errorAttributes]; } - show:(id)string { [self displayString:string attributes:outputAttributes]; } - showLine:(id)string { [self displayString:[NSString stringWithFormat:@"%@\n", string] attributes:errorAttributes]; } - (void)displayString:(NSString *)aString attributes:(NSDictionary *)attributes { NSAttributedString *astring; astring = [[NSAttributedString alloc] initWithString:aString attributes:attributes]; [dialogText insertText:AUTORELEASE(astring)]; } - (void)complete:(id)sender { // NSRange range = [inputText selectedRange]; NSLog(@"complete %@", nil); } @end steptalk-0.10.0/Applications/Conversation/ConversationWindow.gorm/0000755000175000000000000000000010140330574024340 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/ConversationWindow.gorm/data.classes0000644000175000000000000000724210140330574026635 0ustar gurkanroot{ ConversationController = { Actions = ( "say:", "updateLanguage:" ); Outlets = ( inputText, dialogText, languageList, window ); Super = NSObject; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "say:", "updateLanguage:" ); Super = NSObject; }; InputText = { Actions = ( ); Outlets = ( ); Super = NSTextView; }; }steptalk-0.10.0/Applications/Conversation/ConversationWindow.gorm/data.info0000644000175000000000000000027010140330574026125 0ustar gurkanrootGNUstep archive00002af8:00000003:00000003:00000000:01GormFilePrefsManager1NSObject%01NSString&%Latest Version0& % Typed Streamsteptalk-0.10.0/Applications/Conversation/ConversationWindow.gorm/objects.gorm0000644000175000000000000001417410140330574026666 0ustar gurkanrootGNUstep archive00002af8:00000027:000000a2:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&%NSOwner0&% ConversationController0& %  SplitView101 NSSplitView1NSView1 NSResponder% ? C C  C C&01 NSMutableArray1 NSArray&01 NSImage0 &% common_Dimple.tiff0 1 NSColor0 &%NSNamedColorSpace0 &% System0 &% controlBackgroundColor0 0&% controlShadowColor%A0& %  MenuItem101 NSMenuItem0&% Item 20&&&%%0& %  SplitView20% B$ C C  C C&0 &0 0&% System0&% controlBackgroundColor0 0&% controlShadowColor%A0& %  MenuItem20 0&% Item 3&&%%0& %  SplitView30 % B( C C  C C&0! &%A0"& %  SplitView40#% A A D@ C  D@ C&0$ &%A0%& %  SplitView50&% A @ D Cx  D Cx&0' &0(1 NSScrollView%  D C   D C &0) &0*1 NSClipView% A @ D C A  D C&0+ &0,1 NSTextView1NSText% A  D C  D C&0- &0. 0/&% System00&% textBackgroundColor  K K01 /02& %  textColor D K.031 NSScroller1 NSControl% @ @ A C  A C&04 &%051NSCell06&071NSFont%&&&&&&&&&(2 _doScroll:v12@0:4@8*% A A A A 3081NSBox% C D B  D B&09 &0:% @ @ D B  D B&0; &0<1 NSPopUpButton1NSButton% Bx C& A  C& A& 0= &%0>1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell0?&7&&&&&&&&0@1NSMenu0A&0B &0C 0D&% Item 1&&%0E 0F& % common_Nibble%%0G&0H&&&&C@%%%%%0I% ? C B`  C B`&0J &0K% A @ C BP A  C BP&0L &0M1GSTextViewTemplate1GSClassSwapper0N& %  InputText% A  C BP  C BP&0O &0P 0Q&% System0R&% textBackgroundColor  K K0S Q0T& %  textColor C KP0U% @ @ A BP  A BP&0V &%0W0X&7&&&&&&&&&IK% A A A A U0Y% C ? B` B`  B` B`&!0Z &%0[0\&% Say0] 0^& %  common_ret7&&&&&&&&%0_&0`&0a 0b& %  common_retH&&&0c1 NSTextFieldCell0d&% Title7&&&&&&&&0%0e 0f&% System0g&% windowBackgroundColor0h 0i&% System0j& %  textColor @ @%%%A0k&% ButtonY0l&% TextView,0m& %  SplitView0n%  C C  C C&0o & %A0p&% MenuItemC0q& %  GormNSWindow0r1!NSWindow%  D C&% C D7@0s%  D C  D C&0t &&e0u&% Window0v&% Window0w&%Window ? A F@ F@%0x 0y&%NSApplicationIcon0z&% GSCustomClassMap0{&0|& %  TextView1N0}& %  ScrollView(0~& %  ScrollView1I0&% Box8|M0&% GormNSPopUpButton<0 &01"NSNibConnectorq0&%NSOwner0"k0"}%0"l%0"~0"|0"0"%0"p0"0"0"m0"0"0"0""0"%01#NSNibOutletConnector|0& %  inputText0#l0& %  dialogText0#0& %  languageList01$NSNibControlConnector0&% updateLanguage:0$k0&% say:0#q0&% window0#q0&% delegate01% GSMutableSet1& NSMutableSet1'NSSet&rsteptalk-0.10.0/Applications/Conversation/GNUmakefile0000600000175000000000000000350110132015545021573 0ustar gurkanroot# Script Papers # # Copyright (C) 2002 Stefan Urbanek # # Written by: Stefan Urbanek # Date: 2003 Apr 26 # # This file is part of the AgentFarms # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = ScriptConversations PACKAGE_NAME = ScriptConversations ScriptConversations_APPLICATION_ICON = ScriptConversations_MAIN_MODEL_FILE = ScriptConversations.gorm ADDITIONAL_GUI_LIBS += -lStepTalk ############################################################################ # ObjC files ScriptConversations_OBJC_FILES= \ AppController.m \ ConversationController.m \ NSObject+NibLoading.m \ NSTextView+additions.m \ InputText.m \ main.m ############################################################################ # Resource files ScriptConversations_RESOURCE_FILES= \ ScriptConversations.gorm \ ConversationWindow.gorm ADDITIONAL_OBJCFLAGS = -Wno-import ############################################################################ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble steptalk-0.10.0/Applications/Conversation/InputText.h0000644000175000000000000000031510132015547021650 0ustar gurkanroot#import @class ConversationController; @interface InputText:NSTextView { ConversationController *controller; } - (void)setController:(ConversationController *)aController; @end steptalk-0.10.0/Applications/Conversation/InputText.m0000644000175000000000000000157010132015547021661 0ustar gurkanroot#import "InputText.h" #import @implementation InputText - (void) keyDown:(NSEvent *) theEvent { NSString *characters; unichar character; characters = [theEvent characters]; character = 0; if ( [characters length] > 0 ) { character = [characters characterAtIndex: 0]; switch ( character ) { case '\n': case '\r': if ( [theEvent modifierFlags] & NSControlKeyMask ) { [controller say:self]; } break; case '\t': [controller complete:self]; break; default: [super keyDown:theEvent]; } } else { [super keyDown:theEvent]; }; } - (void)setController:(ConversationController *)aController { controller = aController; } @end steptalk-0.10.0/Applications/Conversation/MainMenu.gorm/0000755000175000000000000000000010132015547022210 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/MainMenu.gorm/data.classes0000644000175000000000000000670010132015547024503 0ustar gurkanroot{ AppController = { Actions = ( ); Outlets = ( ); Super = NSObject; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; }steptalk-0.10.0/Applications/Conversation/MainMenu.gorm/objects.gorm0000644000175000000000000000746010132015547024536 0ustar gurkanrootGNUstep archive00002a94:0000000e:0000008a:0000000b:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString& %  MenuItem101 NSMenuItem0&% Quit0&% q&&%01NSImage0&% common_2DCheckMark0 0 & %  common_2DDash2 terminate:v12@0:4@8%0 &% NSOwner0 & %  NSApplication0 & %  MenuItem200&% Info0&&&% 2 submenuAction:v12@0:4@8%01NSMenu01 NSMutableArray1 NSArray&00& %  Info Panel...0&&&% 2 orderFrontStandardInfoPanel:v12@0:4@8%00&% Preferences...0&&&% %00&% Help...0&% ?&&% %00& %  Main Menu0 &00 & %  Conversation0!&&&% %0"0#&% Submenu0$ &0%0&&% New0'&% n&&% %0(0)&% Edit0*&&&% %0+)0, &0-0.&% Cut0/&% x&&% 2 cut:@12@0:4@8%0001&% Copy02&% c&&% 2 copy:@12@0:4@8%0304&% Paste05&% v&&% 2 paste:@12@0:4@8%0607& %  Select All08&% a&&% 2 selectAll:v12@0:4@8%090:&% Windows0;&&&% %0<:0= &0>0?&% Arrange In Front0@&&&% 2 arrangeInFront:v12@0:4@8%0A0B&% Miniaturize Window0C&% m&&% 2  performMiniaturize:v12@0:4@8%0D0E& %  Close Window0F&% w&&% 2 performClose:v12@0:4@8%0G0H&% Services0I&&&% %0JH0K &0L0M&% Hide0N&% h&&% 2  hide:v12@0:4@8%0O& %  MenuItem30P&% MenuItemL0Q& %  MenuItem40R& %  MenuItem50S& %  MenuItem60T& %  MenuItem10A0U& %  MenuItem7%0V& %  MenuItem11D0W& %  MenuItem890X& %  MenuItem12G0Y& %  MenuItem9>0Z& %  MenuItem13(0[& %  GormNSMenu0\&% GSCustomClassMap0]&0^& %  MenuItem14-0_& %  MenuItem1500`& %  MenuItem1630a& %  NSVisible0b &0c& %  MenuItem1760d& %  GormNSMenu1"0e& %  GormNSMenu2<0f& %  GormNSMenu3J0g& %  GormNSMenu4+0h& %  AppController0i1 GSNibItemh  &0j&% NSMenu0k &0l1 NSNibConnectorj0m&% NSOwner0n Pj0o j0p hm0q1 NSNibOutletConnectormh0r&% delegate0s j0t [ 0u O[0v Q[0w R[0x Sj0y dS0z Ud0{ Wj0| eW0} Ye0~ Te0 Ve0 Xj0 fX0 Zj0 gZ0 ^g0 _g0 `g0 cg01NSNibControlConnectorU0&% NSFirst0& %  newDocument:steptalk-0.10.0/Applications/Conversation/NSObject+NibLoading.h0000600000175000000000000000173010132015545023345 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSObject(NibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName; @end steptalk-0.10.0/Applications/Conversation/NSObject+NibLoading.m0000600000175000000000000000312710132015545023354 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSObject+NibLoading.h" #import @implementation NSObject(NibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName { NSDictionary *dict; NSBundle *bundle; BOOL flag; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, @"NSOwner", nil, nil]; bundle = [NSBundle bundleForClass:[self class]]; flag = [bundle loadNibFile:aName externalNameTable:dict withZone:[self zone]]; if(!flag) { NSRunAlertPanel(@"Unable to load resources", @"Unable to load '%@' resources", @"Cancel", nil, nil, aName); } return flag; } @end steptalk-0.10.0/Applications/Conversation/NSTextView+additions.h0000644000175000000000000000203210132015546023673 0ustar gurkanroot/** NSTextView additions Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSTextView(PaperAdditions) - (NSString *)selectedString; - (BOOL)hasSelection; @end steptalk-0.10.0/Applications/Conversation/NSTextView+additions.m0000644000175000000000000000235210132015546023705 0ustar gurkanroot/** NSTextView additions Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSTextView+additions.h" @implementation NSTextView(PaperAdditions) - (NSString *)selectedString { NSRange range = [self selectedRange]; return [[self attributedSubstringFromRange:range] string]; } - (BOOL)hasSelection { NSRange range = [self selectedRange]; return (range.length != 0); } @end steptalk-0.10.0/Applications/Conversation/a/0000755000175000000000000000000010132015547017754 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/a/ConversationWindow.gorm/0000755000175000000000000000000010132015547024561 5ustar gurkanrootsteptalk-0.10.0/Applications/Conversation/a/ConversationWindow.gorm/data.classes0000644000175000000000000000724210132015547027056 0ustar gurkanroot{ ConversationController = { Actions = ( "say:", "updateLanguage:" ); Outlets = ( inputText, dialogText, languageList, window ); Super = NSObject; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "say:", "updateLanguage:" ); Super = NSObject; }; InputText = { Actions = ( ); Outlets = ( ); Super = NSTextView; }; }steptalk-0.10.0/Applications/Conversation/a/ConversationWindow.gorm/objects.gorm0000644000175000000000000001315610132015547027106 0ustar gurkanrootGNUstep archive00002a94:00000024:000000a1:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% NSOwner0&% ConversationController0& %  SplitView101 NSSplitView1NSView1 NSResponder% ? C C  C C&01 NSMutableArray1 NSArray&01 NSImage0 &% common_Dimple.tiff0 1 NSColor0 &% NSNamedColorSpace0 &% System0 &% controlBackgroundColor0 0&% controlShadowColor%A0& %  MenuItem101 NSMenuItem0&% Item 20&&&%%0& %  SplitView20% B$ C C  C C&0 &0 0&% System0&% controlBackgroundColor0 0&% controlShadowColor%A0& %  MenuItem20 0&% Item 3&&%%0& %  SplitView30 % B( C C  C C&0! &%A0"& %  SplitView40#% A A D@ C  D@ C&0$ &%A0%& %  SplitView50&% A @ D Cx  D Cx&0' &0(1 NSScrollView%  D C   D C &0) &0*1 NSClipView% A @ D C A  D C&0+ &0,1 NSTextView1NSText% A  D C  D C&0- &0. 0/&% System00&% textBackgroundColor  K K01 /02& %  textColor D K.031 NSScroller1 NSControl% @ @ A C  A C&04 &%051NSCell06&071NSFont%&&&&&&&&&(2 _doScroll:v12@0:4@8*% A A A A 3081NSBox% C D B  D B&09 &0:% @ @ D B  D B&0; &0<1 NSPopUpButton1NSButton% Bx C& A  C& A& 0= &%0>1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell0?&7&&&&&&&&0@1NSMenu0A&0B &0C 0D&% Item 1&&%0E 0F& %  common_Nibble%%0G&0H&&&&C@%%%%%0I% ? C B`  C B`&0J &0K% A @ C BP A  C BP&0L &0M1GSTextViewTemplate1GSClassSwapper0N& %  InputText% A  C BP  C BP&0O &0P 0Q&% System0R&% textBackgroundColor  K K0S Q0T& %  textColor C KP0U% @ @ A BP  A BP&0V &%0W0X&7&&&&&&&&&IK% A A A A U0Y% C ? B` B`  B` B`&!0Z &%0[0\&% Say0] 0^& %  common_ret7&&&&&&&&%0_&0`&0a 0b& %  common_retH&&&0c1 NSTextFieldCell0d&% Title7&&&&&&&&%0e 0f&% System0g&% windowBackgroundColor0h 0i&% System0j& %  textColor @ @%%%A0k&% ButtonY0l&% TextView,0m& %  SplitView0n%  C C  C C&0o & %A0p&% MenuItemC0q& %  GormNSWindow0r1!NSWindow%  D C&% C` D30s%  D C  D C&0t &&e0u&% Window0v&% Window0w&% Window ? A F@ F@%0x 0y&% NSApplicationIcon0z&% GSCustomClassMap0{&0|& %  TextView1N0}& %  ScrollView(0~& %  ScrollView1I0&% Box8|M0&% GormNSPopUpButton<0 &01"NSNibConnectorq0&% NSOwner0"k0"}%0"l%0"~0"|0"0"%0"p0"0"0"m0"0"0"0""0"%01#NSNibOutletConnector|0& %  inputText0#l0& %  dialogText0#0& %  languageList01$NSNibControlConnector0&% updateLanguage:0$k0&% say:0#q0&% window0#q0&% delegatesteptalk-0.10.0/Applications/Conversation/main.m0000600000175000000000000000207710132015545020632 0ustar gurkanroot/** main Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Feb 20 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #define APP_NAME @"GNUstep" /* * Initialise and go! */ int main(int argc, const char *argv[]) { return NSApplicationMain (argc, argv); } steptalk-0.10.0/Applications/Conversation/run0000755000175000000000000000006410132015547020266 0ustar gurkanrootmake debug=yes && openapp ScriptConversations.debug steptalk-0.10.0/Applications/ScriptPapers/0000775000175000000000000000000010132015545017501 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/AppController.h0000600000175000000000000000174010132015545022426 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface AppController : NSObject { } @end steptalk-0.10.0/Applications/ScriptPapers/AppController.m0000600000175000000000000000273410132015545022437 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "AppController.h" #import #import #import #import #import #import "ScriptPaper.h" #import "ScriptPaperController.h" @interface AppController(Private) @end @implementation AppController - init { [super init]; return self; } - (void)dealloc { [super dealloc]; } - (void)applicationDidFinishLaunching:(id)notif { /* Go to known state of application */ [[NSDocumentController sharedDocumentController] newDocument:nil]; } @end steptalk-0.10.0/Applications/ScriptPapers/ChangeLog0000644000175000000000000000036110132015545021251 0ustar gurkanroot2003 May 11 Stefan Urbanek * Added -Wno-import * Added TODO 2003 May 4 Stefan Urbanek * Added application icon 2003 May 4 Stefan Urbanek * ChangeLog started steptalk-0.10.0/Applications/ScriptPapers/English.lproj/0000775000175000000000000000000010132015545022217 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/ContextBrowser.gorm/0000755000175000000000000000000010132015545026150 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/ContextBrowser.gorm/data.classes0000644000175000000000000000655610132015545030454 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; }steptalk-0.10.0/Applications/ScriptPapers/English.lproj/ContextBrowser.gorm/objects.gorm0000644000175000000000000000711710132015545030475 0ustar gurkanrootGNUstep archive00002968:0000001c:0000005a:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% NSOwner0& %  NSApplication0&% GSCustomClassMap0&0& %  TableColumn101 NSTableColumn0 &% column2 CԀ A GP0 1NSTableHeaderCell1NSTextFieldCell1 NSActionCell1 NSCell0 &%  0 1 NSFont0 &% Helvetica-Bold A@A@&&&&&&&&%01 NSColor0&% NSNamedColorSpace0&% System0&% controlShadowColor0 0&% System0&% windowFrameTextColor00&% nine0 0& %  Helvetica A`A`&&&&&&&&%01 NSTableView1 NSControl1NSView1 NSResponder%  C C!  C C!&01NSMutableArray1NSArray&%0 0&&&&&&&&&0&00&% column1 BP A GP0 0!&%  &&&&&&&&%0"0#&% neuf#&&&&&&&&%0$ 0%&% textBackgroundColor0& 0'& %  textColor0( 0)& %  gridColor0* 0+&% controlBackgroundColor0,1NSTableHeaderView%  C A  C A&0-&0.1GSTableCornerView% @ @ A A  A A&0/&%% A @ @@$&00& %  ScrollView011 NSScrollView% B C C_  C C_&02&031 NSClipView% A A C CE  C CE&04&05 06&% controlBackgroundColor071 NSScroller% @ A A CE  A CE&08&%09 &&&&&&&&&12 _doScroll:v12@0:4@8.0:% A @ C A  C A&0;&,0< 0=& %  controlColor3% A A A A 7:0>&% Button0?1NSButton% C A B` A  B` A&0@&%0A1 NSButtonCell0B&% Delete&&&&&&&&%?0C&0D&&&&0E& %  GormNSWindow0F1NSWindow%  C C&% C D:0G%  C C  C C&0H&1?0I 0J&% System0K&% windowBackgroundColor0L&% Window0M&% Window0N&% Window ? A F@ F@%0O1NSImage0P&% NSApplicationIcon0Q& %  TableColumn0R&% GormNSTableView0S&0T1NSNibConnectorE0U&% NSOwner0V00WR0XQ0Y0Z>steptalk-0.10.0/Applications/ScriptPapers/English.lproj/NewPaperPanel.gorm/0000755000175000000000000000000010132015545025661 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/NewPaperPanel.gorm/data.classes0000644000175000000000000000655610132015545030165 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; }steptalk-0.10.0/Applications/ScriptPapers/English.lproj/NewPaperPanel.gorm/objects.gorm0000644000175000000000000001132010132015545030175 0ustar gurkanrootGNUstep archive00002968:00000022:00000070:00000005:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% NSOwner0& %  NSApplication0&% GSCustomClassMap0&0& %  GormNSWindow0&% NSPanel0 &% TextView0 1 NSTextView1NSText1NSView1 NSResponder% A  C; C  C; C&0 1 NSMutableArray1 NSArray&0 1 NSColor0 &% NSNamedColorSpace0&% System0&% textBackgroundColor  K K0 0& %  textColor C; K0& %  ScrollView01 NSScrollView% B CR C  CR C&0 &01 NSClipView% A @ C; C A  C; C&0 & 01 NSScroller1 NSControl% @ @ A C  A C&0 &%01NSCell0&01NSFont0& %  Helvetica A`A`&&&&&&&&&2 _doScroll:v12@0:4@8% A A A A 0& %  GormNSBrowser01 NSBrowser% A CF C> C  C> C&0 &0 %  C> B  C> B&0! &0"% A @ C' B  C' B&0# &0$1NSMatrix%  C' B  C' B&0% &%0&1 NSActionCell0'&&&&&&&&&%% C' B 0( 0)&% System0*&% controlBackgroundColor(0+& %  NSBrowserCell0,1 NSBrowserCell0-&&&&&&&&&%%0. &2doClick:2doDoubleClick:0/ 00&% System01&% controlBackgroundColor02% @ @ A B  A B&03 &%04-&&&&&&&&& "% A A A A 2%05-&&&&&&&&,06&% NSMatrix07&% /% B08% @ ? B A  B A&09 &%0:-&&&&&&&&&2 scrollViaScroller:v12@0:4@8   C> B0; &0<1NSBrowserColumn $%70=0> % C  C B  C B&0? &0@% A @ B B  B B&0A &0B )0C& %  controlColor0D% @ @ A B  A B&0E &%0F'&&&&&&&&&>2 _doScroll:@% A A A A D%%%0G1NSWindowTemplate1NSWindow0H& %  GormNSWindow%  CR C&% C D40I%  CR C  CR C&0J &0K1 NSPopUpButton1NSButton% B4 C B A  B A&0L &%0M1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell0N&% Button&&&&&&&&0O1NSMenu0P&0Q &0R1 NSMenuItem0S&% Item 10T&&&%0U1!NSImage0V& %  common_Nibble%0W 0X&% Item 2T&&%%0Y 0Z&% Item 3T&&%%%K0[&0\&&&&OR%%%%%0] )0^&% windowBackgroundColor0_&% Window0`&% Window0a&% Window ? A F@ F@%0b!0c&% NSApplicationIcon0d&% GormNSPopUpButtonK0e &0f1"NSNibConnector0g&% NSOwner0h"0i& %  ScrollView0j"0k&% TextView0l"0m"dsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/Paper.gorm/0000755000175000000000000000000010132015545024227 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/Paper.gorm/data.classes0000644000175000000000000000674210132015545026530 0ustar gurkanroot{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; ScriptPaperController = { Actions = ( ); Outlets = ( sourceView ); Super = NSWindowController; }; }steptalk-0.10.0/Applications/ScriptPapers/English.lproj/Paper.gorm/objects.gorm0000644000175000000000000000371010132015545026547 0ustar gurkanrootGNUstep archive00002968:00000016:00000031:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% NSOwner0&% ScriptPaperController0&% GSCustomClassMap0&0&% TextView01 NSTextView1NSText1NSView1 NSResponder% A  C C  C C&0 1 NSMutableArray1 NSArray&0 1 NSColor0 &% NSNamedColorSpace0 &% System0 &% textBackgroundColor  K K0 0& %  textColor C K0& %  ScrollView01 NSScrollView%  C C  C C&0 &01 NSClipView% A @ C C A  C C&0 & 01 NSScroller1 NSControl% @ @ A C  A C&0 &%01NSCell0&01NSFont0& %  Helvetica A`A`&&&&&&&&&2 _doScroll:v12@0:4@8% A A A A 0& %  GormNSWindow01NSWindow%  C C&% C\ D@0%  C C  C C&0 &0 0 &% System0!&% windowBackgroundColor0"&% Window0#&% Window0$&% Window ? A F@ F@%0%1NSImage0&&% NSApplicationIcon0' &0(1NSNibConnector0)&% NSOwner0*0+0,1NSNibOutletConnector)0-&% window0.)0/&% delegate00)01& %  sourceViewsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/0000755000175000000000000000000010132015545025577 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/data.classes0000644000175000000000000000676110132015545030101 0ustar gurkanroot{ AppController = { Actions = ( ); Outlets = ( ); Super = NSObject; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontSharedMemoryPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "doSelection:", "doAndShowSelection:" ); Super = NSObject; }; }steptalk-0.10.0/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/objects.gorm0000644000175000000000000003132010132015545030115 0ustar gurkanrootGNUstep archive00002968:0000000e:000001c0:00000022:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&`01NSString& %  GormNSMenu101NSMenu0&% Edit01NSMutableArray1NSArray&01 NSMenuItem0&% Cut0 &% x&&%0 1 NSImage0 &% common_2DCheckMark0 0 & %  common_2DDash2 cut:@12@0:4@8%0 0&% Copy0&% c&&% 2 copy:@12@0:4@8%0 0&% Paste0&% v&&% 2 paste:@12@0:4@8%0 0& %  Select All0&% a&&% 2 selectAll:v12@0:4@8%0 0&% Find0&&&% 2submenuAction:%00&0 0& %  Find Panel...0&% f&&% %0 0 & %  Find Next0!&% g&&% %0" 0#& %  Find Previous0$&% d&&% %0% 0&&% Enter Selection0'&% e&&% %0( 0)&% Jump To Selection0*&% j&&% %0+ 0,& %  Font Panel...0-&% t&&% 2 orderFrontFontPanel:v12@0:4@8%0. 0/& %  Colors...00&&&% 2 orderFrontColorPanel:v12@0:4@8%01& %  MenuItem3202 03& %  Copy Ruler04&% 1&&% 2 copyRuler:v12@0:4@8%05& %  GormNSMenu20607&% Windows08&09 0:&% Arrange In Front0;&&&% 2  arrangeInFront:v12@0:4@8%0< 0=&% Miniaturize Window0>&% m&&% 2  performMiniaturize:v12@0:4@8%0? 0@& %  Close Window0A&% w&&% 2 performClose:v12@0:4@8%0B& %  MenuItem330C 0D& %  Paste Ruler0E&% 2&&% 2 pasteRuler:v12@0:4@8%0F& %  GormNSMenu30G0H&% Services0I&0J& %  MenuItem340K 0L& %  Font Panel...0M&% t&&% %0N& %  GormNSMenu40O0P&% Paper0Q&0R 0S&% Open...0T&% o&&% 2 openDocument:@12@0:4@8%0U 0V&% New0W&% n&&% 2 newDocument:v12@0:4@8%0X 0Y&% Save...0Z&% s&&% 2 saveDocument:v12@0:4@8%0[ 0\& %  Save As...0]&% S&&% 2 saveDocumentAs:v12@0:4@8%0^ 0_& %  Save To...0`&&&% 2 saveDocumentTo:v12@0:4@8%0a 0b&% Save All0c&&&% 2 saveAllDocuments:v12@0:4@8%0d 0e&% Close0f&&&% 2 close:@12@0:4@8%0g& %  MenuItem350h 0i&% Bold0j&% b&&% 2 addFontTrait:v12@0:4@8%0k& %  GormNSMenu50l0m&% Format0n&0o 0p&% Font0q&&&% %0rp0s&  Kh0t 0u&% Italic0v&% i&&% %0w 0x& %  Underline0y&&&% 2 underline:v12@0:4@8%0z 0{& %  Superscript0|&&&% 2 superscript:v12@0:4@8%0} 0~& %  Subscript0&&&% 2 subscript:v12@0:4@8%0 0&% Unscript0&&&% 2 unscript:v12@0:4@8%0 0& %  Copy Font0&% 3&&% 2 copyFont:v12@0:4@8%0 0& %  Paste Font0&% 4&&% 2 pasteFont:v12@0:4@8%l0 0&% Text0&&&% %00&0 0& %  Align Left0&&&% 2 alignLeft:v12@0:4@8%0 0&% Center0&&&% 2 alignCenter:v12@0:4@8%0 0& %  Align Right0&&&% 2 alignRight:v12@0:4@8%0 0& %  Show Ruler0&&&% 2 toggleRuler:v12@0:4@8%2Cl0 0& %  Colors...0&&&% %0 0&% Page Layout...0&% P&&% 2 runPageLayout:v12@0:4@8%0& %  MenuItem36t0& %  GormNSMenu60& %  MenuItem37w0& %  GormNSMenu7r0& %  MenuItem38z0& %  GormNSMenu80& %  MenuItem39}0& %  MenuItem600 0&% Script0&&&% %00&% Do0&0 0& %  Do Selection0&% e&&% %0 0&% Do and Show Selection0&% d&&% %00& %  Script Papers0&  0 0&% Info0&&&% %00&0 0& %  Info Panel...0&&&% 2  orderFrontStandardInfoPanel:v12@0:4@8%0 0&% Preferences...0&&&% %0± 0ñ&% Help...0ı&% ?&&% %0ű P0Ʊ&&&% %O0DZ 0ȱ&&&% %0ɱ 0ʱ&% Tools0˱&&&% %0̱0ͱ&0α 0ϱ& %  Inspector0б&% 1&&% %0ѱ 70ұ&&&% %60ӱ H0Ա&&&% %G0ձ 0ֱ&% Hide0ױ&% h&&% 2! hide:v12@0:4@8%0ر 0ٱ&% Quit0ڱ&% q&&% 2" terminate:v12@0:4@8%0۱& %  GormNSMenu90ܱ& %  MenuItem610ݱ& %  MenuItem620ޱ& %  MenuItem630߱& %  MenuItem640& %  MenuItem650& %  MenuItem660 0&% Font0&&&% %00&0 0&% Bold0&% b&&% %0 0&% Italic0&% i&&% %0 0& %  Underline0&&&% %0 0& %  Superscript0&&&% %0 0& %  Subscript0&&&% %0 0&% Unscript0&&&% %0 0& %  Copy Font0&% 3&&% %0 0& %  Paste Font0&% 4&&% %0P&% FormatP&P P&% TextP&&&% %PP&P P& %  Align LeftP &&&% %P P &% CenterP &&&% %P P& %  Align RightP&&&% %P P& %  Show RulerP&&&% %P P& %  Copy RulerP&% 1&&% %P P& %  Paste RulerP&% 2&&%  %P P&% Page Layout...P&% P&&% %P& %  MenuItem67P&% NSMenuP& %  NSVisibleP&P & %  MenuItem68P!& %  MenuItem69+P"& %  MenuItem10P#& %  MenuItem11P$& %  MenuItem129P%& %  MenuItem13& %  MenuItem75P?& %  MenuItem76P@& %  MenuItem77PA& %  GormNSMenu10PB& %  GormNSMenu11PC& %  GormNSMenu12PD& %  MenuItem20[PE& %  MenuItem21^PF& %  GormNSMenuPG& %  MenuItem22aPH& %  MenuItem23.PI& %  MenuItem24dPJ& %  MenuItem25oPK& %  MenuItem26PL& %  MenuItem27PM& %  MenuItem28PN& %  MenuItem29PO& %  MenuItem1PP&% NSOwnerPQ& %  NSApplicationPR& %  MenuItem50PS& %  MenuItem2PT& %  MenuItem51PU& %  MenuItem3PV& %  MenuItem52PW& %  MenuItem4PX& %  MenuItem53PY& %  MenuItem5PZ& %  MenuItem54P[& %  MenuItem6P\& %  MenuItem55P]& %  MenuItem7P^& %  MenuItem56P_& %  MenuItem8P`& %  MenuItem57Pa& %  MenuItem9Pb& %  MenuItem58Pc& %  MenuItem59Pd&% GSCustomClassMapPe&Pf& %  MenuItem30Pg& %  MenuItem31Ph&SSPi1 NSNibConnectorPj&% NSOwnerPk 9Pl OPm `Pn F`Po UFPp WFPq YFPr cPs cPt ]Pu _Pv aPw "Px #Py 5#Pz $5P{ %5P| &5P} ^P~ F^P bP NbP NP NP +NP DNP ENP GNP INP JkP KkP LkP KP MP NP fP gP 1P BP JP JP gP P P P P ,P -P .P /kP 0P 0P 1P 2P 3P 4P 5P RP RP TېP VP AVP XAP ZېP1 NSNibControlConnectorTP&% NSFirstP& %  doSelection:P ZP&% doAndShowSelection:P ;jP1NSNibOutletConnectorj;P&% delegateP BP BP  BP CP 6CP 7CP 8CP :CP =CP >CP ?CP @CP !P Hsteptalk-0.10.0/Applications/ScriptPapers/GNUmakefile0000600000175000000000000000355610132015545021552 0ustar gurkanroot# Script Papers # # Copyright (C) 2002 Stefan Urbanek # # Written by: Stefan Urbanek # Date: 2003 Apr 26 # # This file is part of the AgentFarms # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = ScriptPapers PACKAGE_NAME = ScriptPapers ScriptPapers_APPLICATION_ICON = ScriptPapers_MAIN_MODEL_FILE = ScriptPapers.gorm ADDITIONAL_GUI_LIBS += -lStepTalk ############################################################################ # ObjC files ScriptPapers_OBJC_FILES= \ AppController.m \ ScriptPaper.m \ ScriptPaperController.m \ NSObject+NibLoading.m \ NSTextView+additions.m \ main.m ############################################################################ # Resource files ScriptPapers_LOCALIZED_RESOURCE_FILES= \ ScriptPapers.gorm \ Paper.gorm ScriptPapers_RESOURCE_FILES= \ Images/ScriptPaperFile.tiff \ Images/ScriptPapers.tiff ADDITIONAL_OBJCFLAGS = -Wno-import ############################################################################ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble steptalk-0.10.0/Applications/ScriptPapers/Images/0000775000175000000000000000000010132015545020706 5ustar gurkanrootsteptalk-0.10.0/Applications/ScriptPapers/Images/ScriptPaperFile.tiff0000644000175000000000000000672010132015545024617 0ustar gurkanrootII* P8$ BaPd6DbQ8qV,cr5 AJdI(c3`G2FRHLk$0,o 篌Q&m¾E3 3,Kr{M7HOm=4=O!:N 8syi8RE?4~ӇOD)pUu\Չ`և[n`W5h`\gUUaceI7ۇ =8~筬hۇo)R]5uy^${]ĵv]!Xn fFlti'24IF KrK6Lj۩gɫ:,lñN {i{~ݸ1oѿJԬУ܃)46,z,$1ú .,Um]P +(].)j+2K햃4w5?wx.㯴S^ͮ Cb|հ %?$7Bş.cN=`?ĸN|2@B@#b"d,.(@@g`C8r0HUP.1>C40{E^l_)1H ar?p09Fp-` f @aFR.W9F%IgV^/afqvQCi2h_$&E"\]1+hEf?ЀC\DXkpȰp?4v9?W_S3G3*nC7Nؒ~+Š_ e2cxuFZ$Ƚ{ABHZP* A(;.? #9K4(=D !7YyoIfnL:?1 w)]u` iSht.x0P?I.qM/lX5T?09my0L@)`֒|YCi ?-yo A=%D"wnlEK0ث)@$G 8-l\?ˆR ;'Yxf?f5Hag&I?dԢ${|?quYՃM!.6 n"bLh A}Wwۨ^ 0>Cp;. aj8&'50UQp/'jUyR%.IEs"eW.r{ϐ*WhD Nx9{NC:R+z6fo?xIMO_,B@K`&`^B+%b:$w;xjy<8At |19lz)D-r@{Љߍ7BCGYG._(78Be c"oyFRs6iZ1gR5T ё# a8/6ț*Dp?b@ Ęo(ABEV0]S΀\ Ὡu>.j%\JVz|@1Fb6)bJ_LxQϡ:(BCdEwCo0鹈#+|rr=ϺCPn-6a`, pD@? Lf(nSe'.LᜐHU AWm@-,ꐢ [ 2֤!7oPf b?p0ye=}-x$'DzzC>Ax0ע'6|9 A=_n?H*B$G CPaƷh|wb!j1.0':ek(H! t\M~@.aʾHAHv ФKj(M`H-pmaT b  DAG!86<9.x{ kD"蠊A *!A -0#A\0P`JV  $ hAL Р f &R`Z `Dg+a,pp$ `@ف ܡIA~+ ?~HP2OCّ*e q.mH O @D503&9"0VwZ|l/n au k\- 5h(D i8 hn(48!C~[&S'yp*2L`a` π  $PI~v`~M!H $w`!aTC:TGD@Y `ETX @bmJ`h7^O8XT@ITCf 539K4KtZ0v ! GaL2 b t+ԻNtN" Ύ99 aEN"O OU NQQ#4Q 00    (R ' 'steptalk-0.10.0/Applications/ScriptPapers/Images/ScriptPapers.tiff0000644000175000000000000001034010132015545024173 0ustar gurkanrootII* DA@PDbQ8V-FcQD H 7RL*eBU)%s|c,M'S9dUOFԚ &_MNS fE?շXlV;%gZmVeohNpw2r_|#7ذ9?orXFO-aȉ nώ4OI2_fXevOV'vy3yaڲG?'2;.'2$븻P_#}=Oγ|,?+'i}n^*#p P { =qEBM 4zDcܵ@.׆KP[pʹ8tpn͢'!Xg%䤜rBJ< [Z˒/Q,L5siCNlc;Ʃtχ?0P- R ч)G,JSp0,CM DuR" V.!W|%М*-9)yYenK-g8LuY1 m\Qq]̒]i_%Q{f:f:[Wlǹtw~6+k̖% ,r+nD9)4ߕY}e2Ӊ9Uhi [gwzDSF[)Laga6^{n=Iٽ spIǑ7r[:-ϟ$].1IuM_VYU8Y yIgyo)P7&q%hX~t:~`WC{T ,?, _CMA%Ir@%B;'/͆O1S[mY,ZWuP7AkzTY"h?,a2?7꽃rP7Fi~1Q pEuaflHQB\FFh d%%l:x~?Gi֬]D hU`Ъ6D#G&.apP1pڧPQhԈrn)^ WD?M^ɱ0?e^P#m*!db^(&စNc$IBT[0p(  (8]] n`nݳ :/5(t 8{/>1SW[gzPM V&E"\]E+qhH1S6"Q*P\8PlSŤYͣJiC35 0?p+͈kA7é&$Ƚ!A?`:D`UjV&:A*Gs pB !@gM qH`[p70AR0T++Pux`XQ XEe,jh`jZ^@ c"+ A^$T> f'r@8a"?xt >4% ,abڀ/,6,4zsF2 ꡀ f P0o`IϰB!RnGfol,  Nే&ez @ 9"T,İ{ÍjR e #Oi<>'A!<JA^pO8 " o@kak " b  ",c?b800iq(0.0 l *XcЦ zcAǏ0-f/{ N" `n a00cab&NE0 ZVM X  n ea0lu A@BaMf0S! R u@ ~ ębGeff% 5&a&`4l-0җ N(n @ - n1' mANX`HQ `` + ؠ l ` \w" 1%LtoDL5 NI'tp8jlV(&8fP  :A@N>BW5_5XkTP Fn i+E {Oّ#1+1JP $N^Ġ+;1.@H/ tA t Q Q8UH s6ɷ SsQ>jѥi@1B^8XJOrF9=H6Ja ^ @Z B@TS"%BgC,E8"_6j&x 8[A4j%VRDWMLam!ezLRCA ' q@AL r %Vn  m6K%&|9à2)Rs;påМ.4ܥetzY , -OLa koSgQcz:2WZw G`sbpE'.}ʏdu VvO  rz&j(̵h>`!bW`- @5L*8G  ]$T-Um+\D.u: m+TS\^@ .  j!p`G  ;5dDT58b ԁ@[sР[V *l ta ' 7-  `ܰ|ꎖFiw% ur0hb"8Ah~:z7z{7{W Ȏ: @ aT`(2N0 ! 2!.@:l8 P Vjx$* @#$AX8:x>8E8I 2!aaJ1  @@vAKuX{yA*O8ba@) EX ᾦ  la ͮax 8?j"p rH" XU"=9-187B 00(R ' 'steptalk-0.10.0/Applications/ScriptPapers/NSObject+NibLoading.h0000600000175000000000000000173010132015545023312 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSObject(NibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName; @end steptalk-0.10.0/Applications/ScriptPapers/NSObject+NibLoading.m0000600000175000000000000000312710132015545023321 0ustar gurkanroot/** NSObject+NibLoading Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Oct 10 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSObject+NibLoading.h" #import @implementation NSObject(NibLoading) - (BOOL)loadMyNibNamed:(NSString *)aName { NSDictionary *dict; NSBundle *bundle; BOOL flag; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, @"NSOwner", nil, nil]; bundle = [NSBundle bundleForClass:[self class]]; flag = [bundle loadNibFile:aName externalNameTable:dict withZone:[self zone]]; if(!flag) { NSRunAlertPanel(@"Unable to load resources", @"Unable to load '%@' resources", @"Cancel", nil, nil, aName); } return flag; } @end steptalk-0.10.0/Applications/ScriptPapers/NSTextView+additions.h0000644000175000000000000000203210132015545023637 0ustar gurkanroot/** NSTextView additions Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSTextView(PaperAdditions) - (NSString *)selectedString; - (BOOL)hasSelection; @end steptalk-0.10.0/Applications/ScriptPapers/NSTextView+additions.m0000644000175000000000000000235210132015545023651 0ustar gurkanroot/** NSTextView additions Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSTextView+additions.h" @implementation NSTextView(PaperAdditions) - (NSString *)selectedString { NSRange range = [self selectedRange]; return [[self attributedSubstringFromRange:range] string]; } - (BOOL)hasSelection { NSRange range = [self selectedRange]; return (range.length != 0); } @end steptalk-0.10.0/Applications/ScriptPapers/ScriptPaper.h0000600000175000000000000000214210132015545022073 0ustar gurkanroot/** ScriptPaper Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STEnvironment; @interface ScriptPaper:NSDocument { STEnvironment *environment; } - (IBAction)doSelection:(id)sender; - (IBAction)doAndShowSelection:(id)sender; @end steptalk-0.10.0/Applications/ScriptPapers/ScriptPaper.m0000600000175000000000000000550710132015545022110 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ScriptPaper.h" #import #import #import #import #import #import "ScriptPaperController.h" @implementation ScriptPaper - init { [super init]; environment = [[STEnvironment alloc] initDefault]; return self; } - (void)dealloc { [super dealloc]; } - (void)makeWindowControllers { ScriptPaperController *controller; controller = [[ScriptPaperController alloc] init]; [controller setDocument:self]; [self addWindowController:AUTORELEASE(controller)]; } - (id)executeScriptString:(NSString *)source { STEngine *engine; NSString *error; id retval = nil; engine = [STEngine engineForLanguageWithName: [STLanguage defaultLanguageName]]; if(!engine) { NSLog(@"Unable to get scripting engine."); return nil; } if(!environment) { NSLog(@"No scripting environment"); return nil; } NS_DURING retval = [engine executeCode:source inEnvironment:environment]; NS_HANDLER error = [NSString stringWithFormat: @"Error: " @"Execution of script failed. %@. (%@)", [localException reason], [localException name]]; // [[STTranscript sharedTranscript] showError:error]; NSLog(@"Script exception: %@", error); retval = nil; NS_ENDHANDLER return retval; } - (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)fileType { NSLog(@"Write to file %@ of type %@. (not implemented)", fileName, fileType); return YES; } - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)fileType { NSLog(@"Read from file %@ of type %@. (not implemented)", fileName, fileType); return YES; } @end steptalk-0.10.0/Applications/ScriptPapers/ScriptPaperController.h0000600000175000000000000000213710132015545024143 0ustar gurkanroot/** ScriptPaper Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class ScriptPaper; @class NSTextView; @class NSForm; @class NSWindow; @interface ScriptPaperController:NSWindowController { NSTextView *sourceView; } @end steptalk-0.10.0/Applications/ScriptPapers/ScriptPaperController.m0000600000175000000000000000472610132015545024156 0ustar gurkanroot/** Controller Copyright (c) 2003 Stefan Urbanek Written by: Stefan Urbanek Date: 2003 Apr 26 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ScriptPaperController.h" #import #import #import #import #import "NSTextView+additions.h" #import "ScriptPaper.h" @implementation ScriptPaperController - init { return [self initWithWindowNibName:@"Paper"]; } - (void)windowDidLoad { [sourceView setRichText:NO]; [sourceView setString:@"This is a paper.\n1 + 1"]; } - (void)dealloc { [super dealloc]; } /** Execute selected text as script. */ - (IBAction)doSelection:(id)sender { NSString *selectedString = [sourceView selectedString]; NSLog(@"Do!"); [[self document] executeScriptString:selectedString]; } /** Execute selected text as script and insert result into the paper. */ - (IBAction)doAndShowSelection:(id)sender { NSString *selectedString = [sourceView selectedString]; NSRange range; id string; int length; id retval = nil; NSLog(@"Do and Show!"); retval = [[self document] executeScriptString:selectedString]; if(!retval) { retval = @"(nil)"; } range = [sourceView selectedRange]; range = NSMakeRange(NSMaxRange(range), 0); [sourceView setSelectedRange:range]; if([retval isKindOfClass:[NSString class]] || [retval isKindOfClass:[NSAttributedString class]]) { string = retval; } else { string = [retval description]; } [sourceView insertText:@" "]; [sourceView insertText:string]; range = NSMakeRange(range.location + 1, [string length]); } @end steptalk-0.10.0/Applications/ScriptPapers/ScriptPapersInfo.plist0000644000175000000000000000132710132015545024012 0ustar gurkanroot{ ApplicationName = "Script Papers"; ApplicationDescription = "Application for writing script papers."; ApplicationRelease = "0.1.0"; Authors = ("Stefan Urbanek "); Copyright = "Copyright (c) 2003 Stefan Urbanek "; CopyrightDescription = "This program is released under the GNU General Public License"; NSIcon = ScriptPapers; NSTypes = ( { NSUnixExtensions = ("spaper"); NSName = "spaper"; NSHumanReadableName = "Script Paper"; NSMIMETypes = ("application/spaper"); NSIcon = ScriptPaperFile; NSRole = Editor; NSDocumentClass = ScriptPaper; } ); } steptalk-0.10.0/Applications/ScriptPapers/TODO0000644000175000000000000000121510132015545020166 0ustar gurkanroot1 Add 'New in environment...' which will open "New panel" where user will be able to select scripting environment. 2 Add environment browser (named objects, loaded frameworks and bundles) 2.1 Implement 'Load bundle' 2.2 Implement 'Load framework' 2.3 Implement deletion of objects 3 Add menu item 'Script->Inspect selection' and add object inspector, like the one in Smalltalk 3.1 Object inspector (use class description) 3.2 Array inspector (delete functions for mutable arrays) 3.3 Dictionary inspector 3.4 Ability to save objects (use NSArchiver) 4 Implement document saving (warn the user, that all created objects will be lost) steptalk-0.10.0/Applications/ScriptPapers/main.m0000600000175000000000000000207710132015545020577 0ustar gurkanroot/** main Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Feb 20 This file is part of the Farmer application. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #define APP_NAME @"GNUstep" /* * Initialise and go! */ int main(int argc, const char *argv[]) { return NSApplicationMain (argc, argv); } steptalk-0.10.0/Applications/ScriptPapers/run0000755000175000000000000000005510132015545020231 0ustar gurkanrootmake debug=yes && openapp ScriptPapers.debug steptalk-0.10.0/Documentation/0000775000175000000000000000000010132015521015237 5ustar gurkanrootsteptalk-0.10.0/Documentation/Additions.txt0000644000175000000000000000127610132015521017722 0ustar gurkanrootGNUstep/Cocoa classes additions ------------------------------- NSFileManager + (NSString *)homeDirectory + (NSString *)homeDirectoryForUser:(NSString *)user + (NSString *)openStepRootDirectory + (NSArray *)searchPathForDirectories:(int)dir inDomains:(int)domainMask expandTilde:(BOOL)flag + (NSArray *)searchPathForDirectories:(int)dir inDomains:(int)domainMask + (NSString *)temporaryDirectory + (NSArray *)standardLibraryPaths Example: NSFileManager searchPathForDirectories:NSLibraryDirectory inDomains:(NSUserDomainMask or: NSLocalDomainMask) steptalk-0.10.0/Documentation/ApplicationScripting.txt0000644000175000000000000000733510132015521022134 0ustar gurkanrootApplication Scripting --------------------- Scripting for applications is provided by the Application Scripting Bundle. The bundle is installed together with StepTalk. Contents: Creating a scriptable application Scripts Script Metafile Example Creating a scriptable application --------------------------------- 1 Think of objects you want to provide for scripting. 2 Make classes available in ScriptingInfo.plist: { STClasses = { MessageComposition, InternetAddress }; } Add this line to your makefile: MyApp_RESOURCE_FILES = ScriptingInfo.plist 3 Include bundle loading code Copy files: STScriptingSupport.h STScriptingSupport.m from ApplicationScripting/Support directory to your project and add following line to your makefile: MyApp_OBJC_FILES += STScriptingSupport.m 4 Make scripting available to the user #import "STScriptingSupport.h" ... if([NSApp isScriptingSupported]) { [menu addItemWithTitle: @"Scripting" action: NULL keyEquivalent: @""]; [menu setSubmenu: [NSApp scriptingMenu] forItem: [menu itemWithTitle:@"Scripting"]]; } ... Scripts ------- Application is looking for scripts in: - applications resource directory ApplicationName.app/Resources/Scripts - application specific scripts in all GNUstep Library directories */Library/StepTalk/Scripts/ApplicationName - shared scriptins in all GNUstep Library directories */Library/StepTalk/Scripts/Shared - resource directories of all bundles loaded by the application BundleName.bundle/Resources/Scripts (*) can be any of GNUstep System, Local, Network or user path Script metafile --------------- Each script may have accopmpaining file containing information about script. This information file is optional, has extension .stinfo and its name is script name with that extension. For example if script name is insertDate.st then information file is insertDate.st.stinfo. File may contain: - script name that will be shown to the user (localizable) - script description (localizable) - scripting language used for script -- overrides language guess based on file extension The file is dictionary property list. Kes are: Name - Name of a script that is shown to the user. It can be localized. Description - Description of a script. It can be localized. Language - Scripting language name used in script. This value overrides language guess based on script file extension. Localizable keys have values that are dictionaries: { Default = { Name = "Some name"; Description = "Some description"; }; English = { Name = "Some name in english"; Description = "Some description in english"; }; French = { Name = "Some name in french"; Description = "Some description in french"; } } Example ------- 1. Create a script file test.st with contents: Transcript showLine:'It works.' 2. Create (optional) meta file test.st.stinfo with contents: { English = { Description = "This is a script for testing if scripting works"; Name = "Test"; } } 3. Put both files into */Library/StepTalk/Scripts/your_application_name 4. Then run your application, open scripts panel, select the script and run it by doubleclicking or by pressing the 'Run' button. 5. Then look at the transcript window for the result. steptalk-0.10.0/Documentation/Bundles.txt0000644000175000000000000000170010132015521017370 0ustar gurkanrootBundles ------- Any bundle, including an application or a framework, can provide information about scripting. Info dictionary --------------- STClasses - array of public classes STScriptingInfoClass - name of a scripting controller. Default value is bundleNameScriptingInfo. (STExportAllClasses - exports all classes (ignore STClasses)) (not used yet) Scripting Controller -------------------- Scripting controller is a class object that provides information about bundle scripting abilities. At this time it provides information only about available named objects. Informal protocol: + (NSDictionary *)namedObjectsForScripting; Returns a dictionary with named objects. TODO: STBundle methods ---------------- + bundleWithApplication: Search in */Applications + bundleWithFramework: Search in */Library/Frameworks + bundleWithName: Search in */Library/Bundles steptalk-0.10.0/Documentation/DOTemplate.plist0000644000175000000000000000110510132015521020305 0ustar gurkanroot/* DOTemplate.plist This file contains template for a distributed object in the distributed environment. File name is name of the object used in the environment. DO files should reside in: any_gnustep_root/Library/StepTalk/DistributedObjects */ { Host = "default host name"; Hosts = ( list of hosts to be searched ); Tool = "name of a tool that will register the object"; Arguments = (tool arguments); Name = "name of the object to be connected"; Wait = seconds to wait before connection after the tool is launched; } steptalk-0.10.0/Documentation/Defaults.txt0000644000175000000000000000063610132015521017552 0ustar gurkanrootStepTalk Defaults ----------------- NOTE: Defaults changed. For example, to set default language name: > defaults write NSGlobalDomain STDefaultLanguageName Smalltalk or to set scripting environment specific to an application: > defaults write ApplicationName STDefaultEnvironmentDescriptionName Safe Name: STDefaultLanguageName Type: String Name: STDefaultEnvironmentDescriptionName Type: String steptalk-0.10.0/Documentation/DevelopmentNotes.txt0000644000175000000000000000066710132015521021302 0ustar gurkanrootDevelopment Notes ----------------- This document contains information about StepTalk development. Directory structure ------------------- Directory structure needs to be changed to: / /Documentation /Examples /Source /Applications /Frameworks /StepTalk /ApplicationScripting /Languages /Modules /Tools /Support /ApplicationScripting /Testing steptalk-0.10.0/Documentation/Environment.txt0000644000175000000000000000217510132015521020307 0ustar gurkanrootScripting environment descriptions ---------------------------------- Property list containing dictionary with keys: Name Name of scripting description Use Array of scripting descriptions to include. Modules Array of modules to be loaded Finders Array of object finder names to be used Behaviours Dictionary of behaviour descriptions, that can be adopted by a class or another behaviour. Classes Dictionary of class descriptions. DefaultRestriction Aliases object name aliases (not impl.) Behaviours ---------- Use Adopt behaviour SymbolicSelectors Map of symbolic selectors. Aliases Method name aliases. AllowMethods List of allowed methods. DenyMethods List of denied methods. Classes ------- (Same items as in Behaviours) Super Super class name. Restriction Values: DenyAll, AllowAll "DenyAll" deny all methods except those in "AllowMethods" list or in "Aliases" "AllowAll" allow all methods except those in "DenyMehods" list. steptalk-0.10.0/Documentation/HowTo.txt0000644000175000000000000000242010132015521017034 0ustar gurkanrootStepTalk HowTo -------------- NOTE: This file has to be written. You may consult StepTalk header files. How to create scripting environment? ------------------------------------ STEnvironment *env; env = [STEnvironment defaultScriptingEnvironment]; or env = [STEnvironment environmentWithDescriptionName:envName]; How to register named objects in the scripting environment? ----------------------------------------------------------- [env setObject:object forName:@"ObjectName"]; like in: [env setObject:transcript forName:@"Transcript"]; See: STEnvironment How to create a scripting engine? --------------------------------- STEngine *engine; engine = [STEngine engineForLanguageWithName:langName]; See: STLanguage, STEngine How to execute a code? -------------------- STEngine *engine; id result; NS_DURING result = [engine executeCode:string inEnvironment:env]; NS_HANDLER /* handle the exception */ NS_ENDHANDLER See: STEngine, NSException How to create a language bundle? -------------------------------- Languages/Smalltalk/SmalltalkEngine.m Languages/Smalltalk/SmalltalkEngine.h Languages/Smalltalk/STBytecodeInterpreter.m - sendSelectorAtIndex:withArgCount: steptalk-0.10.0/Documentation/Ideas.txt0000644000175000000000000000046610132015521017031 0ustar gurkanrootIdeas ----- This file contains ideas. The good ones should be implemented. The bad ones should be improved, kept here for some future improvement or ignored. ----- Contexts Context is a separate process. STContext environment availableLanguages executeScript: steptalk-0.10.0/Documentation/Languages.txt0000644000175000000000000000070110132015521017702 0ustar gurkanrootLanguages --------- How to create a language bundle? In directory Languages/Smalltalk/ see files SmalltalkEngine.[hm] SmalltalkInfo.plist and in STBytecodeInterpreter.m see method - sendSelectorAtIndex:withArgCount: LanguageInfo.plist ------------------ STLanguageName Language name that will be used instead of bundle name. STEngine; Engine class name. If there is no such class, then princicpial class will be used. steptalk-0.10.0/Documentation/Modules.txt0000644000175000000000000000207610132015521017413 0ustar gurkanrootModules ------- Here is a brief list of available modules and list of what they provide. To load a module use: Environment loadModule:'moduleName' or put name of a module into a Modules list into a scripting environment you use, like: ~/.../Library/StepTalk/Environments/My.stenv { Use = (Foundation); Modules = (moduleName); } Foundation - public Foundation/gnustep-base classes - extern variables, like exception and notification names AppKit - public AppKit/gnustep-gui classes - extern variables ObjectiveC - object named 'Runtime' methods: - classWithName:string - nameOfClass:class - selectorsContainingString: returns an array of selectors that contain specified string - implementorsOfSelector: returns an array of all classes that implement specified selector - additions to NSObject + instanceMethodNames - methodNames + methodNames + instanceVariableNames steptalk-0.10.0/Documentation/ObjCTypes.txt0000644000175000000000000000030010132015521017631 0ustar gurkanrootConversion between objects and Objective-C types ------------------------------------------------ Number types - NSNumber char * - NSString id, class - no conversion structures - STStructure steptalk-0.10.0/Documentation/ObjectFinders.txt0000644000175000000000000000043610132015521020522 0ustar gurkanrootObject Finders -------------- STEnvironment provides mechanisms for named objects. Object finders are objects that will find an object by a name. The lookup is as follows: 1. look for object in environment's object pool 2. look for object using all environment's finders steptalk-0.10.0/Documentation/Reference/0000775000175000000000000000000010306171427017150 5ustar gurkanrootsteptalk-0.10.0/Documentation/Reference/NSInvocation+additions.gsdoc0000644000175000000000000000534210306171426024516 0ustar gurkanroot NSInvocation class additions urbanek@host.sk 2002 Free Software Foundation Software documentation for the NSInvocation(STAdditions) category StepTalk/NSInvocation+additions.h Description forthcoming. invocationWithTarget: target selector: selector Description forthcoming. invocationWithTarget: target selectorName: selectorName Description forthcoming. getArgumentAsObjectAtIndex: anIndex Description forthcoming. returnValueAsObject Description forthcoming. setArgumentAsObject: anObject atIndex: anIndex Description forthcoming. NSInvocation+additions functions

value type anObject Description forthcoming. value type This method is a factory method, that means that you have to release the object when you no longer need it.
steptalk-0.10.0/Documentation/Reference/NSInvocation+additions.html0000644000175000000000000001104110306171427024355 0ustar gurkanroot NSInvocation class additions Up

NSInvocation class additions

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the NSInvocation(STAdditions) category

NSInvocation(STAdditions)

Declared in:
StepTalk/NSInvocation+additions.h

Description forthcoming.

Method summary

invocationWithTarget: selector: 

+ (id) invocationWithTarget: (id)target selector: (SEL)selector;

Description forthcoming.


invocationWithTarget: selectorName: 

+ (id) invocationWithTarget: (id)target selectorName: (NSString*)selectorName;

Description forthcoming.


getArgumentAsObjectAtIndex: 

- (id) getArgumentAsObjectAtIndex: (int)anIndex;

Description forthcoming.


returnValueAsObject 

- (id) returnValueAsObject;

Description forthcoming.


setArgumentAsObject: atIndex: 

- (void) setArgumentAsObject: (id)anObject atIndex: (int)anIndex;

Description forthcoming.


NSInvocation+additions functions

STGetValueOfTypeFromObject

void STGetValueOfTypeFromObject(void* value, const char* type, id anObject);

Description forthcoming.


STObjectFromValueOfType

id STObjectFromValueOfType(void* value, const char* type);

This method is a factory method, that means that you have to release the object when you no longer need it.



Up
steptalk-0.10.0/Documentation/Reference/NSObject+additions.gsdoc0000644000175000000000000000234110306171426023607 0ustar gurkanroot NSObject+additions documentation 2002 Free Software Foundation Software documentation for the NSObject(STAdditions) category StepTalk/NSObject+additions.h Description forthcoming. isNil Description forthcoming. isSame: anObject Description forthcoming. notNil Description forthcoming. steptalk-0.10.0/Documentation/Reference/NSObject+additions.html0000644000175000000000000000377010306171427023464 0ustar gurkanroot NSObject+additions documentation Up

NSObject+additions documentation

Authors

Generated by stevko

Copyright: (C) 2002 Free Software Foundation

Software documentation for the NSObject(STAdditions) category

NSObject(STAdditions)

Declared in:
StepTalk/NSObject+additions.h

Description forthcoming.

Method summary

isNil 

- (BOOL) isNil;

Description forthcoming.


isSame: 

- (BOOL) isSame: (id)anObject;

Description forthcoming.


notNil 

- (BOOL) notNil;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STActor.gsdoc0000644000175000000000000000667710306171426021525 0ustar gurkanroot STActor class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STActor class StepTalk/STActor.h NSCoding Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. actorInEnvironment: env Return new instance of script object without any instance variables addMethod: aMethod Description forthcoming. environment Description forthcoming. initWithEnvironment: env Description forthcoming. methodDictionary Description forthcoming. methodNames Description forthcoming. methodWithName: aName Description forthcoming. removeMethod: aMethod Description forthcoming. removeMethodWithName: aName Description forthcoming. setEnvironment: env Set object's environment. Note: This method should be replaced by some other, more clever mechanism. steptalk-0.10.0/Documentation/Reference/STActor.html0000644000175000000000000001422010306171427021352 0ustar gurkanroot STActor class documentation Up

STActor class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STActor class

STActor : NSObject

Declared in:
StepTalk/STActor.h
Conforms to:
NSCoding

Description forthcoming.


Instance Variables

Method summary

actorInEnvironment: 

+ (id) actorInEnvironment: (STEnvironment*)env;

Return new instance of script object without any instance variables


addMethod: 

- (void) addMethod: (id<STMethod>)aMethod;

Description forthcoming.


environment 

- (STEnvironment*) environment;

Description forthcoming.


initWithEnvironment: 

- (id) initWithEnvironment: (STEnvironment*)env;

Description forthcoming.


methodDictionary 

- (NSDictionary*) methodDictionary;

Description forthcoming.


methodNames 

- (NSArray*) methodNames;

Description forthcoming.


methodWithName: 

- (id<STMethod>) methodWithName: (NSString*)aName;

Description forthcoming.


removeMethod: 

- (void) removeMethod: (id<STMethod>)aMethod;

Description forthcoming.


removeMethodWithName: 

- (void) removeMethodWithName: (NSString*)aName;

Description forthcoming.


setEnvironment: 

- (void) setEnvironment: (STEnvironment*)env;

Set object's environment. Note: This method should be replaced by some other, more clever mechanism.




Instance Variables for STActor Class

environment

@protected STEnvironment* environment;

Description forthcoming.


ivars

@protected NSMutableDictionary* ivars;

Description forthcoming.


methodDictionary

@protected NSMutableDictionary* methodDictionary;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STBundleInfo.gsdoc0000644000175000000000000001222210306171426022461 0ustar gurkanroot STBundleInfo class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STBundleInfo class StepTalk/STBundleInfo.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. infoForBundle: aBundle Description forthcoming. allClassNames Return an array of all class names. initWithBundle: aBundle Initialize info with bundle aBundle. namedObjects Return a dictionary of named objects. Named objects are get from scripting info class specified in ScriptingInfo.plist. objectReferenceDictionary This method is for application scripting support. Return dictionary containing object references where a key is name of an object and value is a path to the object relative to application delegate. publicClassNames Description forthcoming. Software documentation for the NSBundle(STAdditions) category StepTalk/STBundleInfo.h Description forthcoming. allFrameworkNames Return names of all available frameworks in the system. bundleForFrameworkWithName: aName Return bundle for framework with name aName. pathForFrameworkWithName: aName Return path for framework with name aName . stepTalkBundleNames Get list of all StepTalk bundles from Library/StepTalk/Bundles stepTalkBundleWithName: moduleName Description forthcoming. scriptingInfoDictionary Description forthcoming. steptalk-0.10.0/Documentation/Reference/STBundleInfo.html0000644000175000000000000002210110306171427022324 0ustar gurkanroot STBundleInfo class documentation Up

STBundleInfo class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STBundleInfo class

STBundleInfo : NSObject

Declared in:
StepTalk/STBundleInfo.h

Description forthcoming.


Instance Variables

Method summary

infoForBundle: 

+ (id) infoForBundle: (NSBundle*)aBundle;

Description forthcoming.


allClassNames 

- (NSArray*) allClassNames;

Return an array of all class names.


initWithBundle: 

- (id) initWithBundle: (NSBundle*)aBundle;
This is a designated initialiser for the class.

Initialize info with bundle aBundle.


namedObjects 

- (NSDictionary*) namedObjects;

Return a dictionary of named objects. Named objects are get from scripting info class specified in ScriptingInfo.plist.


objectReferenceDictionary 

- (NSDictionary*) objectReferenceDictionary;

This method is for application scripting support. Return dictionary containing object references where a key is name of an object and value is a path to the object relative to application delegate.


publicClassNames 

- (NSArray*) publicClassNames;

Description forthcoming.




Instance Variables for STBundleInfo Class

allClasses

@protected NSArray* allClasses;

Description forthcoming.


bundle

@protected NSBundle* bundle;

Description forthcoming.


objectReferenceDictionary

@protected NSDictionary* objectReferenceDictionary;

Description forthcoming.


publicClasses

@protected NSArray* publicClasses;

Description forthcoming.


scriptingInfoClass

@protected Class scriptingInfoClass;

Description forthcoming.


scriptingInfoClassName

@protected NSString* scriptingInfoClassName;

Description forthcoming.


useAllClasses

@protected BOOL useAllClasses;

Description forthcoming.





Software documentation for the NSBundle(STAdditions) category

NSBundle(STAdditions)

Declared in:
StepTalk/STBundleInfo.h

Description forthcoming.

Method summary

allFrameworkNames 

+ (NSArray*) allFrameworkNames;

Return names of all available frameworks in the system.


bundleForFrameworkWithName: 

+ (NSBundle*) bundleForFrameworkWithName: (NSString*)aName;

Return bundle for framework with name aName.


pathForFrameworkWithName: 

+ (NSString*) pathForFrameworkWithName: (NSString*)aName;

Return path for framework with name aName .


stepTalkBundleNames 

+ (NSArray*) stepTalkBundleNames;

Get list of all StepTalk bundles from Library/StepTalk/Bundles


stepTalkBundleWithName: 

+ (id) stepTalkBundleWithName: (NSString*)moduleName;

Description forthcoming.


scriptingInfoDictionary 

- (NSDictionary*) scriptingInfoDictionary;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STContext.gsdoc0000644000175000000000000001222110306171426022057 0ustar gurkanroot STEnvironment class reference urbanek@host.sk 2002 Free Software Foundation Software documentation for the STContext class StepTalk/STContext.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. addNamedObjectsFromDictionary: dict Description forthcoming. createsUnknownObjects Returns YES if unknown objects are being created. fullScriptingEnabled Returns YES if full scripting is enabled. knownObjectNames Description forthcoming. objectDictionary Returns a dictionary of all named objects in the environment. objectReferenceForObjectWithName: name Description forthcoming. objectWithName: objName Return object with name objName. If object is not found int the object dictionary, then object finders are used to try to find the object. If object is found by an object finder, then it is put into the object dicitonary. If there is no object with given name, nil is returned. parentContext Description forthcoming. removeObjectWithName: objName Remove object named objName. setCreatesUnknownObjects: flag

Enable or disable creation of unknown objects. Normally you get nil if you request for non-existant object. If flag is YES then by requesting non-existant object, name for that object is created and it is set no STNil.

Note: This method will be probably removed (moved to Smalltalk language bundle).

setFullScriptingEnabled: flag Full scripting
Enable or disable full scripting. When full scripting is enabled, you may send any message to any object.
setObject: anObject forName: objName Register object anObject with name objName. setParentContext: context Description forthcoming.
steptalk-0.10.0/Documentation/Reference/STContext.html0000644000175000000000000002101610306171427021727 0ustar gurkanroot STEnvironment class reference Up

STEnvironment class reference

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STContext class

STContext : NSObject

Declared in:
StepTalk/STContext.h

Description forthcoming.


Instance Variables

Method summary

addNamedObjectsFromDictionary: 

- (void) addNamedObjectsFromDictionary: (NSDictionary*)dict;

Description forthcoming.


createsUnknownObjects 

- (BOOL) createsUnknownObjects;

Returns YES if unknown objects are being created.


fullScriptingEnabled 

- (BOOL) fullScriptingEnabled;

Returns YES if full scripting is enabled.


knownObjectNames 

- (NSArray*) knownObjectNames;

Description forthcoming.


objectDictionary 

- (NSMutableDictionary*) objectDictionary;

Returns a dictionary of all named objects in the environment.


objectReferenceForObjectWithName: 

- (STObjectReference*) objectReferenceForObjectWithName: (NSString*)name;

Description forthcoming.


objectWithName: 

- (id) objectWithName: (NSString*)objName;

Return object with name objName. If object is not found int the object dictionary, then object finders are used to try to find the object. If object is found by an object finder, then it is put into the object dicitonary. If there is no object with given name, nil is returned.


parentContext 

- (STContext*) parentContext;

Description forthcoming.


removeObjectWithName: 

- (void) removeObjectWithName: (NSString*)objName;

Remove object named objName.


setCreatesUnknownObjects: 

- (void) setCreatesUnknownObjects: (BOOL)flag;

Enable or disable creation of unknown objects. Normally you get nil if you request for non-existant object. If flag is YES then by requesting non-existant object, name for that object is created and it is set no STNil.

Note: This method will be probably removed (moved to Smalltalk language bundle).


setFullScriptingEnabled: 

- (void) setFullScriptingEnabled: (BOOL)flag;

Full scripting
Enable or disable full scripting. When full scripting is enabled, you may send any message to any object.


setObject: forName: 

- (void) setObject: (id)anObject forName: (NSString*)objName;

Register object anObject with name objName.


setParentContext: 

- (void) setParentContext: (STContext*)context;

Description forthcoming.




Instance Variables for STContext Class

createsUnknownObjects

@protected BOOL createsUnknownObjects;

Description forthcoming.


fullScripting

@protected BOOL fullScripting;

Description forthcoming.


objectDictionary

@protected NSMutableDictionary* objectDictionary;

Description forthcoming.


parentContext

@protected STContext* parentContext;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STConversation.gsdoc0000644000175000000000000000652010306171426023112 0ustar gurkanroot STConversation class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STConversation class StepTalk/STConversation.h STConversation Description forthcoming. context Description forthcoming. initWithContext: aContext language: aLanguage Description forthcoming. language Return name of the language used in the receiver conversation runScriptFromString: aString Description forthcoming. setLanguage: newLanguage Description forthcoming. Software documentation for the STConversation protocol StepTalk/STConversation.h Description forthcoming. interpretScript: aString Interpret given string as a script in the receiver environment. knownLanguages Description forthcoming. language Description forthcoming. result Description forthcoming. resultByCopy Description forthcoming. setLanguage: newLanguage Set language for the receiver. steptalk-0.10.0/Documentation/Reference/STConversation.html0000644000175000000000000001522110306171427022756 0ustar gurkanroot STConversation class documentation Up

STConversation class documentation

Authors

Stefan Urbanek (urbanek@host.sk)
Stefan Urbanek

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STConversation class

STConversation : NSObject

Declared in:
StepTalk/STConversation.h
Conforms to:
STConversation

Description forthcoming.

Method summary

context 

- (STContext*) context;

Description forthcoming.


initWithContext: language: 

- (id) initWithContext: (STContext*)aContext language: (NSString*)aLanguage;

Description forthcoming.


language 

- (NSString*) language;

Return name of the language used in the receiver conversation


runScriptFromString: 

- (id) runScriptFromString: (NSString*)aString;

Description forthcoming.


setLanguage: 

- (void) setLanguage: (NSString*)newLanguage;

Description forthcoming.


Software documentation for the STConversation protocol

STConversation

Declared in:
StepTalk/STConversation.h

Description forthcoming.

Method summary

interpretScript: 

- (void) interpretScript: (bycopy NSString*)aString;

Interpret given string as a script in the receiver environment.


knownLanguages 

- (bycopy NSArray*) knownLanguages;

Description forthcoming.


language 

- (NSString*) language;

Description forthcoming.


result 

- (id) result;

Description forthcoming.


resultByCopy 

- (bycopy id) resultByCopy;

Description forthcoming.


setLanguage: 

- (void) setLanguage: (NSString*)newLanguage;

Set language for the receiver.



Up
steptalk-0.10.0/Documentation/Reference/STEngine.gsdoc0000644000175000000000000001152010306171426021641 0ustar gurkanroot STEngine class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STEngine class StepTalk/STEngine.h STEngine is abstract class for language engines used to intepret scripts. engineForFileType: fileType Description forthcoming. engineForLanguage: name Return a scripting engine for language with specified name. The engine is get from default language manager. engineForLanguageWithName: name Instance creation canInterpret: sourceCode Description forthcoming. executeCode: code inEnvironment: env Execude source code code in an environment env. This is the method, that has to be implemented by those who are writing a language engine. executeMethod: aMethod forReceiver: anObject withArguments: args inEnvironment: env Description forthcoming. interpretMethod: aMethod forReceiver: anObject withArguments: args inContext: context Description forthcoming. interpretScript: script inContext: context Description forthcoming. methodFromSource: sourceString forReceiver: receiver inContext: context Description forthcoming. methodFromSource: sourceString forReceiver: receiver inEnvironment: env Description forthcoming. setValue: anObject forOption: anOption Description forthcoming. understandsCode: code Description forthcoming. valueForOption: anOption Description forthcoming. steptalk-0.10.0/Documentation/Reference/STEngine.html0000644000175000000000000002101610306171427021510 0ustar gurkanroot STEngine class documentation Up

STEngine class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STEngine class

STEngine : NSObject

Declared in:
StepTalk/STEngine.h

STEngine is abstract class for language engines used to intepret scripts.

Method summary

engineForFileType: 

+ (STEngine*) engineForFileType: (NSString*)fileType;

Description forthcoming.


engineForLanguage: 

+ (STEngine*) engineForLanguage: (NSString*)name;

Return a scripting engine for language with specified name. The engine is get from default language manager.


engineForLanguageWithName: 

+ (STEngine*) engineForLanguageWithName: (NSString*)name;

Instance creation


canInterpret: 

- (BOOL) canInterpret: (NSString*)sourceCode;

Description forthcoming.


executeCode: inEnvironment: 

- (id) executeCode: (NSString*)code inEnvironment: (STEnvironment*)env;
Subclasses should override this method.

Execude source code code in an environment env. This is the method, that has to be implemented by those who are writing a language engine.


executeMethod: forReceiver: withArguments: inEnvironment: 

- (id) executeMethod: (id<STMethod>)aMethod forReceiver: (id)anObject withArguments: (NSArray*)args inEnvironment: (STEnvironment*)env;

Description forthcoming.


interpretMethod: forReceiver: withArguments: inContext: 

- (id) interpretMethod: (id<STMethod>)aMethod forReceiver: (id)anObject withArguments: (NSArray*)args inContext: (STContext*)context;

Description forthcoming.


interpretScript: inContext: 

- (id) interpretScript: (NSString*)script inContext: (STContext*)context;

Description forthcoming.


methodFromSource: forReceiver: inContext: 

- (STMethod*) methodFromSource: (NSString*)sourceString forReceiver: (id)receiver inContext: (STContext*)context;

Description forthcoming.


methodFromSource: forReceiver: inEnvironment: 

- (STMethod*) methodFromSource: (NSString*)sourceString forReceiver: (id)receiver inEnvironment: (STEnvironment*)env;

Description forthcoming.


setValue: forOption: 

- (void) setValue: (id)anObject forOption: (NSString*)anOption;

Description forthcoming.


understandsCode: 

- (BOOL) understandsCode: (NSString*)code;

Description forthcoming.


valueForOption: 

- (id) valueForOption: (NSString*)anOption;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STEnvironment.gsdoc0000644000175000000000000001335610306171426022751 0ustar gurkanroot STEnvironment class reference urbanek@host.sk 2002 Free Software Foundation Software documentation for the STEnvironment class StepTalk/STEnvironment.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. environmentWithDefaultDescription Creates and initialises new scripting environment using default description. environmentWithDescription: aDescription Creates and initialises scripting environment using environment description description. sharedEnvironment Creating environment
Returns an instance of the scripting environment that is shared in the scope of actual application or process.
addClassesWithNames: names Add classes specified by the names in the names array. This method is used internally to add classes provided by modules. includeBundle: aBundle Include scripting capabilities advertised by the bundle aBundle. If the bundle is already loaded, nothing happens. includeFramework: frameworkName Include scripting capabilities advertised by the framework with name frameworkName. If the framework is already loaded, nothing happens. initWithDefaultDescription Initialises scripting environment using default description. initWithDescription: aDescription Initialises scripting environment using scripting description aDescription. loadModule: moduleName Modules
Load StepTalk module with the name moduleName. Modules are stored in the Library/StepTalk/Modules directory.
registerObjectFinder: finder name: name Distributed objects
Register object finder finder under the name name
registerObjectFinderNamed: name Register object finder named name. This method will try to find an object finder bundle in Library/StepTalk/Finders directories. removeObjectFinderWithName: name Remove object finder with name name translateSelector: aString forReceiver: anObject Selector translation
steptalk-0.10.0/Documentation/Reference/STEnvironment.html0000644000175000000000000002604510306171427022616 0ustar gurkanroot STEnvironment class reference Up

STEnvironment class reference

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STEnvironment class

STEnvironment : STContext

Declared in:
StepTalk/STEnvironment.h

Description forthcoming.


Instance Variables

Method summary

environmentWithDefaultDescription 

+ (STEnvironment*) environmentWithDefaultDescription;

Creates and initialises new scripting environment using default description.


environmentWithDescription: 

+ (id) environmentWithDescription: (STEnvironmentDescription*)aDescription;

Creates and initialises scripting environment using environment description description.


sharedEnvironment 

+ (id) sharedEnvironment;

Creating environment
Returns an instance of the scripting environment that is shared in the scope of actual application or process.


addClassesWithNames: 

- (void) addClassesWithNames: (NSArray*)names;

Add classes specified by the names in the names array. This method is used internally to add classes provided by modules.


includeBundle: 

- (BOOL) includeBundle: (NSBundle*)aBundle;

Include scripting capabilities advertised by the bundle


includeFramework: 

- (BOOL) includeFramework: (NSString*)frameworkName;

Include scripting capabilities advertised by the framework with name


initWithDefaultDescription 

- (id) initWithDefaultDescription;
This is a designated initialiser for the class.

Initialises scripting environment using default description.


initWithDescription: 

- (id) initWithDescription: (bycopy STEnvironmentDescription*)aDescription;

Initialises scripting environment using scripting description aDescription.


loadModule: 

- (void) loadModule: (NSString*)moduleName;

Modules
Load StepTalk module with the name moduleName. Modules are stored in the Library/StepTalk/Modules directory.


registerObjectFinder: name: 

- (void) registerObjectFinder: (id)finder name: (NSString*)name;

Distributed objects
Register object finder finder under the name name


registerObjectFinderNamed: 

- (void) registerObjectFinderNamed: (NSString*)name;

Register object finder named name. This method will try to find an object finder bundle in Library/StepTalk/Finders directories.


removeObjectFinderWithName: 

- (void) removeObjectFinderWithName: (NSString*)name;

Remove object finder with name name


translateSelector: forReceiver: 

- (NSString*) translateSelector: (NSString*)aString forReceiver: (id)anObject;

Selector translation




Instance Variables for STEnvironment Class

classes

@protected NSMutableDictionary* classes;

Description forthcoming.


description

@protected STEnvironmentDescription* description;

Description forthcoming.


infoCache

@protected NSMutableDictionary* infoCache;

Description forthcoming.


loadedBundles

@protected NSMutableArray* loadedBundles;

Description forthcoming.


objectFinders

@protected NSMutableDictionary* objectFinders;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STExterns.gsdoc0000644000175000000000000000575010306171426022074 0ustar gurkanroot STExterns documentation urbanek@host.sk 2002 Free Software Foundation STExterns variables

Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming.
steptalk-0.10.0/Documentation/Reference/STEnvironmentDescription.gsdoc0000644000175000000000000001074510306171426025154 0ustar gurkanroot STEnvironmentDescription class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STEnvironmentDescription class StepTalk/STEnvironmentDescription.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. defaultDescriptionName Description forthcoming. descriptionFromDictionary: dictionary Description forthcoming. descriptionWithName: descriptionName Description forthcoming. classes Description forthcoming. frameworks Description forthcoming. initFromDictionary: def Description forthcoming. initWithName: defName Description forthcoming. modules Description forthcoming. objectFinders Description forthcoming. updateClassWithName: className description: def Description forthcoming. updateFromDictionary: def Description forthcoming. steptalk-0.10.0/Documentation/Reference/STEnvironmentDescription.html0000644000175000000000000001765310306171427025027 0ustar gurkanroot STEnvironmentDescription class documentation Up

STEnvironmentDescription class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STEnvironmentDescription class

STEnvironmentDescription : NSObject

Declared in:
StepTalk/STEnvironmentDescription.h

Description forthcoming.


Instance Variables

Method summary

defaultDescriptionName 

+ (NSString*) defaultDescriptionName;

Description forthcoming.


descriptionFromDictionary: 

+ (id) descriptionFromDictionary: (NSDictionary*)dictionary;

Description forthcoming.


descriptionWithName: 

+ (id) descriptionWithName: (NSString*)descriptionName;

Description forthcoming.


classes 

- (NSMutableDictionary*) classes;

Description forthcoming.


frameworks 

- (NSArray*) frameworks;

Description forthcoming.


initFromDictionary: 

- (id) initFromDictionary: (NSDictionary*)def;

Description forthcoming.


initWithName: 

- (id) initWithName: (NSString*)defName;

Description forthcoming.


modules 

- (NSArray*) modules;

Description forthcoming.


objectFinders 

- (NSArray*) objectFinders;

Description forthcoming.


updateClassWithName: description: 

- (void) updateClassWithName: (NSString*)className description: (NSDictionary*)def;

Description forthcoming.


updateFromDictionary: 

- (void) updateFromDictionary: (NSDictionary*)def;

Description forthcoming.




Instance Variables for STEnvironmentDescription Class

aliases

@protected NSMutableDictionary* aliases;

Description forthcoming.


behaviours

@protected NSMutableDictionary* behaviours;

Description forthcoming.


classes

@protected NSMutableDictionary* classes;

Description forthcoming.


finders

@protected NSMutableArray* finders;

Description forthcoming.


frameworks

@protected NSMutableArray* frameworks;

Description forthcoming.


modules

@protected NSMutableArray* modules;

Description forthcoming.


restriction

@protected int restriction;

Description forthcoming.


usedDefs

@protected NSMutableArray* usedDefs;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STExterns.html0000644000175000000000000001060210306171427021732 0ustar gurkanroot STExterns documentation Up

STExterns documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

STExterns variables

STGenericException

NSString* STGenericException;

Description forthcoming.


STInternalInconsistencyException

NSString* STInternalInconsistencyException;

Description forthcoming.


STInvalidArgumentException

NSString* STInvalidArgumentException;

Description forthcoming.


STLanguageBundleExtension

NSString* STLanguageBundleExtension;

Description forthcoming.


STLanguageBundlesDirectory

NSString* STLanguageBundlesDirectory;

Description forthcoming.


STLanguagesConfigFile

NSString* STLanguagesConfigFile;

Description forthcoming.


STLibraryDirectory

NSString* STLibraryDirectory;

Description forthcoming.


STMallocZone

NSZone* STMallocZone;

Description forthcoming.


STModuleExtension

NSString* STModuleExtension;

Description forthcoming.


STModulesDirectory

NSString* STModulesDirectory;

Description forthcoming.


STNil

STUndefinedObject* STNil;

Description forthcoming.


STScriptExtension

NSString* STScriptExtension;

Description forthcoming.


STScriptingEnvironmentExtension

NSString* STScriptingEnvironmentExtension;

Description forthcoming.


STScriptingEnvironmentsDirectory

NSString* STScriptingEnvironmentsDirectory;

Description forthcoming.


STScriptingException

NSString* STScriptingException;

Description forthcoming.


STScriptsDirectory

NSString* STScriptsDirectory;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STFileScript.gsdoc0000644000175000000000000000571610306171426022512 0ustar gurkanroot STFileScript class documentation stefanurbanek@yahoo.fr 2002 Stefan Urbanek Software documentation for the STFileScript class StepTalk/STFileScript.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. scriptWithFile: file Description forthcoming. compareByLocalizedName: aScript Compare scripts by localized name. fileName Return file name of the receiver. initWithFile: aFile Create a new script from file aFile>. Script information will be read from 'aFile.stinfo' file containing a dictionary property list. localizedName Returns localized name of the receiver script. scriptDescription Returns localized description of the script. scriptName Returns a script name by which the script is identified steptalk-0.10.0/Documentation/Reference/STFileScript.html0000644000175000000000000001202610306171427022350 0ustar gurkanroot STFileScript class documentation Up

STFileScript class documentation

Authors

Stefan Urbanek (stefanurbanek@yahoo.fr)

Copyright: (C) 2002 Stefan Urbanek

Software documentation for the STFileScript class

STFileScript : STScript

Declared in:
StepTalk/STFileScript.h

Description forthcoming.


Instance Variables

Method summary

scriptWithFile: 

+ (id) scriptWithFile: (NSString*)file;

Description forthcoming.


compareByLocalizedName: 

- (NSComparisonResult) compareByLocalizedName: (STFileScript*)aScript;

Compare scripts by localized name.


fileName 

- (NSString*) fileName;

Return file name of the receiver.


initWithFile: 

- (id) initWithFile: (NSString*)aFile;

Create a new script from file aFile>. Script information will be read from 'aFile.stinfo' file containing a dictionary property list.


localizedName 

- (NSString*) localizedName;

Returns localized name of the receiver script.


scriptDescription 

- (NSString*) scriptDescription;

Returns localized description of the script.


scriptName 

- (NSString*) scriptName;

Returns a script name by which the script is identified




Instance Variables for STFileScript Class

description

@protected NSString* description;

Description forthcoming.


fileName

@protected NSString* fileName;

Description forthcoming.


localizedName

@protected NSString* localizedName;

Description forthcoming.


menuKey

@protected NSString* menuKey;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STFunctions.gsdoc0000644000175000000000000000232010306171426022402 0ustar gurkanroot STFunctions documentation urbanek@host.sk 2002 Free Software Foundation STFunctions functions

resourceDir extension Description forthcoming. name resourceDir extension Description forthcoming. Description forthcoming.
steptalk-0.10.0/Documentation/Reference/STFunctions.html0000644000175000000000000000263510306171427022261 0ustar gurkanroot STFunctions documentation Up

STFunctions documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

STFunctions functions

STFindAllResources

NSArray* STFindAllResources(NSString* resourceDir, NSString* extension);

Description forthcoming.


STFindResource

NSString* STFindResource(NSString* name, NSString* resourceDir, NSString* extension);

Description forthcoming.


STUserConfigPath

NSString* STUserConfigPath();

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STLanguage.gsdoc0000644000175000000000000000602310132015521022147 0ustar gurkanroot STLanguage class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STLanguage class StepTalk/STLanguage.h Description forthcoming. allKnownFileTypes Return all known types (extensions) of StepTalk script files allLanguageNames Returns an array containing the names of all available languages defaultLanguageName Returns the name of default scripting language specified by the STDefaultLanguageName default. If there is no such default in user's defaults database, then Smalltalk is used. languageForFileType: fileType Returns the language bundle for a language used by files of type fileType. languageNameForFileType: fileType Returns name of a language used by files of type fileType. languageWithName: languageName Returns language bundle for a language with name languageName languageWithPath: path Returns language bundle for language with name languageName. engine Returns a scripting engine provided by the language. languageName Returns the name of the language steptalk-0.10.0/Documentation/Reference/STLanguage.html0000644000175000000000000001142010132015521022011 0ustar gurkanroot STLanguage class documentation Up

STLanguage class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STLanguage class

STLanguage : NSBundle

Declared in:
StepTalk/STLanguage.h

Description forthcoming.

Method summary

allKnownFileTypes

+ (NSArray*) allKnownFileTypes;

Return all known types (extensions) of StepTalk script files


allLanguageNames

+ (NSArray*) allLanguageNames;

Returns an array containing the names of all available languages


defaultLanguageName

+ (NSString*) defaultLanguageName;

Returns the name of default scripting language specified by the STDefaultLanguageName default. If there is no such default in user's defaults database, then Smalltalk is used.


languageForFileType:

+ (STLanguage*) languageForFileType: (NSString*)fileType;

Returns the language bundle for a language used by files of type fileType.


languageNameForFileType:

+ (NSString*) languageNameForFileType: (NSString*)fileType;

Returns name of a language used by files of type fileType.


languageWithName:

+ (id) languageWithName: (NSString*)languageName;

Returns language bundle for a language with name languageName


languageWithPath:

+ (id) languageWithPath: (NSString*)path;

Returns language bundle for language with name languageName.


engine

- (STEngine*) engine;

Returns a scripting engine provided by the language.


languageName

- (NSString*) languageName;

Returns the name of the language



Up steptalk-0.10.0/Documentation/Reference/STLanguageManager.gsdoc0000644000175000000000000001155110306171426023456 0ustar gurkanroot STLanguageManager class documentation Software documentation for the STLanguageManager class StepTalk/STLanguageManager.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. defaultManager Description forthcoming. availableLanguages Description forthcoming. bundleForLanguage: language Description forthcoming. createEngineForLanguage: language Description forthcoming. defaultLanguage Returns the name of default scripting language specified by the STDefaultLanguage default. If there is no such default in user's defaults database, then Smalltalk is used. engineClassForLanguage: language Return an engine class for specified language. The class lookup is as follows:
  • internal class dictionary by language name
  • all loaded classes by class name in the language info dictionary
  • in the language bundle
  • in the language bundle as language_nameEngine
infoForLanguage: language Description forthcoming. knownFileTypes Description forthcoming. languageForFileType: type Description forthcoming. registerLanguage: language engineClass: class info: info Description forthcoming. registerLanguagesFromBundle: bundle Description forthcoming. removeLanguage: language Description forthcoming.
steptalk-0.10.0/Documentation/Reference/STLanguageManager.html0000644000175000000000000001232610306171427023325 0ustar gurkanroot STLanguageManager class documentation Up

STLanguageManager class documentation

Authors

Generated by stevko

Software documentation for the STLanguageManager class

STLanguageManager : NSObject

Declared in:
StepTalk/STLanguageManager.h

Description forthcoming.


Instance Variables

Method summary

defaultManager 

+ (STLanguageManager*) defaultManager;

Description forthcoming.


availableLanguages 

- (NSArray*) availableLanguages;

Description forthcoming.


bundleForLanguage: 

- (NSBundle*) bundleForLanguage: (NSString*)language;

Description forthcoming.


createEngineForLanguage: 

- (STEngine*) createEngineForLanguage: (NSString*)language;

Description forthcoming.


defaultLanguage 

- (NSString*) defaultLanguage;

Returns the name of default scripting language specified by the STDefaultLanguage default. If there is no such default in user's defaults database, then Smalltalk is used.


engineClassForLanguage: 

- (Class) engineClassForLanguage: (NSString*)language;

Return an engine class for specified language. The class lookup is as follows:




Instance Variables for STLanguageManager Class

engineClasses

@protected NSMutableDictionary* engineClasses;

Description forthcoming.


fileTypes

@protected NSMutableDictionary* fileTypes;

Description forthcoming.


languageBundles

@protected NSMutableDictionary* languageBundles;

Description forthcoming.


languageInfos

@protected NSMutableDictionary* languageInfos;

Description forthcoming.


languages

@protected NSMutableArray* languages;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STMethod.gsdoc0000644000175000000000000000233210306171426021655 0ustar gurkanroot STMethod documentation urbanek@host.sk 2003 Free Software Foundation Software documentation for the STMethod protocol StepTalk/STMethod.h Description forthcoming. languageName Description forthcoming. methodName Description forthcoming. source Description forthcoming. steptalk-0.10.0/Documentation/Reference/STMethod.html0000644000175000000000000000366610306171427021536 0ustar gurkanroot STMethod documentation Up

STMethod documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2003 Free Software Foundation

Software documentation for the STMethod protocol

STMethod

Declared in:
StepTalk/STMethod.h

Description forthcoming.

Method summary

languageName 

- (NSString*) languageName;

Description forthcoming.


methodName 

- (NSString*) methodName;

Description forthcoming.


source 

- (NSString*) source;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STObjCRuntime.gsdoc0000644000175000000000000000431410306171426022620 0ustar gurkanroot STObjCRuntime documentation urbanek@host.sk 2002 Free Software Foundation STObjCRuntime functions

Description forthcoming. Description forthcoming. classNames Description forthcoming. sel Description forthcoming. Description forthcoming. sel Description forthcoming. aString Description forthcoming. val Description forthcoming. sel Description forthcoming.
steptalk-0.10.0/Documentation/Reference/STObjCRuntime.html0000644000175000000000000000570710306171427022475 0ustar gurkanroot STObjCRuntime documentation Up

STObjCRuntime documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

STObjCRuntime functions

STAllObjectiveCClasses

NSMutableDictionary* STAllObjectiveCClasses();

Description forthcoming.


STAllObjectiveCSelectors

NSArray* STAllObjectiveCSelectors();

Description forthcoming.


STClassDictionaryWithNames

NSDictionary* STClassDictionaryWithNames(NSArray* classNames);

Description forthcoming.


STConstructMethodSignatureForSelector

NSMethodSignature* STConstructMethodSignatureForSelector(SEL sel);

Description forthcoming.


STGetFoundationConstants

NSMutableDictionary* STGetFoundationConstants();

Description forthcoming.


STMethodSignatureForSelector

NSMethodSignature* STMethodSignatureForSelector(SEL sel);

Description forthcoming.


STSelectorFromString

SEL STSelectorFromString(NSString* aString);

Description forthcoming.


STSelectorFromValue

SEL STSelectorFromValue(NSValue* val);

Description forthcoming.


STValueFromSelector

NSValue* STValueFromSelector(SEL sel);

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STObjectReference.gsdoc0000644000175000000000000000407210306171426023465 0ustar gurkanroot STObjectReference class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STObjectReference class StepTalk/STObjectReference.h Description forthcoming. Description forthcoming. Description forthcoming. identifier Description forthcoming. initWithIdentifier: ident target: anObject Description forthcoming. object Description forthcoming. setObject: anObject Description forthcoming. target Description forthcoming. steptalk-0.10.0/Documentation/Reference/STObjectReference.html0000644000175000000000000001023410306171427023330 0ustar gurkanroot STObjectReference class documentation Up

STObjectReference class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STObjectReference class

STObjectReference : NSObject

Declared in:
StepTalk/STObjectReference.h

Description forthcoming.


Instance Variables

Method summary

identifier 

- (NSString*) identifier;

Description forthcoming.


initWithIdentifier: target: 

- (id) initWithIdentifier: (NSString*)ident target: (id)anObject;

Description forthcoming.


object 

- (id) object;

Description forthcoming.


setObject: 

- (void) setObject: (id)anObject;

Description forthcoming.


target 

- (id) target;

Description forthcoming.




Instance Variables for STObjectReference Class

identifier

@protected NSString* identifier;

Description forthcoming.


target

@protected id target;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STRemoteConversation.gsdoc0000644000175000000000000000407710306171426024273 0ustar gurkanroot STRemoteConversation class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STRemoteConversation class StepTalk/STRemoteConversation.h Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. initWithEnvironmentName: envName host: host language: langName Description forthcoming. steptalk-0.10.0/Documentation/Reference/STRemoteConversation.html0000644000175000000000000000636710306171427024145 0ustar gurkanroot STRemoteConversation class documentation Up

STRemoteConversation class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STRemoteConversation class

STRemoteConversation : STConversation

Declared in:
StepTalk/STRemoteConversation.h

Description forthcoming.


Instance Variables

Method summary

initWithEnvironmentName: host: language: 

- (id) initWithEnvironmentName: (NSString*)envName host: (NSString*)host language: (NSString*)langName;

Description forthcoming.




Instance Variables for STRemoteConversation Class

connection

@protected NSConnection* connection;

Description forthcoming.


environmentName

@protected NSString* environmentName;

Description forthcoming.


environmentProcess

@protected id environmentProcess;

Description forthcoming.


hostName

@protected NSString* hostName;

Description forthcoming.


proxy

@protected id proxy;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STScript.gsdoc0000644000175000000000000000457210306171426021711 0ustar gurkanroot STScript class documentation stefanurbanek@yahoo.fr 2002 Stefan Urbanek Software documentation for the STScript class StepTalk/STScript.h Description forthcoming. Description forthcoming. Description forthcoming. scriptWithSource: aString language: lang Description forthcoming. initWithSource: aString language: lang Description forthcoming. language Returns language of the script. setLanguage: name Set language of the script. setSource: aString Description forthcoming. source Description forthcoming. steptalk-0.10.0/Documentation/Reference/STScript.html0000644000175000000000000001103310306171427021545 0ustar gurkanroot STScript class documentation Up

STScript class documentation

Authors

Stefan Urbanek (stefanurbanek@yahoo.fr)

Copyright: (C) 2002 Stefan Urbanek

Software documentation for the STScript class

STScript : NSObject

Declared in:
StepTalk/STScript.h

Description forthcoming.


Instance Variables

Method summary

scriptWithSource: language: 

+ (id) scriptWithSource: (NSString*)aString language: (NSString*)lang;

Description forthcoming.


initWithSource: language: 

- (id) initWithSource: (NSString*)aString language: (NSString*)lang;

Description forthcoming.


language 

- (NSString*) language;

Returns language of the script.


setLanguage: 

- (void) setLanguage: (NSString*)name;

Set language of the script.


setSource: 

- (void) setSource: (NSString*)aString;

Description forthcoming.


source 

- (NSString*) source;

Description forthcoming.




Instance Variables for STScript Class

language

@protected NSString* language;

Description forthcoming.


source

@protected NSString* source;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STScriptObject.gsdoc0000644000175000000000000001073510306171426023036 0ustar gurkanroot STScriptObject class documentation Software documentation for the STScriptObject class StepTalk/STScriptObject.h NSCoding STScriptObject Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. scriptObject Return new instance of script object without any instance variables addMethod: aMethod Description forthcoming. environment Description forthcoming. initWithInstanceVariableNames: names Description forthcoming. instanceVariableNames Description forthcoming. methodDictionary Description forthcoming. methodNames Description forthcoming. methodWithName: aName Description forthcoming. objectForVariable: aName Description forthcoming. removeMethod: aMethod Description forthcoming. removeMethodWithName: aName Description forthcoming. setEnvironment: env Set object's environment. Note: This method should be replaced by some other, more clever mechanism. setObject: anObject forVariable: aName Description forthcoming. Software documentation for the STScriptObject protocol StepTalk/STScriptObject.h Description forthcoming. instanceVariableNames Description forthcoming. steptalk-0.10.0/Documentation/Reference/STScriptObject.html0000644000175000000000000002126710306171427022706 0ustar gurkanroot STScriptObject class documentation Up

STScriptObject class documentation

Authors

Generated by stevko

Software documentation for the STScriptObject class

STScriptObject : NSObject

Declared in:
StepTalk/STScriptObject.h
Conforms to:
NSCoding
STScriptObject

Description forthcoming.


Instance Variables

Method summary

scriptObject 

+ (id) scriptObject;

Return new instance of script object without any instance variables


addMethod: 

- (void) addMethod: (id<STMethod>)aMethod;

Description forthcoming.


environment 

- (STEnvironment*) environment;

Description forthcoming.


initWithInstanceVariableNames: 

- (id) initWithInstanceVariableNames: (NSString*)names;

Description forthcoming.


instanceVariableNames 

- (NSArray*) instanceVariableNames;

Description forthcoming.


methodDictionary 

- (NSDictionary*) methodDictionary;

Description forthcoming.


methodNames 

- (NSArray*) methodNames;

Description forthcoming.


methodWithName: 

- (id<STMethod>) methodWithName: (NSString*)aName;

Description forthcoming.


objectForVariable: 

- (id) objectForVariable: (NSString*)aName;

Description forthcoming.


removeMethod: 

- (void) removeMethod: (id<STMethod>)aMethod;

Description forthcoming.


removeMethodWithName: 

- (void) removeMethodWithName: (NSString*)aName;

Description forthcoming.


setEnvironment: 

- (void) setEnvironment: (STEnvironment*)env;

Set object's environment. Note: This method should be replaced by some other, more clever mechanism.


setObject: forVariable: 

- (void) setObject: (id)anObject forVariable: (NSString*)aName;

Description forthcoming.




Instance Variables for STScriptObject Class

environment

@protected STEnvironment* environment;

Description forthcoming.


ivars

@protected NSMutableDictionary* ivars;

Description forthcoming.


methodDictionary

@protected NSMutableDictionary* methodDictionary;

Description forthcoming.





Software documentation for the STScriptObject protocol

STScriptObject

Declared in:
StepTalk/STScriptObject.h

Description forthcoming.

Method summary

instanceVariableNames 

- (NSArray*) instanceVariableNames;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STScripting.gsdoc0000644000175000000000000000417210306171426022403 0ustar gurkanroot STScripting protocol documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the NSObject(STScripting) category StepTalk/STScripting.h STScripting Description forthcoming. Software documentation for the STScripting protocol StepTalk/STScripting.h Description forthcoming. classForScripting Description forthcoming. className Description forthcoming. isClass Description forthcoming. classForScripting Description forthcoming. className Description forthcoming. isClass Description forthcoming. steptalk-0.10.0/Documentation/Reference/STScripting.html0000644000175000000000000000772410306171427022257 0ustar gurkanroot STScripting protocol documentation Up

STScripting protocol documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the NSObject(STScripting) category

NSObject(STScripting)

Declared in:
StepTalk/STScripting.h
Conforms to:
STScripting

Description forthcoming.

Software documentation for the STScripting protocol

STScripting

Declared in:
StepTalk/STScripting.h

Description forthcoming.

Method summary

classForScripting 

+ (Class) classForScripting;

Description forthcoming.


className 

+ (NSString*) className;

Description forthcoming.


isClass 

+ (BOOL) isClass;

Description forthcoming.


classForScripting 

- (Class) classForScripting;

Description forthcoming.


className 

- (NSString*) className;

Description forthcoming.


isClass 

- (BOOL) isClass;

Description forthcoming.



Up
steptalk-0.10.0/Documentation/Reference/STScriptsManager.gsdoc0000644000175000000000000000662310306171426023366 0ustar gurkanroot STScriptsManager class documentation urbanek@host.sk 2002 Stefan Urbanek Software documentation for the STScriptsManager class StepTalk/STScriptsManager.h Description forthcoming. Description forthcoming. Description forthcoming. defaultManager Returns default scripts manager for current process (application or tool). allScripts Return list of all scripts for managed domain. initWithDomainName: name Initializes the receiver to be used with domain named name. If name is nil, default scripts domain name will be used. scriptSearchPaths Retrun an array of script search paths. Scripts are searched in Library/StepTalk/Scripts/ scriptsDomainName, Library/StepTalk/Scripts/Shared and in all loaded bundles in bundlePath /Resources/Scripts. scriptWithName: aString Get a script with name aString for current scripting domain. scriptsDomainName Return name of script manager domain. setScriptSearchPaths: anArray Set script search paths to anArray. setScriptSearchPathsToDefaults Description forthcoming. validScriptSearchPaths Return script search paths that are valid. That means that path exists and is a directory. steptalk-0.10.0/Documentation/Reference/STScriptsManager.html0000644000175000000000000001401710306171427023230 0ustar gurkanroot STScriptsManager class documentation Up

STScriptsManager class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Stefan Urbanek

Software documentation for the STScriptsManager class

STScriptsManager : NSObject

Declared in:
StepTalk/STScriptsManager.h

Description forthcoming.


Instance Variables

Method summary

defaultManager 

+ (id) defaultManager;

Returns default scripts manager for current process (application or tool).


allScripts 

- (NSArray*) allScripts;

Return list of all scripts for managed domain.


initWithDomainName: 

- (id) initWithDomainName: (NSString*)name;
This is a designated initialiser for the class.

Initializes the receiver to be used with domain named name. If name is nil, default scripts domain name will be used.


scriptSearchPaths 

- (NSArray*) scriptSearchPaths;

Retrun an array of script search paths. Scripts are searched in Library/StepTalk/Scripts/ scriptsDomainName, Library/StepTalk/Scripts/Shared and in all loaded bundles in bundlePath /Resources/Scripts.


scriptWithName: 

- (STFileScript*) scriptWithName: (NSString*)aString;

Get a script with name aString for current scripting domain.


scriptsDomainName 

- (NSString*) scriptsDomainName;

Return name of script manager domain.


setScriptSearchPaths: 

- (void) setScriptSearchPaths: (NSArray*)anArray;

Set script search paths to anArray.


setScriptSearchPathsToDefaults 

- (void) setScriptSearchPathsToDefaults;

Description forthcoming.


validScriptSearchPaths 

- (NSArray*) validScriptSearchPaths;

Return script search paths that are valid. That means that path exists and is a directory.




Instance Variables for STScriptsManager Class

scriptSearchPaths

@protected NSArray* scriptSearchPaths;

Description forthcoming.


scriptsDomainName

@protected NSString* scriptsDomainName;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STSelector.gsdoc0000644000175000000000000000330210306171426022213 0ustar gurkanroot STSelector class documentation Software documentation for the STSelector class StepTalk/STSelector.h Description forthcoming. Description forthcoming. Description forthcoming. initWithName: aString Description forthcoming. initWithSelector: aSel Description forthcoming. selectorName Description forthcoming. selectorValue Description forthcoming. steptalk-0.10.0/Documentation/Reference/STSelector.html0000644000175000000000000000610110306171427022061 0ustar gurkanroot STSelector class documentation Up

STSelector class documentation

Authors

Generated by stevko

Software documentation for the STSelector class

STSelector : NSObject

Declared in:
StepTalk/STSelector.h

Description forthcoming.


Instance Variables

Method summary

initWithName: 

- (id) initWithName: (NSString*)aString;

Description forthcoming.


initWithSelector: 

- (id) initWithSelector: (SEL)aSel;

Description forthcoming.


selectorName 

- (NSString*) selectorName;

Description forthcoming.


selectorValue 

- (SEL) selectorValue;

Description forthcoming.




Instance Variables for STSelector Class

sel

@protected SEL sel;

Description forthcoming.


selectorName

@protected NSString* selectorName;

Description forthcoming.






Up
steptalk-0.10.0/Documentation/Reference/STUndefinedObject.gsdoc0000644000175000000000000000145010306171426023465 0ustar gurkanroot STUndefinedObject class documentation urbanek@host.sk 2002 Free Software Foundation Software documentation for the STUndefinedObject class StepTalk/STUndefinedObject.h Description forthcoming. steptalk-0.10.0/Documentation/Reference/STUndefinedObject.html0000644000175000000000000000174210306171427023337 0ustar gurkanroot STUndefinedObject class documentation Up

STUndefinedObject class documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Copyright: (C) 2002 Free Software Foundation

Software documentation for the STUndefinedObject class

STUndefinedObject : NSObject

Declared in:
StepTalk/STUndefinedObject.h

Description forthcoming.


Up
steptalk-0.10.0/Documentation/Reference/StepTalk.html0000644000175000000000000000575610306171427021600 0ustar gurkanroot StepTalk Documentation

StepTalk Documentation

Authors

Stefan Urbanek (urbanek@host.sk)

Version: 0.7.1

Date: 2003 Apr 22

Introduction

StepTalk is a scripting framework for creating scriptable servers or applications. StepTalk, when combined with the dynamism that the Objective-C language provides, goes way beyond mere scripting. intro


steptalk-0.10.0/Documentation/Reference/StepTalk.igsdoc0000644000175000000000000011011210306171427022063 0ustar gurkanroot{ categories = { NSBundle = { STAdditions = STBundleInfo; }; NSInvocation = { STAdditions = "NSInvocation+additions"; }; NSObject = { STAdditions = "NSObject+additions"; STScripting = STScripting; }; }; category = { "NSBundle(STAdditions)" = STBundleInfo; "NSInvocation(STAdditions)" = "NSInvocation+additions"; "NSObject(STAdditions)" = "NSObject+additions"; "NSObject(STScripting)" = STScripting; }; class = { STActor = STActor; STBundleInfo = STBundleInfo; STContext = STContext; STConversation = STConversation; STEngine = STEngine; STEnvironment = STEnvironment; STEnvironmentDescription = STEnvironmentDescription; STFileScript = STFileScript; STLanguage = STLanguage; STLanguageManager = STLanguageManager; STMethod = STMethod; STObjectReference = STObjectReference; STRemoteConversation = STRemoteConversation; STScript = STScript; STScriptObject = STScriptObject; STScriptsManager = STScriptsManager; STSelector = STSelector; STUndefinedObject = STUndefinedObject; }; classvars = { STActor = { environment = STActor; ivars = STActor; methodDictionary = STActor; }; STBundleInfo = { allClasses = STBundleInfo; bundle = STBundleInfo; objectReferenceDictionary = STBundleInfo; publicClasses = STBundleInfo; scriptingInfoClass = STBundleInfo; scriptingInfoClassName = STBundleInfo; useAllClasses = STBundleInfo; }; STContext = { createsUnknownObjects = STContext; fullScripting = STContext; objectDictionary = STContext; parentContext = STContext; }; STEnvironment = { classes = STEnvironment; description = STEnvironment; infoCache = STEnvironment; loadedBundles = STEnvironment; objectFinders = STEnvironment; }; STEnvironmentDescription = { aliases = STEnvironmentDescription; behaviours = STEnvironmentDescription; classes = STEnvironmentDescription; finders = STEnvironmentDescription; frameworks = STEnvironmentDescription; modules = STEnvironmentDescription; restriction = STEnvironmentDescription; usedDefs = STEnvironmentDescription; }; STFileScript = { description = STFileScript; fileName = STFileScript; localizedName = STFileScript; menuKey = STFileScript; }; STLanguageManager = { engineClasses = STLanguageManager; fileTypes = STLanguageManager; languageBundles = STLanguageManager; languageInfos = STLanguageManager; languages = STLanguageManager; }; STObjectReference = { identifier = STObjectReference; target = STObjectReference; }; STRemoteConversation = { connection = STRemoteConversation; environmentName = STRemoteConversation; environmentProcess = STRemoteConversation; hostName = STRemoteConversation; proxy = STRemoteConversation; }; STScript = { language = STScript; source = STScript; }; STScriptObject = { environment = STScriptObject; ivars = STScriptObject; methodDictionary = STScriptObject; }; STScriptsManager = { scriptSearchPaths = STScriptsManager; scriptsDomainName = STScriptsManager; }; STSelector = { sel = STSelector; selectorName = STSelector; }; }; function = { STAllObjectiveCClasses = STObjCRuntime; STAllObjectiveCSelectors = STObjCRuntime; STClassDictionaryWithNames = STObjCRuntime; STConstructMethodSignatureForSelector = STObjCRuntime; STFindAllResources = STFunctions; STFindResource = STFunctions; STGetFoundationConstants = STObjCRuntime; STGetValueOfTypeFromObject = "NSInvocation+additions"; STMethodSignatureForSelector = STObjCRuntime; STObjectFromValueOfType = "NSInvocation+additions"; STSelectorFromString = STObjCRuntime; STSelectorFromValue = STObjCRuntime; STUserConfigPath = STFunctions; STValueFromSelector = STObjCRuntime; }; ivariable = { aliases = { STEnvironmentDescription = STEnvironmentDescription; }; allClasses = { STBundleInfo = STBundleInfo; }; behaviours = { STEnvironmentDescription = STEnvironmentDescription; }; bundle = { STBundleInfo = STBundleInfo; }; classes = { STEnvironment = STEnvironment; STEnvironmentDescription = STEnvironmentDescription; }; connection = { STRemoteConversation = STRemoteConversation; }; createsUnknownObjects = { STContext = STContext; }; description = { STEnvironment = STEnvironment; STFileScript = STFileScript; }; engineClasses = { STLanguageManager = STLanguageManager; }; environment = { STActor = STActor; STScriptObject = STScriptObject; }; environmentName = { STRemoteConversation = STRemoteConversation; }; environmentProcess = { STRemoteConversation = STRemoteConversation; }; fileName = { STFileScript = STFileScript; }; fileTypes = { STLanguageManager = STLanguageManager; }; finders = { STEnvironmentDescription = STEnvironmentDescription; }; frameworks = { STEnvironmentDescription = STEnvironmentDescription; }; fullScripting = { STContext = STContext; }; hostName = { STRemoteConversation = STRemoteConversation; }; identifier = { STObjectReference = STObjectReference; }; infoCache = { STEnvironment = STEnvironment; }; ivars = { STActor = STActor; STScriptObject = STScriptObject; }; language = { STScript = STScript; }; languageBundles = { STLanguageManager = STLanguageManager; }; languageInfos = { STLanguageManager = STLanguageManager; }; languages = { STLanguageManager = STLanguageManager; }; loadedBundles = { STEnvironment = STEnvironment; }; localizedName = { STFileScript = STFileScript; }; menuKey = { STFileScript = STFileScript; }; methodDictionary = { STActor = STActor; STScriptObject = STScriptObject; }; modules = { STEnvironmentDescription = STEnvironmentDescription; }; objectDictionary = { STContext = STContext; }; objectFinders = { STEnvironment = STEnvironment; }; objectReferenceDictionary = { STBundleInfo = STBundleInfo; }; parentContext = { STContext = STContext; }; proxy = { STRemoteConversation = STRemoteConversation; }; publicClasses = { STBundleInfo = STBundleInfo; }; restriction = { STEnvironmentDescription = STEnvironmentDescription; }; scriptSearchPaths = { STScriptsManager = STScriptsManager; }; scriptingInfoClass = { STBundleInfo = STBundleInfo; }; scriptingInfoClassName = { STBundleInfo = STBundleInfo; }; scriptsDomainName = { STScriptsManager = STScriptsManager; }; sel = { STSelector = STSelector; }; selectorName = { STSelector = STSelector; }; source = { STScript = STScript; }; target = { STObjectReference = STObjectReference; }; useAllClasses = { STBundleInfo = STBundleInfo; }; usedDefs = { STEnvironmentDescription = STEnvironmentDescription; }; }; method = { "+actorInEnvironment:" = { STActor = STActor; }; "+allFrameworkNames" = { NSBundle = STBundleInfo; }; "+allKnownFileTypes" = { STLanguage = STLanguage; }; "+allLanguageNames" = { STLanguage = STLanguage; }; "+bundleForFrameworkWithName:" = { NSBundle = STBundleInfo; }; "+classForScripting" = { "(STScripting)" = STScripting; }; "+className" = { "(STScripting)" = STScripting; }; "+conversationWithEnvironment:language:" = { STConversation = STConversation; }; "+defaultDescriptionName" = { STEnvironmentDescription = STEnvironmentDescription; }; "+defaultLanguageName" = { STLanguage = STLanguage; }; "+defaultManager" = { STLanguageManager = STLanguageManager; STScriptsManager = STScriptsManager; }; "+defaultScriptingEnvironment" = { STEnvironment = STEnvironment; }; "+descriptionFromDictionary:" = { STEnvironmentDescription = STEnvironmentDescription; }; "+descriptionWithName:" = { STEnvironmentDescription = STEnvironmentDescription; }; "+engineForFileType:" = { STEngine = STEngine; }; "+engineForLanguage:" = { STEngine = STEngine; }; "+engineForLanguageWithName:" = { STEngine = STEngine; }; "+environmentWithDefaultDescription" = { STEnvironment = STEnvironment; }; "+environmentWithDescription:" = { STEnvironment = STEnvironment; }; "+environmentWithDescriptionName:" = { STEnvironment = STEnvironment; }; "+infoForBundle:" = { STBundleInfo = STBundleInfo; }; "+invocationWithTarget:selector:" = { NSInvocation = "NSInvocation+additions"; }; "+invocationWithTarget:selectorName:" = { NSInvocation = "NSInvocation+additions"; }; "+isClass" = { "(STScripting)" = STScripting; }; "+languageForFileType:" = { STLanguage = STLanguage; }; "+languageNameForFileType:" = { STLanguage = STLanguage; }; "+languageWithName:" = { STLanguage = STLanguage; }; "+languageWithPath:" = { STLanguage = STLanguage; }; "+pathForFrameworkWithName:" = { NSBundle = STBundleInfo; }; "+scriptObject" = { STScriptObject = STScriptObject; }; "+scriptWithFile:" = { STFileScript = STFileScript; STScript = STScript; }; "+scriptWithSource:language:" = { STScript = STScript; }; "+sharedEnvironment" = { STEnvironment = STEnvironment; }; "+stepTalkBundleNames" = { NSBundle = STBundleInfo; }; "+stepTalkBundleWithName:" = { NSBundle = STBundleInfo; }; "-addClassesWithNames:" = { STEnvironment = STEnvironment; }; "-addMethod:" = { STActor = STActor; STScriptObject = STScriptObject; }; "-addNamedObjectsFromDictionary:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-allClassNames" = { STBundleInfo = STBundleInfo; }; "-allScripts" = { STScriptsManager = STScriptsManager; }; "-availableLanguages" = { STLanguageManager = STLanguageManager; }; "-bundleForLanguage:" = { STLanguageManager = STLanguageManager; }; "-canInterpret:" = { STEngine = STEngine; }; "-classForScripting" = { "(STScripting)" = STScripting; }; "-className" = { "(STScripting)" = STScripting; }; "-classes" = { STEnvironmentDescription = STEnvironmentDescription; }; "-compareByLocalizedName:" = { STFileScript = STFileScript; STScript = STScript; }; "-context" = { STConversation = STConversation; }; "-createEngineForLanguage:" = { STLanguageManager = STLanguageManager; }; "-createsUnknownObjects" = { STContext = STContext; STEnvironment = STEnvironment; }; "-defaultEnvironment" = { STEngine = STEngine; }; "-defaultLanguage" = { STLanguageManager = STLanguageManager; }; "-engine" = { STLanguage = STLanguage; }; "-engineClassForLanguage:" = { STLanguageManager = STLanguageManager; }; "-environment" = { STActor = STActor; STConversation = STConversation; STScriptObject = STScriptObject; }; "-executeCode:" = { STEngine = STEngine; }; "-executeCode:inEnvironment:" = { STEngine = STEngine; }; "-executeMethod:forReceiver:withArguments:inEnvironment:" = { STEngine = STEngine; }; "-executeMethod:forScriptObject:" = { STEngine = STEngine; }; "-fileName" = { STFileScript = STFileScript; STScript = STScript; }; "-frameworks" = { STEnvironmentDescription = STEnvironmentDescription; }; "-fullScriptingEnabled" = { STContext = STContext; STEnvironment = STEnvironment; }; "-getArgumentAsObjectAtIndex:" = { NSInvocation = "NSInvocation+additions"; }; "-identifier" = { STObjectReference = STObjectReference; }; "-includeBundle:" = { STEnvironment = STEnvironment; }; "-includeFramework:" = { STEnvironment = STEnvironment; }; "-initDefault" = { STEnvironment = STEnvironment; }; "-initFromDictionary:" = { STEnvironmentDescription = STEnvironmentDescription; }; "-initWithBundle:" = { STBundleInfo = STBundleInfo; }; "-initWithContext:language:" = { STConversation = STConversation; }; "-initWithDefaultDescription" = { STEnvironment = STEnvironment; }; "-initWithDescription:" = { STEnvironment = STEnvironment; }; "-initWithDescriptionName:" = { STEnvironment = STEnvironment; }; "-initWithDomainName:" = { STScriptsManager = STScriptsManager; }; "-initWithEnvironment:" = { STActor = STActor; }; "-initWithEnvironment:language:" = { STConversation = STConversation; }; "-initWithEnvironmentName:host:language:" = { STRemoteConversation = STRemoteConversation; }; "-initWithFile:" = { STFileScript = STFileScript; STScript = STScript; }; "-initWithIdentifier:target:" = { STObjectReference = STObjectReference; }; "-initWithInstanceVariableNames:" = { STScriptObject = STScriptObject; }; "-initWithName:" = { STEnvironmentDescription = STEnvironmentDescription; STSelector = STSelector; }; "-initWithObjectName:pool:" = { STObjectReference = STObjectReference; }; "-initWithSelector:" = { STSelector = STSelector; }; "-initWithSource:language:" = { STScript = STScript; }; "-instanceVariableNames" = { "(STScriptObject)" = STScriptObject; STScriptObject = STScriptObject; }; "-interpretMethod:forReceiver:withArguments:inContext:" = { STEngine = STEngine; }; "-interpretScript:" = { "(STConversation)" = STConversation; }; "-interpretScript:inContext:" = { STEngine = STEngine; }; "-isClass" = { "(STScripting)" = STScripting; }; "-isNil" = { NSObject = "NSObject+additions"; }; "-isSame:" = { NSObject = "NSObject+additions"; }; "-knownLanguages" = { "(STConversation)" = STConversation; }; "-knownObjectNames" = { STContext = STContext; STEnvironment = STEnvironment; }; "-language" = { "(STConversation)" = STConversation; STConversation = STConversation; STScript = STScript; }; "-languageName" = { "(STMethod)" = STMethod; STLanguage = STLanguage; STMethod = STMethod; }; "-loadModule:" = { STEnvironment = STEnvironment; }; "-localizedName" = { STFileScript = STFileScript; STScript = STScript; }; "-methodDictionary" = { STActor = STActor; STScriptObject = STScriptObject; }; "-methodFromSource:forReceiver:inContext:" = { STEngine = STEngine; }; "-methodFromSource:forReceiver:inEnvironment:" = { STEngine = STEngine; }; "-methodFromSource:forScriptObject:" = { STEngine = STEngine; }; "-methodName" = { "(STMethod)" = STMethod; STMethod = STMethod; }; "-methodNames" = { STActor = STActor; STScriptObject = STScriptObject; }; "-methodWithName:" = { STActor = STActor; STScriptObject = STScriptObject; }; "-modules" = { STEnvironmentDescription = STEnvironmentDescription; }; "-namedObjects" = { STBundleInfo = STBundleInfo; }; "-notNil" = { NSObject = "NSObject+additions"; }; "-object" = { STObjectReference = STObjectReference; }; "-objectDictionary" = { STContext = STContext; STEnvironment = STEnvironment; }; "-objectFinders" = { STEnvironmentDescription = STEnvironmentDescription; }; "-objectForVariable:" = { STScriptObject = STScriptObject; }; "-objectName" = { STObjectReference = STObjectReference; }; "-objectReferenceDictionary" = { STBundleInfo = STBundleInfo; }; "-objectReferenceForObjectWithName:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-objectWithName:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-parentContext" = { STContext = STContext; }; "-pool" = { STObjectReference = STObjectReference; }; "-publicClassNames" = { STBundleInfo = STBundleInfo; }; "-registerObjectFinder:name:" = { STEnvironment = STEnvironment; }; "-registerObjectFinderNamed:" = { STEnvironment = STEnvironment; }; "-removeMethod:" = { STActor = STActor; STScriptObject = STScriptObject; }; "-removeMethodWithName:" = { STActor = STActor; STScriptObject = STScriptObject; }; "-removeObjectFinderWithName:" = { STEnvironment = STEnvironment; }; "-removeObjectWithName:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-result" = { "(STConversation)" = STConversation; }; "-resultByCopy" = { "(STConversation)" = STConversation; }; "-returnValueAsObject" = { NSInvocation = "NSInvocation+additions"; }; "-runScriptFromString:" = { STConversation = STConversation; }; "-scriptDescription" = { STFileScript = STFileScript; STScript = STScript; }; "-scriptName" = { STFileScript = STFileScript; STScript = STScript; }; "-scriptSearchPaths" = { STScriptsManager = STScriptsManager; }; "-scriptWithName:" = { STScriptsManager = STScriptsManager; }; "-scriptingInfoDictionary" = { NSBundle = STBundleInfo; }; "-scriptsDomainName" = { STScriptsManager = STScriptsManager; }; "-selectorName" = { STSelector = STSelector; }; "-selectorValue" = { STSelector = STSelector; }; "-setArgumentAsObject:atIndex:" = { NSInvocation = "NSInvocation+additions"; }; "-setCreatesUnknownObjects:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-setDefaultEnvironment:" = { STEngine = STEngine; }; "-setEnvironment:" = { STActor = STActor; STScriptObject = STScriptObject; }; "-setFullScriptingEnabled:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-setLanguage:" = { "(STConversation)" = STConversation; STConversation = STConversation; STScript = STScript; }; "-setObject:" = { STObjectReference = STObjectReference; }; "-setObject:forName:" = { STContext = STContext; STEnvironment = STEnvironment; }; "-setObject:forVariable:" = { STScriptObject = STScriptObject; }; "-setObjectName:" = { STObjectReference = STObjectReference; }; "-setParentContext:" = { STContext = STContext; }; "-setPool:" = { STObjectReference = STObjectReference; }; "-setScriptSearchPaths:" = { STScriptsManager = STScriptsManager; }; "-setScriptSearchPathsToDefaults" = { STScriptsManager = STScriptsManager; }; "-setSource:" = { STScript = STScript; }; "-setValue:forOption:" = { STEngine = STEngine; }; "-source" = { "(STMethod)" = STMethod; STMethod = STMethod; STScript = STScript; }; "-stringValue" = { STSelector = STSelector; }; "-target" = { STObjectReference = STObjectReference; }; "-translateSelector:forReceiver:" = { STEnvironment = STEnvironment; }; "-understandsCode:" = { STEngine = STEngine; }; "-updateClassWithName:description:" = { STEnvironmentDescription = STEnvironmentDescription; }; "-updateFromDictionary:" = { STEnvironmentDescription = STEnvironmentDescription; }; "-validScriptSearchPaths" = { STScriptsManager = STScriptsManager; }; "-valueForOption:" = { STEngine = STEngine; }; }; output = { "Headers/StepTalk/NSInvocation+additions.h" = ( "../Documentation/Reference/NSInvocation+additions.gsdoc" ); "Headers/StepTalk/NSObject+additions.h" = ( "../Documentation/Reference/NSObject+additions.gsdoc" ); Headers/StepTalk/STBundleInfo.h = ( ../Documentation/Reference/STBundleInfo.gsdoc ); Headers/StepTalk/STEngine.h = ( ../Documentation/Reference/STEngine.gsdoc ); Headers/StepTalk/STEnvironment.h = ( ../Documentation/Reference/STEnvironment.gsdoc ); Headers/StepTalk/STExterns.h = ( ../Documentation/Reference/STExterns.gsdoc ); Headers/StepTalk/STFunctions.h = ( ../Documentation/Reference/STFunctions.gsdoc ); Headers/StepTalk/STLanguage.h = ( ../Documentation/Reference/STLanguage.gsdoc ); Headers/StepTalk/STMethod.h = ( ../Documentation/Reference/STMethod.gsdoc ); Headers/StepTalk/STObjCRuntime.h = ( ../Documentation/Reference/STObjCRuntime.gsdoc ); Headers/StepTalk/STObjectReference.h = ( ../Documentation/Reference/STObjectReference.gsdoc ); Headers/StepTalk/STScript.h = ( ../Documentation/Reference/STScript.gsdoc ); Headers/StepTalk/STScriptObject.h = ( ../Documentation/Reference/STScriptObject.gsdoc ); Headers/StepTalk/STScripting.h = ( ../Documentation/Reference/STScripting.gsdoc ); Headers/StepTalk/STScriptsManager.h = ( ../Documentation/Reference/STScriptsManager.gsdoc ); Headers/StepTalk/STSelector.h = ( ../Documentation/Reference/STSelector.gsdoc ); Headers/StepTalk/STUndefinedObject.h = ( ../Documentation/Reference/STUndefinedObject.gsdoc ); "NSInvocation+additions.h" = ( "../../Documentation/Reference/NSInvocation+additions.gsdoc" ); "NSObject+additions.h" = ( "../../Documentation/Reference/NSObject+additions.gsdoc" ); STActor.h = ( ../../Documentation/Reference/STActor.gsdoc ); STBundleInfo.h = ( ../../Documentation/Reference/STBundleInfo.gsdoc ); STContext.h = ( ../../Documentation/Reference/STContext.gsdoc ); STConversation.h = ( ../../Documentation/Reference/STConversation.gsdoc ); STEngine.h = ( ../../Documentation/Reference/STEngine.gsdoc ); STEnvironment.h = ( ../../Documentation/Reference/STEnvironment.gsdoc ); STEnvironmentDescription.h = ( ../../Documentation/Reference/STEnvironmentDescription.gsdoc ); STExterns.h = ( ../../Documentation/Reference/STExterns.gsdoc ); STFileScript.h = ( ../../Documentation/Reference/STFileScript.gsdoc ); STFunctions.h = ( ../../Documentation/Reference/STFunctions.gsdoc ); STLanguage.h = ( ../../Documentation/Reference/STLanguage.gsdoc ); STLanguageManager.h = ( ../../Documentation/Reference/STLanguageManager.gsdoc ); STMethod.h = ( ../../Documentation/Reference/STMethod.gsdoc ); STObjCRuntime.h = ( ../../Documentation/Reference/STObjCRuntime.gsdoc ); STObjectReference.h = ( ../../Documentation/Reference/STObjectReference.gsdoc ); STRemoteConversation.h = ( ../../Documentation/Reference/STRemoteConversation.gsdoc ); STScript.h = ( ../../Documentation/Reference/STScript.gsdoc ); STScriptObject.h = ( ../../Documentation/Reference/STScriptObject.gsdoc ); STScripting.h = ( ../../Documentation/Reference/STScripting.gsdoc ); STScriptsManager.h = ( ../../Documentation/Reference/STScriptsManager.gsdoc ); STSelector.h = ( ../../Documentation/Reference/STSelector.gsdoc ); STUndefinedObject.h = ( ../../Documentation/Reference/STUndefinedObject.gsdoc ); }; protocol = { "(STConversation)" = STConversation; "(STMethod)" = STMethod; "(STScriptObject)" = STScriptObject; "(STScripting)" = STScripting; }; source = { "Headers/StepTalk/NSInvocation+additions.h" = ( "NSInvocation+additions.m" ); "Headers/StepTalk/NSObject+additions.h" = ( "NSObject+additions.m" ); Headers/StepTalk/STBundleInfo.h = ( STBundleInfo.m ); Headers/StepTalk/STEngine.h = ( STEngine.m ); Headers/StepTalk/STEnvironment.h = ( STEnvironment.m ); Headers/StepTalk/STExterns.h = ( STExterns.m ); Headers/StepTalk/STFunctions.h = ( STFunctions.m ); Headers/StepTalk/STLanguage.h = ( STLanguage.m ); Headers/StepTalk/STMethod.h = ( STMethod.m ); Headers/StepTalk/STObjCRuntime.h = ( STObjCRuntime.m ); Headers/StepTalk/STObjectReference.h = ( STObjectReference.m ); Headers/StepTalk/STScript.h = ( STScript.m ); Headers/StepTalk/STScriptObject.h = ( STScriptObject.m ); Headers/StepTalk/STScripting.h = ( STScripting.m ); Headers/StepTalk/STScriptsManager.h = ( STScriptsManager.m ); Headers/StepTalk/STSelector.h = ( STSelector.m ); Headers/StepTalk/STUndefinedObject.h = ( STUndefinedObject.m ); "NSInvocation+additions.h" = ( "NSInvocation+additions.m" ); "NSObject+additions.h" = ( "NSObject+additions.m" ); STActor.h = ( STActor.m ); STBundleInfo.h = ( STBundleInfo.m ); STContext.h = ( STContext.m ); STConversation.h = ( STConversation.m ); STEngine.h = ( STEngine.m ); STEnvironment.h = ( STEnvironment.m ); STEnvironmentDescription.h = ( STEnvironmentDescription.m ); STExterns.h = ( STExterns.m ); STFileScript.h = ( STFileScript.m ); STFunctions.h = ( STFunctions.m ); STLanguage.h = ( STLanguage.m ); STLanguageManager.h = ( STLanguageManager.m ); STMethod.h = ( STMethod.m ); STObjCRuntime.h = ( STObjCRuntime.m ); STObjectReference.h = ( STObjectReference.m ); STRemoteConversation.h = ( STRemoteConversation.m ); STScript.h = ( STScript.m ); STScriptObject.h = ( STScriptObject.m ); STScripting.h = ( STScripting.m ); STScriptsManager.h = ( STScriptsManager.m ); STSelector.h = ( STSelector.m ); STUndefinedObject.h = ( STUndefinedObject.m ); }; super = { STActor = NSObject; STBundleInfo = NSObject; STContext = NSObject; STConversation = NSObject; STEngine = NSObject; STEnvironment = STContext; STEnvironmentDescription = NSObject; STFileScript = STScript; STLanguage = NSBundle; STLanguageManager = NSObject; STMethod = NSObject; STObjectReference = NSObject; STRemoteConversation = STConversation; STScript = NSObject; STScriptObject = NSObject; STScriptsManager = NSObject; STSelector = NSObject; STUndefinedObject = NSObject; }; title = { "NSInvocation+additions" = "NSInvocation class additions"; "NSObject+additions" = "NSObject+additions documentation"; STActor = "STActor class documentation"; STBundleInfo = "STBundleInfo class documentation"; STContext = "STEnvironment class reference"; STConversation = "STConversation class documentation"; STEngine = "STEngine class documentation"; STEnvironment = "STEnvironment class reference"; STEnvironmentDescription = "STEnvironmentDescription class documentation"; STExterns = "STExterns documentation"; STFileScript = "STFileScript class documentation"; STFunctions = "STFunctions documentation"; STLanguage = "STLanguage class documentation"; STLanguageManager = "STLanguageManager class documentation"; STMethod = "STMethod documentation"; STObjCRuntime = "STObjCRuntime documentation"; STObjectReference = "STObjectReference class documentation"; STRemoteConversation = "STRemoteConversation class documentation"; STScript = "STScript class documentation"; STScriptObject = "STScriptObject class documentation"; STScripting = "STScripting protocol documentation"; STScriptsManager = "STScriptsManager class documentation"; STSelector = "STSelector class documentation"; STUndefinedObject = "STUndefinedObject class documentation"; StepTalk = "StepTalk Documentation"; }; unitmethods = { "(STConversation)" = { "-interpretScript:" = STConversation; "-knownLanguages" = STConversation; "-language" = STConversation; "-result" = STConversation; "-resultByCopy" = STConversation; "-setLanguage:" = STConversation; }; "(STMethod)" = { "-languageName" = STMethod; "-methodName" = STMethod; "-source" = STMethod; }; "(STScriptObject)" = { "-instanceVariableNames" = STScriptObject; }; "(STScripting)" = { "+classForScripting" = STScripting; "+className" = STScripting; "+isClass" = STScripting; "-classForScripting" = STScripting; "-className" = STScripting; "-isClass" = STScripting; }; "NSBundle(STAdditions)" = { "+allFrameworkNames" = STBundleInfo; "+bundleForFrameworkWithName:" = STBundleInfo; "+pathForFrameworkWithName:" = STBundleInfo; "+stepTalkBundleNames" = STBundleInfo; "+stepTalkBundleWithName:" = STBundleInfo; "-scriptingInfoDictionary" = STBundleInfo; }; "NSInvocation(STAdditions)" = { "+invocationWithTarget:selector:" = "NSInvocation+additions"; "+invocationWithTarget:selectorName:" = "NSInvocation+additions"; "-getArgumentAsObjectAtIndex:" = "NSInvocation+additions"; "-returnValueAsObject" = "NSInvocation+additions"; "-setArgumentAsObject:atIndex:" = "NSInvocation+additions"; }; "NSObject(STAdditions)" = { "-isNil" = "NSObject+additions"; "-isSame:" = "NSObject+additions"; "-notNil" = "NSObject+additions"; }; STActor = { "+actorInEnvironment:" = STActor; "-addMethod:" = STActor; "-environment" = STActor; "-initWithEnvironment:" = STActor; "-methodDictionary" = STActor; "-methodNames" = STActor; "-methodWithName:" = STActor; "-removeMethod:" = STActor; "-removeMethodWithName:" = STActor; "-setEnvironment:" = STActor; }; STBundleInfo = { "+infoForBundle:" = STBundleInfo; "-allClassNames" = STBundleInfo; "-initWithBundle:" = STBundleInfo; "-namedObjects" = STBundleInfo; "-objectReferenceDictionary" = STBundleInfo; "-publicClassNames" = STBundleInfo; }; STContext = { "-addNamedObjectsFromDictionary:" = STContext; "-createsUnknownObjects" = STContext; "-fullScriptingEnabled" = STContext; "-knownObjectNames" = STContext; "-objectDictionary" = STContext; "-objectReferenceForObjectWithName:" = STContext; "-objectWithName:" = STContext; "-parentContext" = STContext; "-removeObjectWithName:" = STContext; "-setCreatesUnknownObjects:" = STContext; "-setFullScriptingEnabled:" = STContext; "-setObject:forName:" = STContext; "-setParentContext:" = STContext; }; STConversation = { "+conversationWithEnvironment:language:" = STConversation; "-context" = STConversation; "-environment" = STConversation; "-initWithContext:language:" = STConversation; "-initWithEnvironment:language:" = STConversation; "-language" = STConversation; "-runScriptFromString:" = STConversation; "-setLanguage:" = STConversation; }; STEngine = { "+engineForFileType:" = STEngine; "+engineForLanguage:" = STEngine; "+engineForLanguageWithName:" = STEngine; "-canInterpret:" = STEngine; "-defaultEnvironment" = STEngine; "-executeCode:" = STEngine; "-executeCode:inEnvironment:" = STEngine; "-executeMethod:forReceiver:withArguments:inEnvironment:" = STEngine; "-executeMethod:forScriptObject:" = STEngine; "-interpretMethod:forReceiver:withArguments:inContext:" = STEngine; "-interpretScript:inContext:" = STEngine; "-methodFromSource:forReceiver:inContext:" = STEngine; "-methodFromSource:forReceiver:inEnvironment:" = STEngine; "-methodFromSource:forScriptObject:" = STEngine; "-setDefaultEnvironment:" = STEngine; "-setValue:forOption:" = STEngine; "-understandsCode:" = STEngine; "-valueForOption:" = STEngine; }; STEnvironment = { "+defaultScriptingEnvironment" = STEnvironment; "+environmentWithDefaultDescription" = STEnvironment; "+environmentWithDescription:" = STEnvironment; "+environmentWithDescriptionName:" = STEnvironment; "+sharedEnvironment" = STEnvironment; "-addClassesWithNames:" = STEnvironment; "-addNamedObjectsFromDictionary:" = STEnvironment; "-createsUnknownObjects" = STEnvironment; "-fullScriptingEnabled" = STEnvironment; "-includeBundle:" = STEnvironment; "-includeFramework:" = STEnvironment; "-initDefault" = STEnvironment; "-initWithDefaultDescription" = STEnvironment; "-initWithDescription:" = STEnvironment; "-initWithDescriptionName:" = STEnvironment; "-knownObjectNames" = STEnvironment; "-loadModule:" = STEnvironment; "-objectDictionary" = STEnvironment; "-objectReferenceForObjectWithName:" = STEnvironment; "-objectWithName:" = STEnvironment; "-registerObjectFinder:name:" = STEnvironment; "-registerObjectFinderNamed:" = STEnvironment; "-removeObjectFinderWithName:" = STEnvironment; "-removeObjectWithName:" = STEnvironment; "-setCreatesUnknownObjects:" = STEnvironment; "-setFullScriptingEnabled:" = STEnvironment; "-setObject:forName:" = STEnvironment; "-translateSelector:forReceiver:" = STEnvironment; }; STEnvironmentDescription = { "+defaultDescriptionName" = STEnvironmentDescription; "+descriptionFromDictionary:" = STEnvironmentDescription; "+descriptionWithName:" = STEnvironmentDescription; "-classes" = STEnvironmentDescription; "-frameworks" = STEnvironmentDescription; "-initFromDictionary:" = STEnvironmentDescription; "-initWithName:" = STEnvironmentDescription; "-modules" = STEnvironmentDescription; "-objectFinders" = STEnvironmentDescription; "-updateClassWithName:description:" = STEnvironmentDescription; "-updateFromDictionary:" = STEnvironmentDescription; }; STFileScript = { "+scriptWithFile:" = STFileScript; "-compareByLocalizedName:" = STFileScript; "-fileName" = STFileScript; "-initWithFile:" = STFileScript; "-localizedName" = STFileScript; "-scriptDescription" = STFileScript; "-scriptName" = STFileScript; }; STLanguage = { "+allKnownFileTypes" = STLanguage; "+allLanguageNames" = STLanguage; "+defaultLanguageName" = STLanguage; "+languageForFileType:" = STLanguage; "+languageNameForFileType:" = STLanguage; "+languageWithName:" = STLanguage; "+languageWithPath:" = STLanguage; "-engine" = STLanguage; "-languageName" = STLanguage; }; STLanguageManager = { "+defaultManager" = STLanguageManager; "-availableLanguages" = STLanguageManager; "-bundleForLanguage:" = STLanguageManager; "-createEngineForLanguage:" = STLanguageManager; "-defaultLanguage" = STLanguageManager; "-engineClassForLanguage:" = STLanguageManager; }; STMethod = { "-languageName" = STMethod; "-methodName" = STMethod; "-source" = STMethod; }; STObjectReference = { "-identifier" = STObjectReference; "-initWithIdentifier:target:" = STObjectReference; "-initWithObjectName:pool:" = STObjectReference; "-object" = STObjectReference; "-objectName" = STObjectReference; "-pool" = STObjectReference; "-setObject:" = STObjectReference; "-setObjectName:" = STObjectReference; "-setPool:" = STObjectReference; "-target" = STObjectReference; }; STRemoteConversation = { "-initWithEnvironmentName:host:language:" = STRemoteConversation; }; STScript = { "+scriptWithFile:" = STScript; "+scriptWithSource:language:" = STScript; "-compareByLocalizedName:" = STScript; "-fileName" = STScript; "-initWithFile:" = STScript; "-initWithSource:language:" = STScript; "-language" = STScript; "-localizedName" = STScript; "-scriptDescription" = STScript; "-scriptName" = STScript; "-setLanguage:" = STScript; "-setSource:" = STScript; "-source" = STScript; }; STScriptObject = { "+scriptObject" = STScriptObject; "-addMethod:" = STScriptObject; "-environment" = STScriptObject; "-initWithInstanceVariableNames:" = STScriptObject; "-instanceVariableNames" = STScriptObject; "-methodDictionary" = STScriptObject; "-methodNames" = STScriptObject; "-methodWithName:" = STScriptObject; "-objectForVariable:" = STScriptObject; "-removeMethod:" = STScriptObject; "-removeMethodWithName:" = STScriptObject; "-setEnvironment:" = STScriptObject; "-setObject:forVariable:" = STScriptObject; }; STScriptsManager = { "+defaultManager" = STScriptsManager; "-allScripts" = STScriptsManager; "-initWithDomainName:" = STScriptsManager; "-scriptSearchPaths" = STScriptsManager; "-scriptWithName:" = STScriptsManager; "-scriptsDomainName" = STScriptsManager; "-setScriptSearchPaths:" = STScriptsManager; "-setScriptSearchPathsToDefaults" = STScriptsManager; "-validScriptSearchPaths" = STScriptsManager; }; STSelector = { "-initWithName:" = STSelector; "-initWithSelector:" = STSelector; "-selectorName" = STSelector; "-selectorValue" = STSelector; "-stringValue" = STSelector; }; }; variable = { STGenericException = STExterns; STInternalInconsistencyException = STExterns; STInvalidArgumentException = STExterns; STLanguageBundleExtension = STExterns; STLanguageBundlesDirectory = STExterns; STLanguagesConfigFile = STExterns; STLibraryDirectory = STExterns; STMallocZone = STExterns; STModuleExtension = STExterns; STModulesDirectory = STExterns; STNil = STExterns; STScriptExtension = STExterns; STScriptingEnvironmentExtension = STExterns; STScriptingEnvironmentsDirectory = STExterns; STScriptingException = STExterns; STScriptsDirectory = STExterns; }; }steptalk-0.10.0/Documentation/Smalltalk.txt0000644000175000000000000001133710132015521017727 0ustar gurkanrootSmalltalk language extensions to NSObjects ------------------------------------------ Contents: 1. Source 2. Symbolic Selectors 3. Iterators and cycles 4. Exception handling 1. Source --------- Smalltalk script can be list of methods or just list of statements. List of statements is like single method without method name. List of methods --------------- Source begins with '[|' (left square bracket) and is followed by optional list of script variables. Methods are separated by '!' and are encoles by ']' (right square bracket). Example without vars: [| main self other. ^self ! other Transcript showLine:'This is other'. ! ] Example with vars: [| :var1 :var2 main "Your code here...". ^self ! other "Your code here...". ^self ! ] Simple script (statements) -------------------------- Simple script is just list of smalltalk statements. It is like contents of one method. Why source begins with '[|' and not just '['? --------------------------------------------- Look at this example: [one two three] It has more meanings. It can be: - list of methods with one method named 'one'. 'two' is target object and 'three' is a message. or - simple statement with block. 'one' is target object and 'two' and 'three' are messages. 2. Symbolic selectors --------------------- In StepTalk symbolic selectors are mapped to normal selectors. Comparison operators (NSObject) ------------------------------- Symb. sel. Real sel. ------------------------------------- = isEqual: == isSame: ~= notEqual: ~~ notSame: < isLessThan: > isGreatherThan: <= isLessOrEqualThan: >= isGreatherOrEqualThan: Target type Selector Argument Type Real Selector ----------------------------------------------------------------------- NSArray @ NSNumber objectAtIndex: NSArray , any arrayByAddingObject: NSArray + any arrayByAddingObject: NSMutableArray += any addObject: NSMutableArray -= any removeObject: NSDictionary @ any objectForKey: NSUserDefaults @ any objectForKey: NSString , NSString stringByAppendingString: NSString / NSString stringByAppendingPathComponent: NSString @ NSNumber characterAtIndex: NSMutableString += NSString appendString: NSSet < NSSet isSubsetOfSet: NSMutableSet += any addObject: NSMutableSet -= any removeObject: NSDate - NSDate timeIntervalSinceDate: NSNumber +,-,*,/ NSNumber add:,subtract:,multiply:,divide: Special selectors to create objects from two NSNumbers Symb.sel. Real sel. Result Methods ------------------------------------------------------- <> rangeWith: range location, length @ pointWith: point x, y @@ sizeWith: size width, height Examples: str := 'This is string.'. substr := str substringWithRange: (8 <> 3) range := str rangeOfString: 'str'. newRange := ( (range location) <> 6). 3. Iterator and cycles ---------------------- Cycles ------ To create a cycle, you may use whileTrue: or whileFalse: on NSBlock conditionBlock whileTrue: toDoBlock. To use a sequence of numbers, you may use to:do: or to:step:do: on NSNumber min to: max do: block min to: max step: step do: block Array iterators --------------- Following methods will iterate through all objects in receiver. Selector Description ------------------------------------------------------------------------------- do: Evaluate block for each object in array and return last evaluated expression select: Create new array which will contain those objects from receiver, for which value of block was true reject: Create new array which will contain those objects from receiver, for which value of block was false collect: Create new array from block return values. detect: Return first object for which block evaluation result is true. Othervise return nil. 4. Exception handling --------------------- If you want to handle an exception, you may do so by using blocks. You send handler: message to guarded block. guardedBlock handler: handlerBlock. If exception occures in guarded block, then handler block is evaluated. steptalk-0.10.0/Documentation/Tools.txt0000644000175000000000000000254110132015521017100 0ustar gurkanrootStepTalk Tools Contents: stexec stshell (from Examples directory) ------------------------------------------------------------------------------ stexec - execute StepTalk script (in GNUstep-base environment) Usage: stexec [options] script [args ...] [ , script ...] Options: -help print this message -list-all-objects list all available objects -list-classes list available classes -list-objects list named instances -language lang force use of language lang -list-languages list available languages -continue do not stop when one of scripts failed to execute -full enable full scripting -environment env use scripting environment with name env (You do not have to specify full name of the option (for example, -env), but when it is not clear, the behaviour is undefined) Examples: > stexec myScript.st > stexec -env AppKit myAppKitScript.st Running more than one script (preserves the environment through all scripts) > stexec myScript1.st , myScript2.st , myScript3.st ------------------------------------------------------------------------------ stshell - StepTalk shell Usage: stshell [options] script Options are: -help this text -language lang use language lang -environment env use scripting environment with name env steptalk-0.10.0/Documentation/TroubleShooting.txt0000644000175000000000000000130210132015521021121 0ustar gurkanrootTrouble Shooting ---------------- - Language of a script cannot be recognized. - It is not possible to see some scripts in the scripts panel. StepTalk is trying to determine script language by the file extension. Each language has a extension list of files which contain scripts in that language. To prevend expensive searching for file extensions in languages, StepTalk uses a dictionary with file-language mapping. That dictionary is stored in ~/Library/StepTalk/Configuration and is created first time you use some StepTalk tool. If you install new language, that file has to be updated. Solution: Run in terminal: > stupdate_languages steptalk-0.10.0/Documentation/Use.txt0000644000175000000000000000063310132015521016534 0ustar gurkanrootPossible use of StepTalk ------------------------ StepTalk Shell -------------- - interactive communication with remote objects for example i am using it for writing simple tests or for playing with gnustep classes moreover, the steptalk shell can be used for gnustep-novices to learn about gnustep-classes and their behavior or, as i am using it, to communicate interactively with an distant object steptalk-0.10.0/Examples/0000775000175000000000000000000010301403400014177 5ustar gurkanrootsteptalk-0.10.0/Examples/AppKit/0000775000175000000000000000000010212422536015403 5ustar gurkanrootsteptalk-0.10.0/Examples/AppKit/Fonts.rtf0000644000175000000000000002402210132015525017204 0ustar gurkanroot{\rtf1\ansi\ansicpg10000\cocoartf102{\fonttbl\f0\fnil Academy;\f1\fnil Activa;\f2\fnil AdineKirnbergScript;\f3\fnil Albatross;\f4\fnil AlexFraction;\f5\fnil AnnStone;\f6\fnil Anson;\f7\fnil Antiqua;\f8\fnil Arctic;\f9\fnil Arial;\f10\fnil ArrowFont;\f11\fnil Ashley;\f12\fnil Averoigne;\f13\fnil Balsam;\f14\fnil BeachmanScript;\f15\fnil Beffle;\f16\fnil BenjaminCapitals;\f17\fnil BillsDingbats;\f18\fnil BlackAdderII;\f19\fnil BlackChancery;\f20\fnil BlackForest;\f21\fnil Blockboys;\f22\fnil Bodacious;\f23\fnil Boston;\f24\fnil Braille;\f25\fnil Buccaneer;\f26\fnil Bucephalus;\f27\fnil BujardetFreres;\f28\fnil Burgundian;\f29\fnil CSDChalk;\f30\fnil CSDJersey;\f31\fnil CableDingbats;\f32\fnil Cairo;\f33\fnil Caitlyn;\f34\fnil Caligula;\f35\fnil Camberic;\f36\fnil Canaith;\f37\fnil Cardiff;\f38\fnil Carolus;\f39\fnil Carrick-Capitals;\f40\fnil Cavemann;\f41\fnil CelticHand;\f42\fnil CelticmdDecorativeWDropCaps;\f43\fnil CharlieChan;\f44\fnil ChopinOpenFace;\f45\fnil Civitype;\f46\fnil ClGaelach;\f47\fnil College;\f48\fnil Colton-Gothic;\f49\fnil Columbus;\f50\fmodern Courier;\f51\fnil Creedmore;\f52\fnil Crillee;\f53\fnil Cyrillic;\f54\fnil Cyrillic-BoldI;\f55\fnil Cyrillic-NormalI;\f56\fnil DavysBigKeyCapitals;\f57\fnil DavysDingbats;\f58\fnil DavysOtherDingbats;\f59\fnil Deusex;\f60\fnil Devandra;\f61\fnil Diner-Fatt;\f62\fnil Diner-Skinny;\f63\fnil Dingbats;\f64\fnil Dot-Matrix;\f65\fnil Dragonwick;\f66\fnil Dubiel;\f67\fnil Dupuy;\f68\fnil Durango;\f69\fnil EastSide;\f70\fnil EileenCapitals;\f71\fnil EileensZodiac;\f72\fnil ElGarrett;\f73\fnil Elbjorg-Script;\f74\fnil ElizabethAnn;\f75\fnil ElzevierCapitals;\f76\fnil EnglishTowne;\f77\fnil Enya;\f78\fnil Eraser;\f79\fnil EuropeanCourier;\f80\fnil FOOD;\f81\fnil Faustus;\f82\fnil Final-Frontier;\f83\fnil FletcherGothic;\f84\fnil Fleurons;\f85\fnil Flintstone;\f86\fnil FoxScript;\f87\fnil FrankRuehl;\f88\fnil FreeMono;\f89\fnil FreeSans;\f90\fnil FreeSerif;\f91\fnil FreightIBM;\f92\fnil Frutiger;\f93\fnil Fusion;\f94\fnil Galaxy;\f95\fnil Gallaudet;\f96\fnil Garton;\f97\fnil GesseleScript;\f98\fnil Goethe;\f99\fnil Golder;\f100\fnil GoudyHundred;\f101\fnil Greek;\f102\fnil GreenCapitals;\f103\fnil Greenowic-Narrow;\f104\fnil GriffinDingbats;\f105\fnil GriffinOneDingbats;\f106\fnil Hanch;\f107\fnil Hancock;\f108\fnil Handbook;\f109\fnil HandwriteInkblot;\f110\fnil HanziKaishu;\f111\fnil Harting2;\f112\fnil Headhunter;\f113\fnil Heidelberg;\f114\fswiss Helvetica;\f115\fnil Hiragana;\f116\fnil HobbyHeadline;\f117\fnil HorstCapitals;\f118\fnil Hotshot;\f119\fnil InkaBod;\f120\fnil Inkwell;\f121\fnil IsadoraCapitals;\f122\fnil Jana;\f123\fnil KOI8-Terminal;\f124\fnil Karloff;\f125\fnil Kashmir;\f126\fnil Katakana;\f127\fnil Kennon;\f128\fnil KhachaturianCapitals;\f129\fnil KonanurCapitals;\f130\fnil Kramer;\f131\fnil LED-FontHC;\f132\fnil Lancaster;\f133\fnil LaserLondon;\f134\fnil Lazurski;\f135\fnil LeftyCasual;\f136\fnil Libra;\f137\fnil Lichtner;\f138\fnil LiquidCrystal;\f139\fnil Livia;\f140\fnil LombardoBeneventan;\f141\fnil Longdon-Decorative;\f142\fnil Lower-EastSide;\f143\fnil LowerWestSide;\f144\fnil Loxley;\f145\fnil Lumparsky;\f146\fnil Luxembourg;\f147\fnil Madrid;\f148\fnil Magazine;\f149\fnil Marriage;\f150\fnil MathSymbol;\f151\fnil McGareyFractured;\f152\fnil MiamiBeach;\f153\fnil MicroTiempo;\f154\fnil ModPassenger;\f155\fnil MultiformCapitals;\f156\fnil Musgrave;\f157\fnil NRBBangkok;\f158\fnil NRBWelshGillian;\f159\fnil Newborough;\f160\fnil Newport-Gothic;\f161\fnil NewsGothic;\f162\fnil Newtown;\f163\fnil NiteClub;\f164\fnil Nordic;\f165\fnil Ophir;\f166\fnil OregonWet;\f167\fnil OxNard;\f168\fnil Oxford;\f169\fnil PCOrnaments;\f170\fnil PCRounders;\f171\fnil ParisMetro;\f172\fnil ParsZibaDraft;\f173\fnil Passenger;\f174\fnil Pheasant-SmallCaps;\f175\fnil PhoenixOne;\f176\fnil Plymouth;\f177\fnil PostCrypt;\f178\fnil Presentor;\f179\fnil Queens-Park;\f180\fnil RRKeyCapitals;\f181\fnil RRKeyCapitalsLimited;\f182\fnil RabbitEars;\f183\fnil RansomNote;\f184\fnil Ravenna;\f185\fnil RedLetter;\f186\fnil ReliefDeco;\f187\fnil RichardMurray;\f188\fnil Rochester;\f189\fnil Rockmaker;\f190\fnil Roissy;\f191\fnil Rothman;\f192\fnil RoundedRelief;\f193\fnil RunesOfPower;\f194\fnil SILDoulosIPA;\f195\fnil SILManuscriptIPA;\f196\fnil SILSophiaIPA;\f197\fnil Sapir;\f198\fnil SchwarzWald;\f199\fnil SecretCode;\f200\fnil SedimentaryFont;\f201\fnil Silicon-Valley;\f202\fnil Sinaloa;\f203\fnil Slabface;\f204\fnil Slogan;\f205\fnil SportsAndHobbies;\f206\fnil Stars-&Stripes;\f207\fnil SteelPlateGothic;\f208\fnil Strongman;\f209\fnil Stymie;\f210\fnil Swansea;\f211\fnil Sydney;\f212\fnil Tabatha;\f213\fnil Tamworth-Gothic;\f214\fnil Taranis;\f215\fnil Telford;\f216\fnil Telford-Hollow;\f217\fnil Tempus;\f218\fnil Textbook;\f219\fnil Theodoric;\f220\fnil Tiverton;\f221\fnil ToneAndDebs;\f222\fnil ToulouseLautrec;\f223\fnil Trains;\f224\fnil TwoGriffin;\f225\fnil UechiGothic;\f226\fnil UncodeSecret;\f227\fnil UpperEastSide;\f228\fnil Vagabond;\f229\fnil VagabondHollow;\f230\fnil Vassallo;\f231\fnil Vera;\f232\fnil VictoriasSecret;\f233\fnil VideoTerminalScreen;\f234\fnil Vilna;\f235\fnil Vireo;\f236\fnil WalrodInitials;\f237\fnil Weiss;\f238\fnil Wharmby;\f239\fnil ZaleskiCapitals;} \f0\fs72\pard\tx0\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\ql Academy\par \f1 Activa\par \f2 AdineKirnbergScript\par \f3 Albatross\par \f4 AlexFraction\par \f5 AnnStone\par \f6 Anson\par \f7 Antiqua\par \f8 Arctic\par \f9 Arial\par \f10 ArrowFont\par \f11 Ashley\par \f12 Averoigne\par \f13 Balsam\par \f14 BeachmanScript\par \f15 Beffle\par \f16 BenjaminCapitals\par \f17 BillsDingbats\par \f18 BlackAdderII\par \f19 BlackChancery\par \f20 BlackForest\par \f21 Blockboys\par \f22 Bodacious\par \f23 Boston\par \f24 Braille\par \f25 Buccaneer\par \f26 Bucephalus\par \f27 BujardetFreres\par \f28 Burgundian\par \f29 CSDChalk\par \f30 CSDJersey\par \f31 CableDingbats\par \f32 Cairo\par \f33 Caitlyn\par \f34 Caligula\par \f35 Camberic\par \f36 Canaith\par \f37 Cardiff\par \f38 Carolus\par \f39 Carrick-Capitals\par \f40 Cavemann\par \f41 CelticHand\par \f42 CelticmdDecorativeWDropCaps\par \f43 CharlieChan\par \f44 ChopinOpenFace\par \f45 Civitype\par \f46 ClGaelach\par \f47 College\par \f48 Colton-Gothic\par \f49 Columbus\par \f50 Courier\par \f51 Creedmore\par \f52 Crillee\par \f53 Cyrillic\par \f54 Cyrillic-BoldI\par \f55 Cyrillic-NormalI\par \f56 DavysBigKeyCapitals\par \f57 DavysDingbats\par \f58 DavysOtherDingbats\par \f59 Deusex\par \f60 Devandra\par \f61 Diner-Fatt\par \f62 Diner-Skinny\par \f63 Dingbats\par \f64 Dot-Matrix\par \f65 Dragonwick\par \f66 Dubiel\par \f67 Dupuy\par \f68 Durango\par \f69 EastSide\par \f70 EileenCapitals\par \f71 EileensZodiac\par \f72 ElGarrett\par \f73 Elbjorg-Script\par \f74 ElizabethAnn\par \f75 ElzevierCapitals\par \f76 EnglishTowne\par \f77 Enya\par \f78 Eraser\par \f79 EuropeanCourier\par \f80 FOOD\par \f81 Faustus\par \f82 Final-Frontier\par \f83 FletcherGothic\par \f84 Fleurons\par \f85 Flintstone\par \f86 FoxScript\par \f87 FrankRuehl\par \f88 FreeMono\par \f89 FreeSans\par \f90 FreeSerif\par \f91 FreightIBM\par \f92 Frutiger\par \f93 Fusion\par \f94 Galaxy\par \f95 Gallaudet\par \f96 Garton\par \f97 GesseleScript\par \f98 Goethe\par \f99 Golder\par \f100 GoudyHundred\par \f101 Greek\par \f102 GreenCapitals\par \f103 Greenowic-Narrow\par \f104 GriffinDingbats\par \f105 GriffinOneDingbats\par \f106 Hanch\par \f107 Hancock\par \f108 Handbook\par \f109 HandwriteInkblot\par \f110 HanziKaishu\par \f111 Harting2\par \f112 Headhunter\par \f113 Heidelberg\par \f114 Helvetica\par \f115 Hiragana\par \f116 HobbyHeadline\par \f117 HorstCapitals\par \f118 Hotshot\par \f119 InkaBod\par \f120 Inkwell\par \f121 IsadoraCapitals\par \f122 Jana\par \f123 KOI8-Terminal\par \f124 Karloff\par \f125 Kashmir\par \f126 Katakana\par \f127 Kennon\par \f128 KhachaturianCapitals\par \f129 KonanurCapitals\par \f130 Kramer\par \f131 LED-FontHC\par \f132 Lancaster\par \f133 LaserLondon\par \f134 Lazurski\par \f135 LeftyCasual\par \f136 Libra\par \f137 Lichtner\par \f138 LiquidCrystal\par \f139 Livia\par \f140 LombardoBeneventan\par \f141 Longdon-Decorative\par \f142 Lower-EastSide\par \f143 LowerWestSide\par \f144 Loxley\par \f145 Lumparsky\par \f146 Luxembourg\par \f147 Madrid\par \f148 Magazine\par \f149 Marriage\par \f150 MathSymbol\par \f151 McGareyFractured\par \f152 MiamiBeach\par \f153 MicroTiempo\par \f154 ModPassenger\par \f155 MultiformCapitals\par \f156 Musgrave\par \f157 NRBBangkok\par \f158 NRBWelshGillian\par \f159 Newborough\par \f160 Newport-Gothic\par \f161 NewsGothic\par \f162 Newtown\par \f163 NiteClub\par \f164 Nordic\par \f165 Ophir\par \f166 OregonWet\par \f167 OxNard\par \f168 Oxford\par \f169 PCOrnaments\par \f170 PCRounders\par \f171 ParisMetro\par \f172 ParsZibaDraft\par \f173 Passenger\par \f174 Pheasant-SmallCaps\par \f175 PhoenixOne\par \f176 Plymouth\par \f177 PostCrypt\par \f178 Presentor\par \f179 Queens-Park\par \f180 RRKeyCapitals\par \f181 RRKeyCapitalsLimited\par \f182 RabbitEars\par \f183 RansomNote\par \f184 Ravenna\par \f185 RedLetter\par \f186 ReliefDeco\par \f187 RichardMurray\par \f188 Rochester\par \f189 Rockmaker\par \f190 Roissy\par \f191 Rothman\par \f192 RoundedRelief\par \f193 RunesOfPower\par \f194 SILDoulosIPA\par \f195 SILManuscriptIPA\par \f196 SILSophiaIPA\par \f197 Sapir\par \f198 SchwarzWald\par \f199 SecretCode\par \f200 SedimentaryFont\par \f201 Silicon-Valley\par \f202 Sinaloa\par \f203 Slabface\par \f204 Slogan\par \f205 SportsAndHobbies\par \f206 Stars-&Stripes\par \f207 SteelPlateGothic\par \f208 Strongman\par \f209 Stymie\par \f210 Swansea\par \f211 Sydney\par \f212 Tabatha\par \f213 Tamworth-Gothic\par \f214 Taranis\par \f215 Telford\par \f216 Telford-Hollow\par \f217 Tempus\par \f218 Textbook\par \f219 Theodoric\par \f220 Tiverton\par \f221 ToneAndDebs\par \f222 ToulouseLautrec\par \f223 Trains\par \f224 TwoGriffin\par \f225 UechiGothic\par \f226 UncodeSecret\par \f227 UpperEastSide\par \f228 Vagabond\par \f229 VagabondHollow\par \f230 Vassallo\par \f231 Vera Serif\par \f232 VictoriasSecret\par \f233 VideoTerminalScreen\par \f234 Vilna\par \f235 Vireo\par \f236 WalrodInitials\par \f237 Weiss\par \f238 Wharmby\par \f239 ZaleskiCapitals\par }steptalk-0.10.0/Examples/AppKit/app.st0000644000175000000000000000711210205641510016527 0ustar gurkanroot" Whole application written in StepTalk/Smalltalk Author: Matthew D Swank Date: 2005 Feb 18 " |object engine| Environment loadModule:'AppKit'. Environment includeFramework:'StepTalkLocalLib'. "object := STScriptObject scriptObject." object := STExtendedScriptObject alloc initWithInstanceVariableArray: #('window' 'label' 'menu'). object setEnvironment: Environment. engine := STEngine engineForLanguageWithName:'Smalltalk'. object addMethod: (engine methodFromSource: 'applicationWillFinishLaunching: notification window := NSWindow alloc initWithContentRect: (STLLUtil makeRectX:300 withY:300 withW:200 withH:100) styleMask:15 backing: NSBackingStoreBuffered defer: YES. window setTitle:\'Hello World\'. label := NSTextField alloc initWithFrame:(STLLUtil makeRectX:30 withY:30 withW:80 withH:30). label setSelectable:NO. label setBezeled:NO. label setDrawsBackground:NO. label setStringValue:\'Hello World\'. window contentView addSubview: label. menu := NSMenu new. menu addItemWithTitle: \'Info\' action: nil keyEquivalent: \'\'. menu addItemWithTitle: \'Hide\' action: #hide: keyEquivalent: \'h\'. menu addItemWithTitle: \'Quit\' action: #terminate: keyEquivalent: \'q\'. info := NSMenu new. (info addItemWithTitle: \'Info Panel...\' action: #orderFrontStandardInfoPanel: keyEquivalent: \'\') setTarget: self. info addItemWithTitle: \'Preferences\' action: nil keyEquivalent: \'\'. info addItemWithTitle: \'Help\' action: #orderFrontHelpPanel: keyEquivalent: \'?\'. menu setSubmenu: info forItem: (menu itemWithTitle:\'Info\'). application setMainMenu:menu.' forReceiver: object inEnvironment: Environment). object addMethod: (engine methodFromSource: 'applicationDidFinishLaunching: notification window makeKeyAndOrderFront: self.' forReceiver: object inEnvironment: Environment). object addMethod: (engine methodFromSource: 'applicationShouldTerminateAfterLastWindowClosed: application ^true' forReceiver: object inEnvironment: Environment). object addMethod: (engine methodFromSource: 'orderFrontStandardInfoPanel: sender "STLLUtil log:\'orderFrontStandardInfoPanel fired\'." application orderFrontStandardInfoPanelWithOptions: (NSDictionary alloc initWithContentsOfFile: \'/home/singollo/Info.plist\').' forReceiver: object inEnvironment: Environment). application := NSApplication sharedApplication. application setDelegate: object. application run. steptalk-0.10.0/Examples/AppKit/listFonts.st0000644000175000000000000000154310132015525017736 0ustar gurkanroot" listFonts.st Example that will create a 'rtf file containing smaples of all available fonts. " [| :text main | fontManager | Environment loadModule:'AppKit'. text := NSTextView alloc initWithFrame:NSNullRect. text setRichText:YES. fontManager := NSFontManager sharedFontManager. (fontManager availableFontFamilies) do: [ :font | self addFontSample:font ]. text writeRTFDToFile:'Fonts.rtf' atomically:YES. ^nil ! addFontSample:fontName | attr font | Transcript showLine:fontName. attr := NSMutableDictionary dictionary. font := (NSFont fontWithName:fontName size:36). (font isNil) ifFalse: [ attr setObject:font forKey:NSFontAttributeName. text setTypingAttributes:attr. text insertText:(fontName,'\n'). ]. ^self ] steptalk-0.10.0/Examples/AppKit/openPanel.st0000644000175000000000000000021010132015525017660 0ustar gurkanrootEnvironment loadModule:'AppKit'. panel := NSOpenPanel openPanel. runResult := panel runModal. Transcript showLine: (panel filename). steptalk-0.10.0/Examples/AppKit/panel.st0000644000175000000000000000041110132015525017041 0ustar gurkanroot| app | Environment loadModule:'AppKit'. app := NSApplication sharedApplication. app runAlertPanelWithTitle: 'Test' message: 'Alert panel test' defaultButton: 'OK' alternateButton: nil otherButton: nil. steptalk-0.10.0/Examples/AppKit/pb.st0000644000175000000000000000022710132015525016350 0ustar gurkanroot" Print available Pasteboard types " | pb | Environment loadModule:'AppKit'. pb := NSPasteboard generalPasteboard. Transcript showLine: (pb types). steptalk-0.10.0/Examples/AppKit/printers.st0000644000175000000000000000026210132015525017614 0ustar gurkanroot"List all available printers" | printers | Environment loadModule:'AppKit'. printers := NSPrinter printerTypes. printers do: [ :printer | Transcript showLine: printer. ] steptalk-0.10.0/Examples/AppKit/problem.st0000644000175000000000000000051710205635705017422 0ustar gurkanroot"a := [:x :y|[:z | x + y + z] valueWith:3]. Transcript showLine:(a valueWith:5 with:7). " a := [:x :y|[:z | x + y + z]] valueWith:3 with:5. Transcript showLine:(a valueWith:7). " Error (NSInvalidArgumentException): GSMutableDictionary(instance) does not recognize isValid StepTalk > ([:x :y|[:z | x + y + z]] valueWith "steptalk-0.10.0/Examples/AppKit/rtf2text.st0000644000175000000000000000102410132015525017525 0ustar gurkanroot" rtf2text.st Convert RTF document to plain text. ussage: stexec rtf2text infile outfile " | infile outfile rtfString | Environment loadModule:'AppKit'. ((Args count) < 2) ifTrue: [ Transcript showLine:'rtf2text: Please specify input and output filename'. ] ifFalse: [ infile := Args @ 0. outfile := Args @ 1. rtfString := (NSAttributedString alloc) initWithPath:infile documentAttributes:nil. (rtfString string) writeToFile:outfile atomically:YES. ] steptalk-0.10.0/Examples/AppKit/text.st0000644000175000000000000000110710132015525016731 0ustar gurkanroot"NSText test" Environment loadModule:'AppKit'. tattr := NSMutableDictionary dictionary. tattr setObject:(NSFont fontWithName:'Times' size:10) forKey:NSFontAttributeName. hattr := NSMutableDictionary dictionary. hattr setObject:(NSFont fontWithName:'Helvetica' size:10) forKey:NSFontAttributeName. text := NSTextView alloc initWithFrame:NSNullRect. text setRichText:YES. text setTypingAttributes:tattr. text insertText:'This is Times\n'. text setTypingAttributes:hattr. text insertText:'This is Helvetica\n'. text writeRTFDToFile:'Test.rtf' atomically:YES. steptalk-0.10.0/Examples/Developer/0000775000175000000000000000000010132015525016135 5ustar gurkanrootsteptalk-0.10.0/Examples/Developer/StepUnit.st0000644000175000000000000001660510132015525020266 0ustar gurkanroot" @file: StepUnit.st @author: Mateu Batle mateu.batle@tragnarion.com @brief Very simple unit testing framework done in StepTalk for testing Objective C applications @brief $Id: StepUnit.st,v 1.1 2004/06/20 11:40:54 stefanu Exp $ StepUnit is released under the terms of the LGPL license. (check http://www.gnu.org/licenses/gpl.txt) Help: Testing framework is executed running stexec StepUnit, or directly StepUnit.sh. This script scans the currend diretory recursively and runs every script whose filename matches 'test*.st'. It provides in the environment an object called stepunit which has some useful methods for testing. Here is a list of this methods: - should: val. Tests result of boolean expression which must be true for test ok. - shouldNot: val. Tests result of boolean expression which must be false for test ok. - shouldBeEqual: left to: right. Tests objects are the same. - shouldRaise: exp. Exp must be a block. Runs the block, which must throw exception for test ok. - shouldBeEmpty: object. Object must be nil, or object isEmpty must return true for test ok. - shouldNotBeEmpty: object All methods can be added a 'desc: string' argument, which is recommended to use to identify the test. Each test script just has to run the test code and call the testing methods specified before (on the object stepunit already present in the environment). You should also load modules in the environment to access new classes, etc. if needed (with Environment loadModule: 'modulename'). Test example: res := 2 + 2. stepunit should: (res = 4) desc: '2 + 2 works' " [| :numTestFilesOK :numTestFilesFailed :numTestsFailed :numTestsOK :numTotalFailed :numTotalOK :env :conversation :fm main "*** Initialize counters ***" numTestsFailed := 0. numTestsOK := 0. numTotalFailed := 0. numTotalOK := 0. numTestFilesFailed := 0. numTestFilesOK := 0. "*** Add some classes ***" classes := (NSMutableArray alloc) init. classes += 'STEnvironment'. classes += 'STConversation'. Environment addClassesWithNames: classes. "*** Store object in the environment ***" env := Environment. env setObject: self forName:'stepunit'. env setFullScriptingEnabled: YES. "*** Create conversation ***" conv := STConversation conversationWithEnvironment: env language: 'Smalltalk'. conv setLanguage: 'Smalltalk'. "*** Execute all tests here ***" fm := NSFileManager defaultManager. path := (fm currentDirectoryPath) stringByStandardizingPath. self runTests: path. "*** Summary of running test ***" self showSummary. ^ self ! runTests: path | dirent attr | (((path lastPathComponent) substringToIndex: 1) = '.') ifFalse: [ Transcript showLine: '*** Scanning for tests in directory ', (path), ' ***'. dirent := fm directoryContentsAtPath: path. dirent do: [ :file | attr := fm fileAttributesAtPath: (path / file) traverseLink: NO. filetype := (attr @ 'NSFileType'). (filetype isEqualToString: 'NSFileTypeDirectory') ifTrue: [ fm changeCurrentDirectoryPath: (path / file). self runTests: (path / file). fm changeCurrentDirectoryPath: path. ] ifFalse: [ (((file pathExtension) = 'st') and: ((file lowercaseString) hasPrefix: 'test')) ifTrue: [self executeTest: (path / file)]. ] ]. ^self ] ! executeTest: path numTestsFailed := 0. numTestsOK := 0. Transcript show: '*** Test Case '. Transcript show: (numTestFilesOK + numTestFilesFailed + 1). Transcript showLine: ': ', path, ' start ***'. code := NSString stringWithContentsOfFile: path. res := conv runScriptFromString: code. Transcript showLine: '*** Test Case ', path, ' finish ***'. (numTestsFailed = 0) ifTrue: [ numTestFilesOK := numTestFilesOK + 1. ] ifFalse: [ numTestFilesFailed := numTestFilesFailed + 1. ]. ^self ! showSummary Transcript showLine: '***** SUMMARY *****'. Transcript showLine: 'Name', ' ', 'Failed', ' ', 'OK', ' ', 'Total'. Transcript show: 'Files', ' '. Transcript show: numTestFilesFailed. Transcript show: ' '. Transcript show: numTestFilesOK. Transcript show: ' '. Transcript show: (numTestFilesFailed + numTestFilesOK). Transcript showLine: nil. Transcript show: 'Tests', ' '. Transcript show: numTotalFailed. Transcript show: ' '. Transcript show: numTotalOK. Transcript show: ' '. Transcript show: (numTotalFailed + numTotalOK). Transcript showLine: ''. ^self """ Methods for unit testing """ ! should:val val ifFalse: [self testfail] ifTrue: [self testok]. ^self ! should:val desc*esc val ifFalse: [self testfail: desc] ifTrue: [self testok: desc]. ^self ! shouldNot: val val ifTrue: [self testfail] ifFalse: [self testok]. ^self ! shouldNot: val desc: desc val ifTrue: [self testfail: desc] ifFalse: [self testok: desc]. ^self ! shouldBeEqual: left to: right (left = right) ifFalse: [self testfail] ifTrue: [self testok]. ^self ! shouldBeEqual: left to: right desc: desc (left = right) ifFalse: [self testfail: desc] ifTrue: [self testok: desc]. ^self ! shouldRaise: exp flag := false. desc := 'exception not raised'. exp handler: [ :exception | flag := true. desc := (exception name), ' ', (exception reason). ]. self should: flag desc: desc. ^self ! shouldRaise: exp desc: desc flag := false. desc2 := desc, ' exception not raised'. exp handler: [ :exception | flag := true. desc := desc, ' ', (exception name), ' ', (exception reason). ]. self should: flag desc: desc. ^self ! shouldBeEmpty: object (object = nil) ifFalse: [ (object respondsToSelector: #isEmpty) ifFalse: [self testfail: 'object not responds to isEmpty, assumed not empty'.] ifTrue: [self should: (object isEmpty) desc: 'object empty'.] ] ifTrue: [ self testok: 'object empty' ]. ^self ! shouldBeEmpty: object desc: desc (object = nil) ifFalse: [ (object respondsToSelector: #isEmpty) ifFalse: [self testfail: desc] ifTrue: [self should: (object isEmpty) desc: desc] ] ifTrue: [ self testok: desc ]. ^self ! shouldNotBeEmpty: object (object = nil) ifFalse: [ (object respondsToSelector: #isEmpty) ifFalse: [self testok: 'object not responds to isEmpty, assumed not empty'] ifTrue: [self shouldNot: (object isEmpty) desc: 'object empty'] ] ifTrue: [ self testfail: 'object not empty'. ]. ^self ! shouldNotBeEmpty: object desc: desc (object = nil) ifFalse: [ (object respondsToSelector: #isEmpty) ifFalse: [self testok: desc] ifTrue: [self shouldNot: (object isEmpty) desc: desc]. ] ifTrue: [ self testfail: desc. ]. ^self ! testfail ^ self testfail: 'NO DESCRIPTION' ! testfail: desc numTotalFailed := numTotalFailed + 1. numTestsFailed := numTestsFailed + 1. Transcript showLine: 'TEST FAILED: ', desc. ^nil ! testok ^ self testok: 'NO DESCRIPTION' ! testok: desc numTotalOK := numTotalOK + 1. numTestsOK := numTestsOK + 1. Transcript showLine: 'TEST OK: ', desc. ^ self ] steptalk-0.10.0/Examples/Developer/versions.st0000644000175000000000000000164410132015525020360 0ustar gurkanroot" Print versions of all (public) GNUstep classes Use: > stexec versions.st To include AppKit classes: > stexec -environment AppKit versions.st " | classes versions names | classes := Environment objectDictionary allValues. classes := classes select: [ :class | class isClass]. classes := classes select: [ :class | class respondsToSelector:#className]. classes := classes select: [ :class | class respondsToSelector:#version]. versions := NSMutableDictionary dictionary. classes do: [ :class | versions setObject: (class version) forKey: (class className). ]. names := versions allKeys sortedArrayUsingSelector: #compare:. names do: [ :key | Transcript showLine: ( key, ' ', ((versions objectForKey:key) stringValue)) ]. steptalk-0.10.0/Examples/Distant/0000755000175000000000000000000010301403727015617 5ustar gurkanrootsteptalk-0.10.0/Examples/Distant/test.sh0000644000175000000000000000026110301404233017122 0ustar gurkanroot#!/bin/csh # stenvironment -name TestEnvironment echo "text := 'Hello StepTalk.'" | stexec -env TestEnvironment echo "Transcript showLine:text" | stexec -env TestEnvironment steptalk-0.10.0/Examples/ReadMe.txt0000644000175000000000000000231710132015525016107 0ustar gurkanrootSmalltalk examples ------------------ Smalltalk examples are included in Smalltalk directory. math.st Simple example. > stexec math.st hello.st Example to show block closures, symbolic selectors and ussage of arguments. > stexec hello.st > stexec hello.st World createFile.st Try to create a file. Example to show how the restricted scriptiong works. This will work fine: > stexec createFile.st This would not: > stexec --environment Safe createFile.st exception.st Same as createFile.st but handles the exception. This will work fine: > stexec exception.st This will end with handled exception: > stexec --environment Safe exception.st listDir.st List content of current directory. > stexec listDir.st plparse.st, pldes.st GNUstep tools written in smalltalk > stexec plparse.st file1 file2 ... Scriptable server example ------------------------- To compile type > make Then run server > opentool Server Then from same directory, but in another terminal try > stalk Server talkToServer.st > stalk Server talkToServer.st "Hi there!" steptalk-0.10.0/Examples/Server/0000775000175000000000000000000010365363566015501 5ustar gurkanrootsteptalk-0.10.0/Examples/Server/ChangeLog0000644000175000000000000000023010112242241017214 0ustar gurkanroot2003 Apr 04 David Ayers * ChangeLog: Added new file. * GNUmakefile: Added flags to show all warnings except for import. steptalk-0.10.0/Examples/Server/GNUmakefile0000644000175000000000000000233710342042733017537 0ustar gurkanroot# # StepTalk examples # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = Server Server_OBJC_FILES = Server.m ADDITIONAL_TOOL_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include Makefile.postamble steptalk-0.10.0/Examples/Server/Server.m0000644000175000000000000000230310112242241017071 0ustar gurkanroot/* Server.m StepTalk scriptable server example */ #import #import #import #import #import #include @interface Server:NSObject - say:(NSString *)string; @end @implementation Server - (STEnvironment *)scriptingEnvironment { /* here we should add some objects or class references ... */ return [STEnvironment defaultScriptingEnvironment]; } - (NSDate *)date { return [NSDate date]; } - say:(NSString *)string { printf("%s\n",[string cString]); return self; } @end int main(int argc, const char **argv) { NSAutoreleasePool *pool; NSConnection *connection; Server *server = [Server new]; pool = [NSAutoreleasePool new]; connection = [NSConnection newRegisteringAtName:@"Server" withRootObject:server]; if (!connection) { NSLog(@"Unable to register server"); [pool release]; return 1; } NSLog(@"Server started"); [[NSRunLoop currentRunLoop] run]; RELEASE(connection); RELEASE(pool); return 0; } steptalk-0.10.0/Examples/Server/talkToServer.st0000644000175000000000000000044010112242241020442 0ustar gurkanroot" talkToServer.stalk Server script example Ussage: stalk Server talkToServer.st [message] " | message | ((Args count) < 1 ) ifTrue: [ message := 'Hello!'. ^0 ] ifFalse: [ message := Args objectAtIndex: 0. ^0 ]. Server say:message steptalk-0.10.0/Examples/Shell/0000775000175000000000000000000010365363566015302 5ustar gurkanrootsteptalk-0.10.0/Examples/Shell/.cvsignore0000644000175000000000000000010510132015525017251 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Examples/Shell/AppKit.txt0000644000175000000000000000157110132015525017212 0ustar gurkanrootSimple AppKit Examples ---------------------- To be able to try following examples you have to load the AppKit module: > Environment loadModule: 'AppKit' How to get a filename using the Open panel > NSOpenPanel openPanel runModal ; filename Applications and files ---------------------- > Workspace := NSWorkspace sharedWorkspace How to launch an application > Workspace launchApplication:'application name' How to open a file > Workspace openFile:'file name' How to open a file with specified application > Workspace openFile:'file name' withApplication:'application name' How to open a file using the open panel > Workspace openFile:(NSOpenPanel openPanel runModal ; filename) Text ---- How to display a RTF file > text := NSAttributedString alloc > text initWithPath: file documentAttributes:nil > Transcript show: (text string) steptalk-0.10.0/Examples/Shell/ChangeLog0000644000175000000000000000302210305164431017027 0ustar gurkanroot2005 Aug 30 * use STLanguageManager instead of removed STLanguage 2005 Aug 15 * Added distant environments * Removed named objects as they were causing troubles with distant environments * Suspend completion for distant environments Warning: option 'environment' has different meaning. See stshell --help. 2003 Sep 21 * Added named objects FileManager, LastCommand and LastObject 2003 Jun 19 * Renamed stshell.m to stshell_tool.m. MS Windows was causing problems with case insensitive file system. (Reported by Michael Adams ) 2003 Apr 04 David Ayers * GNUmakefile: Added flags to show all warnings except for import. * STShell.m: Unified name for private categories. 2003 Jan 16 Stefan Urbanek * GNUmakefile: Added -lncurses 2002 Jun 21 Stefan Urbanek * Added executeScriptNamed: 2002 Jun 8 Stefan Urbanek * Reflect STEnvironment changes * Removed loading of Foundation module as this is handleb by the STEnvironment 2002 Jun 7 Stefan Urbanek * Changed printing of result object (handle arrays, dictionaries and sets different way) 2002 Jun 6 Stefan Urbanek * Update completition list lazily (only when needed) 2002 Jun 4 Stefan Urbanek * add DistributedFinder object finder to the environment 2002 May 30 Stefan Urbanek * added Environment object. steptalk-0.10.0/Examples/Shell/GNUmakefile0000644000175000000000000000217510132015525017334 0ustar gurkanroot# # StepTalk tools # # Copyright (C) 2002 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = stshell stshell_OBJC_FILES = STShell.m STShell+output.m stshell_tool.m ADDITIONAL_TOOL_LIBS += -lStepTalk -lreadline -lncurses ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUMakefile.postamble steptalk-0.10.0/Examples/Shell/README0000644000175000000000000000421510132015525016137 0ustar gurkanrootstshell ------- Author: Stefan Urbanek What is stshell? ----------------- StepTalk Shell is an interactive tool for communicating with objects. Features -------- - GNUstep classes and objects - command-line editing - TAB completition of named objects and selectors For more information read included *.txt files. Installation ------------ Requirements: StepTalk and the readline library (development files) > make > make install Running ------- To run stshell with default language, run just > stshell If you would like to use another language, then use > stshell -language AnotherLanguage To use AppKit > stshell -environment AppKit To use it as a distributed objects 'glue' > stshell -environment Distributed The shell will greet you with 'Welcome to the StepTalk shell.' message. Welcome to the StepTalk shell. StepTalk > _ Now you may write statements in the language you have specified. StepTalk > Transcript showLine:'Current date is ', ((NSDate date) description) If the line is too long, then you may use the backslash '\' character at the end of the line to continue on the next line. StepTalk > Transcript showLine:'Current date is ', \ ... ? ((NSDate date) description) Objects history array --------------------- All results from the expressions are stored in the 'Objects' array. The example above can be written in more steps: StepTalk > ((NSDate date) description) 0: 2002-05-29 22:41:57 +0200 StepTalk > 'Current date is ', (Objects @ 0) 1: Current date is 2002-05-29 22:41:57 +0200 StepTalk > Transcript showLine: (Objects @ 1) Current date is 2002-05-29 22:41:57 +0200 To show all objects type: StepTalk > Shell listObjects Objects 0: '2002-05-29 22:41:57 +0200' (GSCInlineString) 1: 'Current date is 2002-05-29 22:41:57 +020...' (GSUnicodeString) TAB completition ---------------- Here is an example of TAB completition. StepTalk > Tr showL:'Current date is ', ((NSDate date) desci) Feedback -------- Any questions, comments and bug reports are velcome at urbanek@host.sk steptalk-0.10.0/Examples/Shell/STShell+output.m0000644000175000000000000001026410132015525020310 0ustar gurkanroot/** STShell+output Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 7 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import "STShell.h" #import #import #import #import #import #import #import #import #import #include @implementation STShell(STShellOutput) - show:(id)anObject { printf("%s", [[anObject description] cString]); return self; } - showLine:(id)anObject { [self show:anObject]; putchar('\n'); return nil; } - (void)showError:(NSString *)errString { fprintf(stderr, "%s\n\n", [errString cString]); } - showResult:(id)obj { const char *className = [NSStringFromClass([obj class]) cString]; int objIndex = [objectStack count] - 1; int i; if(obj) { if([obj isKindOfClass:[NSArray class]]) { printf("(%i) %s\n", objIndex, className); for(i = 0;i<[obj count]; i++) { printf("%i %s\n", i, [self displayCStringForObject:[obj objectAtIndex:i]]); } } else if([obj isKindOfClass:[NSSet class]]) { printf("(%i) %s\n", objIndex, className); obj = [[obj allObjects] sortedArrayUsingSelector:@selector(compare:)]; for(i = 0;i<[obj count]; i++) { printf("%s\n", [self displayCStringForObject:[obj objectAtIndex:i]]); } } else if([obj isKindOfClass:[NSDictionary class]]) { NSString *key; NSArray *keys; printf("(%i) %s\n", objIndex, className); keys = [[obj allKeys] sortedArrayUsingSelector:@selector(compare:)]; for(i = 0;i<[keys count]; i++) { key = [keys objectAtIndex:i]; printf("%s : %s\n", [self displayCStringForObject:key], [self displayCStringForObject:[obj objectForKey:key]]); } } else { printf("(%i) %s\n", objIndex, [self displayCStringForObject:obj]); } } return self; } - (char *)displayCStringForObject:(id)object { NSString *str = [object description]; if( [str length] > 60 ) { str = [str substringToIndex:60]; str = [str stringByAppendingString:@"..."]; } return [str cString]; } - showException:(NSException *)exception { printf("Error (%s): %s\n", [[exception name] cString], [[exception reason] cString]); return self; } - (id)listObjects { NSString *str; int i; id object; printf("Objects\n"); for(i = 0; i < [objectStack count]; i++) { object = [objectStack objectAtIndex:i]; str = [object description]; if( [str length] > 60 ) { str = [str substringToIndex:60]; str = [str stringByAppendingString:@"..."]; } printf("%4i: '%s' (%s)\n", i, [str cString], [[[object class] description] cString]); } return nil; } @end steptalk-0.10.0/Examples/Shell/STShell.h0000644000175000000000000000377010300741477016764 0ustar gurkanroot/** STShell StepTalk Shell Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 May 29 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import @class STConversation; @class STEnvironment; @class STScriptsManager; @class NSMutableArray; @class NSException; @interface STShell:NSObject { STScriptsManager *scriptsManager; STConversation *conversation; NSString *prompt; NSString *source; NSMutableArray *objectStack; BOOL exitRequest; BOOL updateCompletionList; NSArray *completionList; BOOL completionEnabled; } - initWithEnvironment:(STEnvironment *)env; - (void)setLanguage:(NSString *)langName; - (void)setEnvironment:(STEnvironment *)newEnv; - (STEnvironment *)environment; - (void)run; - show:(id)anObject; - showLine:(id)anObject; - (id)executeLine:(NSString *)line; - showResult:(id)obj; - showException:(NSException *)exception; - (void)showError:(NSString *)errString; @end @interface STShell(STShellOutput) - show:(id)anObject; - showLine:(id)anObject; - showResult:(id)obj; - (char *)displayCStringForObject:(id)object; - showException:(NSException *)exception; - (id)listObjects; @end steptalk-0.10.0/Examples/Shell/STShell.m0000644000175000000000000002070010307113150016745 0ustar gurkanroot/** STShell StepTalk Shell Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 May 29 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import "STShell.h" #import #import #import #import #import #import #import #import #import #import #include static Class NSString_class; static Class NSNumber_class; NSArray *objcSelectors = nil; static STShell *sharedShell = nil; @interface STShell(STPrivateMethods) - (int) completion; - (NSString *)readLine; - (void)initReadline; @end int complete_handler(void) { return [sharedShell completion]; } @implementation STShell + (void)initialize { NSString_class = [NSString class]; NSNumber_class = [NSNumber class]; } + sharedShell { return sharedShell; } - initWithConversation:(STConversation *)conv { self = [super init]; [self initReadline]; objectStack = [[NSMutableArray alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bundleLoaded:) name:NSBundleDidLoadNotification object:nil]; scriptsManager = RETAIN([STScriptsManager defaultManager]); prompt = @"StepTalk > "; conversation = RETAIN(conv); /* FIXME: make this more clever for completion handler */ if(!sharedShell) { sharedShell = self; } return self; } - (void)updateCompletionList { NSMutableArray *array = [[NSMutableArray alloc] init]; RELEASE(completionList); [array addObjectsFromArray:STAllObjectiveCSelectors()]; completionList = [[NSArray alloc] initWithArray:array]; updateCompletionList = NO; } - (void)dealloc { RELEASE(objectStack); RELEASE(completionList); RELEASE(scriptsManager); RELEASE(conversation); [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } -(void)bundleLoaded:(NSNotification *)notif { updateCompletionList = YES; } - (void)initReadline { rl_initialize(); rl_bind_key('\t', complete_handler); } - (void)setLanguage:(NSString *)langName { NSDebugLog(@"Setting language to %@", langName); [conversation setLanguage:langName]; } - (void)setEnvironment:(STEnvironment *)newEnv { [conversation setEnvironment:newEnv]; } - (STEnvironment *)environment { return [conversation context]; } - (void)run { STEnvironment *env; NSString *line; id result; [self showLine:@"Welcome to the StepTalk shell."]; // NSLog(@"Environment %@", env); if(![conversation isKindOfClass:[STRemoteConversation class]]) { completionEnabled = YES; } else { [self showLine:@"Note: Completion disabled for distant conversation"]; } while(1) { line = [self readLine]; if(exitRequest) break; if(!line) continue; result = [self executeLine:line]; if(result) { if(result != objectStack) { [objectStack addObject:result]; } [self showResult:result]; } else { [self showResult:result]; } } printf("\n"); } - (id)executeLine:(NSString *)line { NSString *cmd; id result = nil; /* FIXME: why? */ cmd = [line stringByAppendingString:@" "]; NS_DURING [conversation interpretScript:cmd]; result = [conversation result]; NS_HANDLER [self showException:localException]; NS_ENDHANDLER return result; } - (NSString *)readLine { char *str; NSString *actualPrompt = prompt; NSString *line = @""; BOOL done = NO; int len; while(!done) { str = readline([actualPrompt cString]); done = YES; if(!str) { exitRequest = YES; return nil; } len = strlen(str); if(!len) return nil; if(str[len-1] == '\\') { actualPrompt = @"... ? "; str[strlen(str) - 1] = '\0'; done = NO; } line = [line stringByAppendingString:[NSString stringWithCString:str]]; } add_history([line cString]); return line; } - (int)completion { STEnvironment *env; NSEnumerator *enumerator; NSMutableSet *set; NSString *match; NSString *tail; NSString *str; NSArray *array; int pos = 0; int c; if(!completionEnabled) { return 0; } if(rl_point <= 0) { return 0; } pos = rl_point - 1; c = rl_line_buffer[pos]; while((isalnum(c) || c == '_') && pos >= 0) { pos--; c = rl_line_buffer[pos]; } pos++; match = [NSString stringWithCString:rl_line_buffer + pos length:rl_point - pos]; set = [NSMutableSet set]; if(!completionList || updateCompletionList) { [self updateCompletionList]; } enumerator = [completionList objectEnumerator]; while( (str = [enumerator nextObject]) ) { if( [str hasPrefix:match] ) { [set addObject:str]; } } env = [conversation context]; enumerator = [[env knownObjectNames] objectEnumerator]; while( (str = [enumerator nextObject]) ) { if( [str hasPrefix:match] ) { [set addObject:str]; } } array = [set allObjects]; if( [array count] == 0 ) { printf("\nNo match for completion.\n"); rl_forced_update_display(); } else if ( [array count] == 1 ) { str = [array objectAtIndex:0]; str = [str substringFromIndex:rl_point - pos]; rl_insert_text([str cString]); rl_insert_text(" "); rl_redisplay(); } else { enumerator = [array objectEnumerator]; tail = [enumerator nextObject]; while( (str = [enumerator nextObject]) ) { tail = [str commonPrefixWithString:tail options:NSLiteralSearch]; } tail = [tail substringFromIndex:[match length]]; if( tail && ![tail isEqualToString:@""] ) { rl_insert_text([tail cString]); rl_redisplay(); } else { printf("\n"); enumerator = [array objectEnumerator]; while( (str = [enumerator nextObject]) ) { printf("%s\n", [str cString]); } rl_forced_update_display(); } } return 0; } - (void)exit { /* FIXME: this is not nice */ exit(0); } - (id)executeScriptNamed:(NSString *)scriptName { STScript *script = [scriptsManager scriptWithName:scriptName]; id result = nil; if(!script) { [self showError:[NSString stringWithFormat: @"Unable to find script with name '%@'", scriptName]]; } else { NS_DURING result = [conversation runScriptFromString:[script source]]; NS_HANDLER [self showException:localException]; NS_ENDHANDLER } return result; } - (void)setPrompt:(NSString *)aString { ASSIGN(prompt, aString); } - (NSString *)prompt { return prompt; } @end steptalk-0.10.0/Examples/Shell/Unix.txt0000644000175000000000000000716610132015525016753 0ustar gurkanrootUnix shell equivalents ---------------------- StepTalk is not meant to be used for tasks that can be done using ordinary Unix shells. But this does not mean, that it cannot be used for such tasks. In this file you may find list of unix commands and tasks and their Smalltalk equivalents. Contents: File Manipulation Output Paths and filenames Network Math Date and Time File manipulation ----------------- > fm := NSFileManager defaultManager ls > (fm directoryContentsAtPath: '.') sortedArrayUsingSelector:#compare: pwd > fm currentDirectoryPath cd path > fm changeCurrentDirectoryPath: 'path' ln -s path other > fm createSymbolicLinkAtPath:'path' pathContent:'other' cp src dest > fm copyPath:'src' toPath:'dest' handler: nil cp file_list dest > file_list do: [ :file | fm copyPath:file toPath:'dest' handler: nil ] mv - as cp, movePath:toPath:handler: ln - as cp, linkPath:toPath:handler: rm - removeFileAtPath:handler: mkdir dir > fm createDirectoryAtPath:'dir' attributes:nil df path > fm fileSystemAttributesAtPath:'path' Output ------ echo 'string' > Transcript show:'string' cat file > Transcript show: (NSString stringWithContentsOfFile:'file') "write a string to a file" > ('string' writeToFile:'file' atomically:YES) "create a string from a file" > str := NSString stringWithContentsOfFile:'file' Paths and filenames -------------------------------- For more information, refer to the NSString documentation. NSString methods for path manipulation: - fileSystemRepresentation - isAbsolutePath - pathComponents - lastPathComponent - pathExtension - stringByAbbreviatingWithTildeInPath - stringByAppendingPathComponent: - stringByAppendingPathExtension: - stringByDeletingLastPathComponent - stringByDeletingPathExtension - stringByExpandingTildeInPath - stringByResolvingSymlinksInPath - stringByStandardizingPath - stringsByAppendingPaths: Examples: > path := '/usr/GNUstep/System/Applications/Ink.app' > path pathComponents (?) GSArray 0 / 1 usr 2 GNUstep 3 System 4 Applications 5 Ink.app > path lastPathComponent (?) Ink.app > path pathExtension (?) app In Smalltalk there is a symbolic selector '/' for NSString that is equivalent to the 'stringByAppendingPathComponent:'. > path := 'somePath' > filename := 'someFilename' > fullPath := path / filename Network ------- localhost > NSHost currentHost name nslookup host_name > (NSHost hostWithName:'host_name') addresses nslookup host_address > (NSHost hostWithAddress:'host_address') names "download a file from the web" > data := NSData dataWithContentsOfURL:'url' > data writeToFile:'file' atomically:YES "read a file from the web" > string := NSString stringWithContentsOfURL:'url' Math ---- Just like in: > 1 + 1 or in: > a := b * c Date and Time ------------- date > NSDate date ...or... date > NSCalendarDate date For more information read the NSDate and NSCalendarDate documentation NSCalendarDate methods: Creating a date + calendarDate + dateWithString:calendarFormat: + dateWithString:calendarFormat:locale: + dateWithYear:month:day:hour:minute:second:timeZone: Retrieving date elements - dayOfCommonEra - dayOfMonth - dayOfWeek - dayOfYear - hourOfDay - minuteOfHour - monthOfYear - secondOfMinute - yearOfCommonEra Adjusting a date - dateByAddingYears:months:days:hours:minutes:seconds: steptalk-0.10.0/Examples/Shell/stshell_tool.m0000644000175000000000000001513410307113150020147 0ustar gurkanroot/** stshell StepTalk Shell Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 May 29 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import #import "STShell.h" #import #import #import #import #import #import @interface STShellTool:NSObject { STConversation *conversation; NSArray *arguments; unsigned int currentArg; NSString *environmentName; NSString *hostName; NSString *typeName; NSString *languageName; } - (int)parseArguments; - (NSString *)nextArgument; - (void)reuseArgument; - (void)run; - (void)printHelp; @end @implementation STShellTool - (int)parseArguments { NSString *arg; BOOL isOption = NO; arguments = [[NSProcessInfo processInfo] arguments]; [self nextArgument]; while( (arg = [self nextArgument]) ) { isOption = NO; if( [arg hasPrefix:@"--"] ) { arg = [arg substringFromIndex:2]; isOption = YES; } else if( [arg hasPrefix:@"-"] ) { arg = [arg substringFromIndex:1]; isOption = YES; } if ([@"help" hasPrefix:arg]) { [self printHelp]; return 1; } else if ([@"language" hasPrefix:arg]) { RELEASE(languageName); languageName = [self nextArgument]; if(!languageName) { [NSException raise:@"STShellToolException" format:@"Language name expected"]; } } else if ([@"environment" hasPrefix:arg]) { RELEASE(environmentName); environmentName = [self nextArgument]; if(!environmentName) { [NSException raise:@"STShellToolException" format:@"Environment name expected"]; } } else if ([@"host" hasPrefix:arg]) { RELEASE(hostName); hostName = [self nextArgument]; if(!hostName) { [NSException raise:@"STShellToolException" format:@"Host name expected"]; } } else if ([@"type" hasPrefix:arg]) { RELEASE(typeName); typeName = [self nextArgument]; if(!typeName) { [NSException raise:@"STShellToolException" format:@"Environment description (type) name expected"]; } } else if(!isOption) { break; } } if(arg) { [self reuseArgument]; } return 0; } - (NSString *)nextArgument { if(currentArg < [arguments count]) { return [arguments objectAtIndex:currentArg++]; } return nil; } - (void)reuseArgument { currentArg--; } /* Method taken from stexec.m - look there for updates */ - (void)createConversation { STEnvironmentDescription *desc; STEnvironment *environment; if(environmentName) { /* user wants to connect to a distant environment */ conversation = [[STRemoteConversation alloc] initWithEnvironmentName:environmentName host:hostName language:languageName]; if(!conversation) { NSLog(@"Unable to connect to %@@%@", environmentName, hostName); return; } } else { /* User wants local temporary environment */ if(!typeName || [typeName isEqualToString:@""]) { environment = [STEnvironment environmentWithDefaultDescription]; } else { desc = [STEnvironmentDescription descriptionWithName:typeName]; environment = [STEnvironment environmentWithDescription:desc]; } /* Register basic objects: Environment, Transcript */ [environment setObject:environment forName:@"Environment"]; [environment loadModule:@"SimpleTranscript"]; [environment setCreatesUnknownObjects:YES]; /* FIXME: make this an option */ [environment setFullScriptingEnabled:YES]; conversation = [[STConversation alloc] initWithContext:environment language:languageName]; } } - (void)run { STShell *shell; [self parseArguments]; [self createConversation]; if(!languageName || [languageName isEqualToString:@""]) { languageName = [[STLanguageManager defaultManager] defaultLanguage]; } [conversation setLanguage:languageName]; shell = [[STShell alloc] initWithConversation:conversation]; [shell run]; NSDebugLog(@"Exiting StepTalk shell"); } - (void)printHelp { NSProcessInfo *info = [NSProcessInfo processInfo]; printf("%s - StepTalk shell\n" "Usage: %s [options]\n\n" "Options are:\n" " -help this text\n" " -language lang use language lang\n" " -environment env use scripting environment with name env\n" " -host host find environment on host\n" " -type desc use environment description with name 'desc'\n", [[info processName] cString],[[info processName] cString] ); } @end int main(int argc, const char **argv) { NSAutoreleasePool *pool; STShellTool *tool; pool = [NSAutoreleasePool new]; tool = [[STShellTool alloc] init]; [tool run]; RELEASE(pool); return 0; } steptalk-0.10.0/Examples/Smalltalk/0000775000175000000000000000000010261057560016144 5ustar gurkanrootsteptalk-0.10.0/Examples/Smalltalk/actor.st0000644000175000000000000000257210305164521017623 0ustar gurkanroot| actor engine source method | actor := STActor actorInEnvironment:Environment. "Set ivars" ivars := NSMutableDictionary dictionary. ivars setObject:1 forKey:'number'. actor setInstanceVariables:ivars. " Get the proper engine " engine := STEngine engineForLanguage:'Smalltalk'. " This is the source of new method " source := 'increment number := number + 1. ^self'. " Create method " method := engine methodFromSource:source forReceiver:actor inContext:Environment. " Add the method to the actor " actor addMethod:method. " Add another method with an argument " source := 'setNumber:i number := i. ^self'. method := engine methodFromSource:source forReceiver:actor inContext:Environment. actor addMethod:method. source := 'print Transcript showLine: (\'The number is \', (number description)). ^self'. method := engine methodFromSource:source forReceiver:actor inContext:Environment. actor addMethod:method. " Send it! " actor print. actor increment. actor print. actor increment. actor print. actor setNumber:10. actor print. steptalk-0.10.0/Examples/Smalltalk/createFile.st0000644000175000000000000000054510132015526020552 0ustar gurkanroot| fileManager fileName data | fileManager := NSFileManager defaultManager. fileName := '/tmp/TestFile.text'. ('This is some file' writeToFile:fileName atomically:NO) ifTrue: [ Transcript showLine:'File was succesfully created.' ] ifFalse: [ Transcript showLine:'File was not created.' ] steptalk-0.10.0/Examples/Smalltalk/exception.st0000644000175000000000000000124210132015526020500 0ustar gurkanroot| fileName flag | fileName := '/tmp/TestFile.text'. flag := NO. [ ('This is some file' writeToFile:fileName atomically:NO) ifTrue: [ Transcript showLine:'File was succesfully created.'] ifFalse: [ Transcript showLine:'File was not created.'] ] handler: [ :exception | Transcript showLine:('Handled exception: ',(exception name)). Transcript showLine:('Reason : ',(exception reason)). flag := YES ]. flag ifTrue: [ Transcript showLine:'Finished with exception' ] ifFalse: [ Transcript showLine:'Finished succesfully' ] steptalk-0.10.0/Examples/Smalltalk/extern.st0000644000175000000000000000033310132015526020007 0ustar gurkanroot| foo | "foo is local variable" foo := 'Foo'. Transcript showLine:( 'This is foo : ', foo ). " bar is created in environment as extern variable " bar := 'Bar'. Transcript showLine:( 'And this is bar: ', bar ). steptalk-0.10.0/Examples/Smalltalk/files.st0000644000175000000000000000200110132015526017576 0ustar gurkanroot" List contents of current directory " " Script variables " | fileManager path files dict | " Get default file manager " fileManager := NSFileManager defaultManager. " Get current path " path := fileManager currentDirectoryPath. " Write label on Transcript (for shell it is standard output) " Transcript showLine:( 'Listing of directory: ', path ). " Get files from 'path' " files := fileManager directoryContentsAtPath:path. " For each file from files do the following ..." files do: [ :file | dict := fileManager fileAttributesAtPath: (path / file) traverseLink:NO. Transcript showLine:file. Transcript showLine: (' Type: ', (dict @ NSFileType)). Transcript showLine: (' Size: ', ((dict @ NSFileSize) stringValue)). Transcript showLine: (' Date: ', ((dict @ NSFileModificationDate) description)). Transcript showLine:'' ] steptalk-0.10.0/Examples/Smalltalk/hello.st0000644000175000000000000000056510132015526017614 0ustar gurkanroot" hello Say hello to someone specified as an argument. Ussage: stexec hello.st name " " Is name specified? (Is there some script argument?) " ((Args count) > 0 ) ifTrue: [ " Args is an array of script arguments. " Transcript showLine: ('Hello ', (Args @ 0), '!'). ] ifFalse: [ Transcript showLine:'Hello ... who?' ] steptalk-0.10.0/Examples/Smalltalk/listDir.st0000644000175000000000000000200110132015526020106 0ustar gurkanroot" List contents of current directory " " Script variables " | fileManager path files dict | " Get default file manager " fileManager := NSFileManager defaultManager. " Get current path " path := fileManager currentDirectoryPath. " Write label on Transcript (for shell it is standard output) " Transcript showLine:( 'Listing of directory: ', path ). " Get files from 'path' " files := fileManager directoryContentsAtPath:path. " For each file from files do the following ..." files do: [ :file | dict := fileManager fileAttributesAtPath: (path / file) traverseLink:NO. Transcript showLine:file. Transcript showLine: (' Type: ', (dict @ NSFileType)). Transcript showLine: (' Size: ', ((dict @ NSFileSize) stringValue)). Transcript showLine: (' Date: ', ((dict @ NSFileModificationDate) description)). Transcript showLine:'' ] steptalk-0.10.0/Examples/Smalltalk/math.st0000644000175000000000000000012710132015526017434 0ustar gurkanroot" Smalltalk math example " Transcript show:'1 + 1 = '. Transcript showLine: (1 + 1) steptalk-0.10.0/Examples/Smalltalk/notification.st0000644000175000000000000000117210132015526021172 0ustar gurkanroot" Notification example Show usage of NSNotification class and notification handling in scripts " [| " Main script method " main | center | center := NSNotificationCenter defaultCenter. Transcript showLine:'Registering for notification.'. center addObserver:self selector:#handleNotification: name:'Notification' object:nil. Transcript showLine:'Posting notification.'. center postNotificationName:'Notification' object:nil. ^self ! " Method as notification handler " handleNotification:notif Transcript showLine:'Notification received.'. ^self ] steptalk-0.10.0/Examples/Smalltalk/pldes.st0000644000175000000000000000243710132015526017620 0ustar gurkanroot" pldes.st GNUstep plpdes tool rewriten as Smalltalk script for StepTalk Ussage: stexec pldes.st file1 [file2 ...] " [| :locale main locale := (NSUserDefaults standardUserDefaults) dictionaryRepresentation. ((Args count) < 1 ) ifTrue: [ Transcript showLine:'No file names given to deserialize.' ] ifFalse: [ Args do: [ :file | [self deserializeFile:file] handler: [ :exception | Transcript showLine:'Loading \'', file, '\' - ', (exception reason). ] ] ]. ^self ! deserializeFile:file | myData myString result out | myData := NSData dataWithContentsOfFile: file. result := NSDeserializer deserializePropertyListFromData: myData mutableContainers: NO. (result isNil) ifTrue: [ Transcript showLine:'Loading \'',file, '\' - nil property list'. ] ifFalse: [ myString := result descriptionWithLocale: locale indent: 0. myData := myString dataUsingEncoding: NSASCIIStringEncoding. out := NSFileHandle fileHandleWithStandardOutput. out writeData: myData; synchronizeFile. ]. ^self ] steptalk-0.10.0/Examples/Smalltalk/plparse.st0000644000175000000000000000327410132015526020157 0ustar gurkanroot" plparse.st GNUstep plparse tool rewriten as Smalltalk script for StepTalk Ussage: stexec plparse.st file1 [file2 ...] " [| main | string result | ((Args count) < 1 ) ifTrue: [ Transcript showLine:'No file names given to parse.' ] ifFalse: [ Args do: [ :file | self parseFile:file ] ]. ^self ! parseFile: file Transcript show: ('Parsing ', file, ' - '). [ string := NSString stringWithContentsOfFile:file. result := string propertyList. (result isNil) ifTrue: [ Transcript showLine:'nil property list' ] ifFalse: [ (result isKindOfClass: (NSDictionary class)) ifTrue: [ Transcript showLine:'a dictionary'] ifFalse: [ (result isKindOfClass: (NSArray class)) ifTrue: [ Transcript showLine:'an array'] ifFalse: [ (result isKindOfClass: (NSData class)) ifTrue: [ Transcript showLine:'a data'] ifFalse: [ (result isKindOfClass: (NSString class)) ifTrue: [ Transcript showLine:'a string'] ifFalse: [ Transcript showLine: ('unexpected class - ', result class description ) ] ] ] ] ] ] handler: [ :localException | Transcript showLine: (localException reason) ]. ] steptalk-0.10.0/Examples/Smalltalk/range.st0000644000175000000000000000144110132015526017577 0ustar gurkanroot" Range example " |str substr range| str := 'I like apples and plums.'. Transcript showLine: ('String is : \'', str, '\''). substr := str substringWithRange: (7 <> 5). Transcript showLine: ('Substring at location 7 with length 5 is \'', substr, '\''). range := str rangeOfString: 'tomato'. ((range location) = NSNotFound) ifTrue: [ Transcript showLine: 'Tomato not found' .]. range := str rangeOfString: 'plum'. Transcript showLine: ('Location of \'plum\' is ', ((range location) stringValue), ' and length is ', ((range length) stringValue)). range := ( (range location) <> 5). Transcript showLine: ('Substring with modified range \'', (str substringWithRange:range), '\''). steptalk-0.10.0/Examples/Smalltalk/scope.st0000644000175000000000000000221110132015526017610 0ustar gurkanroot" Variable scope example try to run: > stexec scope.st , scope.st " [| :global main | local | Transcript showLine: ':: Start'. (extern isNil) ifTrue: [ Transcript showLine: 'Script was run for first time. Setting extern.'. extern := 100. ] ifFalse: [ Transcript showLine: 'Extern: ', (extern stringValue). ]. local := 10. Transcript showLine: 'Local: ', (local stringValue). self setLocal:20. Transcript showLine: 'Local after call: ', (local stringValue), ' (has to be 10 not 20)'. global := 10. Transcript showLine: 'Global: ', (global stringValue). self setGlobal:20. Transcript showLine: 'Global after call 1: ', (global stringValue), ' (has to be 20 not 10)'. self testGlobal. Transcript showLine: 'Global after call 2: ', (global stringValue), ' (has to be 20 not 0)'. ^nil ! setLocal:val | local | local := val. ^self ! setGlobal:val global := val. ^self ! testGlobal | global | global := 0. ^self ] steptalk-0.10.0/Examples/Smalltalk/selector.st0000644000175000000000000000040510132015526020322 0ustar gurkanroot" Selector example " [| main self performSelector:#hello. ^nil ! hello | b | Transcript showLine:'Hello!'. ^self ! hello2 Transcript showLine:'Hello!'. ^self ! hello3 |a| Transcript showLine:'Hello!'. ^self ] steptalk-0.10.0/Examples/Smalltalk/shell.st0000644000175000000000000000173610305164540017624 0ustar gurkanroot" Script shell - shell written in script. This is just an example. Run it by: stexec shell.st Author: Stefan Urbanek Date: 2003 Oct 3 " [| :done main | line env engine result | Environment includeFramework:'StepTalk'. Environment loadModule:'ReadlineTranscript'. " Create environment " env := STEnvironment defaultScriptingEnvironment. env setObject:env forName:'Environment'. env setObject:Transcript forName:'Transcript'. env setObject:self forName:'Shell'. " Create and setup engine " engine := STEngine engineForLanguage:'Smalltalk'. " Do the loop! " [ done ] whileFalse: [ line := Transcript readLine:'Shell > '. (line = 'exit') ifTrue: [ done := YES ]. result := engine executeCode: (line, ' ') inEnvironment:env. Transcript showLine: result. ]. ^self ! exit Transcript showLine: 'BLAH'. done := YES. ^self ] steptalk-0.10.0/Examples/Smalltalk/simple.st0000644000175000000000000000004510132015526017773 0ustar gurkanrootTranscript showLine:'Hello ... who?' steptalk-0.10.0/Finders/0000775000175000000000000000000010132015526014025 5ustar gurkanrootsteptalk-0.10.0/Finders/ApplicationFinder/0000775000175000000000000000000010365363565017441 5ustar gurkanrootsteptalk-0.10.0/Finders/ApplicationFinder/.cvsignore0000644000175000000000000000010510132015526021412 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Finders/ApplicationFinder/GNUmakefile0000644000175000000000000000273010132015526021472 0ustar gurkanroot# # Application Finder # # Copyright (C) 2000,2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make include $(GNUSTEP_MAKEFILES)/Additional/gui.make BUNDLE_NAME = ApplicationFinder ApplicationFinder_OBJC_FILES = STApplicationFinder.m ApplicationFinder_PRINCIPAL_CLASS = STApplicationFinder ApplicationFinder_BUNDLE_LIBS += -lStepTalk ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Finders -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Finders/ApplicationFinder/STApplicationFinder.h0000644000175000000000000000201110132015526023423 0ustar gurkanroot/** STApplicationFinder Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 8 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STApplicationFinder:NSObject { } @end steptalk-0.10.0/Finders/ApplicationFinder/STApplicationFinder.m0000644000175000000000000000635310132015526023445 0ustar gurkanroot/** STApplicationFinder Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 8 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STApplicationFinder.h" #import #import #import #import #import #import #import #import #import #import @implementation STApplicationFinder - (NSArray *)applicationsInDirectory:(NSString *)path { NSDirectoryEnumerator *enumerator; NSMutableArray *array = [NSMutableArray array]; NSString *file; enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path]; while ( (file = [enumerator nextObject]) ) { if ([[file pathExtension] isEqualToString:@"app"]) { file = [file lastPathComponent]; file = [file stringByDeletingPathExtension]; [array addObject:file]; } } return [NSArray arrayWithArray:array]; } - (NSArray *)knownObjectNames { NSEnumerator *enumerator; NSArray *paths; NSString *path; NSMutableSet *set = [NSMutableSet set]; paths = NSSearchPathForDirectoriesInDomains(NSAllApplicationsDirectory, NSAllDomainsMask, YES); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { [set addObjectsFromArray:[self applicationsInDirectory:path]]; } return [set allObjects]; } - (id)connectApplicationWithName:(NSString *)name { id app; NSDebugLLog(@"STFinder", @"Connecting application '%@'", name); app = [NSConnection rootProxyForConnectionWithRegisteredName:name /* ... */ host:nil]; return app; } - (id)objectWithName:(NSString *)name { NSString *appName; if( ![[self knownObjectNames] containsObject:name] ) { return nil; } /* FIXME: We need to add .app extension */ appName = [name stringByAppendingPathExtension:@"app"]; NSLog(@"Launching '%@'", name); if([[NSWorkspace sharedWorkspace] launchApplication:appName]) { NSLog(@"Connecting '%@'", name); return [self connectApplicationWithName:name]; } return nil; } @end steptalk-0.10.0/Finders/DistributedFinder/0000775000175000000000000000000010365363565017460 5ustar gurkanrootsteptalk-0.10.0/Finders/DistributedFinder/.cvsignore0000644000175000000000000000010510132015526021431 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Finders/DistributedFinder/GNUmakefile0000644000175000000000000000265710132015526021521 0ustar gurkanroot# # Distributed Objects Finder module # # Copyright (C)2002 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = DistributedFinder DistributedFinder_OBJC_FILES = STDistributedFinder.m DistributedFinder_PRINCIPAL_CLASS = STDistributedFinder DistributedFinder_BUNDLE_LIBS += -lStepTalk ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Finders -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Finders/DistributedFinder/STDistributedFinder.h0000644000175000000000000000215710132015526023474 0ustar gurkanroot/** STDistributedFinder.h StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STDistributedFinder:NSObject - (NSArray *)knownObjectNames; - (id)objectWithName:(NSString *)name; @end steptalk-0.10.0/Finders/DistributedFinder/STDistributedFinder.m0000644000175000000000000001111510132015526023473 0ustar gurkanroot/** STDistributedFinder.m StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STDistributedFinder.h" #import #import #import #import #import #import #import #import #import #import static NSDictionary *STDOInfo(NSString *name) { NSString *file; file = STFindResource(name, @"DistributedObjects", @"plist"); if(file) { return [NSDictionary dictionaryWithContentsOfFile:file]; } return nil; } @implementation STDistributedFinder - (id)connectDistantObjectWithName:(NSString *)name { NSDictionary *dict = STDOInfo(name); NSEnumerator *enumerator; NSString *host; id obj; NSString *distantName; distantName = [dict objectForKey:@"ObjectName"]; if(!distantName || [distantName isEqualToString:@""]) { distantName = name; } /* find object on host 'Host' */ host = [dict objectForKey:@"Host"]; NSDebugLLog(@"STFinder", @"Looking up '%@' at '%@'", distantName, host); obj = [NSConnection rootProxyForConnectionWithRegisteredName:distantName host:host]; if(obj) { return obj; } /* Lookup for object at specified hosts */ enumerator = [[dict objectForKey:@"Hosts"] objectEnumerator]; while( (host = [enumerator nextObject]) ) { NSDebugLLog(@"STFinder", @"Looking up '%@' at '%@'", distantName, host); obj = [NSConnection rootProxyForConnectionWithRegisteredName:distantName host:host]; if(obj) { return obj; } } return nil; } - (id)objectWithName:(NSString *)name { NSDictionary *dict = STDOInfo(name); NSString *toolName = [dict objectForKey:@"Tool"]; NSString *delayStr; NSTask *task; int delay = 5; /* default delay */ id obj; obj = [self connectDistantObjectWithName:name]; if(obj || !dict) { return obj; } if(!toolName || [toolName isEqualToString:@""]) { return nil; } NSDebugLLog(@"STFinder", @"Launching '%@'", toolName); task = [NSTask launchedTaskWithLaunchPath:toolName arguments:[dict objectForKey:@"Arguments"]]; delayStr = [dict objectForKey:@"Wait"]; if(delayStr && ![delayStr isEqualToString:@""]) { delay = [[dict objectForKey:@"Wait"] intValue]; } if(!task) { NSLog(@"(StepTalk) Unable to launch task '%@'", toolName); return nil; } [NSTimer scheduledTimerWithTimeInterval: delay invocation: nil repeats: NO]; [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: delay]]; return [self connectDistantObjectWithName:name]; } - (NSArray *)knownObjectNames { NSMutableArray *array = [NSMutableArray array]; NSEnumerator *enumerator; NSString *name; NSString *file; NSArray *fileArray; fileArray = STFindAllResources(@"DistributedObjects", @"plist"); enumerator = [fileArray objectEnumerator]; while( (file = [enumerator nextObject]) ) { name = [[file lastPathComponent] stringByDeletingPathExtension]; [array addObject:name]; } return [NSArray arrayWithArray:array]; } @end steptalk-0.10.0/Finders/GNUmakefile0000644000175000000000000000215510132015526016100 0ustar gurkanroot# # GNUmakefile # # Copyright (C) 2002 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make ifeq ($(appkit),no) SUBPROJECTS = DistributedFinder else SUBPROJECTS = DistributedFinder ApplicationFinder endif -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/Frameworks/0000775000175000000000000000000010132015560014551 5ustar gurkanrootsteptalk-0.10.0/Frameworks/GNUmakefile0000644000175000000000000000207710132015560016627 0ustar gurkanroot# # Main Makefile for the StepTalk # # Copyright (C) 2000 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS = \ StepTalk -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/Frameworks/StepTalk/0000755000175000000000000000000010365363565016321 5ustar gurkanrootsteptalk-0.10.0/Frameworks/StepTalk/.cvsignore0000644000175000000000000000013510132015550020274 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage *.framework derived_src steptalk-0.10.0/Frameworks/StepTalk/Environments/0000755000175000000000000000000010134611301020762 5ustar gurkanrootsteptalk-0.10.0/Frameworks/StepTalk/Environments/AppKit.stenv0000644000175000000000000000042010132015550023231 0ustar gurkanroot/** AppKit.stenv Description for AppKit environment. Using this description will include Application Kit objects and Application finder. */ { Name = "AppKit"; Modules = (AppKit); Finders = (ApplicationFinder); Use = (Foundation); } steptalk-0.10.0/Frameworks/StepTalk/Environments/Common.stenv0000644000175000000000000000043510132015550023277 0ustar gurkanroot/** Common.stenv * Common scripting environment description */ { Name = "Common"; Bundles = (CommonEnvironment); Import = ( "SymbolicSelectors", "Foundation", "AppKit" ); Applications = ( All ); } steptalk-0.10.0/Frameworks/StepTalk/Environments/Distributed.stenv0000644000175000000000000000037010132015550024327 0ustar gurkanroot/** Distributed.stenv Description for distributed environment. Using this description will include Distributed Object finder. */ { Name = "Distributed"; Finders = (DistributedFinder); Use = ("Foundation"); } steptalk-0.10.0/Frameworks/StepTalk/Environments/Foundation-operators.stenv0000644000175000000000000000562210134611301026172 0ustar gurkanroot/** Foundation-operators.stenv */ { Name = "Foundation-operators"; Use = (SymbolicSelectors); DefaultRestriction = AllowAll; Behaviours = { "NSObject-operators" = { Use = (Comparison, KeyValueCoding); }; }; Classes = { All = { }; // added by mateu "NSObject class" = { SymbolicSelectors = { "=" = "isEqual:"; "==" = "isSame:"; "~=" = "notEqual:"; "~~" = "notSame:"; }; }; NSObject = { Use = ("NSObject-operators"); }; NSProxy = { Use = (KeyValueCoding); }; NSArray = { Super = "NSObject"; SymbolicSelectors = { "@" = "objectAtIndex:"; "," = "arrayByAddingObject:"; "+" = "arrayByAddingObject:"; }; }; NSMutableArray = { Super = "NSArray"; SymbolicSelectors = { "+=" = "addObject:"; "-=" = "removeObject:"; }; }; NSDictionary = { Super = NSObject; SymbolicSelectors = { "@" = "objectForKey:"; }; }; NSUserDefaults = { Super = NSObject; SymbolicSelectors = { "@" = "objectForKey:"; }; }; NSString = { Super = NSObject; SymbolicSelectors = { "," = "stringByAppendingString:"; "/" = "stringByAppendingPathComponent:"; "@" = "characterAtIndex:"; }; Aliases = { size = length; }; }; NSMutableString = { Super = NSString; SymbolicSelectors = { "+=" = "appendString:"; }; }; NSSet = { Super = NSObject; SymbolicSelectors = { "<" = "isSubsetOfSet:"; }; }; NSMutableSet = { Super = NSSet; SymbolicSelectors = { "+=" = "addObject:"; "-=" = "removeObject:"; }; }; NSDate = { Super = NSObject; SymbolicSelectors = { "-" = "timeIntervalSinceDate:"; }; }; NSNumber = { Super = NSValue; Use = (NumberArithmetic); SymbolicSelectors = { "<>" = "rangeWith:"; "@" = "pointWith:"; "@@" = "sizeWith:"; }; }; }; /* Classes */ } steptalk-0.10.0/Frameworks/StepTalk/Environments/Foundation.stenv0000644000175000000000000000130410132015550024151 0ustar gurkanroot/** Foundation.stenv */ { Name = "Foundation"; Modules = (Foundation); Use = ("Foundation-operators"); DefaultRestriction = AllowAll; Classes = { NSObject = { Super = nil; }; "NSObject class" = { Super = nil; }; NSString = { Super = "NSObject"; }; NSArray = { Super = "NSObject"; }; NSDate = { Super = "NSObject"; }; NSValue = { Super = "NSObject"; }; NSNumber = { Super = "NSValue"; }; }; /* Classes */ } steptalk-0.10.0/Frameworks/StepTalk/Environments/Safe.stenv0000644000175000000000000000304610134611230022725 0ustar gurkanroot/** Foundation-safe.stenv */ { Name = "Foundation-safe"; Use = ("Standard"); Behaviours = { "DenyWriteToFile" = { DenyMethods = ( "writeToFile:atomically:", "writeToURL:atomically:" ) }; }; Classes = { NSString = { Use = (DenyWriteToFile); }; NSArray = { Use = (DenyWriteToFile); }; NSDictionary = { Use = (DenyWriteToFile); }; NSData = { Use = (DenyWriteToFile); }; NSFileManager = { DenyMethods = ( "copyPath:toPath:handler:", "createFileAtPath:contents:attributes:", "movePath:toPath:handler:", "linkPath:toPath:handler:", "removeFileAtPath:handler:", "changeFileAttributes:atPath:", "createSymbolicLinkAtPath:pathContent:" ); }; NSUserDefaults = { DenyMethods = ( "removeObjectForKey:", "setBool:forKey:", "setFloat:forKey:", "setInteger:forKey:", "setObject:forKey:", "removePersistentDomainForName:", "setPersistentDomain:forName:", "removeVolatileDomainForName:", "setVolatileDomain:forName:", "registerDefaults:" ); }; }; /* Classes */ } steptalk-0.10.0/Frameworks/StepTalk/Environments/Standard.stenv0000644000175000000000000000032410132015550023604 0ustar gurkanroot/** Standard.stenv * Standard cripting description */ { Name = "Standard"; Modules = (ObjectiveC); Use = ( "SymbolicSelectors", "Foundation", "StepTalk" ); } steptalk-0.10.0/Frameworks/StepTalk/Environments/StepTalk.stenv0000644000175000000000000000160110132015550023572 0ustar gurkanroot/** StepTalk.stenv * StepTalk scripting description * * Copyright (c) 2000 Stefan Urbanek * * This file is part of the StepTalk project. * * */ { Name = "StepTalk"; Frameworks = (StepTalk); Classes = { STBlock = { Super = NSObject; AllowMethods = ( "value", "valueWith:", "valueWith:with:", "valueWith:with:with:", "valueWith:with:with:with:", "argumentCount", "handler:", "whileTrue:", "whileFalse:" ); }; STScriptObject = { Super = NSObject; Restriction = AllowAll; }; STUndefinedObject = { Super = nil; Restriction = AllowAll; }; } } steptalk-0.10.0/Frameworks/StepTalk/Environments/SymbolicSelectors.stenv0000644000175000000000000000205410134611207025516 0ustar gurkanroot/** SymbolicSelectors.stenv * Mappings for some symbolic selectors * * Copyright (c) 2000 Stefan Urbanek * * This file is part of the StepTalk project. * */ { Name = "SymbolicSelectors"; Behaviours = { Comparison = { SymbolicSelectors = { "=" = "isEqual:"; "==" = "isSame:"; "~=" = "notEqual:"; "~~" = "notSame:"; "<" = "isLessThan:"; ">" = "isGreatherThan:"; "<=" = "isLessOrEqualThan:"; ">=" = "isGreatherOrEqualThan:"; }; }; NumberArithmetic = { SymbolicSelectors = { "+" = "add:"; "-" = "subtract:"; "*" = "multiply:"; "/" = "divide:"; }; }; KeyValueCoding = { SymbolicSelectors = { "->" = "valueForKeyPath:"; }; }; }; } steptalk-0.10.0/Frameworks/StepTalk/Errors.plist0000644000175000000000000000017310300726627020642 0ustar gurkanroot( { Name = @"Unable to connect"; Description = @"Unable to connect to the distant environment." } )steptalk-0.10.0/Frameworks/StepTalk/GNUmakefile0000644000175000000000000000607510306166366020376 0ustar gurkanroot# # GNUmakefile # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. include $(GNUSTEP_MAKEFILES)/common.make include ../../Version FRAMEWORK_NAME = StepTalk StepTalk_OBJC_FILES = \ NSInvocation+additions.m \ STActor.m \ STBehaviourInfo.m \ STBundleInfo.m \ STClassInfo.m \ STContext.m \ STConversation.m \ STRemoteConversation.m \ STEngine.m \ STEnvironment.m \ STEnvironmentDescription.m \ STExterns.m \ STFunctions.m \ STFileScript.m \ STLanguageManager.m \ STObjCRuntime.m \ STObjectReference.m \ STScript.m \ STScriptsManager.m \ STScripting.m \ STMethod.m \ STScriptObject.m \ STSelector.m \ STStructure.m \ STUndefinedObject.m \ NSNumber+additions.m \ NSObject+additions.m \ StepTalkScriptingInfo.m # FIXME: NOT FINISHED: # STRemoteConversation.m \ # STDistantEnvironment.m \ STEPTALK_HEADER_FILES = \ STActor.h \ STBundleInfo.h \ STContext.h \ STConversation.h \ STRemoteConversation.h \ STEngine.h \ STEnvironment.h \ STEnvironmentDescription.h \ STExterns.h \ STFunctions.h \ STFileScript.h \ STLanguageManager.h \ STObjCRuntime.h \ STObjectReference.h \ STMethod.h \ STScriptObject.h \ STScript.h \ STScriptsManager.h \ STScripting.h \ STSelector.h \ STUndefinedObject.h \ NSInvocation+additions.h \ NSObject+additions.h StepTalk_HEADER_FILES = $(STEPTALK_HEADER_FILES) \ StepTalk.h StepTalk_RESOURCE_FILES = ScriptingInfo.plist Environments ADDITIONAL_CPPFLAGS += -pipe ADDITIONAL_OBJCFLAGS = -Wno-import -DSTEPTALK_VERSION=$(STEPTALK_VERSION) DOCUMENT_NAME = StepTalk StepTalk_DOC_INSTALL_DIR = Developer StepTalk_HEADER_FILES_DIR = $(HEADER_DIR) StepTalk_AGSDOC_FILES = StepTalk.gsdoc $(STEPTALK_HEADER_FILES) StepTalk_AGSDOC_FLAGS = \ -Up StepTalk \ -Declared StepTalk \ -DocumentationDirectory ../../Documentation/Reference ifeq ($(GNUSTEP_TARGET_OS),mingw32) StepTalk_LIBRARIES_DEPEND_UPON += -lgnustep-base -lobjc endif ifeq ($(check),yes) ADDITIONAL_OBJCFLAGS += -Werror endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/framework.make ifeq ($(doc), yes) include $(GNUSTEP_MAKEFILES)/documentation.make endif -include GNUmakefile.postamble steptalk-0.10.0/Frameworks/StepTalk/GNUmakefile.postamble0000644000175000000000000000330710140326312022337 0ustar gurkanroot# # GNUmakefile.postamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # $(MKDIRS) $(STEPTALK_LIBRARY_DIR) # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: steptalk-0.10.0/Frameworks/StepTalk/NSFileManager+additions.h0000644000175000000000000000034410303702461023040 0ustar gurkanroot#import @interface NSFileManager(StepTalkAdditions) - (NSArray *)pathsForDirectories:(NSArray *)array inDomains:(int)domains; - (NSArray *)filesOfType:(NSString *)type inPaths:(NSArray *)paths; @end steptalk-0.10.0/Frameworks/StepTalk/NSFileManager+additions.m0000644000175000000000000000044210303703520023041 0ustar gurkanroot#import "NSFileManager+additions.h" @implementation NSFileManager(StepTalkAdditions) - (NSArray *)pathsForDirectories:(NSArray *)array inDomains:(int)domains { NSMutableArray *array; NSArray *paths; } - (NSArray *)filesOfType:(NSString *)type inPaths:(NSArray *)paths; @end steptalk-0.10.0/Frameworks/StepTalk/NSInvocation+additions.h0000644000175000000000000000270110132015552022774 0ustar gurkanroot/** NSInvocation+additions.h Various NSInvocation additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import void STGetValueOfTypeFromObject(void *value, const char *type, id anObject); id STObjectFromValueOfType(void *value, const char *type); @interface NSInvocation(STAdditions) + invocationWithTarget:(id)target selectorName:(NSString *)selectorName; + invocationWithTarget:(id)target selector:(SEL)selector; - (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex; - (id)getArgumentAsObjectAtIndex:(int)anIndex; - (id)returnValueAsObject; @end steptalk-0.10.0/Frameworks/StepTalk/NSInvocation+additions.m0000644000175000000000000002474110132015550023007 0ustar gurkanroot/** NSInvocation+additions Various NSInvocation additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA NSInvocation class additions */ #import "NSInvocation+additions.h" #import #import #import #import #import "STExterns.h" #import "STObjCRuntime.h" #import "STScripting.h" #import "STSelector.h" #import "STStructure.h" #import #if 0 static Class NSNumber_class = nil; static Class NSString_class = nil; static Class NSValue_class = nil; #endif #define CASE_NUMBER_TYPE(otype,type,msgtype)\ case otype: object = [NSNumber numberWith##msgtype:*((type *)value)];\ NSDebugLLog(@"STStructure",\ @" is number value '%@'", object);\ break /** This method is a factory method, that means that you have to release the object when you no longer need it. */ id STObjectFromValueOfType(void *value, const char *type) { id object; NSDebugLLog(@"STStructure", @"object from value %p of of type '%c'",value,*type); switch(*type) { case _C_ID: case _C_CLASS: object = *((id *)value); NSDebugLLog(@"STStructure", @" is object value %p", object); break; CASE_NUMBER_TYPE(_C_CHR,char,Char); CASE_NUMBER_TYPE(_C_UCHR,unsigned char, UnsignedChar); CASE_NUMBER_TYPE(_C_SHT,short,Short); CASE_NUMBER_TYPE(_C_USHT,unsigned short,UnsignedShort); CASE_NUMBER_TYPE(_C_INT,int,Int); CASE_NUMBER_TYPE(_C_UINT,unsigned int,UnsignedInt); CASE_NUMBER_TYPE(_C_LNG,long,Long); CASE_NUMBER_TYPE(_C_ULNG,unsigned long,UnsignedLong); #ifdef _C_LNG_LNG CASE_NUMBER_TYPE(_C_LNG_LNG,long long,LongLong); CASE_NUMBER_TYPE(_C_ULNG_LNG,unsigned long long,UnsignedLongLong); #endif CASE_NUMBER_TYPE(_C_FLT,float,Float); CASE_NUMBER_TYPE(_C_DBL,double,Double); case _C_PTR: object = [NSValue valueWithPointer:*((void **)value)]; NSDebugLLog(@"STStructure", @" is pointer value %p", *((void **)value)); break; case _C_CHARPTR: object = [NSString stringWithCString:*((char **)value)]; NSDebugLLog(@"STStructure", @" is string value '%s'", *((char **)value)); break; case _C_VOID: object = nil; break; case _C_STRUCT_B: object = [[STStructure alloc] initWithValue:value type:type]; AUTORELEASE(object); break; case _C_SEL: object = [[STSelector alloc] initWithSelector:*((SEL *)value)]; AUTORELEASE(object); break; case _C_BFLD: case _C_UNDEF: case _C_ARY_B: case _C_ARY_E: case _C_UNION_B: case _C_UNION_E: case _C_STRUCT_E: default: [NSException raise:STInvalidArgumentException format:@"unhandled ObjC type '%s'", type]; } return object; } #define CASE_TYPE(otype,type,msgtype)\ case otype:(*((type *)value)) = [anObject msgtype##Value];\ NSDebugLLog(@"STStructure",\ @" is number value '%@'", anObject);\ break void STGetValueOfTypeFromObject(void *value, const char *type, id anObject) { NSDebugLLog(@"STStructure", @"value at %p from object '%@' of type '%c'", value,anObject,*type); switch(*type) { case _C_ID: case _C_CLASS: NSDebugLLog(@"STStructure", @" is object value"); (*(id *)value) = anObject; break; CASE_TYPE(_C_CHR,char,char); CASE_TYPE(_C_UCHR,unsigned char,unsignedChar); CASE_TYPE(_C_SHT,short,short); CASE_TYPE(_C_USHT,unsigned short,unsignedShort); CASE_TYPE(_C_INT,int,int); CASE_TYPE(_C_UINT,unsigned int,unsignedInt); CASE_TYPE(_C_LNG,long,long); CASE_TYPE(_C_ULNG,unsigned long,unsignedLong); CASE_TYPE(_C_LNG_LNG,long long,longLong); CASE_TYPE(_C_ULNG_LNG,unsigned long long,unsignedLongLong); CASE_TYPE(_C_FLT,float,float); CASE_TYPE(_C_DBL,double,double); CASE_TYPE(_C_PTR,void *,pointer); case _C_CHARPTR: /* FIXME: check if this is good (copy/no copy)*/ (*((const char **)value)) = [[anObject stringValue] cString]; NSDebugLLog(@"STStructure", @" is cstring '%@'", [anObject stringValue]); break; case _C_STRUCT_B: /* FIXME: chech for struct compatibility */ NSDebugLLog(@"STStructure", @" is structure"); [(STStructure*)anObject getValue:value]; break; case _C_SEL: (*((SEL *)value)) = [anObject selectorValue]; break; case _C_BFLD: case _C_VOID: case _C_UNDEF: case _C_ATOM: case _C_ARY_B: case _C_ARY_E: case _C_UNION_B: case _C_UNION_E: case _C_STRUCT_E: default: [NSException raise:STInvalidArgumentException format:@"unhandled ObjC type '%s'", type]; } } @implementation NSInvocation(STAdditions) #if 0 /* with this method it does not work, it is not posiible to create an invocation*/ + (void)initialize { NSNumber_class = [NSNumber class]; NSString_class = [NSString class]; NSValue_class = [NSValue class]; } #endif + invocationWithTarget:(id)target selectorName:(NSString *)selectorName { NSMethodSignature *signature; NSInvocation *invocation; SEL sel; BOOL requiresRegistration = NO; // NSLog(@"GETTING SELECTOR %@", selectorName); sel = NSSelectorFromString(selectorName); if(!sel) { // NSLog(@"REGISTERING SELECTOR"); const char *name = [selectorName cString]; sel = sel_register_name(name); if(!sel) { [NSException raise:STInternalInconsistencyException format:@"Unable to register selector '%@'", selectorName]; return nil; } requiresRegistration = YES; } signature = [target methodSignatureForSelector:sel]; /* FIXME: this is workaround for gnustep DO bug (hight priority) */ if(requiresRegistration) { // NSLog(@"REGISTERING SELECTOR TYPES"); sel = sel_register_typed_name([selectorName cString], [signature methodReturnType]); // NSLog(@"REGISTERED %@", NSStringFromSelector(sel)); } if(!signature) { [NSException raise:STInternalInconsistencyException format:@"No method signature for selector '%@' for " @"receiver of type %@", selectorName,[target className]]; return nil; } invocation = [NSInvocation invocationWithMethodSignature:signature]; [invocation setSelector:sel]; [invocation setTarget:target]; return invocation; } + invocationWithTarget:(id)target selector:(SEL)selector { NSMethodSignature *signature; NSInvocation *invocation; signature = [target methodSignatureForSelector:selector]; if(!signature) { [NSException raise:STInternalInconsistencyException format:@"No method signature for selector '%@' for " @"receiver of type %@", NSStringFromSelector(selector),[target className]]; return nil; } invocation = [NSInvocation invocationWithMethodSignature:signature]; [invocation setSelector:selector]; [invocation setTarget:target]; return invocation; } - (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex { const char *type; void *value; type = [[self methodSignature] getArgumentTypeAtIndex:anIndex]; value = NSZoneMalloc(STMallocZone,objc_sizeof_type(type)); STGetValueOfTypeFromObject(value, type, anObject); [self setArgument:(void *)value atIndex:anIndex]; NSZoneFree(STMallocZone,value); } - (id)getArgumentAsObjectAtIndex:(int)anIndex { const char *type; void *value; id object; type = [[self methodSignature] getArgumentTypeAtIndex:anIndex]; value = NSZoneMalloc(STMallocZone,objc_sizeof_type(type)); [self getArgument:value atIndex:anIndex]; object = STObjectFromValueOfType(value,type); NSZoneFree(STMallocZone,value); return object; } - (id)returnValueAsObject { const char *type; int returnLength; void *value; id returnObject = nil; NSMethodSignature *signature = [self methodSignature]; type = [signature methodReturnType]; returnLength = [signature methodReturnLength]; NSDebugLLog(@"STSending", @" return type '%s', buffer length %i",type,returnLength); if(returnLength!=0) { value = NSZoneMalloc(STMallocZone,returnLength); [self getReturnValue:value]; if( *type == _C_VOID ) { returnObject = [self target]; } else { returnObject = STObjectFromValueOfType(value, type); } NSZoneFree(STMallocZone,value); NSDebugLLog(@"STSending", @" returned object %@",returnObject); } else { returnObject = [self target]; } return returnObject; } @end steptalk-0.10.0/Frameworks/StepTalk/NSNumber+additions.h0000644000175000000000000000311210132015552022110 0ustar gurkanroot/** NSNumber-additions.h Various methods for NSNumber Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSNumber (STAdditions) - add:(NSNumber *)number; - subtract:(NSNumber *)number; - multiply:(NSNumber *)number; - divide:(NSNumber *)number; - (unsigned int)isLessThan:(NSNumber *)number; - (BOOL)isGreatherThan:(NSNumber *)number; - (BOOL)isLessOrEqualThan:(NSNumber *)number; - (BOOL)isGreatherOrEqualThan:(NSNumber *)number; @end @interface NSNumber (STLogicOperations) - (unsigned int)or:(NSNumber *)number; - (unsigned int)and:(NSNumber *)number; - (unsigned int)not; @end @interface NSNumber (STStructure) - rangeWith:(int)length; - pointWith:(float)y; - sizeWith:(float)h; @end steptalk-0.10.0/Frameworks/StepTalk/NSNumber+additions.m0000644000175000000000000000647710132015550022134 0ustar gurkanroot/** NSNumber-additions.h Various methods for NSNumber Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSNumber+additions.h" #import "STExterns.h" #import "STStructure.h" #import #include @implementation NSNumber (STAdditions) - add:(NSNumber *)number { return [NSNumber numberWithDouble:([self doubleValue] + [number doubleValue])]; } - subtract:(NSNumber *)number { return [NSNumber numberWithDouble:([self doubleValue] - [number doubleValue])]; } - multiply:(NSNumber *)number { return [NSNumber numberWithDouble:([self doubleValue] * [number doubleValue])]; } - divide:(NSNumber *)number { if([number doubleValue] == 0.0) { [NSException raise:STGenericException format:@"Division by zero"]; return self; } return [NSNumber numberWithDouble:([self doubleValue] / [number doubleValue])]; } - modulo:(NSNumber *)number { if([number doubleValue] == 0.0) { [NSException raise:STGenericException format:@"Division by zero"]; return self; } return [NSNumber numberWithDouble:(fmod([self doubleValue], [number doubleValue]))]; } - (unsigned int)isLessThan:(NSNumber *)number { return ([self doubleValue] < [number doubleValue]); } - (BOOL)isGreatherThan:(NSNumber *)number { return ([self doubleValue] > [number doubleValue]); } - (BOOL)isLessOrEqualThan:(NSNumber *)number { return ([self doubleValue] <= [number doubleValue]); } - (BOOL)isGreatherOrEqualThan:(NSNumber *)number { return ([self doubleValue] >= [number doubleValue]); } @end @implementation NSNumber (STLogicOperations) - (unsigned int)or:(NSNumber *)number { return ([self intValue] | [number intValue]); } - (unsigned int)and:(NSNumber *)number { return ([self intValue] & [number intValue]); } - (unsigned int)not { /* FIXME */ return ![self intValue]; } @end @implementation NSNumber (STStructure) - rangeWith:(int)length { return [STStructure structureWithRange:NSMakeRange([self intValue], length)]; } - pointWith:(float)y { return [STStructure structureWithPoint:NSMakePoint([self floatValue], y)]; } - sizeWith:(float)h { return [STStructure structureWithSize:NSMakeSize([self floatValue], h)]; } @end steptalk-0.10.0/Frameworks/StepTalk/NSObject+additions.h0000644000175000000000000000202510300724425022073 0ustar gurkanroot/** NSObject-additions.h Various methods for NSObject Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSObject (STAdditions) - (BOOL)isSame:(id)anObject; - (BOOL)isNil; - (BOOL)notNil; @end steptalk-0.10.0/Frameworks/StepTalk/NSObject+additions.m0000644000175000000000000000056610132015550022103 0ustar gurkanroot/** NSObject-additions.m Various methods for NSObject Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "NSObject+additions.h" @implementation NSObject (STAdditions) - (BOOL)isSame:(id)anObject { return self == anObject; } - (BOOL)isNil { return NO; } - (BOOL)notNil { return YES; } @end steptalk-0.10.0/Frameworks/StepTalk/STActor.h0000644000175000000000000000167510300743327020005 0ustar gurkanroot/** STActor StepTalk actor Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2005 June 30 License: LGPL This file is part of the StepTalk project. */ #import #import "STMethod.h" @class NSMutableDictionary; @class NSDictionary; @class NSArray; @class STEnvironment; @interface STActor:NSObject { NSMutableDictionary *ivars; NSMutableDictionary *methodDictionary; STEnvironment *environment; } + actorInEnvironment:(STEnvironment *)env; - initWithEnvironment:(STEnvironment *)env; - (void)setEnvironment:(STEnvironment *)env; - (STEnvironment *)environment; - (void)addMethod:(id )aMethod; - (id )methodWithName:(NSString *)aName; - (void)removeMethod:(id )aMethod; - (void)removeMethodWithName:(NSString *)aName; - (NSArray *)methodNames; - (NSDictionary *)methodDictionary; @end steptalk-0.10.0/Frameworks/StepTalk/STActor.m0000644000175000000000000001167410307113517020011 0ustar gurkanroot/** STActor StepTalk actor Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2005 June 30 License: LGPL This file is part of the StepTalk project. */ #import "STActor.h" #import "NSInvocation+additions.h" #import "STEngine.h" #import "STEnvironment.h" #import "STExterns.h" #import "STObjCRuntime.h" #import #import #import #import #import #import #import @implementation STActor /** Return new instance of script object without any instance variables */ + actorInEnvironment:(STEnvironment *)env { return AUTORELEASE([[self alloc] initWithEnvironment:env]); } + actor { return AUTORELEASE([[self alloc] init]); } - init { self = [super init]; methodDictionary = [[NSMutableDictionary alloc] init]; ivars = [[NSMutableDictionary alloc] init]; return self; } - initWithEnvironment:(STEnvironment *)env; { self = [self init]; [self setEnvironment:env]; return self; } - (void)dealloc { RELEASE(methodDictionary); RELEASE(ivars); [super dealloc]; } - (void)setValue:(id)value forKey:(NSString *)key { /* FIXME: this is not optimal */ if([ivars valueForKey:key] != nil) { [ivars setValue:value forKey:key]; } else { [super setValue:value forKey:key]; } } - (id)valueForKey:(NSString *)key { id value = nil; value = [ivars valueForKey:key]; if(value == nil) { value = [super valueForKey:key]; } return value; } - (NSArray *)instanceVariableNames { return [ivars allKeys]; } - (void)setInstanceVariables:(NSDictionary *)dictionary { [ivars removeAllObjects]; [ivars addEntriesFromDictionary:dictionary]; } - (NSDictionary *)instanceVarables { return [NSDictionary dictionaryWithDictionary:ivars]; } - (void)addMethod:(id )aMethod { [methodDictionary setObject:aMethod forKey:[aMethod methodName]]; } - (id )methodWithName:(NSString *)aName { return [methodDictionary objectForKey:aName]; } - (void)removeMethod:(id )aMethod { [self notImplemented:_cmd]; } - (void)removeMethodWithName:(NSString *)aName { [methodDictionary removeObjectForKey:aName]; } - (NSArray *)methodNames { return [methodDictionary allKeys]; } - (NSDictionary *)methodDictionary { return [NSDictionary dictionaryWithDictionary:methodDictionary]; } /** Set object's environment. Note: This method should be replaced by some other, more clever mechanism. */ - (void)setEnvironment:(STEnvironment *)env { ASSIGN(environment, env); } - (STEnvironment *)environment { return environment; } - (BOOL)respondsToSelector:(SEL)aSelector { if( [super respondsToSelector:(SEL)aSelector] ) { return YES; } return ([methodDictionary objectForKey:NSStringFromSelector(aSelector)] != nil); } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { NSMethodSignature *signature = nil; signature = [super methodSignatureForSelector:sel]; if(!signature) { signature = STConstructMethodSignatureForSelector(sel); } return signature; } - (void) forwardInvocation:(NSInvocation *)invocation { STEngine *engine; id method; NSString *methodName = NSStringFromSelector([invocation selector]); NSMutableArray *args; id arg; int index; int count; id retval = nil; method = [methodDictionary objectForKey:methodName]; if(!method) { [NSException raise:@"STActorException" format:@"No script object method with name '%@'", methodName]; return; } engine = [STEngine engineForLanguage:[method languageName]]; /* Get arguments as array */ count = [[invocation methodSignature] numberOfArguments]; args = [NSMutableArray array]; for(index = 2; index < count; index++) { arg = [invocation getArgumentAsObjectAtIndex:index]; if (arg == nil) { [args addObject:STNil]; } else { [args addObject:arg]; } } retval = [engine executeMethod:method forReceiver:self withArguments:args inContext:environment]; [invocation setReturnValue:&retval]; } - (void)encodeWithCoder:(NSCoder *)coder { // [super encodeWithCoder: coder]; [coder encodeObject:methodDictionary]; [coder encodeObject:ivars]; } - initWithCoder:(NSCoder *)decoder { self = [super init]; //[super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &methodDictionary]; [decoder decodeValueOfObjCType: @encode(id) at: &ivars]; return self; } @end steptalk-0.10.0/Frameworks/StepTalk/STApplicationConversation.h0000644000175000000000000000004510132015560023553 0ustar gurkanroot@interface STApplicationConversation steptalk-0.10.0/Frameworks/StepTalk/STContext.h0000644000175000000000000000403010166604440020347 0ustar gurkanroot/** STContext Scripting context Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2004 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA STEnvironment class reference */ #import @class NSBundle; @class NSDictionary; @class NSMutableDictionary; @class NSMutableArray; @class NSMutableSet; @class STObjectReference; @class STEnvironmentDescription; @interface STContext:NSObject { NSMutableDictionary *objectDictionary; STContext *parentContext; BOOL fullScripting; BOOL createsUnknownObjects; } - (void)setParentContext:(STContext *)context; - (STContext *)parentContext; /** Full scripting */ - (void)setFullScriptingEnabled:(BOOL)flag; - (BOOL)fullScriptingEnabled; -(void)setCreatesUnknownObjects:(BOOL)flag; -(BOOL)createsUnknownObjects; - (NSMutableDictionary *)objectDictionary; - (void)setObject:(id)anObject forName:(NSString *)objName; - (void)removeObjectWithName:(NSString *)objName; - (void)addNamedObjectsFromDictionary:(NSDictionary *)dict; - (id)objectWithName:(NSString *)objName; - (STObjectReference *)objectReferenceForObjectWithName:(NSString *)name; - (NSArray *)knownObjectNames; @end steptalk-0.10.0/Frameworks/StepTalk/STBehaviourInfo.h0000644000175000000000000000347710132015552021472 0ustar gurkanroot/** STBehaviourInfo.h Scripting definition: behaviour information Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include @class NSString; @class NSDictionary; @class NSMutableDictionary; @class NSMutableSet; @class NSSet; @interface STBehaviourInfo:NSObject { NSString *name; NSMutableDictionary *selectorMap; NSMutableSet *allowMethods; NSMutableSet *denyMethods; } - initWithName:(NSString *)aString; - (NSString*)behaviourName; - (void)setTranslation:(NSString *)aSelector forSelector:(NSString *)aString; - (void)removeTranslationForSelector:(NSString *)aString; - (NSDictionary *)selectorMap; - (void)addTranslationsFromDictionary:(NSDictionary *)map; - (void)allowMethods:(NSSet *)set; - (void)denyMethods:(NSSet *)set; - (void)allowMethod:(NSString *)methodName; - (void)denyMethod:(NSString *)methodName; - (NSSet *)allowedMethods; - (NSSet *)deniedMethods; - (void)adopt:(STBehaviourInfo *)info; @end steptalk-0.10.0/Frameworks/StepTalk/STBehaviourInfo.m0000644000175000000000000000623510132015550021470 0ustar gurkanroot/** STBehaviourInfo.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBehaviourInfo.h" #import #import #import #import #import #import #import @implementation STBehaviourInfo - initWithName:(NSString *)aString { self = [super init]; selectorMap = [[NSMutableDictionary alloc] init]; allowMethods = [[NSMutableSet alloc] init]; denyMethods = [[NSMutableSet alloc] init]; name = RETAIN(aString); return self; } - (void)dealloc { RELEASE(selectorMap); RELEASE(allowMethods); RELEASE(denyMethods); RELEASE(name); [super dealloc]; } - (NSString*)behaviourName { return name; } - (void)adopt:(STBehaviourInfo *)info { [self addTranslationsFromDictionary:[info selectorMap]]; [self allowMethods:[info allowedMethods]]; [self denyMethods:[info deniedMethods]]; } - (NSDictionary *)selectorMap { return selectorMap; } - (void)removeTranslationForSelector:(NSString *)aString { [selectorMap removeObjectForKey:aString]; } - (void)setTranslation:(NSString *)translation forSelector:(NSString *)selector { [selectorMap setObject:translation forKey:selector]; } - (void)addMethodsFromArray:(NSArray *)methods { NSEnumerator *enumerator; NSString *sel; enumerator = [methods objectEnumerator]; while( (sel = [enumerator nextObject]) ) { [self setTranslation:sel forSelector:sel]; } } - (void)addTranslationsFromDictionary:(NSDictionary *)map { [selectorMap addEntriesFromDictionary:map]; } - (void)allowMethods:(NSSet *)set { [allowMethods unionSet:set]; [denyMethods minusSet:allowMethods]; } - (void)denyMethods:(NSSet *)set; { [denyMethods unionSet:set]; [allowMethods minusSet:denyMethods]; } - (void)allowMethod:(NSString *)methodName; { [allowMethods addObject:methodName]; [denyMethods removeObject:methodName]; } - (void)denyMethod:(NSString *)methodName; { [denyMethods addObject:methodName]; [allowMethods removeObject:methodName]; } - (NSSet *)allowedMethods { return AUTORELEASE([allowMethods copy]); } - (NSSet *)deniedMethods { return AUTORELEASE([denyMethods copy]); } @end steptalk-0.10.0/Frameworks/StepTalk/STBundleInfo.h0000644000175000000000000000347210132015552020752 0ustar gurkanroot/** STBundleInfo.h Bundle scripting information Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Jan 22 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSArray; @interface STBundleInfo:NSObject { NSBundle *bundle; BOOL useAllClasses; NSArray *publicClasses; NSArray *allClasses; NSDictionary *objectReferenceDictionary; NSString *scriptingInfoClassName; Class scriptingInfoClass; } + infoForBundle:(NSBundle *)aBundle; - initWithBundle:(NSBundle *)aBundle; - (NSDictionary *)objectReferenceDictionary; - (NSDictionary *)namedObjects; - (NSArray *)publicClassNames; - (NSArray *)allClassNames; @end @interface NSBundle(STAdditions) + (NSArray *)stepTalkBundleNames; + stepTalkBundleWithName:(NSString *)moduleName; - (NSDictionary *)scriptingInfoDictionary; + (NSArray *)allFrameworkNames; + (NSString *)pathForFrameworkWithName:(NSString *)aName; + (NSBundle *)bundleForFrameworkWithName:(NSString *)aName; @end steptalk-0.10.0/Frameworks/StepTalk/STBundleInfo.m0000644000175000000000000002404610132015550020755 0ustar gurkanroot/** STBundleInfo.h Bundle scripting information Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Jan 22 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBundleInfo.h" #import "STFunctions.h" #import "STExterns.h" #import #import #import #import #import #import #import #import static NSMutableDictionary *bundleInfoDict; @protocol STScriptingInfoClass + (NSDictionary *)namedObjectsForScripting; @end @interface STBundleInfo(STPrivateMethods) - (void) _bundleDidLoad:(NSNotification *)notif; - (void)_initializeScriptingInfoClass; @end @implementation NSBundle(STAdditions) /** Get list of all StepTalk bundles from Library/StepTalk/Bundles */ + (NSArray *)stepTalkBundleNames { NSArray *bundles; NSEnumerator *enumerator; NSString *path; NSMutableArray *names = [NSMutableArray array]; NSString *name; bundles = STFindAllResources(@"Bundles", STModuleExtension); enumerator = [bundles objectEnumerator]; while( (path = [enumerator nextObject]) ) { name = [path lastPathComponent]; name = [name stringByDeletingPathExtension]; [names addObject:name]; } bundles = STFindAllResources(@"Modules", STModuleExtension); enumerator = [bundles objectEnumerator]; while( (path = [enumerator nextObject]) ) { name = [path lastPathComponent]; name = [name stringByDeletingPathExtension]; [names addObject:name]; } return AUTORELEASE([NSArray arrayWithArray:names]); } + stepTalkBundleWithName:(NSString *)moduleName { NSString *file = STFindResource(moduleName, @"Bundles", @"bundle"); if(!file) { file = STFindResource(moduleName, STModulesDirectory, STModuleExtension); if(!file) { NSLog(@"Could not find bundle with name '%@'", moduleName); return nil; } } return AUTORELEASE([[self alloc] initWithPath:file]); } - (NSDictionary *)scriptingInfoDictionary { NSFileManager *manager = [NSFileManager defaultManager]; NSString *file; file = [self pathForResource:@"ScriptingInfo" ofType:@"plist"]; if([manager fileExistsAtPath:file]) { return [NSDictionary dictionaryWithContentsOfFile:file]; } else { return nil; } } /** Return names of all available frameworks in the system. */ + (NSArray *)allFrameworkNames { NSMutableArray *names = [NSMutableArray array]; NSFileManager *manager = [NSFileManager defaultManager]; NSArray *paths; NSEnumerator *fenum; NSEnumerator *penum; NSString *path; NSString *file; NSString *name; paths = NSStandardLibraryPaths(); penum = [paths objectEnumerator]; while( (path = [penum nextObject]) ) { path = [path stringByAppendingPathComponent:@"Frameworks"]; fenum = [[manager directoryContentsAtPath:path] objectEnumerator]; if( ![manager fileExistsAtPath:path isDirectory:NO] ) { continue; } while( (file = [fenum nextObject]) ) { if( [[file pathExtension] isEqualToString:@"framework"] ) { name = [[file lastPathComponent] stringByDeletingPathExtension]; [names addObject:name]; } } } return names; } /** Return path for framework with name aName. */ + (NSString *)pathForFrameworkWithName:(NSString *)aName { NSFileManager *manager = [NSFileManager defaultManager]; NSArray *paths; NSEnumerator *fenum; NSEnumerator *penum; NSString *path; NSString *file; NSString *name; paths = NSStandardLibraryPaths(); penum = [paths objectEnumerator]; while( (path = [penum nextObject]) ) { path = [path stringByAppendingPathComponent:@"Frameworks"]; fenum = [[manager directoryContentsAtPath:path] objectEnumerator]; if( ![manager fileExistsAtPath:path isDirectory:NO] ) { continue; } while( (file = [fenum nextObject]) ) { if( [[file pathExtension] isEqualToString:@"framework"] ) { name = [[file lastPathComponent] stringByDeletingPathExtension]; if([name isEqualToString:aName]) { return [path stringByAppendingPathComponent:file]; } } } } return nil; } /** Return bundle for framework with name aName. */ + (NSBundle *)bundleForFrameworkWithName:(NSString *)aName { return [self bundleWithPath:[self pathForFrameworkWithName:aName]];; } @end @implementation STBundleInfo + infoForBundle:(NSBundle *)aBundle { return AUTORELEASE([[self alloc] initWithBundle:aBundle]); } /** Initialize info with bundle aBundle. */ - initWithBundle:(NSBundle *)aBundle { STBundleInfo *info; NSString *flagString; NSDictionary *dict; if(!aBundle) { [NSException raise:@"STBundleException" format:@"Nil bundle specified"]; [self dealloc]; return nil; } info = [bundleInfoDict objectForKey:[aBundle bundlePath]]; if(info) { [self dealloc]; return RETAIN(info); } dict = [aBundle scriptingInfoDictionary]; if(!dict) { NSLog(@"Warning: Bundle '%@' does not provide scripting capabilities.", [aBundle bundlePath]); [self dealloc]; return nil; } ASSIGN(bundle, aBundle); #if 0 /* FIXME: remove observer somewhere */ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_bundleDidLoad:) name:NSBundleDidLoadNotification object:self]; #endif flagString = [dict objectForKey:@"UseAllClasses"]; flagString = [flagString lowercaseString]; useAllClasses = [flagString isEqualToString:@"yes"]; if([dict objectForKey: @"STClasses"]) { NSLog(@"WARNING: Use 'Classes' instead of 'STClasses' in " @"ScriptingInfo.plist for bundle '%@'", [aBundle bundlePath]); publicClasses = [dict objectForKey:@"STClasses"]; } else { publicClasses = [dict objectForKey:@"Classes"]; } RETAIN(publicClasses); if([dict objectForKey: @"STScriptingInfoClass"]) { NSLog(@"WARNING: Use 'ScriptingInfoClass' instead of 'STScriptingInfoClass' in " @"ScriptingInfo.plist for bundle '%@'", [aBundle bundlePath]); scriptingInfoClassName = [dict objectForKey:@"STScriptingInfoClass"]; } else { scriptingInfoClassName = [dict objectForKey:@"ScriptingInfoClass"]; } RETAIN(scriptingInfoClassName); objectReferenceDictionary = [dict objectForKey:@"Objects"]; if(!bundleInfoDict) { bundleInfoDict = [[NSMutableDictionary alloc] init]; } [bundleInfoDict setObject:self forKey:[bundle bundlePath]]; return self; } - (void) _bundleDidLoad:(NSNotification *)notif { NSLog(@"Module '%@' loaded", [bundle bundlePath]); if([notif object] != self) { NSLog(@"STBundle: That's not me!"); return; } allClasses = [[notif userInfo] objectForKey:@"NSLoadedClasses"]; RETAIN(allClasses); NSLog(@"All classes are %@"); } - (NSArray *)publicClassNames { if(useAllClasses) { if(!allClasses) { [self _initializeScriptingInfoClass]; } return allClasses; } else { return publicClasses; } } /** Return an array of all class names. */ - (NSArray *)allClassNames { /* FIXME: not implemented; */ NSLog(@"Warning: All bundle classes requested, using public classes only."); return publicClasses; } /** Return a dictionary of named objects. Named objects are get from scripting info class specified in ScriptingInfo.plist.*/ - (NSDictionary *)namedObjects { if(!scriptingInfoClass) { [self _initializeScriptingInfoClass]; } return [(id)scriptingInfoClass namedObjectsForScripting]; } - (void)_initializeScriptingInfoClass { scriptingInfoClass = [bundle classNamed:scriptingInfoClassName]; if(!scriptingInfoClass) { NSDebugLog(@"No scripting info class for bundle '%@'",[bundle bundlePath]); #if 0 [NSException raise:@"STBundleException" format:@"Unable to get scripting info class '%@' for " @"bundle '%@'", scriptingInfoClassName, [bundle bundlePath]]; #endif } } /** This method is for application scripting support. Return dictionary containing object references where a key is name of an object and value is a path to the object relative to application delegate. */ - (NSDictionary *)objectReferenceDictionary { return objectReferenceDictionary; } @end steptalk-0.10.0/Frameworks/StepTalk/STClassInfo.h0000644000175000000000000000300210132015552020573 0ustar gurkanroot/** STClassInfo.h Objective-C class wrapper Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBehaviourInfo.h" @class NSString; @class NSMutableDictionary; @interface STClassInfo:STBehaviourInfo { STClassInfo *superclass; NSString *superclassName; BOOL allowAll; NSMutableDictionary *selectorCache; } - (NSString *)translationForSelector:(NSString *)aString; - (void)setSuperclassInfo:(STClassInfo *)classInfo; - (STClassInfo *)superclassInfo; - (void)setSuperclassName:(NSString *)aString; - (NSString *)superclassName; - (void)setAllowAllMethods:(BOOL)flag; - (BOOL)allowAllMethods; @end steptalk-0.10.0/Frameworks/StepTalk/STClassInfo.m0000644000175000000000000000627710132015550020617 0ustar gurkanroot/** STClassInfo.m Objective-C class wrapper Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STClassInfo.h" #import "STFunctions.h" #import #import #import #import #import @implementation STClassInfo - initWithName:(NSString *)aString { [super initWithName:aString]; selectorCache = [[NSMutableDictionary alloc] init]; return self; } - (void)dealloc { RELEASE(selectorCache); [super dealloc]; } - (void)setSuperclassInfo:(STClassInfo *)classInfo { ASSIGN(superclass,classInfo); } - (STClassInfo *)superclassInfo { return superclass; } - (void) setSuperclassName:(NSString *)aString { ASSIGN(superclassName,aString); } - (NSString *)superclassName { return superclassName; } - (NSString *)translationForSelector:(NSString *)aString { NSString *sel; NSDebugLLog(@"STSending",@"Translate '%@' in %@:%@. (%i)", aString, [self behaviourName],superclassName, allowAll); sel = [selectorCache objectForKey:aString]; if(sel) { return sel; } sel = [selectorMap objectForKey:aString]; if(!sel) { /* Lookup for super selector maping */ if(superclass) { sel = [superclass translationForSelector:aString]; if(sel && ([denyMethods containsObject:sel] || (!allowAll && ![allowMethods containsObject:sel]))) { sel = nil; } else if([allowMethods containsObject:aString]) { sel = aString; } } else if(allowAll || [allowMethods containsObject:aString]) { sel = aString; } NSDebugLLog(@"STSending",@" translated '%@' deny %i allow %i all %i", sel, [denyMethods containsObject:sel], [allowMethods containsObject:sel], allowAll); } NSDebugLLog(@"STSending",@" Return '%@' (%@)", sel, [self behaviourName]); if(sel) { [selectorCache setObject:sel forKey:aString]; } return sel; } - (void)setAllowAllMethods:(BOOL)flag { allowAll = flag; } - (BOOL)allowAllMethods { return allowAll; } @end steptalk-0.10.0/Frameworks/StepTalk/STContext.m0000644000175000000000000001202610140325376020360 0ustar gurkanroot/** STContext Scripting context Copyright (c) 2004 Free Software Foundation Written by: Stefan Urbanek Date: 2004 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA STEnvironment class reference */ #import "STContext.h" #import "STScripting.h" #import "STClassInfo.h" #import "STEnvironmentDescription.h" #import "STExterns.h" #import "STFunctions.h" #import "STBundleInfo.h" #import "STObjCRuntime.h" #import "STObjectReference.h" #import "STUndefinedObject.h" #import #import #import #import #import #import #import #import @implementation STContext -init { self = [super init]; objectDictionary = [[NSMutableDictionary alloc] init]; return self; } - (void)dealloc { RELEASE(objectDictionary); RELEASE(parentContext); [super dealloc]; } - (void)setParentContext:(STContext *)context { ASSIGN(parentContext, context); } - (STContext *)parentContext { return parentContext; } /** Enable or disable full scripting. When full scripting is enabled, you may send any message to any object. */ - (void)setFullScriptingEnabled:(BOOL)flag { fullScripting = flag; } /** Returns YES if full scripting is enabled. */ - (BOOL)fullScriptingEnabled { return fullScripting; } /**

Enable or disable creation of unknown objects. Normally you get nil if you request for non-existant object. If flag is YES then by requesting non-existant object, name for that object is created and it is set no STNil.

Note: This method will be probably removed (moved to Smalltalk language bundle).

*/ -(void)setCreatesUnknownObjects:(BOOL)flag { createsUnknownObjects = flag; } /** Returns YES if unknown objects are being created. */ -(BOOL)createsUnknownObjects { return createsUnknownObjects; } /** Returns a dictionary of all named objects in the environment. */ - (NSMutableDictionary *)objectDictionary { return objectDictionary; } /* ----------------------------------------------------------------------- Objects ----------------------------------------------------------------------- */ /** Register object anObject with name objName. */ - (void)setObject:(id)anObject forName:(NSString *)objName { if(anObject) { [objectDictionary setObject:anObject forKey:objName]; } else { [objectDictionary setObject:STNil forKey:objName]; } } /** Remove object named objName. */ - (void)removeObjectWithName:(NSString *)objName { [objectDictionary removeObjectForKey:objName]; } /** */ - (void)addNamedObjectsFromDictionary:(NSDictionary *)dict { [objectDictionary addEntriesFromDictionary:dict]; } /** Return object with name objName. If object is not found int the object dictionary, then object finders are used to try to find the object. If object is found by an object finder, then it is put into the object dicitonary. If there is no object with given name, nil is returned. */ - (id)objectWithName:(NSString *)objName { id obj; obj = [objectDictionary objectForKey:objName]; if(!obj) { return [parentContext objectWithName:objName]; } return obj; } - (STObjectReference *)objectReferenceForObjectWithName:(NSString *)name { STObjectReference *ref; id target = objectDictionary; if( ![self objectWithName:name] ) { if([[self knownObjectNames] containsObject:name]) { /* FIXME: What I meant by this? */ target = nil; } else if(createsUnknownObjects) { [objectDictionary setObject:STNil forKey:name]; } } ref = [[STObjectReference alloc] initWithIdentifier:name target:target]; return AUTORELEASE(ref); } - (NSArray *)knownObjectNames { NSMutableArray *array = [NSMutableArray array]; [array addObjectsFromArray:[objectDictionary allKeys]]; return [NSArray arrayWithArray:array]; } @end steptalk-0.10.0/Frameworks/StepTalk/STConversation.h0000644000175000000000000000351010307113601021366 0ustar gurkanroot/** STConversation Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Sep 21 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STEngine; @class STContext; @protocol STConversation /** Set language for the receiver. */ - (void)setLanguage:(NSString *)newLanguage; - (NSString *)language; - (bycopy NSArray *)knownLanguages; /** Interpret given string as a script in the receiver environment. */ - (void)interpretScript:(bycopy NSString *)aString; // - (void)interpretScript:(bycopy NSString *)aString inLanguage:(NSString *)lang; - (id)result; - (bycopy id)resultByCopy; @end @interface STConversation:NSObject { STEngine *engine; NSString *languageName; STContext *context; id returnValue; } - initWithContext:(STContext *)aContext language:(NSString *)aLanguage; - (void)setLanguage:(NSString *)newLanguage; - (NSString *)language; - (STContext *)context; /* Depreciated */ - (id)runScriptFromString:(NSString *)aString; @end steptalk-0.10.0/Frameworks/StepTalk/STConversation.m0000644000175000000000000001047010307114067021405 0ustar gurkanroot/** STConversation Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Sep 21 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STConversation.h" #import #import #import "STEnvironment.h" #import "STEngine.h" #import "STLanguageManager.h" @implementation STConversation /** Creates a new conversation with environment created using default description and default language. */ + conversation { STEnvironment *env = [STEnvironment environmentWithDefaultDescription]; NSLog(@"DEPRECATED"); return AUTORELEASE([[self alloc] initWithContext:env language:nil]); } - (bycopy id)resultByCopy { return [self result]; } - (id)runScriptFromString:(NSString *)aString { NSLog(@"Warning: runScriptFromString: in STConversation is deprecated, use -interpretScript: and -returnVale"); [self interpretScript:aString]; return [self result]; } /** Returns all languages that are known in the receiver. Should be used by remote calls instead of NSLanguage query which gives local list of languages. */ - (NSArray *)knownLanguages { return [[STLanguageManager defaultManager] availableLanguages]; } /** Creates a new conversation with environment created using default description and language with name langName. */ + conversationWithEnvironment:(STEnvironment *)env language:(NSString *)langName { STConversation *c; NSLog(@"WARNING: +[STConversaion conversationWithEnvironment:language:] is deprecated, " @" use conversationWithContext:language: instead."); c = [[self alloc] initWithContext:env language:langName]; return AUTORELEASE(c); } - initWithEnvironment:(STEnvironment *)env language:(NSString *)langName { NSLog(@"WARNING: -[STConversaion initWithEnvironment:language:] is deprecated, " @" use initWithContext:language: instead."); return [self initWithContext:env language:langName]; } - initWithContext:(STContext *)aContext language:(NSString *)aLanguage { STLanguageManager *manager = [STLanguageManager defaultManager]; self = [super init]; NSDebugLLog(@"STConversation",@"Creating conversation %@", self); if(!aLanguage || [aLanguage isEqual:@""]) { languageName = RETAIN([manager defaultLanguage]); } else { languageName = RETAIN(aLanguage); } context = RETAIN(aContext); return self; } - (void)dealloc { NSDebugLLog(@"STConversation",@"Deallocating conversation %@", self); RELEASE(languageName); RELEASE(context); RELEASE(engine); RELEASE(returnValue); [super dealloc]; } - (void)_createEngine { ASSIGN(engine,[STEngine engineForLanguage:languageName]); } - (void)setLanguage:(NSString *)newLanguage { if(![newLanguage isEqual:languageName]) { RELEASE(engine); engine = nil; ASSIGN(languageName, newLanguage); } } /** Return name of the language used in the receiver conversation */ - (NSString *)language { return languageName; } - (STEnvironment *)environment { NSLog(@"WARNING: -[STConversaion environment] is deprecated, " @" use -context instead."); return (STEnvironment *)context; } - (STContext *)context { return context; } - (void)interpretScript:(NSString *)aString { if(!engine) { [self _createEngine]; } ASSIGN(returnValue, [engine interpretScript: aString inContext: context]); } - (id)result { return returnValue; } @end steptalk-0.10.0/Frameworks/StepTalk/STEngine.h0000644000175000000000000000342210307120030020115 0ustar gurkanroot/** STEngine.h Scripting engine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @protocol STMethod; @class STContext; @class STEnvironment; @class STLanguageEngine; @class STMethod; /** STEngine is abstract class for language engines used to intepret scripts.*/ @interface STEngine:NSObject { } /** Instance creation */ + (STEngine *) engineForLanguage:(NSString *)name; // - (BOOL)canInterpret:(NSString *)sourceCode; - (id)interpretScript:(NSString *)script inContext:(STContext *)context; /* Methods */ - (STMethod *)methodFromSource:(NSString *)sourceString forReceiver:(id)receiver inContext:(STContext *)context; - (id) executeMethod:(id )aMethod forReceiver:(id)anObject withArguments:(NSArray *)args inContext:(STContext *)context; - (BOOL)understandsCode:(NSString *)code; @end steptalk-0.10.0/Frameworks/StepTalk/STEngine.m0000644000175000000000000000643610307117764020156 0ustar gurkanroot/** STEngine.m Scripting engine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STEngine.h" #import "STEnvironment.h" #import "STExterns.h" #import "STFunctions.h" #import "STLanguageManager.h" #import "STMethod.h" #import "STUndefinedObject.h" #import #import #import #import NSZone *STMallocZone = (NSZone *)nil; void _STInitMallocZone(void) { if(!STMallocZone) { /* FIXME: do some testing whether there should be YES or NO */ STMallocZone = NSCreateZone(NSPageSize(),NSPageSize(),YES); } } @implementation STEngine + (void)initialize { _STInitMallocZone(); if(!STNil) { STNil = (STUndefinedObject *)NSAllocateObject([STUndefinedObject class], 0, STMallocZone); } } /** Return a scripting engine for language with specified name. The engine is get from default language manager. */ + (STEngine *) engineForLanguage:(NSString *)name { STLanguageManager *manager = [STLanguageManager defaultManager]; if(!name) { [NSException raise:@"STConversationException" format:@"Unspecified language for a new engine."]; return nil; } return [manager createEngineForLanguage:name]; } + (STEngine *) engineForLanguageWithName:(NSString *)name { NSLog(@"%@ %@ is depreciated, use %@ instead", [self className], NSStringFromSelector(_cmd), @"engineForLanguage:"); return [self engineForLanguage:name]; } /** Interpret source code code in a context context. This is the method, that has to be implemented by those who are writing a language engine. */ - (id)interpretScript:(NSString *)script inContext:(STContext *)context { [self subclassResponsibility:_cmd]; return nil; } - (BOOL)understandsCode:(NSString *)code { [self subclassResponsibility:_cmd]; return NO; } - (STMethod *)methodFromSource:(NSString *)sourceString forReceiver:(id)receiver inContext:(STContext *)env; { [self subclassResponsibility:_cmd]; return nil; } - (id) executeMethod:(id )aMethod forReceiver:(id)anObject withArguments:(NSArray *)args inContext:(STContext *)env; { [self subclassResponsibility:_cmd]; return nil; } @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironment.h0000644000175000000000000000437710132015552021236 0ustar gurkanroot/** STEnvironment Scripting environment Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA STEnvironment class reference */ #import @class NSBundle; @class NSDictionary; @class NSMutableDictionary; @class NSMutableArray; @class NSMutableSet; @class STObjectReference; @class STEnvironmentDescription; @interface STEnvironment:STContext { STEnvironmentDescription *description; NSMutableDictionary *classes; /* from description */ NSMutableDictionary *infoCache; NSMutableDictionary *objectFinders; NSMutableArray *loadedBundles; } /** Creating environment */ + sharedEnvironment; + (STEnvironment *)environmentWithDefaultDescription; + environmentWithDescription:(STEnvironmentDescription *)aDescription; - initWithDefaultDescription; - initWithDescription:(bycopy STEnvironmentDescription *)aDescription; /** Modules */ - (void)loadModule:(NSString *)moduleName; - (BOOL)includeFramework:(NSString *)frameworkName; - (BOOL)includeBundle:(NSBundle *)aBundle; - (void)addClassesWithNames:(NSArray *)names; /** Distributed objects */ - (void)registerObjectFinder:(id)finder name:(NSString*)name; - (void)registerObjectFinderNamed:(NSString *)name; - (void)removeObjectFinderWithName:(NSString *)name; /** Selector translation */ - (NSString *)translateSelector:(NSString *)aString forReceiver:(id)anObject; @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironment.m0000644000175000000000000003070110307120166021233 0ustar gurkanroot/** STEnvironment Scripting environment Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA STEnvironment class reference */ #import "STEnvironment.h" #import "STScripting.h" #import "STClassInfo.h" #import "STEnvironmentDescription.h" #import "STExterns.h" #import "STFunctions.h" #import "STBundleInfo.h" #import "STObjCRuntime.h" #import "STObjectReference.h" #import "STUndefinedObject.h" #import #import #import #import #import #import #import #import STEnvironment *sharedEnvironment = nil; @interface STEnvironment(STPrivateMethods) - (STClassInfo *)findClassInfoForObject:(id)anObject; @end @implementation STEnvironment /** Returns an instance of the scripting environment that is shared in the scope of actual application or process. */ + sharedEnvironment { if(sharedEnvironment == nil) { sharedEnvironment = [[self alloc] initWithDefaultDescription]; } return sharedEnvironment; } /** Creates and initialises new scripting environment using default description. */ + (STEnvironment *)environmentWithDefaultDescription { return AUTORELEASE([[self alloc] initWithDefaultDescription]); } /** Creates and initialises scripting environment using environment description description. */ + environmentWithDescription:(STEnvironmentDescription *)aDescription { return AUTORELEASE([[self alloc] initWithDescription:aDescription]); } /** Initialises scripting environment using default description. */ - initWithDefaultDescription { STEnvironmentDescription *desc; NSString *name; name = [STEnvironmentDescription defaultDescriptionName]; desc = [STEnvironmentDescription descriptionWithName:name]; return [self initWithDescription:desc]; } /** Initialises scripting environment using scripting description aDescription. */ - initWithDescription:(bycopy STEnvironmentDescription *)aDescription { NSEnumerator *enumerator; NSString *name; self = [super init]; infoCache = [[NSMutableDictionary alloc] init]; description = RETAIN(aDescription); RETAIN(description); classes = [description classes]; /* Load modules */ enumerator = [[description modules] objectEnumerator]; while( (name = [enumerator nextObject]) ) { [self loadModule:name]; } /* Load frameworks */ enumerator = [[description frameworks] objectEnumerator]; while( (name = [enumerator nextObject]) ) { [self includeFramework:name]; } /* Register finders */ enumerator = [[description objectFinders] objectEnumerator]; while( (name = [enumerator nextObject]) ) { [self registerObjectFinderNamed:name]; } return self; } - (void)dealloc { RELEASE(description); RELEASE(infoCache); RELEASE(objectFinders); RELEASE(loadedBundles); [super dealloc]; } /** Add classes specified by the names in the names array. This method is used internally to add classes provided by modules. */ - (void)addClassesWithNames:(NSArray *)names { [self addNamedObjectsFromDictionary:STClassDictionaryWithNames(names)]; } /** Load StepTalk module with the name moduleName. Modules are stored in the Library/StepTalk/Modules directory. */ - (void) loadModule:(NSString *)moduleName { NSBundle *bundle; bundle = [NSBundle stepTalkBundleWithName:moduleName]; [self includeBundle:bundle]; } /** Include scripting capabilities advertised by the framework with name frameworkName. If the framework is already loaded, nothing happens. */ - (BOOL)includeFramework:(NSString *)frameworkName { NSBundle *bundle; bundle = [NSBundle bundleForFrameworkWithName:frameworkName]; if(!bundle) { return NO; } return [self includeBundle:bundle]; } /** Include scripting capabilities advertised by the bundle aBundle. If the bundle is already loaded, nothing happens. */ - (BOOL)includeBundle:(NSBundle *)aBundle { STBundleInfo *info; /* Ignore already included bundles. */ if([loadedBundles containsObject:[aBundle bundlePath]]) { NSDebugLog(@"Bundle '%@' already included.", [aBundle bundlePath]); return YES; } info = [STBundleInfo infoForBundle:aBundle]; if(!info) { return NO; } [self addNamedObjectsFromDictionary:[info namedObjects]]; [self addClassesWithNames:[info publicClassNames]]; if(!loadedBundles) { loadedBundles = [[NSMutableArray alloc] init]; } /* FIXME: is this sufficient? */ [loadedBundles addObject:[aBundle bundlePath]]; return YES; } /* ----------------------------------------------------------------------- Objects ----------------------------------------------------------------------- */ /** Return object with name objName. If object is not found int the object dictionary, then object finders are used to try to find the object. If object is found by an object finder, then it is put into the object dicitonary. If there is no object with given name, nil is returned. */ - (id)objectWithName:(NSString *)objName { NSEnumerator *enumerator; id obj; id finder; obj = [super objectWithName:objName]; if(!obj) { enumerator = [objectFinders objectEnumerator]; while( (finder = [enumerator nextObject]) ) { obj = [finder objectWithName:objName]; if(obj) { [self setObject:obj forName:objName]; break; } } } /* FIXME: Warning: possible security problem in the future */ /* If there is no such object and full scripting is enabled, then class namespace is searched */ if(!obj && fullScripting) { obj = NSClassFromString(objName); } return obj; } /* FIXME: rewrite, it is too sloooooow */ - (STClassInfo *)findClassInfoForObject:(id)anObject { STClassInfo *info = nil; NSString *className; NSString *origName; Class class; if(!anObject) { anObject = STNil; } /* FIXME: temporary solution */ if( [anObject isProxy] ) { NSDebugLog(@"FIXME: receiver is a distant object"); info = [classes objectForKey:@"NSProxy"]; if(!info) { return [classes objectForKey:@"All"]; } return info; } if([anObject respondsToSelector:@selector(classForScripting)]) { class = [anObject classForScripting]; } else { class = [anObject class]; } className = [anObject className]; if([anObject isClass]) { origName = className = [className stringByAppendingString:@" class"]; NSDebugLLog(@"STSending", @"Looking for class info '%@'...", className); info = [infoCache objectForKey:className]; if(info) { return info; } while( !(info = [classes objectForKey:className]) ) { class = [class superclass]; if(!class) { break; } className = [[class className] stringByAppendingString:@" class"]; NSDebugLLog(@"STSending", @" ... %@?",className); } } else { origName = className; NSDebugLLog(@"STSending", @"Looking for class info '%@' (instance)...", className); info = [infoCache objectForKey:className]; if(info) { return info; } while( !(info = [classes objectForKey:className]) ) { class = [class superclass]; if(!class) { break; } className = [class className]; NSDebugLLog(@"STSending", @" ... %@?",className); } } if(!info) { NSDebugLLog(@"STSending", @"No class info '%@'", className); return nil; } NSDebugLLog(@"STSending", @"Found class info '%@'", className); [infoCache setObject:info forKey:origName]; return info; } - (NSString *)translateSelector:(NSString *)aString forReceiver:(id)anObject { STClassInfo *class; NSString *selector; class = [self findClassInfoForObject:anObject]; NSDebugLLog(@"STSending", @"Lookup selector '%@' class %@", aString, [class behaviourName]); selector = [class translationForSelector:aString]; NSDebugLLog(@"STSending", @"Found selector '%@'",selector); #ifdef DEBUG if(! [selector isEqualToString:aString]) { NSDebugLLog(@"STSending", @"using selector '%@' instead of '%@'", selector,aString); } #endif if(!selector && fullScripting ) { NSDebugLLog(@"STSending", @"using selector '%@' (full scriptig)", aString); selector = AUTORELEASE([aString copy]); } if(!selector) { [NSException raise:STScriptingException format:@"Receiver of type %@ denies selector '%@'", [anObject className],aString]; /* if exception is ignored, then try to use original selector */ selector = AUTORELEASE([aString copy]); } return selector; } - (NSArray *)knownObjectNames { NSMutableArray *array = [NSMutableArray array]; NSEnumerator *enumerator; id finder; [array addObjectsFromArray:[super knownObjectNames]]; enumerator = [objectFinders objectEnumerator]; while( (finder = [enumerator nextObject]) ) { [array addObjectsFromArray:[finder knownObjectNames]]; } return [NSArray arrayWithArray:array]; } /** Register object finder finder under the name name */ - (void)registerObjectFinder:(id)finder name:(NSString*)name { if(!objectFinders) { objectFinders = [[NSMutableDictionary alloc] init]; } [objectFinders setObject:finder forKey:name]; } /** Register object finder named name. This method will try to find an object finder bundle in Library/StepTalk/Finders directories. */ - (void)registerObjectFinderNamed:(NSString *)name { NSBundle *bundle; NSString *path; id finder; if([objectFinders objectForKey:name]) { return; } path = STFindResource(name, @"Finders", @"bundle"); if(!path) { NSLog(@"Unknown object finder with name '%@'", name); return; } NSDebugLog(@"Finder '%@'", path); bundle = [NSBundle bundleWithPath:path]; if(!bundle) { NSLog(@"Unable to load object finder bundle '%@'", path); return; } finder = [[[bundle principalClass] alloc] init]; if(!finder) { NSLog(@"Unable to create object finder from '%@'", path); return; } [self registerObjectFinder:finder name:name]; } /** Remove object finder with name name */ - (void)removeObjectFinderWithName:(NSString *)name { [objectFinders removeObjectForKey:name]; } @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironmentDescription.h0000644000175000000000000000365410132015552023437 0ustar gurkanroot/** STEnvironmentDescription.h Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 Jun 16 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import enum { STUndefinedRestriction, STAllowAllRestriction, STDenyAllRestriction }; @class NSDictionary; @class NSMutableArray; @class NSMutableDictionary; @interface STEnvironmentDescription:NSObject { NSMutableArray *usedDefs; NSMutableDictionary *classes; NSMutableDictionary *behaviours; NSMutableDictionary *aliases; NSMutableArray *modules; NSMutableArray *frameworks; NSMutableArray *finders; int restriction; } + (NSString *)defaultDescriptionName; + descriptionWithName:(NSString *)descriptionName; + descriptionFromDictionary:(NSDictionary *)dictionary; - initWithName:(NSString *)defName; - initFromDictionary:(NSDictionary *)def; - (void)updateFromDictionary:(NSDictionary *)def; - (void)updateClassWithName:(NSString *)className description:(NSDictionary *)def; - (NSMutableDictionary *)classes; - (NSArray *)modules; - (NSArray *)frameworks; - (NSArray *)objectFinders; @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironmentDescription.m0000644000175000000000000003211410132015550023433 0ustar gurkanroot/** STEnvironmentDescription.m Compiled scripting environment description Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 Jun 16 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STEnvironmentDescription.h" #import "STClassInfo.h" #import "STExterns.h" #import "STFunctions.h" #import "STBehaviourInfo.h" #import #import #import #import #import #import #import #import static NSDictionary *dictForDescriptionWithName(NSString *defName) { NSString *file; NSDictionary *dict; file = STFindResource(defName, STScriptingEnvironmentsDirectory, STScriptingEnvironmentExtension); if(!file) { [NSException raise:STGenericException format: @"Could not find " @"environment description with name '%@'.", defName]; return nil; } dict = [NSDictionary dictionaryWithContentsOfFile:file]; if(!dict) { [NSException raise:STGenericException format:@"Error while opening " @"environment description with name '%@'.", defName]; return nil; } return dict; } @interface STEnvironmentDescription(PrivateMethods) - (void)updateFromDictionary:(NSDictionary *)def; - (void)updateUseListFromDictionary:(NSDictionary *)def; - (void)updateBehavioursFromDictionary:(NSDictionary *)aDict; - (void)updateBehaviour:(STBehaviourInfo *)behInfo description:(NSDictionary *)def; - (void)updateClassesFromDictionary:(NSDictionary *)def; - (void)updateClassWithName:(NSString *)className description:(NSDictionary *)def; - (void)updateAliasesFromDictionary:(NSDictionary *)def; - (void)fixupScriptingDescription; - (void)resolveSuperclasses; - (void)updateUseList:(NSArray *)array; - (void)updateModuleList:(NSArray *)array; - (void)updateFrameworkList:(NSArray *)array; - (void)updateFinderList:(NSArray *)array; @end @implementation STEnvironmentDescription + (NSString *)defaultEnvironmentDescriptionName { NSLog(@"WARNING: +[STEnvironmentDescription defaultEnvironmentDescriptionName:] is deprecated, " @" use defaultDescriptionName: instead."); return [self defaultDescriptionName]; } + (NSString *)defaultDescriptionName { NSUserDefaults *defs; NSString *name; defs = [NSUserDefaults standardUserDefaults]; name = [defs objectForKey:@"STDefaultEnvironmentDescriptionName"]; if(!name || [name isEqualToString:@""]) { name = [NSString stringWithString:@"Standard"]; } return name; } + descriptionWithName:(NSString *)descriptionName { return AUTORELEASE([[self alloc] initWithName:descriptionName]); } + descriptionFromDictionary:(NSDictionary *)dictionary { return AUTORELEASE([[self alloc] initFromDictionary:dictionary]); } - (void)dealloc { RELEASE(usedDefs); RELEASE(classes); RELEASE(behaviours); RELEASE(aliases); RELEASE(modules); RELEASE(finders); [super dealloc]; } - initWithName:(NSString *)defName; { return [self initFromDictionary:dictForDescriptionWithName(defName)]; } - initFromDictionary:(NSDictionary *)def { if(!def) { [self dealloc]; return nil; } [self updateFromDictionary:def]; [self fixupScriptingDescription]; return self; } - (void)updateFromDictionary:(NSDictionary *)def { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSString *str; BOOL saveFlag = restriction; if(!def) { NSLog(@"Warning: nil dictionary for environmet description update"); return; }; str = [def objectForKey:@"DefaultRestriction"]; if(str) { str = [str lowercaseString]; if([str isEqualToString:@"allowall"]) { restriction = STAllowAllRestriction; } else if([str isEqualToString:@"denyall"]) { restriction = STDenyAllRestriction; } else { [NSException raise:STGenericException format:@"Invalid default restriction rule '%@'.", str]; return; } } [self updateUseList:[def objectForKey:@"Use"]]; [self updateModuleList:[def objectForKey:@"Modules"]]; [self updateFrameworkList:[def objectForKey:@"Frameworks"]]; [self updateFinderList:[def objectForKey:@"Finders"]]; [self updateBehavioursFromDictionary:[def objectForKey:@"Behaviours"]]; [self updateClassesFromDictionary:[def objectForKey:@"Classes"]]; [self updateAliasesFromDictionary:[def objectForKey:@"Aliases"]]; restriction = saveFlag; [pool release]; } - (void)updateUseList:(NSArray *)array { NSEnumerator *enumerator; NSString *str; enumerator = [array objectEnumerator]; while( (str = [enumerator nextObject]) ) { if(!usedDefs) { usedDefs = [[NSMutableArray alloc] init]; } if( ![usedDefs containsObject:str] ) { [usedDefs addObject:str]; [self updateFromDictionary:dictForDescriptionWithName(str)]; } } } - (void)updateModuleList:(NSArray *)array { NSEnumerator *enumerator; NSString *str; enumerator = [array objectEnumerator]; while( (str = [enumerator nextObject]) ) { if(!modules) { modules = [[NSMutableArray alloc] init]; } if( ![modules containsObject:str] ) { [modules addObject:str]; } } } - (void)updateFrameworkList:(NSArray *)array { NSEnumerator *enumerator; NSString *str; enumerator = [array objectEnumerator]; while( (str = [enumerator nextObject]) ) { if(!frameworks) { frameworks = [[NSMutableArray alloc] init]; } if( ![frameworks containsObject:str] ) { [frameworks addObject:str]; } } } - (NSArray *)frameworks { return [NSArray arrayWithArray:frameworks]; } - (void)updateFinderList:(NSArray *)array { NSEnumerator *enumerator; NSString *str; enumerator = [array objectEnumerator]; while( (str = [enumerator nextObject]) ) { if(!finders) { finders = [[NSMutableArray alloc] init]; } if( ![finders containsObject:str] ) { [finders addObject:str]; } } } - (void)updateBehavioursFromDictionary:(NSDictionary *)dict { NSEnumerator *enumerator; NSString *name; STBehaviourInfo *behInfo; enumerator = [dict keyEnumerator]; while( (name = [enumerator nextObject]) ) { if([behaviours objectForKey:name]) { [NSException raise:STGenericException format:@"Behaviour '%@' defined more than once.", name]; return; } if(!behaviours) { behaviours = [[NSMutableDictionary alloc] init]; } behInfo = [[STBehaviourInfo alloc] initWithName:name]; [behaviours setObject:behInfo forKey:name]; [self updateBehaviour:behInfo description:[dict objectForKey:name]]; } } - (void)updateBehaviour:(STBehaviourInfo *)behInfo description:(NSDictionary *)def { NSString *str; NSEnumerator *enumerator; STBehaviourInfo *useInfo; enumerator = [[def objectForKey:@"Use"] objectEnumerator]; while( (str = [enumerator nextObject]) ) { useInfo = [behaviours objectForKey:str]; if(!useInfo) { [NSException raise:STGenericException format:@"Undefined behaviour '%@'.", str]; return; } [behInfo adopt:useInfo]; } [behInfo allowMethods:[NSSet setWithArray:[def objectForKey:@"AllowMethods"]]]; [behInfo denyMethods:[NSSet setWithArray:[def objectForKey:@"DenyMethods"]]]; [behInfo addTranslationsFromDictionary:[def objectForKey:@"SymbolicSelectors"]]; [behInfo addTranslationsFromDictionary:[def objectForKey:@"Aliases"]]; } - (void)updateClassesFromDictionary:(NSDictionary *)dict { NSEnumerator *enumerator; NSString *str; enumerator = [dict keyEnumerator]; while( (str = [enumerator nextObject]) ) { [self updateClassWithName:str description:[dict objectForKey:str]]; } } - (void)updateClassWithName:(NSString *)className description:(NSDictionary *)def { STClassInfo *class; NSString *superName; NSString *flag; NSString *str; BOOL newClass = NO; if(!classes) { classes = [[NSMutableDictionary alloc] init]; } class = [classes objectForKey:className]; if( !class ) { class = [[STClassInfo alloc] initWithName:className]; [classes setObject:class forKey:className]; newClass = YES; } str = [def objectForKey:@"Super"]; superName = [class superclassName]; if(str && (![str isEqualToString:superName])) { if(newClass | (superName == nil)) { [class setSuperclassName:str]; } else { [NSException raise:STGenericException format:@"Trying to change superclass of '%@' " @"from '%@' to '%@'", className,[class superclassName],str]; return; } } [self updateBehaviour:class description:def]; flag = [def objectForKey:@"Restriction"]; NSDebugLLog(@"STEnvironment", @"Class %@ restriction %@ (default %i)", className, flag, restriction); if(flag) { flag = [flag lowercaseString]; if([flag isEqualToString:@"allowall"]) { [class setAllowAllMethods:YES]; } else if([flag isEqualToString:@"denyall"]) { [class setAllowAllMethods:NO]; } else { [NSException raise:STGenericException format:@"Invalid method restriction rule '%@'.", flag]; return; } } else { if(restriction == STAllowAllRestriction) { [class setAllowAllMethods:YES]; } else if (restriction == STDenyAllRestriction) { [class setAllowAllMethods:NO]; } } } - (void)updateAliasesFromDictionary:(NSDictionary *)dict { NSEnumerator *enumerator; NSString *str; enumerator = [dict keyEnumerator]; while( (str = [enumerator nextObject]) ) { [aliases setObject:str forKey:[dict objectForKey:str]]; } } - (NSMutableDictionary *)classes { return classes; } - (NSArray *)modules { return [NSArray arrayWithArray:modules]; } - (NSArray *)objectFinders { return [NSArray arrayWithArray:finders]; } - (void)fixupScriptingDescription { [self resolveSuperclasses]; } - (void)resolveSuperclasses { NSEnumerator *enumerator; STClassInfo *superclass; STClassInfo *class; NSString *className; enumerator = [classes objectEnumerator]; while( (class = [enumerator nextObject]) ) { if([[class behaviourName] isEqualToString:@"All"]) { continue; } className = [class superclassName]; if( (className == nil) || [className isEqualToString:@"nil"] ) { superclass = [classes objectForKey:@"All"]; if(!superclass) { continue; } } else { superclass = [classes objectForKey:className]; } if(!superclass) { [NSException raise:STGenericException format:@"Resolving superclasses: " @"Could not find class '%@'.", className]; return; } [class setSuperclassInfo:superclass]; } } @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironmentServer.h0000644000175000000000000000012310276226363022423 0ustar gurkanroot#import @interface STEnvironmentServer:NSObject { } @end steptalk-0.10.0/Frameworks/StepTalk/STEnvironmentServer.m0000644000175000000000000000210510300727444022424 0ustar gurkanroot#import "STEnvironmentServer.h" #import #import #import #import static STEnvironmentServer *sharedEnvironmentServer = nil; @implementation STEnvironmentServer + sharedServer { if(!sharedEnvironmentServer) { sharedEnvironmentServer = [[self alloc] init]; } return sharedEnvironmentServer; } - (void)createEnvironmentWithName:(NSString *)envName { NSTask *task; NSString *path; NSArray *args; NSString *pid; /* FIXME: use absolute path */ path = @"stenvironment"; pid = [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]]; args = [NSArray arrayWithObjects:@"-name", envName, @"-observer", pid, nil]; task = [NSTask launchedTaskWithLaunchPath:path arguments:args]; /* FIXME: remove this sleep */ sleep(1); } @end steptalk-0.10.0/Frameworks/StepTalk/STExterns.h0000644000175000000000000000333010132015552020346 0ustar gurkanroot/** STExterns.h Misc. variables Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @class NSString; @class STUndefinedObject; extern STUndefinedObject *STNil; /* exceptions */ extern NSString *STGenericException; /* can be ignored */ extern NSString *STInvalidArgumentException; extern NSString *STInternalInconsistencyException; /* not recoverable */ extern NSString *STScriptingException; extern NSString *STLibraryDirectory; extern NSString *STScriptExtension; extern NSString *STScriptsDirectory; extern NSString *STScriptingEnvironmentsDirectory; extern NSString *STScriptingEnvironmentExtension; extern NSString *STModulesDirectory; extern NSString *STModuleExtension; extern NSString *STLanguageBundlesDirectory; extern NSString *STLanguageBundleExtension; extern NSString *STLanguagesConfigFile; /* malloc zone */ extern NSZone *STMallocZone; steptalk-0.10.0/Frameworks/StepTalk/STExterns.m0000644000175000000000000000425710132015550020362 0ustar gurkanroot/** STExterns.m Misc. variables Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import NSString *STGenericException = @"STGenericException"; NSString *STInvalidArgumentException = @"STInvalidArgumentException"; NSString *STInternalInconsistencyException = @"STInternalInconsistencyException"; NSString *STRangeException = @"STRangeException"; NSString *STScriptingException = @"STScriptingException"; NSString *STCompilerSyntaxException = @"STCompilerSyntaxException"; NSString *STCompilerGenericException = @"STCompilerGenericException"; NSString *STCompilerInconsistencyException = @"STCompilerInconsistencyException"; NSString *STInterpreterGenericException = @"STInterpreterGenericException"; NSString *STInvalidBytecodeException = @"STInterpreterInvalidBytecodeException"; NSString *STInterpreterInconsistencyException = @"STInterpreterInconsistencyException"; NSString *STLibraryDirectory = @"StepTalk"; NSString *STScriptsDirectory = @"Scripts"; NSString *STModulesDirectory = @"Modules"; NSString *STModuleExtension = @"bundle"; NSString *STScriptingEnvironmentsDirectory = @"Environments"; NSString *STScriptingEnvironmentExtension = @"stenv"; NSString *STLanguageBundlesDirectory = @"Languages"; NSString *STLanguageBundleExtension = @"stlanguage"; NSString *STLanguagesConfigFile = @"Languages.plist"; steptalk-0.10.0/Frameworks/StepTalk/STMethod.h0000644000175000000000000000205710132015552020143 0ustar gurkanroot/** STMethod Copyright (c) 2003 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Aug 6 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @protocol STMethod - (NSString *)source; - (NSString *)methodName; - (NSString *)languageName; @end steptalk-0.10.0/Frameworks/StepTalk/STFileScript.h0000644000175000000000000000253110132015560020763 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STFileScript:STScript { NSString *fileName; NSString *localizedName; NSString *menuKey; NSString *description; } + scriptWithFile:(NSString *)file; - initWithFile:(NSString *)aFile; - (NSString *)fileName; - (NSString *)scriptName; - (NSString *)localizedName; - (NSString *)scriptDescription; - (NSComparisonResult)compareByLocalizedName:(STFileScript *)aScript; @end steptalk-0.10.0/Frameworks/StepTalk/STFileScript.m0000644000175000000000000001132010307121264020767 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STFileScript.h" #import "STLanguageManager.h" #import #import #import #import #import #import #import @interface NSDictionary(LocalizedKey) - (id)localizedObjectForKey:(NSString *)key; @end @implementation NSDictionary(LocalizedKey) - (id)localizedObjectForKey:(NSString *)key { NSEnumerator *enumerator; NSDictionary *dict; NSString *language; NSArray *languages; id obj = nil; languages = [NSUserDefaults userLanguages]; enumerator = [languages objectEnumerator]; while( (language = [enumerator nextObject]) ) { dict = [self objectForKey:language]; obj = [dict objectForKey:key]; if(obj) { return obj; } } return [(NSDictionary *)[self objectForKey:@"Default"] objectForKey:key]; } @end @implementation STFileScript + scriptWithFile:(NSString *)file { STFileScript *script; script = [[STFileScript alloc] initWithFile:file]; return AUTORELEASE(script); } /** Create a new script from file aFile>. Script information will be read from 'aFile.stinfo' file containing a dictionary property list. */ - initWithFile:(NSString *)aFile { STLanguageManager *langManager = [STLanguageManager defaultManager]; NSFileManager *manager = [NSFileManager defaultManager]; NSDictionary *info = nil; NSString *infoFile; NSString *lang; BOOL isDir; // infoFile = [aFile stringByDeletingPathExtension]; infoFile = [aFile stringByAppendingPathExtension: @"stinfo"]; if([manager fileExistsAtPath:infoFile isDirectory:&isDir] && !isDir ) { info = [NSDictionary dictionaryWithContentsOfFile:infoFile]; } self = [super init]; fileName = RETAIN(aFile); localizedName = [info localizedObjectForKey:@"Name"]; if(!localizedName) { localizedName = [[fileName lastPathComponent] stringByDeletingPathExtension]; } RETAIN(localizedName); menuKey = RETAIN([info localizedObjectForKey:@"MenuKey"]); description = RETAIN([info localizedObjectForKey:@"Description"]); lang = [info localizedObjectForKey:@"Language"]; if(!lang) { lang = [langManager languageForFileType:[fileName pathExtension]]; } if(!lang) { lang = @"Unknown"; } [self setLanguage:lang]; return self; } - (void)dealloc { RELEASE(fileName); RELEASE(localizedName); RELEASE(menuKey); RELEASE(description); [super dealloc]; } /** Return file name of the receiver. */ - (NSString *)fileName { return fileName; } /** Return menu item key equivalent for receiver. */ - (NSString *)menuKey { return menuKey; } /** Returns source string of the receiver script.*/ - (NSString *)source { /* FIXME if(!source) { source = [[NSString alloc] initWithContentsOfFile:fileName]; } */ return [[NSString alloc] initWithContentsOfFile:fileName]; } /** Returns a script name by which the script is identified */ - (NSString *)scriptName { return fileName; } /** Returns localized name of the receiver script. */ - (NSString *)localizedName { return localizedName; } /** Returns localized description of the script. */ - (NSString *)scriptDescription { return description; } /** Returns language of the script. */ - (NSString *)language { return language; } /** Compare scripts by localized name. */ - (NSComparisonResult)compareByLocalizedName:(STFileScript *)aScript { return [localizedName caseInsensitiveCompare:[aScript localizedName]]; } @end steptalk-0.10.0/Frameworks/StepTalk/STFunctions.h0000644000175000000000000000237210132015552020673 0ustar gurkanroot/** STFunctions.h Misc. functions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSString; @class NSArray; NSArray *STFindAllResources(NSString *resourceDir, NSString *extension); NSString *STFindResource(NSString *name, NSString *resourceDir, NSString *extension); NSString *STUserConfigPath(void); steptalk-0.10.0/Frameworks/StepTalk/STFunctions.m0000644000175000000000000000767110307120231020702 0ustar gurkanroot/** STFunctions.m Misc. functions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STFunctions.h" #import "STExterns.h" #import "STContext.h" #import #import #import #import #import #import @class STContext; NSString *STFindResource(NSString *name, NSString *resourceDir, NSString *extension) { NSFileManager *manager = [NSFileManager defaultManager]; NSArray *paths; NSEnumerator *enumerator; NSString *path; NSString *file; paths = NSStandardLibraryPaths(); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { file = [path stringByAppendingPathComponent:STLibraryDirectory]; file = [file stringByAppendingPathComponent:resourceDir]; file = [file stringByAppendingPathComponent:name]; if( [manager fileExistsAtPath:file] ) { return file; } file = [file stringByAppendingPathExtension:extension]; if( [manager fileExistsAtPath:file] ) { return file; } } return [[NSBundle bundleForClass:[STContext class]] pathForResource:name ofType:extension inDirectory:resourceDir]; } NSArray *STFindAllResources(NSString *resourceDir, NSString *extension) { NSFileManager *manager = [NSFileManager defaultManager]; NSDirectoryEnumerator *dirs; NSArray *paths; NSEnumerator *enumerator; NSString *path; NSString *file; NSMutableArray *resources = [NSMutableArray array]; paths = NSStandardLibraryPaths(); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:STLibraryDirectory]; path = [path stringByAppendingPathComponent:resourceDir]; if( ![manager fileExistsAtPath:path] ) { continue; } dirs = [manager enumeratorAtPath:path]; while( (file = [dirs nextObject]) ) { if( [[[dirs directoryAttributes] fileType] isEqualToString:NSFileTypeDirectory] && [[file pathExtension] isEqualToString:extension]) { file = [path stringByAppendingPathComponent:file]; [resources addObject:file]; } } } return [NSArray arrayWithArray:resources]; } NSString *STUserConfigPath(void) { NSString *path = nil; NSArray *paths; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); path = [paths objectAtIndex: 0]; path = [path stringByAppendingPathComponent:STLibraryDirectory]; path = [path stringByAppendingPathComponent:@"Configuration"]; return path; } steptalk-0.10.0/Frameworks/StepTalk/STLanguageManager.h0000644000175000000000000000202710307121377021745 0ustar gurkanroot#import @class NSArray; @class NSBundle; @class NSDictionary; @class NSMutableArray; @class NSMutableDictionary; @class STEngine; @interface STLanguageManager:NSObject { NSMutableArray *languages; NSMutableDictionary *engineClasses; NSMutableDictionary *languageInfos; NSMutableDictionary *languageBundles; NSMutableDictionary *fileTypes; } + (STLanguageManager *)defaultManager; - (NSArray *)availableLanguages; - (NSString *)defaultLanguage; - (void)registerLanguagesFromBundle:(NSBundle *)bundle; - (void)registerLanguage:(NSString *)language engineClass:(Class)class info:(NSDictionary *)info; - (void)removeLanguage:(NSString *)language; - (Class)engineClassForLanguage:(NSString *)language; - (STEngine *)createEngineForLanguage:(NSString *)language; - (NSDictionary *)infoForLanguage:(NSString *)language; - (NSString *)languageForFileType:(NSString *)fileType; - (NSArray *)knownFileTypes; - (NSBundle *)bundleForLanguage:(NSString *)language; @end steptalk-0.10.0/Frameworks/StepTalk/STLanguageManager.m0000644000175000000000000002313010307121452021742 0ustar gurkanroot#import "STLanguageManager.h" #import "STExterns.h" #import #import #import #import #import #import #import #import #import static STLanguageManager *defaultManager = nil; @interface STLanguageManager(StepTalkPrivate) - (void) _registerKnownLanguages; - (void) _registerLanguagesFromPath:(NSString *)path; - (void) _updateFileTypes; @end @implementation STLanguageManager + (STLanguageManager *)defaultManager { if(!defaultManager) { defaultManager = [[STLanguageManager alloc] init]; } return defaultManager; } - init { self = [super init]; languages = [[NSMutableArray alloc] init]; engineClasses = [[NSMutableDictionary alloc] init]; languageInfos = [[NSMutableDictionary alloc] init]; languageBundles = [[NSMutableDictionary alloc] init]; fileTypes = [[NSMutableDictionary alloc] init]; [self _registerKnownLanguages]; return self; } - (void)dealloc { RELEASE(languages); RELEASE(engineClasses); RELEASE(languageInfos); RELEASE(languageBundles); RELEASE(fileTypes); [self dealloc]; } - (void) _registerKnownLanguages { NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSBundle *bundle; NSString *path; NSArray *paths; BOOL isDir; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); enumerator = [paths objectEnumerator]; /* find languages at knowl loactions */ while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:@"StepTalk"]; path = [path stringByAppendingPathComponent:STLanguageBundlesDirectory]; if([manager fileExistsAtPath:path isDirectory:&isDir] && isDir) { [self _registerLanguagesFromPath:path]; } } /* find languages at known loactions */ enumerator = [[NSBundle allBundles] objectEnumerator]; while( (bundle = [enumerator nextObject]) ) { [self registerLanguagesFromBundle:bundle]; } } - (void)_registerLanguagesFromPath:(NSString *)path { NSDirectoryEnumerator *enumerator; NSString *file; NSBundle *bundle; NSDebugLLog(@"STLanguageManager", @"Looking in path %@", path); enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path]; while( (file = [enumerator nextObject]) ) { if([[file pathExtension] isEqualToString:STLanguageBundleExtension]) { file = [path stringByAppendingPathComponent:file]; bundle = [NSBundle bundleWithPath:file]; [self registerLanguagesFromBundle:bundle]; } } } - (void)registerLanguage:(NSString *)language engineClass:(Class)class info:(NSDictionary *)info { if([languages containsObject:language]) { [NSException raise:@"StepTalkException" format:@"Language '%@' already registered", language]; return; } if(!language || [language isEqualToString:@""]) { [NSException raise:@"StepTalkException" format:@"No language specified for registration of class '%@'", [class className]]; return; } if(!class) { [NSException raise:@"StepTalkException" format:@"Unable to regirster language %@. No class specified.", language]; return; } [languages addObject:language]; [engineClasses setObject:class forKey:language]; [languageBundles setObject:[NSBundle bundleForClass:class] forKey:language]; [languageInfos setObject:info forKey:language]; [self _updateFileTypes]; } - (void)registerLanguagesFromBundle:(NSBundle *)bundle { NSDictionary *info; NSDictionary *langDict; NSEnumerator *enumerator; NSString *language; int foundLanguages = 0; /* StepTalkLanguages = { Smalltalk = { EngineClass = SmalltalkEngine} }; */ NSDebugLLog(@"STLanguageManager", @"Registering languages from bundle %@", [bundle bundlePath]); info = [bundle infoDictionary]; langDict = [info objectForKey:@"StepTalkLanguages"]; enumerator = [langDict keyEnumerator]; while( (language = [enumerator nextObject]) ) { info = [langDict objectForKey:language]; if([languages containsObject:language]) { /* FIXME: issue this warning NSLog(@"Warning: Language %@ already registered in bundle at path %@", language, [[languageBundles objectForKey:language] bundlePath]); */ continue; } NSDebugLLog(@"STLanguageManager", @"Found language %@", language); [languages addObject:language]; [languageInfos setObject:info forKey:language]; [languageBundles setObject:bundle forKey:language]; foundLanguages = foundLanguages + 1; } if(foundLanguages == 0) { NSDebugLLog(@"STLanguageManager", @"No languages found in bundle %@", [bundle bundlePath]); } [self _updateFileTypes]; } - (void)_updateFileTypes { NSEnumerator *languageEnumerator; NSEnumerator *fileEnumerator; NSDictionary *info; NSString *language; NSString *type; [fileTypes removeAllObjects]; languageEnumerator = [languages objectEnumerator]; while( (language = [languageEnumerator nextObject]) ) { info = [languageInfos objectForKey:language]; fileEnumerator = [[info objectForKey:@"FileTypes"] objectEnumerator]; while( (type = [fileEnumerator nextObject]) ) { [fileTypes setObject:language forKey:type]; } } } - (NSArray *)availableLanguages { return [NSArray arrayWithArray:languages]; } /** Returns the name of default scripting language specified by the STDefaultLanguage default. If there is no such default in user's defaults database, then Smalltalk is used. */ - (NSString *)defaultLanguage { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSString *name= [defs objectForKey:@"STDefaultLanguage"]; if(!name) { return @"Smalltalk"; } else { return name; } } - (NSArray *)knownFileTypes { return [fileTypes allKeys]; } - (void)removeLanguage:(NSString *)language { [engineClasses removeObjectForKey:language]; [languageInfos removeObjectForKey:language]; [languageBundles removeObjectForKey:language]; [languages removeObject:language]; [self _updateFileTypes]; } /** Return an engine class for specified language. The class lookup is as follows:
  • internal class dictionary by language name
  • all loaded classes by class name in the language info dictionary
  • in the language bundle
  • in the language bundle as language_nameEngine
*/ - (Class)engineClassForLanguage:(NSString *)language { NSString *className; NSBundle *bundle; Class class; NSDebugLLog(@"STLanguageManager", @"Engine class for language %@ requested", language); class = [engineClasses objectForKey:language]; /* If there is no class, load bundle first and try again */ if(!class) { className = [(NSDictionary *)[languageInfos objectForKey:language] objectForKey:@"EngineClass"]; NSDebugLLog(@"STLanguageManager", @"No known class, looking for class named %@", className); class = NSClassFromString(className); if(class) { return class; } /* there is no such class, so try to load class the containing bundle */ bundle = [languageBundles objectForKey:language]; NSDebugLLog(@"STLanguageManager", @"Looking in bundle %@", [bundle bundlePath]); if(!bundle) { [NSException raise:@"StepTalkException" format:@"Unable to find engine class for language '%@': No bundle.", language]; return nil; } class = [bundle classNamed:className]; if(!class) { className = [language stringByAppendingString:@"Engine"]; class = [bundle classNamed:className]; if(!class) { [NSException raise:@"StepTalkException" format:@"Unable to find engine class '%@' for language '%@' in bundle %@.", className, [bundle bundlePath], language]; return nil; } } } NSDebugLLog(@"STLanguageManager", @"Got engine class %@'", [class className]); return class; } - (STEngine *)createEngineForLanguage:(NSString *)language { Class engineClass; engineClass = [self engineClassForLanguage:language]; return AUTORELEASE([[engineClass alloc] init]); } - (NSDictionary *)infoForLanguage:(NSString *)language { return [languageInfos objectForKey:language]; } - (NSBundle *)bundleForLanguage:(NSString *)language { return [languageBundles objectForKey:language]; } - (NSString *)languageForFileType:(NSString *)type { return [fileTypes objectForKey:type]; } @end steptalk-0.10.0/Frameworks/StepTalk/STMethod.m0000644000175000000000000000172210132015552020146 0ustar gurkanroot/** STMethod Copyright (c) 2003 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Aug 6 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STMethod.h" /* Nothig here */ steptalk-0.10.0/Frameworks/StepTalk/STObjCRuntime.h0000644000175000000000000000331510166607724021121 0ustar gurkanroot/** STObjCRuntime.m Objective C runtime additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSMutableDictionary; @class NSString; @class NSValue; @class NSMethodSignature; @class NSDictionary; @class NSArray; extern NSMutableDictionary *STAllObjectiveCClasses(void); extern NSMutableDictionary *STGetFoundationConstants(void); extern NSDictionary *STClassDictionaryWithNames(NSArray *classNames); extern NSArray *STAllObjectiveCSelectors(void); extern NSValue *STValueFromSelector(SEL sel); extern SEL STSelectorFromValue(NSValue *val); extern SEL STSelectorFromString(NSString *aString); extern NSMethodSignature *STConstructMethodSignatureForSelector(SEL sel); /* Deprecated - remove */ extern NSMethodSignature *STMethodSignatureForSelector(SEL sel); steptalk-0.10.0/Frameworks/StepTalk/STObjCRuntime.m0000644000175000000000000001735010166607724021132 0ustar gurkanroot/** STObjCRuntime.m Objective C runtime additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STObjCRuntime.h" #import "STExterns.h" #import #import #import #import #import #import #import #import #define SELECTOR_TYPES_COUNT 10 /* Predefined default selector types up to 10 arguments for fast creation. It should be faster than manually constructing the string. */ static const char *selector_types[] = { "@8@0:4", "@12@0:4@8", "@16@0:4@8@12", "@20@0:4@8@12@16", "@24@0:4@8@12@16@20", "@28@0:4@8@12@16@20@24" "@32@0:4@8@12@16@20@24@28" "@36@0:4@8@12@16@20@24@28@32" "@40@0:4@8@12@16@20@24@28@32@36" "@44@0:4@8@12@16@20@24@28@32@36@40" }; NSMutableDictionary *STAllObjectiveCClasses(void) { NSString *name; NSMutableDictionary *dict; void *state = 0; Class class; dict = [NSMutableDictionary dictionary]; while( (class = objc_next_class(&state)) ) { name = [NSString stringWithCString:class_get_class_name(class)]; [dict setObject:class forKey:name]; } // NSLog(@"%i Objective-C classes found",[dict count]); return dict; } NSDictionary *STClassDictionaryWithNames(NSArray *classNames) { NSEnumerator *enumerator = [classNames objectEnumerator]; NSString *className; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class class; while( (className = [enumerator nextObject]) ) { class = NSClassFromString(className); if(class) { [dict setObject:NSClassFromString(className) forKey:className]; } else { NSLog(@"Warning: Class with name '%@' not found", className); } } return [NSDictionary dictionaryWithDictionary:dict]; } NSValue *STValueFromSelector(SEL sel) { return [NSValue value:&sel withObjCType:@encode(SEL)]; } SEL STSelectorFromValue(NSValue *val) { SEL sel; [val getValue:&sel]; return sel; } SEL STSelectorFromString(NSString *aString) { const char *name = [aString cString]; const char *ptr; int argc = 0; SEL sel; sel = NSSelectorFromString(aString); if(!sel) { ptr = name; while(*ptr) { if(*ptr == ':') { argc ++; } ptr++; } if( argc < SELECTOR_TYPES_COUNT ) { NSDebugLLog(@"STSending", @"registering selector '%s' " @"with %i arguments, types:'%s'", name,argc,selector_types[argc]); sel = sel_register_typed_name(name, selector_types[argc]); } if(!sel) { [NSException raise:STInternalInconsistencyException format:@"Unable to register selector '%@'", aString]; return 0; } } else { /* FIXME: temporary hack */ } return sel; } SEL STCreateTypedSelector(SEL sel) { const char *name = sel_get_name(sel); const char *ptr; int argc = 0; SEL newSel; NSLog(@"STCreateTypedSelector is deprecated."); ptr = name; while(*ptr) { if(*ptr == ':') { argc ++; } ptr++; } if( argc < SELECTOR_TYPES_COUNT ) { NSDebugLLog(@"STSending", @"registering selector '%s' " @"with %i arguments, types:'%s'", name,argc,selector_types[argc]); newSel = sel_register_typed_name(name, selector_types[argc]); } if(!newSel) { [NSException raise:STInternalInconsistencyException format:@"Unable to register typed selector '%s'", name]; return 0; } return newSel; } NSMethodSignature *STConstructMethodSignatureForSelector(SEL sel) { const char *name = sel_get_name(sel); const char *ptr; const char *types = (const char *)0; int argc = 0; ptr = name; while(*ptr) { if(*ptr == ':') { argc ++; } ptr++; } if( argc < SELECTOR_TYPES_COUNT ) { NSDebugLLog(@"STSending", @"registering selector '%s' " @"with %i arguments, types:'%s'", name,argc,selector_types[argc]); types = selector_types[argc]; } if(!types) { [NSException raise:STInternalInconsistencyException format:@"Unable to construct types for selector '%s'", name]; return 0; } return [NSMethodSignature signatureWithObjCTypes:types]; } NSMethodSignature *STMethodSignatureForSelector(SEL sel) { const char *types; NSLog(@"STMethodSignatureForSelector is deprecated."); types = sel_get_type(sel); if(!types) { sel = STCreateTypedSelector(sel); types = sel_get_type(sel); } return [NSMethodSignature signatureWithObjCTypes:types]; } static NSArray *selectors_from_list(struct objc_method_list *methods) { NSMutableArray *array = [NSMutableArray array]; int count = methods->method_count; int i; for(i=0;imethod_list[i].method_name)]; } if(methods->method_next) { [array addObjectsFromArray:selectors_from_list(methods->method_next)]; } return array; } NSArray *STAllObjectiveCSelectors(void) { NSMutableArray *array; NSArray *methods; Class class; void *state = 0; array = [[NSMutableArray alloc] init]; while( (class = objc_next_class(&state)) ) { if(class->methods) { methods = selectors_from_list(class->methods); [array addObjectsFromArray:methods]; } class = class->class_pointer; if(class->methods) { methods = selectors_from_list(class->methods); [array addObjectsFromArray:methods]; } } /* get rid of duplicates */ array = (NSMutableArray *)[[NSSet setWithArray:(NSArray *)array] allObjects]; array = (NSMutableArray *)[array sortedArrayUsingSelector:@selector(compare:)]; return array; } steptalk-0.10.0/Frameworks/StepTalk/STObjectReference.h0000644000175000000000000000242110132015552021743 0ustar gurkanroot/** STObjectReference.h Reference to object in NSDictionary. Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSString; @interface STObjectReference:NSObject { NSString *identifier; id target; } - initWithIdentifier:(NSString *)ident target:(id)anObject; - (void)setObject:anObject; - (id)object; - (NSString *)identifier; - (id) target; @end steptalk-0.10.0/Frameworks/StepTalk/STObjectReference.m0000644000175000000000000000343410132015550021753 0ustar gurkanroot/** STObjectReference.m Reference to object in NSDictionary. Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STObjectReference.h" #import "STExterns.h" #import #import #import #import @implementation STObjectReference - initWithIdentifier:(NSString *)ident target:(id)anObject; { self = [super init]; identifier = [ident copy]; target = RETAIN(anObject); return self; } - (void)dealloc { RELEASE(identifier); RELEASE(target); [super dealloc]; } - (NSString *)identifier { return identifier; } - (id) target { return target; } - (void)setObject:anObject { if(!anObject) { anObject = STNil; } [(NSMutableDictionary *)target setObject:anObject forKey:identifier]; } - object { return [(NSDictionary *)target objectForKey:identifier]; } @end steptalk-0.10.0/Frameworks/StepTalk/STRemoteConversation.h0000644000175000000000000000305310307114774022560 0ustar gurkanroot/** STRemoteConversation Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Sep 21 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STConversation.h" #import @class NSConnection; @protocol STEnvironmentProcess - (STConversation *)createConversation; @end @interface STRemoteConversation:STConversation { NSConnection *connection; NSString *environmentName; NSString *hostName; NSDistantObject *proxy; NSDistantObject *environmentProcess; } - initWithEnvironmentName:(NSString *)envName host:(NSString *)host language:(NSString *)langName; - (void)open; - (void)close; @end steptalk-0.10.0/Frameworks/StepTalk/STRemoteConversation.m0000644000175000000000000000646310307121665022572 0ustar gurkanroot/* FIXME: not used! just an unimplemented idea. */ #import "STRemoteConversation.h" #import #import #import #import #import "STEnvironment.h" @implementation STRemoteConversation - initWithEnvironmentName:(NSString *)envName host:(NSString *)host language:(NSString *)langName { self = [super init]; if(!envName) { [NSException raise:@"STConversationException" format:@"Unspecified environment name for a distant conversation"]; [self dealloc]; return nil; } environmentName = RETAIN(envName); hostName = RETAIN(host); [self open]; return self; } - (void)open { NSString *envProcName; if(connection) { [NSException raise:@"STConversationException" format:@"Unable to open conversation: already opened."]; return; } envProcName = [NSString stringWithFormat:@"STEnvironment:%@", environmentName]; connection = [NSConnection connectionWithRegisteredName:envProcName host:hostName]; RETAIN(connection); if(!connection) { [NSException raise:@"STConversationException" format:@"Connection failed for environment '%@'", environmentName]; return; } environmentProcess = RETAIN([connection rootProxy]); proxy = RETAIN([environmentProcess createConversation]); [proxy setProtocolForProxy:@protocol(STConversation)]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(connectionDidDie:) name: NSConnectionDidDieNotification object: connection]; } - (void)close { [[NSNotificationCenter defaultCenter] removeObserver:self]; RELEASE(proxy); proxy = nil; RELEASE(environmentProcess); environmentProcess = nil; [connection invalidate]; RELEASE(connection); connection = nil; return; } - (void)dealloc { /* After this we should not have any connection, environmentProcess nor proxy */ [self close]; RELEASE(environmentName); RELEASE(hostName); [super dealloc]; } - (void)setLanguage:(NSString *)newLanguage { [proxy setLanguage:newLanguage]; } /** Return name of the language used in the receiver conversation */ - (NSString *)language { return [proxy language]; } - (STEnvironment *)environment { /* FIXME: return local description */ return nil; } - (void)interpretScript:(NSString *)aString { [proxy interpretScript:aString]; } - (id)result { return [proxy result]; } - (bycopy id)resultByCopy { return [proxy resultByCopy]; } - (void)connectionDidDie:(NSNotification *)notification { [[NSNotificationCenter defaultCenter] removeObserver:self]; if(proxy) { NSLog(@"Connection did die for %@ (%@)", self, environmentName); } else { NSLog(@"Closing conversation (%@) with %@", self, environmentName); } proxy = nil; environmentProcess = nil; RELEASE(connection); connection = nil; } @end steptalk-0.10.0/Frameworks/StepTalk/STScript.h0000644000175000000000000000243710132015552020171 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STScript:NSObject { NSString *source; NSString *language; } + scriptWithSource:(NSString *)aString language:(NSString *)lang; - initWithSource:(NSString *)aString language:(NSString *)lang; - (NSString *)source; - (void)setSource:(NSString *)aString; - (NSString *)language; - (void)setLanguage:(NSString *)name; @end steptalk-0.10.0/Frameworks/StepTalk/STScript.m0000644000175000000000000000315610305156435020205 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STScript.h" #import @implementation STScript + scriptWithSource:(NSString *)aString language:(NSString *)lang { return AUTORELEASE([[self alloc] initWithSource:aString language:lang]); } - initWithSource:(NSString *)aString language:(NSString *)lang { self = [super init]; language = RETAIN(lang); source = RETAIN(aString); return self; } - (NSString *)source { return source; } - (void)setSource:(NSString *)aString { ASSIGN(source,aString); } /** Returns language of the script. */ - (NSString *)language { return language; } /** Set language of the script. */ - (void)setLanguage:(NSString *)name { ASSIGN(language,name); } @end steptalk-0.10.0/Frameworks/StepTalk/STScriptObject.h0000644000175000000000000000167110132015552021317 0ustar gurkanroot/* 2003 Aug 5 */ #import #import "STMethod.h" @class NSMutableDictionary; @class NSDictionary; @class NSArray; @class STEnvironment; @protocol STScriptObject - (NSArray *)instanceVariableNames; @end @interface STScriptObject:NSObject { NSMutableDictionary *ivars; NSMutableDictionary *methodDictionary; STEnvironment *environment; } + scriptObject; - initWithInstanceVariableNames:(NSString *)names; - (void)setEnvironment:(STEnvironment *)env; - (STEnvironment *)environment; - (void)setObject:(id)anObject forVariable:(NSString *)aName; - (id)objectForVariable:(NSString *)aName; - (NSArray *)instanceVariableNames; - (void)addMethod:(id )aMethod; - (id )methodWithName:(NSString *)aName; - (void)removeMethod:(id )aMethod; - (void)removeMethodWithName:(NSString *)aName; - (NSArray *)methodNames; - (NSDictionary *)methodDictionary; @end steptalk-0.10.0/Frameworks/StepTalk/STScriptObject.m0000644000175000000000000001005310307121622021316 0ustar gurkanroot/* 2003 Aug 5 */ #import "STScriptObject.h" #import "NSInvocation+additions.h" #import "STEnvironment.h" #import "STEngine.h" #import "STExterns.h" #import "STObjCRuntime.h" #import #import #import #import #import #import @implementation STScriptObject /** Return new instance of script object without any instance variables */ + scriptObject { return AUTORELEASE([[self alloc] init]); } - init { self = [super init]; methodDictionary = [[NSMutableDictionary alloc] init]; return self; } - initWithInstanceVariableNames:(NSString *)names { return [self init]; } - (void)dealloc { RELEASE(methodDictionary); RELEASE(ivars); [super dealloc]; } - (void)setObject:(id)anObject forVariable:(NSString *)aName { [self notImplemented:_cmd]; } - (id)objectForVariable:(NSString *)aName { [self notImplemented:_cmd]; return nil; } - (NSArray *)instanceVariableNames { return [ivars allKeys]; } - (void)addMethod:(id )aMethod { [methodDictionary setObject:aMethod forKey:[aMethod methodName]]; } - (id )methodWithName:(NSString *)aName { return [methodDictionary objectForKey:aName]; } - (void)removeMethod:(id )aMethod { [self notImplemented:_cmd]; } - (void)removeMethodWithName:(NSString *)aName { [methodDictionary removeObjectForKey:aName]; } - (NSArray *)methodNames { return [methodDictionary allKeys]; } - (NSDictionary *)methodDictionary { return [NSDictionary dictionaryWithDictionary:methodDictionary]; } /** Set object's environment. Note: This method should be replaced by some other, more clever mechanism. */ - (void)setEnvironment:(STEnvironment *)env { ASSIGN(environment, env); } - (STEnvironment *)environment { return environment; } - (BOOL)respondsToSelector:(SEL)aSelector { if( [super respondsToSelector:(SEL)aSelector] ) { return YES; } return ([methodDictionary objectForKey:NSStringFromSelector(aSelector)] != nil); } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { NSMethodSignature *signature = nil; signature = [super methodSignatureForSelector:sel]; if(!signature) { signature = STConstructMethodSignatureForSelector(sel); } return signature; } - (void) forwardInvocation:(NSInvocation *)invocation { STEngine *engine; id method; NSString *methodName = NSStringFromSelector([invocation selector]); NSMutableArray *args; id arg; int index; int count; id retval = nil; method = [methodDictionary objectForKey:methodName]; if(!method) { [NSException raise:@"STScriptObjectException" format:@"No script object method with name '%@'", methodName]; return; } engine = [STEngine engineForLanguage:[method languageName]]; /* Get arguments as array */ count = [[invocation methodSignature] numberOfArguments]; args = [NSMutableArray array]; for(index = 2; index < count; index++) { arg = [invocation getArgumentAsObjectAtIndex:index]; if (arg == nil) { [args addObject:STNil]; } else { [args addObject:arg]; } } retval = [engine executeMethod:method forReceiver:self withArguments:args inContext:environment]; [invocation setReturnValue:&retval]; } - (void)encodeWithCoder:(NSCoder *)coder { // [super encodeWithCoder: coder]; [coder encodeObject:methodDictionary]; [coder encodeObject:ivars]; } - initWithCoder:(NSCoder *)decoder { self = [super init]; //[super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &methodDictionary]; [decoder decodeValueOfObjCType: @encode(id) at: &ivars]; return self; } @end steptalk-0.10.0/Frameworks/StepTalk/STScripting.h0000644000175000000000000000233410132015552020663 0ustar gurkanroot/** STScripting.h Scripting protocol Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STEnvironment; @protocol STScripting - (BOOL)isClass; + (BOOL)isClass; - (NSString *)className; + (NSString *)className; - (Class) classForScripting; + (Class) classForScripting; @end @interface NSObject (STScripting) @end steptalk-0.10.0/Frameworks/StepTalk/STScripting.m0000644000175000000000000000305410132015550020666 0ustar gurkanroot/** STScripting.m Scripting protocol Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA STScripting protocol documentation */ #import "STScripting.h" @implementation NSObject (STScripting) /* - (id)replacementForScriptingInEnvironment:(STEnvironment *)env { return self; } */ - (BOOL)isClass { return NO; } + (BOOL)isClass { return YES; } + (NSString *)className { return NSStringFromClass(self); } - (NSString *)className { return [[self class] className]; } /*Subclasses should override this method to force use of another class */ - (Class) classForScripting { return [self class]; } + (Class) classForScripting { return [self class]; } @end steptalk-0.10.0/Frameworks/StepTalk/STScriptingServer.h0000644000175000000000000000047010132015560022050 0ustar gurkanroot/* FIXME: not used! just an unimplemented idea. (See NSDistant*) */ @interface STScriptingServer { } + serverWithRegisteredName:(NSString *)name host:(NSString *)host; - registerLocallyWithName:(NSString *)name; - createConversation; - conversationWithInfo:(NSDictionary*)dict; @end steptalk-0.10.0/Frameworks/StepTalk/STScriptingServer.m0000644000175000000000000000171010132015560022053 0ustar gurkanroot/* FIXME: not used! just an unimplemented idea. (See NSDistant*) */ @implementation STScriptingServer { } + serverWithRegisteredName:(NSString *)name host:(NSString *)host { return [STDistantScriptingServer serverWithRegisteredName:name host:host]; } - registerLocallyWithName:(NSString *)name { NSLog(@"Not implemented: registerLocallyWithName"); } - createConversation; - conversationWithInfo:(NSDictionary*)dict; @end @implementation STLocalScriptingServer { } + serverWithRegisteredName:(NSString *)name host:(NSString *)host; - registerLocallyWithName:(NSString *)name; - createConversation; - conversationWithInfo:(NSDictionary*)dict; @end @implementation STDistantScriptingServer { } + serverWithRegisteredName:(NSString *)name host:(NSString *)host; - registerLocallyWithName:(NSString *)name; - createConversation; - conversationWithInfo:(NSDictionary*)dict; @end steptalk-0.10.0/Frameworks/StepTalk/STScriptsManager.h0000644000175000000000000000265710132015552021653 0ustar gurkanroot/** STScriptsManager Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSArray; @class STFileScript; @interface STScriptsManager:NSObject { NSString *scriptsDomainName; NSArray *scriptSearchPaths; } + defaultManager; - initWithDomainName:(NSString *)name; - (NSString *)scriptsDomainName; - (void)setScriptSearchPathsToDefaults; - (NSArray *)scriptSearchPaths; - (void)setScriptSearchPaths:(NSArray *)anArray; - (NSArray *)validScriptSearchPaths; - (STFileScript *)scriptWithName:(NSString*)aString; - (NSArray *)allScripts; @end steptalk-0.10.0/Frameworks/StepTalk/STScriptsManager.m0000644000175000000000000002034710305156524021663 0ustar gurkanroot/** STScriptsManager Copyright (c)2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STScriptsManager.h" #import "STExterns.h" #import "STLanguageManager.h" #import "STFileScript.h" #import #import #import #import #import #import #import #import #import #import #import static STScriptsManager *sharedScriptsManager = nil; @interface STScriptsManager (STPriavteMethods) - (NSArray *)_scriptsAtPath:(NSString *)path; @end @implementation STScriptsManager /** Return default domain name for scripts. Usually this is application or process name.*/ + (NSString *)defaultScriptsDomainName { return [[NSProcessInfo processInfo] processName]; } /** Returns default scripts manager for current process (application or tool). */ + defaultManager { if(!sharedScriptsManager) { sharedScriptsManager = [[STScriptsManager alloc] init]; } return sharedScriptsManager; } - init { return [self initWithDomainName:nil]; } /** Initializes the receiver to be used with domain named name. If name is nil, default scripts domain name will be used. */ - initWithDomainName:(NSString *)name { self = [super init]; if(!name) { name = [STScriptsManager defaultScriptsDomainName]; } scriptsDomainName = RETAIN(name); return self; } - (void)dealloc { RELEASE(scriptsDomainName); [super dealloc]; } /** Return name of script manager domain. */ - (NSString *)scriptsDomainName { return scriptsDomainName; } /* Sets script search paths to defaults. Default paths are (in this order): /StepTalk/Scripts/. /StepTalk/Scripts/Shared and paths to Resource/Scripts in all loaded bundles including the main bundle.*/ - (void)setScriptSearchPathsToDefaults { NSMutableArray *scriptPaths = [NSMutableArray array]; NSEnumerator *enumerator; NSString *path; NSString *str; NSArray *paths; NSBundle *bundle; paths = NSStandardLibraryPaths(); enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:STLibraryDirectory]; path = [path stringByAppendingPathComponent:@"Scripts"]; str = [path stringByAppendingPathComponent: scriptsDomainName]; [scriptPaths addObject:str]; str = [path stringByAppendingPathComponent:@"Shared"]; [scriptPaths addObject:str]; } /* Add same, but without StepTalk (only Library/Scripts) */ enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { path = [path stringByAppendingPathComponent:@"Scripts"]; str = [path stringByAppendingPathComponent: scriptsDomainName]; [scriptPaths addObject:str]; str = [path stringByAppendingPathComponent:@"Shared"]; [scriptPaths addObject:str]; } enumerator = [[NSBundle allBundles] objectEnumerator]; while( (bundle = [enumerator nextObject]) ) { path = [bundle resourcePath]; path = [path stringByAppendingPathComponent:@"Scripts"]; [scriptPaths addObject:path]; } RELEASE(scriptSearchPaths); scriptSearchPaths = [[NSArray alloc] initWithArray:scriptPaths]; } /** Retrun an array of script search paths. Scripts are searched in Library/StepTalk/Scripts/scriptsDomainName, Library/StepTalk/Scripts/Shared and in all loaded bundles in bundlePath/Resources/Scripts. */ - (NSArray *)scriptSearchPaths { if(!scriptSearchPaths) { [self setScriptSearchPathsToDefaults]; } return scriptSearchPaths; } /** Set script search paths to anArray. */ - (void)setScriptSearchPaths:(NSArray *)anArray { ASSIGN(scriptSearchPaths, anArray); } /** Return script search paths that are valid. That means that path exists and is a directory. */ - (NSArray *)validScriptSearchPaths { NSMutableArray *scriptPaths = [NSMutableArray array]; NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSString *path; NSArray *paths; BOOL isDir; paths = [self scriptSearchPaths]; enumerator = [paths objectEnumerator]; while( (path = [enumerator nextObject]) ) { if( [manager fileExistsAtPath:path isDirectory:&isDir] && isDir ) { // NSLog(@"VARLIOD %@", path); [scriptPaths addObject:path]; } } return [NSArray arrayWithArray:scriptPaths]; } /** Get a script with name aString for current scripting domain. */ - (STFileScript *)scriptWithName:(NSString*)aString { NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *pEnumerator; NSEnumerator *sEnumerator; NSString *path; NSString *file; NSString *str; NSArray *paths; paths = [self validScriptSearchPaths]; pEnumerator = [paths objectEnumerator]; while( (path = [pEnumerator nextObject]) ) { // NSLog(@"IN %@", path); sEnumerator = [[manager directoryContentsAtPath:path] objectEnumerator]; while( (file = [sEnumerator nextObject]) ) { if( ! [[file pathExtension] isEqualToString:@"stinfo"] ) { NSDebugLLog(@"STScriptManager", @"Script %@", file); str = [file lastPathComponent]; str = [str stringByDeletingPathExtension]; if([str isEqualToString:aString]) { return [STFileScript scriptWithFile: [path stringByAppendingPathComponent:file]]; } } } } return nil; } - (NSArray *)_scriptsAtPath:(NSString *)path { STLanguageManager *langManager = [STLanguageManager defaultManager]; NSMutableArray *scripts = [NSMutableArray array]; NSFileManager *manager = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSString *file; NSString *ext; NSSet *types; types = [NSSet setWithArray:[langManager knownFileTypes]]; enumerator = [[manager directoryContentsAtPath:path] objectEnumerator]; while( (file = [enumerator nextObject]) ) { ext = [file pathExtension]; if( [types containsObject:ext] ) { STFileScript *script; NSLog(@"Found script %@", file); script = [STFileScript scriptWithFile: [path stringByAppendingPathComponent:file]]; [scripts addObject:script]; } } return [NSArray arrayWithArray:scripts]; } /** Return list of all scripts for managed domain. */ - (NSArray *)allScripts { NSMutableArray *scripts = [NSMutableArray array]; NSEnumerator *enumerator; NSString *path; enumerator = [[self validScriptSearchPaths] objectEnumerator]; while( (path = [enumerator nextObject]) ) { [scripts addObjectsFromArray:[self _scriptsAtPath:path]]; } return [NSArray arrayWithArray:scripts]; } @end steptalk-0.10.0/Frameworks/StepTalk/STSelector.h0000644000175000000000000000223410132015552020500 0ustar gurkanroot/* STSelector Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Feb 4 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STSelector:NSObject { NSString *selectorName; SEL sel; } - initWithName:(NSString *)aString; - initWithSelector:(SEL)aSel; - (SEL)selectorValue; - (NSString *)selectorName; @end steptalk-0.10.0/Frameworks/StepTalk/STSelector.m0000644000175000000000000000377310132015550020514 0ustar gurkanroot/* STSelector Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Feb 4 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STSelector.h" #import "STObjCRuntime.h" #import #import @implementation STSelector - initWithName:(NSString *)aString { [super init]; selectorName = RETAIN(aString); return self; } - initWithSelector:(SEL)aSel { [super init]; sel = aSel; return self; } - (void)dealloc { RELEASE(selectorName); [super dealloc]; } - (SEL)selectorValue { if(sel == 0) { sel = STSelectorFromString(selectorName); } return sel; } - (NSString *)description { return [NSString stringWithFormat:@"#%@", [self selectorName]]; } - (NSString *)selectorName { if(!selectorName) { selectorName = RETAIN(NSStringFromSelector(sel)); } return selectorName; } - (void)encodeWithCoder:(NSCoder *)coder { // [super encodeWithCoder: coder]; [coder encodeObject:selectorName]; } - initWithCoder:(NSCoder *)decoder { self = [super init]; // super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &selectorName]; return self; } @end steptalk-0.10.0/Frameworks/StepTalk/STStepTalkManager.h0000644000175000000000000000007310300727225021745 0ustar gurkanroot@interface STStepTalkManager - createLocalEnvironment @end steptalk-0.10.0/Frameworks/StepTalk/STStructure.h0000644000175000000000000000442510132015552020724 0ustar gurkanroot/** STStructure.h C structure wrapper Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import // @class STRange; // @class STPoint; // @class STRect; @class NSString; @class NSMutableArray; @interface STStructure:NSObject { NSString *structType; NSString *name; NSMutableArray *fields; } + structureWithValue:(void *)value type:(const char*)type; + structureWithRange:(NSRange)range; + structureWithPoint:(NSPoint)point; + structureWithRect:(NSRect)rect; + structureWithSize:(NSSize)size; - initWithValue:(void *)value type:(const char*)type; - (const char *)type; - (NSString *)structureName; - (void)getValue:(void *)value; - (NSRange)rangeValue; - (NSPoint)pointValue; - (NSRect)rectValue; - (NSSize)sizeValue; - valueAtIndex:(unsigned)index; - (void)setValue:anObject atIndex:(unsigned)index; - (int)intValueAtIndex:(unsigned)index; - (float)floatValueAtIndex:(unsigned)index; @end /* @interface STRange:STStructure - rangeWithLocation:(int)loc length:(int)length; - (int)location; - (int)length; @end @interface STPoint:STStructure - pointWithX:(float)x y:(float)y; - (float)x; - (float)y; @end @interface STRect:STStructure - rectWithX:(float)x y:(float)y width:(float)w heigth:(float)h; - rectWithOrigin:(NSPoint)origin size:(NSPoint)size; - (float)x; - (float)y; - (float)width; - (float)height; - (NSPoint)origin; - (NSPoint)size; @end */ steptalk-0.10.0/Frameworks/StepTalk/STStructure.m0000644000175000000000000001542410132015550020730 0ustar gurkanroot/** STStructure.m C structure wrapper Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STStructure.h" #import "STExterns.h" #import #import #import #import #import #import "NSInvocation+additions.h" #import @implementation STStructure + structureWithValue:(void *)value type:(const char*)type { STStructure *str; str = [[self alloc] initWithValue:value type:type]; return AUTORELEASE(str); } + structureWithRange:(NSRange)range { STStructure *str; str = [[self alloc] initWithValue:&range type:@encode(NSRange)]; return AUTORELEASE(str); } + structureWithPoint:(NSPoint)point { STStructure *str; str = [[self alloc] initWithValue:&point type:@encode(NSPoint)]; return AUTORELEASE(str); } + structureWithSize:(NSSize)size { STStructure *str; str = [[self alloc] initWithValue:&size type:@encode(NSSize)]; return AUTORELEASE(str); } + structureWithRect:(NSRect)rect { STStructure *str; str = [[self alloc] initWithValue:&rect type:@encode(NSRect)]; return AUTORELEASE(str); } - initWithValue:(void *)value type:(const char*)type { const char *nameBeg; int offset = 0; int align; int rem; self = [super init]; NSDebugLLog(@"STStructure", @"creating structure of type '%s' value ptr %p",type,value); structType = [[NSString alloc] initWithCString:type]; fields = [[NSMutableArray alloc] init]; type++; nameBeg = type; while (*type != _C_STRUCT_E && *type++ != '='); name = [[NSString alloc] initWithCString:nameBeg length:type-nameBeg]; while(*type != _C_STRUCT_E) { [fields addObject:STObjectFromValueOfType(((char *)value)+offset,type)]; offset += objc_sizeof_type(type); type = objc_skip_typespec(type); if(*type == _C_STRUCT_E) { break; } align = objc_alignof_type(type); rem = offset % align; if(rem != 0) { offset += align - rem; } } return self; } - (void)dealloc { RELEASE(fields); RELEASE(structType); RELEASE(name); [super dealloc]; } - (void)getValue:(void *)value { const char *type = [structType cString]; int offset=0; int align; int rem; int i = 0; type++; while (*type != _C_STRUCT_E && *type++ != '='); while(*type != _C_STRUCT_E) { STGetValueOfTypeFromObject((void *)((char*)value+offset), type, [fields objectAtIndex:i++]); offset += objc_sizeof_type(type); type = objc_skip_typespec(type); if(*type == _C_STRUCT_E) { break; } align = objc_alignof_type(type); rem = offset % align; if(rem != 0) { offset += align - rem; } } } - (const char *)type { return [structType cString]; } - (NSString *)structureName { return name; } - (const char *)typeOfFieldAtIndex:(unsigned)index { const char *type = [structType cString]; for(type += 1; *type != _C_STRUCT_E && index>0; index--) { type = objc_skip_argspec(type); } if(*type == _C_STRUCT_E) { [NSException raise:STInternalInconsistencyException format:@"invalid structure field index"]; return 0; } return type; } - (NSRange)rangeValue { /* FIXME: do some checking */ return NSMakeRange([self intValueAtIndex:0],[self intValueAtIndex:1]); } - (NSPoint)pointValue { /* FIXME: do some checking */ return NSMakePoint([self floatValueAtIndex:0],[self floatValueAtIndex:1]); } - (NSSize)sizeValue { /* FIXME: do some checking */ return NSMakeSize([self floatValueAtIndex:0],[self floatValueAtIndex:1]); } - (NSRect)rectValue { NSPoint origin = [[fields objectAtIndex:0] pointValue]; NSSize size = [[fields objectAtIndex:1] sizeValue]; NSRect rect; /* FIXME: do some checking */ rect.origin = origin; rect.size = size; return rect; } - valueAtIndex:(unsigned)index { return [fields objectAtIndex:index]; } - (void)setValue:anObject atIndex:(unsigned)index { [fields replaceObjectAtIndex:index withObject:anObject]; } - (int)intValueAtIndex:(unsigned)index { return (int)[[fields objectAtIndex:index] intValue]; } - (float)floatValueAtIndex:(unsigned)index { return (float)[[fields objectAtIndex:index] floatValue]; } /* NSRange */ - (int)location { return [[fields objectAtIndex:0] intValue]; } - (int)length { return [[fields objectAtIndex:1] intValue]; } - (void)setLocation:(int)location { [fields replaceObjectAtIndex:0 withObject: [NSNumber numberWithInt:location]]; } - (void)setLength:(int)length { [fields replaceObjectAtIndex:1 withObject: [NSNumber numberWithInt:length]]; } /* NSPoint */ - (float)x { return [[fields objectAtIndex:0] floatValue]; } - (void)setX:(float)x { [fields replaceObjectAtIndex:0 withObject: [NSNumber numberWithFloat:x]]; } - (float)y { return [[fields objectAtIndex:1] floatValue]; } - (void)setY:(float)y { [fields replaceObjectAtIndex:1 withObject: [NSNumber numberWithFloat:y]]; } /* NSSize */ - (float)width { return [[fields objectAtIndex:0] floatValue]; } - (float)height { return [[fields objectAtIndex:1] floatValue]; } - (void)setWidth:(float)width { [fields replaceObjectAtIndex:0 withObject: [NSNumber numberWithFloat:width]]; } - (void)setHeight:(float)height { [fields replaceObjectAtIndex:1 withObject: [NSNumber numberWithFloat:height]]; } /* NSRect */ - (id)origin { NSLog(@"Origin %@", [fields objectAtIndex:0]); return [fields objectAtIndex:0]; } - (id)size { NSLog(@"Size %@", [fields objectAtIndex:1]); return [fields objectAtIndex:1] ; } @end steptalk-0.10.0/Frameworks/StepTalk/STUndefinedObject.h0000644000175000000000000000203110132015552021743 0ustar gurkanroot/** STUndefinedObject.h Wrapper for nil object Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STUndefinedObject:NSObject @end steptalk-0.10.0/Frameworks/StepTalk/STUndefinedObject.m0000644000175000000000000000367510166607724022006 0ustar gurkanroot/** STUndefinedObject.m Wrapper for nil object Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STUndefinedObject.h" #import "STExterns.h" #import "STObjCRuntime.h" #import STUndefinedObject *STNil = nil; @implementation STUndefinedObject + (id) alloc { return STNil; } + (id) allocWithZone: (NSZone*)z { return STNil; } + (id) autorelease { return self; } - (void) dealloc { NSLog(@"Warning: Trying to dealloc STNil object"); } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { NSMethodSignature *signature = nil; signature = [super methodSignatureForSelector:sel]; if(!signature) { signature = STConstructMethodSignatureForSelector(sel); } return signature; } - (void) forwardInvocation: (NSInvocation*)anInvocation { /* this object is deaf */ } - (BOOL) isEqual: (id)anObject { return ( (self == anObject) || (anObject == nil) ); } - (void) release { /* do nothing */ } - (id) retain { return self; } - (BOOL)isNil { return YES; } - (BOOL)notNil { return NO; } @end steptalk-0.10.0/Frameworks/StepTalk/ScriptingInfo.plist0000644000175000000000000000050710306166366022151 0ustar gurkanroot{ ScriptingInfoClass = StepTalkScriptingInfo; Classes = ( STActor, STEnvironment, STLanguageManager, STScript, STScriptsManager, STBundleInfo, STEngine, STScriptObject, STConversation, STRemoteConversation, STContext ); } steptalk-0.10.0/Frameworks/StepTalk/StepTalk/0000755000175000000000000000000010306171427020035 5ustar gurkanrootsteptalk-0.10.0/Frameworks/StepTalk/StepTalk/dependencies0000644000175000000000000000302610306171427022407 0ustar gurkanrootStepTalk/dependencies: \ Headers/StepTalk/NSInvocation+additions.h \ STSelector.h \ STExterns.h \ STSelector.m \ STExterns.m \ NSInvocation+additions.h \ STActor.h \ Headers/StepTalk/STExterns.h \ NSInvocation+additions.m \ STActor.m \ Headers/StepTalk/STUndefinedObject.h \ STScript.h \ STScript.m \ Headers/StepTalk/STLanguage.h \ Headers/StepTalk/STFunctions.h \ Headers/StepTalk/STObjectReference.h \ STFileScript.h \ STFileScript.m \ STUndefinedObject.h \ STUndefinedObject.m \ STMethod.h \ STLanguage.h \ Headers/StepTalk/NSObject+additions.h \ STObjectReference.h \ STMethod.m \ STLanguage.m \ STEnvironment.h \ STEnvironmentDescription.h \ STObjectReference.m \ Headers/StepTalk/STScripting.h \ STEnvironment.m \ STEnvironmentDescription.m \ NSObject+additions.h \ STObjCRuntime.h \ Headers/StepTalk/STEnvironment.h \ STConversation.h \ NSObject+additions.m \ STObjCRuntime.m \ STEngine.h \ STConversation.m \ STEngine.m \ Headers/StepTalk/STScript.h \ Headers/StepTalk/STObjCRuntime.h \ STRemoteConversation.h \ STLanguageManager.h \ STRemoteConversation.m \ STLanguageManager.m \ STFunctions.h \ Headers/StepTalk/STScriptsManager.h \ STScriptObject.h \ Headers/StepTalk/STBundleInfo.h \ Headers/StepTalk/STScriptObject.h \ STFunctions.m \ STScriptObject.m \ Headers/StepTalk/STMethod.h \ STScriptsManager.h \ STScriptsManager.m \ Headers/StepTalk/STSelector.h \ STContext.h \ STBundleInfo.h \ STContext.m \ STBundleInfo.m \ STScripting.h \ STScripting.m \ Headers/StepTalk/STEngine.hsteptalk-0.10.0/Frameworks/StepTalk/StepTalk.gsdoc0000644000175000000000000000150310132015550021044 0ustar gurkanroot StepTalk Documentation 0.7.1 2003 Apr 22 Introduction

StepTalk is a scripting framework for creating scriptable servers or applications. StepTalk, when combined with the dynamism that the Objective-C language provides, goes way beyond mere scripting. intro

steptalk-0.10.0/Frameworks/StepTalk/StepTalk.h0000644000175000000000000000272510306166366020222 0ustar gurkanroot/** StepTalk.h Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 1 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import steptalk-0.10.0/Frameworks/StepTalk/StepTalkScriptingInfo.h0000600000175000000000000000206110132015557022672 0ustar gurkanroot/** StepTalkScriptingInfo.h Module to bring StepTalk classes Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface StepTalkScriptingInfo:NSObject @end steptalk-0.10.0/Frameworks/StepTalk/StepTalkScriptingInfo.m0000600000175000000000000000220310132015557022675 0ustar gurkanroot/** StepTalkScriptingInfo. Module to bring StepTalk classes Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "StepTalkScriptingInfo.h" @class NSDictionary; @implementation StepTalkScriptingInfo + (NSDictionary *)namedObjectsForScripting { return nil; } @end steptalk-0.10.0/Frameworks/StepTalk/old/0000755000175000000000000000000010306171301017053 5ustar gurkanrootsteptalk-0.10.0/Frameworks/StepTalk/old/STDistantEnvironment.h0000644000175000000000000000060110132015560023324 0ustar gurkanroot/* FIXME: not used! just an unimplemented idea. */ #import @interface STDistantEnvironment:NSObject { NSStrnig *distantName; NSStrnig *distantHost; NSDistantObject *environment; } + environmentWithName:(NSString *)name host:(NSString *)host; - initWithName:(NSString *)name host:(NSString *)host; - (STConversation *)createConversation; @end steptalk-0.10.0/Frameworks/StepTalk/old/STDistantEnvironment.m0000644000175000000000000000262410132015560023340 0ustar gurkanroot#import "STDistantEnvironment.h" #import #import #import #import #import @implementation STDistantEnvironment + environmentWithName:(NSString *)name host:(NSString *)host; - initWithName:(NSString *)name host:(NSString *)host { self = [super init]; distantName = RETAIN(name); distantHost = RETAIN(host); [self connect]; return self; } - (STConversation *)createConversation; - (void)connect { environment = (NSDistantObject *)[NSConnection rootProxyForConnectionWithRegisteredName:distantName host:distantHost]; if(!environment) { [NSException raise:@"STDistantEnvironmentException" format:@"Unable to get distant environment object from server '%@'", distantName]; return; } RETAIN(environment); // [(NSDistantObject *)simulator setProtocolForProxy:@protocol(AFSimulator)]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_connectionDidDie:) name:NSConnectionDidDieNotification object:[environment connectionForProxy]]; } - (STConversation *)createConversationProxy { return [environment createConversation]; } @end steptalk-0.10.0/Frameworks/StepTalk/old/STLanguage.h0000644000175000000000000000260610305157062021231 0ustar gurkanroot/** STLanguage.h StepTalk language bundle Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Oct 24 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STEngine; @interface STLanguage:NSBundle + (NSArray *)allLanguageNames; + (NSString *)defaultLanguageName; + (NSArray *)allKnownFileTypes; + languageWithName:(NSString *)languageName; + languageWithPath:(NSString *)path; + (NSString *)languageNameForFileType:(NSString *)fileType; + (STLanguage *)languageForFileType:(NSString *)fileType; - (NSString *)languageName; - (STEngine *)engine; @end steptalk-0.10.0/Frameworks/StepTalk/old/STLanguage.m0000644000175000000000000001373210305157062021240 0ustar gurkanroot/** STLanguage.m StepTalk language bundle Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Oct 24 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STLanguage.h" #import "STEngine.h" #import "STExterns.h" #import "STFunctions.h" #import #import #import #import #import #import #import #import #import static NSDictionary *fileTypeDictionary = nil; @implementation STLanguage /** Returns an array containing the names of all available languages*/ + (NSArray *)allLanguageNames { NSArray *bundles; NSEnumerator *enumerator; NSString *path; NSMutableArray *languages = [NSMutableArray array]; STLanguage *lang; bundles = STFindAllResources(STLanguageBundlesDirectory, STLanguageBundleExtension); enumerator = [bundles objectEnumerator]; while( (path = [enumerator nextObject]) ) { lang = [STLanguage languageWithPath:path]; [languages addObject:[lang languageName]]; } return AUTORELEASE([languages copy]); } /** Returns the name of default scripting language specified by the STDefaultLanguageName default. If there is no such default in user's defaults database, then Smalltalk is used. */ + (NSString *)defaultLanguageName { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSString *name= [defs objectForKey:@"STDefaultLanguageName"]; if(!name) { return @"Smalltalk"; } else { return name; } } /** Returns language bundle for a language with name languageName */ + languageWithName:(NSString *)languageName { NSString *file = STFindResource(languageName, STLanguageBundlesDirectory, STLanguageBundleExtension); if(!file) { NSLog(@"Could not find language with name '%@'", languageName); return nil; } return [self languageWithPath:file]; } /** Returns language bundle for language with name languageName. */ + languageWithPath:(NSString *)path { if(!path) { return nil; } return AUTORELEASE([[STLanguage alloc] initWithPath:path]); } /** Update information about handling various files with StepTalk. */ + (void)updateFileTypeDictionary { NSString *path = STUserConfigPath(); NSFileManager *fm = [NSFileManager defaultManager]; NSTask *task; NSDictionary *dict; RELEASE(fileTypeDictionary); path = [path stringByAppendingPathComponent:STLanguagesConfigFile]; /* FIXME: use defaults instead. calling task with given argument is a bug*/ if( ![fm fileExistsAtPath:path]) { NSLog(@"Creating lanugages configuration file..."); task = [NSTask launchedTaskWithLaunchPath:@"stupdate_languages" arguments:nil]; [task waitUntilExit]; } if( ![fm fileExistsAtPath:path]) { [NSException raise:STGenericException format:@"Unable to get languages configuration file"]; return; } dict = [NSDictionary dictionaryWithContentsOfFile:path]; fileTypeDictionary = [dict objectForKey:@"STFileTypes"]; RETAIN(fileTypeDictionary); } /** Returns name of a language used by files of type fileType. */ + (NSString *)languageNameForFileType:(NSString *)fileType { if(!fileTypeDictionary) { [self updateFileTypeDictionary]; } return [fileTypeDictionary objectForKey:fileType]; } /** Return all known types (extensions) of StepTalk script files */ + (NSArray *)allKnownFileTypes { if(!fileTypeDictionary) { [self updateFileTypeDictionary]; } return [fileTypeDictionary allKeys]; } /** Returns the language bundle for a language used by files of type fileType. */ + (STLanguage *)languageForFileType:(NSString *)fileType { NSString *langName = [STLanguage languageNameForFileType:fileType]; if(langName) { return [STLanguage languageWithName:langName]; } [NSException raise:STGenericException format:@"Unknown language for file type '%@'", fileType]; return nil; } /** Returns the name of the language */ - (NSString *)languageName { NSString *name; name = [[self infoDictionary] objectForKey:@"STLanguageName"]; if(!name) { name = [[self bundlePath] lastPathComponent]; name = [name stringByDeletingPathExtension]; } return name; } /** Returns a scripting engine provided by the language. */ - (STEngine *)engine { NSString *className =[[self infoDictionary] objectForKey:@"STEngine"]; Class engineClass = nil; STEngine *engine; if(className) { engineClass = [self classNamed:className]; } if(!engineClass) { engineClass = [self principalClass]; } engine = [[engineClass alloc] init]; return AUTORELEASE(engine); } @end steptalk-0.10.0/Frameworks/StepTalkViews/0000755000175000000000000000000010132015547017321 5ustar gurkanrootsteptalk-0.10.0/Frameworks/StepTalkViews/GNUmakefile0000600000175000000000000000351110132015547021363 0ustar gurkanroot# # GNUmakefile # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. include $(GNUSTEP_MAKEFILES)/common.make include ../../Version FRAMEWORK_NAME = StepTalkPanels StepTalkPanels_OBJC_FILES = \ STScriptView.m StepTalkPanels_HEADER_FILES = \ STScriptView.m StepTalkPanels_RESOURCE_FILES = ScriptingInfo.plist ADDITIONAL_OBJCFLAGS = -Wno-import -DSTEPTALK_VERSION=$(STEPTALK_VERSION) DOCUMENT_NAME = StepTalkPanels StepTalkPanels_DOC_INSTALL_DIR = Developer StepTalkPanels_HEADER_FILES_DIR = $(HEADER_DIR) StepTalkPanels_AGSDOC_FILES = StepTalkPanels.gsdoc $(STEPTALK_HEADER_FILES) StepTalkPanels_AGSDOC_FLAGS = \ -Up StepTalk \ -Declared StepTalkPanels \ -DocumentationDirectory ../../Documentation/Reference ifeq ($(GNUSTEP_TARGET_OS),mingw32) StepTalkPanels_LIBRARIES_DEPEND_UPON += -lStepTalk endif ifeq ($(check),yes) ADDITIONAL_OBJCFLAGS += -Werror endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/framework.make ifeq ($(doc), yes) include $(GNUSTEP_MAKEFILES)/documentation.make endif -include GNUmakefile.postamble steptalk-0.10.0/Frameworks/StepTalkViews/STScriptEditor.h0000644000175000000000000000250610132015547022357 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSTextView; @interface STScriptEditorView:NSView; { NSTextView *textView; NSPopupButton *languageButton; } - (void)setScriptSource:(NSString *)aString; - (NSString *)scriptSource; - (NSString *)scriptLanguage; - (void)setScriptLanguage:(NSString *)languageName; - (void)setAutocompletionWords:(NSArray *)anArray; - (NSArray *)setAutocompletionWords; @end steptalk-0.10.0/Frameworks/StepTalkViews/STScriptEditor.m0000644000175000000000000001542610132015547022371 0ustar gurkanroot/** STScript Copyright (c) 2002 Stefan Urbanek Written by: Stefan Urbanek Date: 2002 Mar 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STScript.h" #import "STLanguage.h" #import #import #import #import #import @implementation STScriptEditor /* ScalingScrollView.m Copyright (c) 1995-1996, NeXT Software, Inc. All rights reserved. Author: Mike Ferris You may freely copy, distribute and reuse the code in this example. NeXT disclaims any warranty of any kind, expressed or implied, as to its fitness for any particular use. */ #import "ScalingScrollView.h" #import #import #import #import #import /* For genstrings: NSLocalizedString(@"10%", @"Zoom popup entry") NSLocalizedString(@"25%", @"Zoom popup entry") NSLocalizedString(@"50%", @"Zoom popup entry") NSLocalizedString(@"75%", @"Zoom popup entry") NSLocalizedString(@"100%", @"Zoom popup entry") NSLocalizedString(@"128%", @"Zoom popup entry") NSLocalizedString(@"200%", @"Zoom popup entry") NSLocalizedString(@"400%", @"Zoom popup entry") NSLocalizedString(@"800%", @"Zoom popup entry") NSLocalizedString(@"1600%", @"Zoom popup entry") */ static NSString *_NSDefaultScaleMenuLabels[] = {/* @"Set...", */ @"10%", @"25%", @"50%", @"75%", @"100%", @"128%", @"200%", @"400%", @"800%", @"1600%"}; static float _NSDefaultScaleMenuFactors[] = {/* 0.0, */ 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 2.0, 4.0, 8.0, 16.0}; static unsigned _NSDefaultScaleMenuSelectedItemIndex = 4; static float _NSButtonPadding = 1.0; static float _NSScaleMenuFontSize = 10.0; @implementation ScalingScrollView - (id)initWithFrame:(NSRect)rect { if ((self = [super initWithFrame: rect])) { scaleFactor = 1.0; } return self; } - (void)_makeScalePopUpButton { if (_scalePopUpButton == nil) { unsigned cnt, numberOfDefaultItems = (sizeof(_NSDefaultScaleMenuLabels) / sizeof(NSString *)); NSButtonCell *curItem; // create it _scalePopUpButton = [[NSPopUpButton allocWithZone:[self zone]] initWithFrame:NSMakeRect(0.0, 0.0, 1.0, 1.0) pullsDown:NO]; // fill it for (cnt = 0; cnt < numberOfDefaultItems; cnt++) { [_scalePopUpButton addItemWithTitle:NSLocalizedString(_NSDefaultScaleMenuLabels[cnt], nil)]; curItem = [_scalePopUpButton itemAtIndex:cnt]; if (_NSDefaultScaleMenuFactors[cnt] != 0.0) { [curItem setRepresentedObject:[NSNumber numberWithFloat:_NSDefaultScaleMenuFactors[cnt]]]; // NSLog (@"%@", [curItem representedObject]); } } [_scalePopUpButton selectItemAtIndex:_NSDefaultScaleMenuSelectedItemIndex]; // hook it up [_scalePopUpButton setTarget:self]; [_scalePopUpButton setAction:@selector(scalePopUpAction:)]; // set a suitable font [_scalePopUpButton setFont:[NSFont systemFontOfSize:_NSScaleMenuFontSize]]; // Make sure the popup is big enough to fit the cells. [_scalePopUpButton sizeToFit]; // don't let it become first responder [_scalePopUpButton setRefusesFirstResponder:YES]; // put it in the scrollview [self addSubview:_scalePopUpButton]; [_scalePopUpButton release]; } } - (void)tile { // Let the superclass do most of the work. [super tile]; if (![self hasHorizontalScroller]) { if (_scalePopUpButton) [_scalePopUpButton removeFromSuperview]; _scalePopUpButton = nil; } else { NSScroller *horizScroller; NSRect horizScrollerFrame, buttonFrame, incrementLineFrame; if (!_scalePopUpButton) [self _makeScalePopUpButton]; horizScroller = [self horizontalScroller]; horizScrollerFrame = [horizScroller frame]; incrementLineFrame = [horizScroller rectForPart:NSScrollerIncrementLine]; buttonFrame = [_scalePopUpButton frame]; // Now we'll just adjust the horizontal scroller size and set the button size and location. horizScrollerFrame.size.width = horizScrollerFrame.size.width - buttonFrame.size.width - _NSButtonPadding; [horizScroller setFrameSize:horizScrollerFrame.size]; buttonFrame.origin.x = NSMaxX(horizScrollerFrame); buttonFrame.size.height = incrementLineFrame.size.height; buttonFrame.origin.y = horizScrollerFrame.origin.y + incrementLineFrame.origin.y; [_scalePopUpButton setFrame:buttonFrame]; } } - (void)scalePopUpAction:(id)sender { #ifdef GNUSTEP NSNumber *selectedFactorObject = [[_scalePopUpButton selectedItem] representedObject]; #else NSNumber *selectedFactorObject = [[sender selectedCell] representedObject]; #endif NSLog (@"%@", sender); if (selectedFactorObject == nil) { NSLog(@"Scale popup action: setting arbitrary zoom factors is not yet supported."); return; } else { [self setScaleFactor:[selectedFactorObject floatValue]]; } } - (float)scaleFactor { return scaleFactor; } - (void)setScaleFactor:(float)newScaleFactor { if (scaleFactor != newScaleFactor) { NSSize curDocFrameSize, newDocBoundsSize; NSView *clipView = [[self documentView] superview]; scaleFactor = newScaleFactor; // Get the frame. The frame must stay the same. curDocFrameSize = [clipView frame].size; // The new bounds will be frame divided by scale factor newDocBoundsSize.width = curDocFrameSize.width / newScaleFactor; newDocBoundsSize.height = curDocFrameSize.height / newScaleFactor; [clipView setBoundsSize:newDocBoundsSize]; } } - (void)setHasHorizontalScroller:(BOOL)flag { if (!flag) [self setScaleFactor:1.0]; [super setHasHorizontalScroller:flag]; } @end /* 12/94 mferris Created 3/4/95 aozer Use in Edit; added ability to turn popup off/on 5/4/95 aozer Scale the clipview rather than the docview 7/20/95 aozer Made popup entries localizable */ @end steptalk-0.10.0/Incubator/0000755000175000000000000000000010300172662014361 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/0000755000175000000000000000000010257602410016524 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/0000755000175000000000000000000010257602410022131 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/Calculator.gorm/0000755000175000000000000000000010257601661025174 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/Calculator.gorm/data.classes0000644000175000000000000000045710257601661027472 0ustar gurkanroot{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "addNumber:", awakeFromNib, "clear:" ); Super = NSObject; }; StepTalkClass = { Actions = ( "addNumber:", awakeFromNib, "clear:" ); Super = NSObject; }; }steptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/Calculator.gorm/data.info0000644000175000000000000000032210257601661026757 0ustar gurkanrootGNUstep archive00002af9:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&% Latest Version0& %  Typed Streamsteptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/Calculator.gorm/objects.gorm0000644000175000000000000001434710257601661027524 0ustar gurkanrootGNUstep archive00002af9:0000001f:0000008d:00000000:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString& %  MenuItem401 NSMenuItem0&% Hide0&% h&&%01NSImage01NSMutableString&% common_2DCheckMark0 0 & %  common_2DDash%0 & %  MenuItem50 0 &% Quit0&% q&&% %0&%NSOwner0& %  NSApplication0& %  TextField01 NSTextField1 NSControl1 NSView1 NSResponder% @ CI C3 B   C3 B &01 NSMutableArray1NSArray&%01NSTextFieldCell1 NSActionCell1NSCell0&% 001NSFont%0&% Helvetica-Bold AA&&&&&&&&0%01NSColor0&%NSNamedColorSpace0&% System0&% textBackgroundColor00& %  textColor0&% NSMenu01NSMenu0 & %  Main Menu0! & 0"&% GSCustomClassMap0#&0$&% Button0%1NSButton% C A B B   B B &0& &%0'1 NSButtonCell0(&% =0)%&&&&&&&&%0*&0+&&&&0,&% Matrix10-1NSMatrix% C B@ B C  B C&0. &%0/00&)&&&&&&&&%% B B 0102&% System03&% controlBackgroundColor104& %  NSButtonCell0506&% Button)&&&&&&&&%07&08&&&&%%09 &0:0;&% +)&&&&&&&&%78&&&0<0=&% -)&&&&&&&&%78&&&0>0?&% *)&&&&&&&&%78&&&0@0A&% /)&&&&&&&&%78&&&@0B& %  NSVisible0C &0D1GSWindowTemplate1GSClassSwapper0E&%NSWindow1NSWindow%  CB Cu&% CP D$0F %  CB Cu  CB Cu&0G &0H% @ A C C   C C &0I &%0J0)&&&&&&&&%% B, B  110K& %  NSButtonCell0L0M&% Button)&&&&&&&&%0N&0O&&&&%%0P &  0Q0R&% 1)&&&&&&&&%NO&&&0S0T&% 2)&&&&&&&&%NO&&&0U0V&% 3)&&&&&&&&%NO&&&0W0X&% 4)&&&&&&&&%NO&&&0Y0Z&% 5)&&&&&&&&%NO&&&0[0\&% 6)&&&&&&&&%NO&&&0]0^&% 7)&&&&&&&&%NO&&&0_0`&% 8)&&&&&&&&%NO&&&0a0b&% 9)&&&&&&&&% NO&&&0c0d&)&&&&&&&&%NO&&&0e0f&% 0)&&&&&&&&%NO&&&0g0h&)&&&&&&&&%NO&&&S-%0i% @ C, C A  C A&0j &%0k0l&% C)&&&&&&&&%0m&0n&&&&0o20p&% windowBackgroundColor0q&% Window0r& %  Calculatorr ? ? F@ F@%&   D Da0s& %  MenuItem1 0t& %  MenuItem20u&% MatrixH0v&% Button1i0w& %  MenuItem3 0x&% MenuItem0y& %  My WindowD0z &  0{1NSNibConnectory0|0}x0~1NSNibControlConnectorx0&%NSFirst0&% hide:0w0w0& %  terminate:00u0,0$0v01 GSMutableSet1 NSMutableSet1NSSet&Dsteptalk-0.10.0/Incubator/STPalette-1.2/CalculatorExample/calculator.st0000644000175000000000000000153710257602327024647 0ustar gurkanroot========================== void awakeFromNib ========================== x := 0 y := 0 ========================== void addNumber: sender ========================== | number | number := sender selectedCell tag. x := (x*10) + number. display setIntValue: x. ========================== void equal: sender ========================== (lastOperation = 1) ifTrue: [ x := y + x ]. (lastOperation = 2) ifTrue: [ x := y - x ]. (lastOperation = 3) ifTrue: [ x := y * x ]. (lastOperation = 4) ifTrue: [ x := y / x ]. lastOperation := 5. display setIntValue: x. y := x. x := 0. ========================== void operation: sender ========================== (lastOperation = 5) ifTrue: [ x := y ]. lastOperation := sender selectedCell tag. y := x. x := 0. ========================== void clear: sender ========================== x := 0. y := 0. display setIntValue: 0. steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/0000755000175000000000000000000010257601754021604 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/Authors0000644000175000000000000000004210257601661023145 0ustar gurkanrootNicolas Roard steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/COPYING0000644000175000000000000006347410257601661022652 0ustar gurkanroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/ChangeLog0000644000175000000000000000051310257601661023352 0ustar gurkanroot26/06/05: v1.2 - added inspector & connection inspector to StepTalkClass 15/06/05: v1.1 - added creation of outlets on the fly - custom connection inspector (only show the script's outlets) - dialog to add/remove outlets from the inspector - the palette contains both StepTalkView and StepTalkObject 14/06/05: initial release steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/GNUmakefile0000644000175000000000000000307510257601661023660 0ustar gurkanroot# GNUmakefile # # Copyright (C) 1999 Free Software Foundation, Inc. # # Author: Richard Frith-Macdonald # Date: 1999 # # This file is part of GNUstep. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include $(GNUSTEP_MAKEFILES)/common.make PALETTE_NAME = StepTalk StepTalk_PALETTE_ICON = StepTalkPalette StepTalk_OBJC_FILES = \ StepTalkInspector.m \ StepTalkClassInspector.m \ StepTalkConnectionInspector.m \ StepTalkPalette.m StepTalk_PRINCIPAL_CLASS = StepTalkPalette ADDITIONAL_LDFLAGS += -lStepTalk -lStepTalkView StepTalk_RESOURCE_FILES = \ StepTalkIcon.png \ StepTalkViewIcon.png \ StepTalkPalette.tiff \ StepTalkPalette.gorm \ StepTalkInspector.gorm \ StepTalkClassInspector.gorm \ palette.table StepTalk_STANDARD_INSTALL = no -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/palette.make -include GNUmakefile.postamble steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/README0000644000175000000000000000413210257601661022461 0ustar gurkanroot This palette use the StepTalkView library to present a StepTalkView and StepTalkObject. How to use it ? =============== First step is to have libStepTalkView installed. Then you can compile this palette. Launch Gorm, and go to Infos->Preferences->Palettes and click on the "add" button, then locate StepTalk.palette and load it. 1) StepTalkView Now you can access to the palette and drag'n drop a StepTalkView on a window. To modify the script, just open the inspector and write in the textview. You can also assign a name to the script, but it doesn't have any impact on the script itself -- it's just useful to categorize your scripts in Gorm. Now that you have a StepTalkView somewhere, you can connect objects to it -- but for that you need outlets, and by default you don't have any. So open the inspector and click the "outlets" button. Add outlets (you can rename them simply by double-clicking in the tableview). By default the target object for a StepTalkView is itself, which means that if you click on a StepTalkView the script it contains will execute. 2) StepTalkObject Instead of using a StepTalkView you can use a StepTalkObject, which is basically the same, but which is a non-graphical object. To instanciate one, just drag'n drop it on your objects palette. Then as for the StepTalkView you need to create outlets if needed. To execute the script, connect a button (for example) to the StepTalkObject's execute: methode. 3) StepTalkClass It's a non-graphical object, so in order to instanciate it, just drop it on your object palette (like for StepTalkObject). The difference between StepTalkObject (that I really should renamed "StepTalkScript" ..) is that a StepTalkClass can holds more than one script, the scripts are methods that can receive parameters, and a StepTalkClass can also contains ivars. So basically you can use a StepTalkClass as replacement for an Objective-C class, more or less -- which let you write entire programs in Gorm... check the demonstration on http://www.xdev.org/gnustep/demo.html -- you can use the Calculator.gorm packaged in this archive to redo the demo. steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.gorm/0000755000175000000000000000000010257601661027150 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.gorm/data.classes0000644000175000000000000000073310257601661031443 0ustar gurkanroot{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "addAction:", "addOutlet:", "removeAction:", "removeOutlet:" ); Super = NSObject; }; StepTalkClassInspector = { Actions = ( "addAction:", "addOutlet:", "removeAction:", "removeOutlet:" ); Outlets = ( methodSignature, textviewCode, outlets, actions, returnType ); Super = IBInspector; }; }steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.gorm/data.info0000644000175000000000000000032210257601661030733 0ustar gurkanrootGNUstep archive00002af9:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&% Latest Version0& %  Typed Streamsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.gorm/objects.gorm0000644000175000000000000002420310257601661031470 0ustar gurkanrootGNUstep archive00002af9:0000002c:00000107:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&%NSOwner0&% StepTalkClassInspector0& %  MenuItem101 NSMenuItem0&% int0&&&%%0 & %  TextField0 1 NSTextField1 NSControl1 NSView1 NSResponder% B C; C܀ A  C܀ A& 0 1 NSMutableArray1 NSArray&%0 1 NSTextFieldCell1 NSActionCell1NSCell0 &01NSFont%&&&&&&&&0%01NSColor0&%NSNamedColorSpace0&% System0&% textBackgroundColor00& %  textColor0& %  MenuItem200&% void&&%%0&% Button01NSButton% B CD Bt A  Bt A&0 &%01 NSButtonCell0& %  Edit class&&&&&&&&%0&0&&&&0&% TextView0 1 NSTextView1NSText% A @ C C*  C C*&0! &0"0#&%NSCalibratedRGBColorSpace ? ? ? ? ?  K K0$0%&% System0&& %  textColor C K0'& %  NSVisible0( &0)&% MenuItem0*0+&% id&&%0,1NSImage0-& % common_Nibble%0.& %  InspectorWin0/1GSWindowTemplate1GSClassSwapper00&%NSWindow1NSWindow%  C C&% C\ DE@01 %  C C  C C&02 &0304&% System05&% windowBackgroundColor06&% Window07&% Inspector Window7 ? ? F@ F@%&   D Da08& %  GormNSWindow090%  D@ C&% DJ@ D 0: %  D@ C  D@ C&0; &  0<1 NSScrollView% C Cr C C  C C& 0= &0>1 NSClipView% A A C B  C B&0? &0@1 NSTableView%  C C!  C C!&0A &%0B0C&&&&&&&&&0D &0E1 NSTableColumn0F&% column1 C A GP0G1NSTableHeaderCell0H&% actions0I% &&&&&&&&0%0J0K&%System0L&%controlShadowColor0M0N&% System0O&% windowFrameTextColor0P 0Q&%sixQ&&&&&&&&0%0RN0S&% textBackgroundColor0T# ?0UN0V& %  gridColor0W# ? ? ? ? ?0X1NSTableHeaderView%  C A  C A&0Y &0Z1 GSTableCornerView% ? ? Ap A  Ap A&0[ &%% A @ @@"0\1! NSScroller% ? A A` B  A` B&0] &%0^C&&&&&&&&&<2 _doScroll:v12@0:4@80_% A ? C A  C A&0` &X0aN0b& %  controlColorZ>% A A A A \_0c% @ A  C C,  C C,&0d &0e% A ? C C* A @ C C*&0f & "0g!% ? ? A` C*  A` C*&0h &%0i0j&&&&&&&&&&ce% A A A A g0k% @ Cr B C  B C& 0l &0m% A A B B  B B&0n &0o%  B C!  B C!&0p &%0q0r&&&&&&&&&0s &0t0u&% column1 B A GP0v0w&% outletsI&&&&&&&&0%J0x0y&% System0z&% windowFrameTextColor0{ QQ&&&&&&&&0%0|y0}&% textBackgroundColorT0~y0& %  gridColorW0%  B A  B A&0 &0 % ? ? Ap A  Ap A&0 &%% A @ @@"0!% ? A A` B  A` B&0 &%0r&&&&&&&&&k0% A ? B A  B A&0 &0y0& %  controlColorm% A A A A 0% @ CU A A  A A& 0 &%00&% +&&&&&&&&%0&0&&&&0% B CU A A  A A& 0 &%00&% -&&&&&&&&%0&0&&&&0% C CU A A  A A& 0 &%00&% +&&&&&&&&%0&0&&&&0% C$ CU A A  A A& 0 &%00&% -&&&&&&&&%0&0&&&& 01" NSPopUpButton% @ C: Bx A  Bx A& 0 &%01#NSPopUpButtonCell1$NSMenuItemCell&&&&&&&&01%NSMenu0&0 &*%0&&&&**%%%%%3660&%Window ? ? F@ F@%&   D Da0&% GSCustomClassMap0&0& %  ScrollView<0& %  ScrollView1c0& %  ScrollView2k0& %  TableColumn100&% column2 C A GP00&%  I&&&&&&&&0%040&% controlShadowColorM0 0&% six&&&&&&&&0%R0N0& %  textColor0& %  TableColumnE0& %  TableColumn2t0&% Button10&% GormNSTableView@0& %  TableColumn300&% column2 B A GP0±0ñ&%  I&&&&&&&&0%x0ı &&&&&&&&0%|0űy0Ʊ& %  textColor0DZ&% Button20ȱ&% GormNSPopUpButton0ɱ&% Button30ʱ&% Button40˱&% GormNSTableView1o0̱ &))01&NSNibConnector.0α&0ϱ&801'NSNibControlConnector801(NSMutableString&% makeKeyAndOrderFront:0ұ&0ӱ&0Ա&0ձ&0ֱ&0ױ&0ر&0ٱ&ː0ڱ&0۱&0ܱ&0ݱ&ǐ0ޱ&ɐ0߱&ʐ0& 01)NSNibOutletConnector0& %  textviewCode0) 0&% methodSignature0)˰0(& %  dataSource0)0'0& %  addOutlet:0'ǰ0& %  removeOutlet:0'ɰ0& %  addAction:0'ʰ0& %  removeAction:0' 0(&% ok:0)0&% outlets0)0&% actions0)80(&% window0)0(&% delegate0&Ȑ0&)0&0&0)0& %  returnTypeP)P(&% delegateP'ȰP(&% ok:P) P(& %  nextKeyViewP) P1* GSMutableSet1+ NSMutableSet1,NSSet&9/steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.h0000644000175000000000000000073310257601661026361 0ustar gurkanroot#include #include #include @interface StepTalkClassInspector : IBInspector { NSTextView* textviewCode; NSTextField* methodSignature; NSTableView* outlets; NSTableView* actions; NSPopUpButton* returnType; @private NSMutableArray* variables; NSMutableArray* methods; StepTalkMethod* currentMethod; NSString* lastModifiedMethod; } - (void) getActions; - (void) getVariables; @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkClassInspector.m0000644000175000000000000001431110257601661026363 0ustar gurkanroot#include #include "StepTalkClassInspector.h" @implementation StepTalkClassInspector - (void) textDidEndEditing: (NSNotification*) notification { [self ok: self]; } - (id) init { self = [super init]; [NSBundle loadNibNamed:@"StepTalkClassInspector" owner:self]; id cm = [NSApp classManager]; NSArray* listOfActions = [cm allActionsForClassNamed: @"StepTalkClass"]; int i; for (i=0; i<[listOfActions count]; i++) { NSString* action = [listOfActions objectAtIndex: i]; NSLog (@" remove %@", action); [cm removeAction: action fromClassNamed: @"StepTalkClass"]; } return self; } - (void) syncWithClassManager { StepTalkClass* stc = (StepTalkClass*) [self object]; id cm = [NSApp classManager]; if ([cm isKnownClass: [stc name]] == NO) { [cm addClassNamed: [stc name] withSuperClassNamed: @"StepTalkClass" withActions: [stc actions] withOutlets: [stc outlets]]; } else // class is already known by the class manager { NSArray* listOfActions = [cm allActionsForClassNamed: [stc name]]; int i; NSLog (@"sync class %@", [stc name]); NSLog (@"prev actions: "); for (i=0; i<[listOfActions count]; i++) { NSString* action = [listOfActions objectAtIndex: i]; NSLog (@" remove %@", action); [cm removeAction: action fromClassNamed: [stc name]]; } listOfActions = [stc actions]; NSLog (@"set actions: "); for (i=0; i<[listOfActions count]; i++) { NSString* action = [listOfActions objectAtIndex: i]; NSLog(@" add %@", action); [cm addAction: action forClassNamed: [stc name]]; } listOfActions = [cm allActionsForClassNamed: [stc name]]; NSLog (@"current actions: "); for (i=0; i<[listOfActions count]; i++) { NSString* action = [listOfActions objectAtIndex: i]; NSLog (@" %@", action); } } } - (void) addAction: (id) sender { StepTalkClass* stc = (StepTalkClass*) [self object]; [stc addMethod: @"newMethod" withContent: @"\" enter your code here \"\n"]; ASSIGN(lastModifiedMethod, @"newMethod"); [self syncWithClassManager]; [self getActions]; } - (void) removeAction: (id) sender { int row = [actions selectedRow]; if (row < [methods count]) { StepTalkClass* stc = (StepTalkClass*) [self object]; [stc removeMethod: [methods objectAtIndex: row]]; [self syncWithClassManager]; [self getActions]; } } - (void) addOutlet: (id) sender { StepTalkClass* stc = (StepTalkClass*) [self object]; [stc addIvar: @"newOutlet"]; [self getVariables]; } - (void) removeOutlet: (id) sender { int row = [outlets selectedRow]; if (row < [variables count]) { StepTalkClass* stc = (StepTalkClass*) [self object]; [stc removeIvar: [variables objectAtIndex: row]]; [self getVariables]; } } - (void) ok: (id) sender { StepTalkClass* stc = (StepTalkClass*) [self object]; NSString* prevMethodName = [[currentMethod name] copy]; NSString* methodName = [methodSignature stringValue]; [currentMethod setContent: [[textviewCode textStorage] string]]; switch ([[returnType selectedItem] tag]) { case 0: [currentMethod setReturnType: @"id"]; break; case 1: [currentMethod setReturnType: @"int"]; break; case 2: [currentMethod setReturnType: @"void"]; } if (![prevMethodName isEqualToString: methodName]) { [stc renameMethod: prevMethodName to: methodName]; ASSIGN(lastModifiedMethod, methodName); [self syncWithClassManager]; } [prevMethodName release]; [self getVariables]; [self getActions]; [super ok:sender]; } - (void) revert: (id) sender { [methodSignature setStringValue: @""]; NSMutableAttributedString* content = [NSMutableAttributedString new]; [[textviewCode textStorage] setAttributedString: content]; [content release]; [self getVariables]; [self getActions]; [super revert:sender]; } - (void) getVariables { [variables release]; StepTalkClass* stc = (StepTalkClass*) [self object]; variables = [[stc variablesArray] retain]; [outlets reloadData]; } - (void) getActions { [methods release]; StepTalkClass* stc = (StepTalkClass*) [self object]; methods = [[stc methodsArray] retain]; [actions reloadData]; if ([methods count] > 0) { // not specially efficient, but we shouldn't have lots of methods.. int i; int index = 0; for (i=0; i< [methods count]; i++) { NSString* method = [methods objectAtIndex: 0]; if ([lastModifiedMethod isEqualToString: method]) { index = i; break; } } [actions selectRow: index byExtendingSelection: NO]; [self tableView: actions shouldSelectRow: index]; } } - (int)numberOfRowsInTableView:(NSTableView *)aTableView { int ret = 0; if (aTableView == outlets) { ret = [variables count]; } if (aTableView == actions) { ret = [methods count]; } return ret; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { id val; if (aTableView == outlets) { val = [variables objectAtIndex: rowIndex]; } if (aTableView == actions) { StepTalkMethod* method = [methods objectAtIndex: rowIndex]; val = [method signature]; } return val; } - (void)tableView: (NSTableView *) aTableView setObjectValue: (id) newKey forTableColumn: (NSTableColumn *) aTableColumn row: (int) rowIndex { if (newKey != nil) { if (aTableView == outlets) { NSLog (@"tableview == outlets"); id prev = [variables objectAtIndex: rowIndex]; StepTalkClass* stc = (StepTalkClass*) [self object]; [stc renameIvar: prev to: newKey]; [self getVariables]; } if (aTableView == actions) { //TODO /* id prev = [variables objectAtIndex: rowIndex]; StepTalkClass* stc = (StepTalkClass*) [self object]; [stc renameIvar: prev to: newKey]; [self getVariables]; */ } } } - (BOOL) tableView: (NSTableView *)aTableView shouldSelectRow: (int)rowIndex { if (aTableView == actions) { StepTalkMethod* method = [methods objectAtIndex: rowIndex]; [currentMethod release]; currentMethod = [method retain]; [methodSignature setStringValue: [method name]]; NSMutableAttributedString* content = [[NSMutableAttributedString alloc] initWithString: [method content]]; [[textviewCode textStorage] setAttributedString: content]; NSString* retType = [method returnType]; [returnType selectItemWithTitle: retType]; } return YES; } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkConnectionInspector.h0000644000175000000000000000073310257601661027413 0ustar gurkanroot#include #include @interface GormConnectionInspector : IBInspector { id currentConnector; NSMutableArray *connectors; NSArray *actions; NSArray *outlets; NSBrowser *newBrowser; NSBrowser *oldBrowser; } @end @implementation GormConnectionInspector (st) @end @interface StepTalkConnectionInspector : GormConnectionInspector { } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkConnectionInspector.m0000644000175000000000000000374710257601661027430 0ustar gurkanroot#include #include "StepTalkConnectionInspector.h" @implementation StepTalkConnectionInspector - (void) setObject: (id)anObject { if (anObject != nil) { NSArray *array; [super setObject: anObject]; // DESTROY(currentConnector); RELEASE(connectors); /* * Create list of existing connections for selected object. */ connectors = [NSMutableArray new]; array = [[(id)NSApp activeDocument] connectorsForSource: object ofClass: [NSNibControlConnector class]]; [connectors addObjectsFromArray: array]; array = [[(id)NSApp activeDocument] connectorsForSource: object ofClass: [NSNibOutletConnector class]]; [connectors addObjectsFromArray: array]; RELEASE(outlets); //outlets = RETAIN([[(id)NSApp classManager] allOutletsForObject: object]); outlets = [[(StepTalkClass*)[self object] outlets] retain]; DESTROY(actions); [oldBrowser loadColumnZero]; /* * See if we can do initial selection based on pre-existing connections. */ if ([NSApp isConnecting] == YES) { id dest = [currentConnector destination]; unsigned row; for (row = 0; row < [connectors count]; row++) { id con = [connectors objectAtIndex: row]; if ([con destination] == dest) { ASSIGN(currentConnector, con); [oldBrowser selectRow: row inColumn: 0]; break; } } } [newBrowser loadColumnZero]; if (currentConnector == nil) { if ([connectors count] > 0) { currentConnector = RETAIN([connectors objectAtIndex: 0]); } else if ([outlets count] == 1) { [newBrowser selectRow: 0 inColumn: 0]; [newBrowser sendAction]; } } if ([currentConnector isKindOfClass: [NSNibControlConnector class]] == YES && [NSApp isConnecting] == NO) { [newBrowser setPath: @"/target"]; [newBrowser sendAction]; } [self updateButtons]; } } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkIcon.png0000644000175000000000000000704610257601661024656 0ustar gurkanrootPNG  IHDR00WbKGD pHYs  tIME # IDATh޽mp\uݻ//Ƙ\Pءax)iڔN:Lh ә-L4ehKi\221_d[-˶dJ~jw1{{9w `زvXcj*֔j"b}o}Kqos_9+j!ua8C1:&p~kG\4K˜E$MAR:DF+>S9WBKɛ4wCb__@θ,C2Ri1Uީ_9&Uƺ͉=c|aێ5f мT]tD_}2NJRd4KVsȡ@PA)"U|Ϩ!fCw_yW]wF 5GrhZ@.4 xp =#m64umFcܷ~F%ձ^-IIq8΁uzK0Gftƒ3ȬF 75<'f,&/!w|} ʑ9G؄3 BX<|KN#пc*O!L 0ܸfw/FxO= -a3+i:ٜ"L?4oa`q=AZrioK&hjQh;C8|#^~Z^ުgh=]nʟ޼L~PIC wѵF]4~Pxמ-ڱSDѼL-S-"f>`x8~z}K &s(a? ƘiO".ī_X T̪Щ_Y}>RnA3m2pm XUfm~kK;S&luҩ䄁yېQV40\I.iٺ(;`&apmm)R/Zu6&Z?vCeWhCS#Nĩ X„h#Qo]*3nLE =qr |rc%]YQ_e6!fתlTM: AN~мbluxOx/RC5g*rCd>|sQ*WN>b@uz=n܆t}VU|OM]8x.FrqTXlYZ\QQU5ɸLeoX:c\k]Y? n)DN)zU\Ѣ0-WBT7ڽh^,nE͛eFZ %MWP!P'!3XHp1U}/M@E01iҕҚ"8 ɱA"g8:;ƢuX}9^E@.bM*upꀟ,~joGtJe59X |2fM 3gv3r,}Ae.@vt5r3&:Y>IEMm8e @f&8-{7]y='~ CEW;.z$j0Cqhhl F88q A 9/K<'`'KR: Z;NM>>UEP-`WHkQ4aT+GyL)R(K@O2s)r^|j:ߔ\gsAP>yX}MpxlxeqW RR OϓK*%i2`X.h_| Vґ,c WU("P?j !:. ec_XgPݶnJ FIr-Z-eFpPDR*S4~,ǂ;YΓJOO < \"g=Zٔw 7ępSuLk@ $j']Ǫ%)I:..iɞï8U kOnuaN >BRf٦%C.wD7M?W閞$iI;{~֬_ ' ^ɒPYOϱi^PUՒ&% Remove&&&&&&&&%0?&0@&&&&0A1 NSTextField% A Cp B A  B A& 0B &%0C0D&% Outlets0E% A@&&&&&&&&0%0F0G&% System0H&% textBackgroundColor0IG0J& %  textColor0K0L&% System0M&% windowBackgroundColor0N&% Window0O&% List of outletsO ? ? F@ F@%&   D Da0P& %  TextField0Q% B C C1 A  C1 A& 0R &%0S0T&&&&&&&&&0%0U0V&% System0W&% textBackgroundColor0XV0Y& %  textColor0Z&% Button0[% CN A  B` A  B` A&!0\ &%0]0^&% Save&&&&&&&&%0_&0`&&&&0a&% TextView0b1 NSTextView1 NSText% A @ Ce C  Ce C&0c &0d0e&% System0f&% textBackgroundColor  K K0ge0h& %  textColor Ce K0i& %  InspectorWin0j0k&%NSWindow %  C C&% C D;0l %  C C  C C&0m &[0n% A B( C| C  C| C&0o &0p% A @ Ce C A @ Ce C&0q &bd0r% @ @ A C  A C&0s &%0t0u&&&&&&&&&&np% A A A A rQ0v% A C B A  B A& 0w &%0x0y& %  Script name:E&&&&&&&&0%0z0{&% System0|&% textBackgroundColor0}{0~& %  textColor0% A A  Bp A  Bp A&0 &%00&% outlets&&&&&&&&%0&0&&&&00&% System0&% windowBackgroundColor0&% Window0&% Inspector Window ? ? F@ F@%&   D Da0&% GSCustomClassMap0&0& %  ScrollViewn0& %  ScrollView1 0& %  TableColumn100&% column2 BT A GP00&%  &&&&&&&&0%00&% System0&% controlShadowColor00&% System0&% windowFrameTextColor00&% three&&&&&&&&0%00&% textBackgroundColor00& %  textColor0& %  TextField1v0& %  TableColumn00&% column1 C' A GP0&&&&&&&&0%0L0&% controlShadowColor00&% quatre&&&&&&&&0%0& %  TextField2A0& %  TableColumn20&% Button10&% GormNSTableView0& %  TableColumn300&% column2 C A GP0&&&&&&&&0%00&% nine&&&&&&&&0%"$0&% Button250&% Button3;0 &01!NSNibConnectori01"NSNibOutletConnectori01#NSMutableString&% window0!Z0!0!a01$NSNibControlConnectorZ0#&% ok:0"a0&% textView0!P0!0"P0±&% name0ñ!0ı!0ű!0Ʊ!0DZ!0ȱ!0ɱ!0ʱ!0˱!0̱!0ͱ!0α$0ϱ#&% makeKeyAndOrderFront:0б$0ѱ#& %  addOutlet:0ұ$0ӱ#& %  removeOutlet:0Ա$P0ձ#&% ok:0ֱ"0ױ#&% outlets0ر"0ٱ#& %  dataSource01% GSMutableSet1& NSMutableSet1'NSSet&jsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkInspector.h0000644000175000000000000000037510257601661025375 0ustar gurkanroot#include #include @interface StepTalkInspector : IBInspector { NSTextView* textView; NSTextField* name; NSTableView* outlets; @private NSMutableArray* variables; } - (void) getVariables; @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkInspector.m0000644000175000000000000000411010257601661025371 0ustar gurkanroot#include #include "StepTalkInspector.h" @implementation StepTalkInspector - (id) init { self = [super init]; [NSBundle loadNibNamed:@"StepTalkInspector" owner:self]; NSLog (@"init inspector, outlets: %@", outlets); return self; } - (void) addOutlet: (id) sender { StepTalkView* stv = (StepTalkView*) [self object]; [stv addIVar: @"newOutlet"]; [self getVariables]; } - (void) removeOutlet: (id) sender { int row = [outlets selectedRow]; if (row < [variables count]) { StepTalkView* stv = (StepTalkView*) [self object]; [stv removeIVar: [variables objectAtIndex: row]]; [self getVariables]; } } - (void) ok: (id) sender { StepTalkView* stv = (StepTalkView*) [self object]; [stv setScript: [[textView textStorage] string]]; [stv setTitle: [name stringValue]]; [self getVariables]; [super ok:sender]; } - (void) revert: (id) sender { StepTalkView* stv = (StepTalkView*) [self object]; NSString* script = [stv script]; NSMutableAttributedString* ascript = [[NSMutableAttributedString alloc] initWithString: script]; [[textView textStorage] setAttributedString: ascript]; [name setStringValue: [stv title]]; [self getVariables]; [super revert:sender]; } - (void) getVariables { [variables release]; StepTalkView* stv = (StepTalkView*) [self object]; variables = [[stv variablesArray] retain]; NSLog (@"getVariables(%@)", variables); [outlets reloadData]; } - (int)numberOfRowsInTableView:(NSTableView *)aTableView { int ret = [variables count]; NSLog (@"nb of rows (%d)", ret); return ret; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { id val = [variables objectAtIndex: rowIndex]; return val; } - (void)tableView: (NSTableView *) aTableView setObjectValue: (id) newKey forTableColumn: (NSTableColumn *) aTableColumn row: (int) rowIndex { if (newKey != nil) { id prev = [variables objectAtIndex: rowIndex]; StepTalkView* stv = (StepTalkView*) [self object]; [stv renameIVar: prev to: newKey]; [self getVariables]; } } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.gorm/0000755000175000000000000000000010257601661025612 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.gorm/data.classes0000644000175000000000000000030110257601661030074 0ustar gurkanroot{ "## Comment" = "Do NOT change this file, Gorm maintains it"; StepTalkPalette = { Actions = ( ); Outlets = ( buttonSTObject, buttonSTClass ); Super = IBPalette; }; }steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.gorm/data.info0000644000175000000000000000032210257601661027375 0ustar gurkanrootGNUstep archive00002af9:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&% Latest Version0& %  Typed Streamsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.gorm/objects.gorm0000644000175000000000000000407710257601661030141 0ustar gurkanrootGNUstep archive00002af9:0000001b:0000002e:00000000:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&%NSOwner0&% StepTalkPalette0&% GSCustomClassMap0&0& %  PaletteWin01GSWindowTemplate1GSClassSwapper0 &%NSWindow1NSWindow1 NSResponder%  C C &% C D 0 1 NSView%  C C   C C &0 1 NSMutableArray1 NSArray&0 1 GSCustomView1 GSNibItem0 & %  StepTalkView A B B B&01NSButton1 NSControl% B BH B B  B B&0 &%01 NSButtonCell1 NSActionCell1NSCell0&% Script01NSFont%&&&&&&&&%0&0&&&&0% C@ BH B B  B B&0 &%00&% Class&&&&&&&&%0&0&&&&01NSColor0&%NSNamedColorSpace0&% System0&% windowBackgroundColor0&% Window0 &% Palette Window  ? ? F@ F@%&   D Da0!&% Button10"&% GormCustomView 0#&% Button0$ &0%1NSNibConnector"0&#0'1NSNibOutletConnector0(1NSMutableString&% originalWindow0)!0*#0+&% buttonSTObject0,!0-& %  buttonSTClass0.1 GSMutableSet1 NSMutableSet1NSSet&steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.h0000644000175000000000000000031710257601661025021 0ustar gurkanroot/* All Rights reserved */ #include #include @interface StepTalkPalette : IBPalette { NSButton *buttonSTObject; NSButton *buttonSTClass; } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.m0000644000175000000000000000537210257601661025034 0ustar gurkanroot/* All Rights reserved */ #include #include #include #include #include #include "StepTalkPalette.h" static NSImage* image = nil; static NSImage* imageView = nil; @implementation NSApplication (nico) - (BOOL) sendAction: (SEL)aSelector to: (id)aTarget from: (id)sender { id resp = [self targetForAction: aSelector to: aTarget from: sender]; if (resp != nil) { NSInvocation *inv; NSMethodSignature *sig; sig = [resp methodSignatureForSelector: aSelector]; inv = [NSInvocation invocationWithMethodSignature: sig]; [inv setSelector: aSelector]; if ([sig numberOfArguments] > 2) { [inv setArgument: &sender atIndex: 2]; } [inv invokeWithTarget: resp]; return YES; } return NO; } @end @implementation StepTalkView (StepTalkPaletteInspector) - (NSString *) connectInspectorClassName { return @"StepTalkConnectionInspector"; } - (NSString *) inspectorClassName { return @"StepTalkInspector"; } - (NSImage*) imageForView { return image; } @end @implementation StepTalkObject (StepTalkPalette) - (NSString *) connectInspectorClassName { return @"StepTalkConnectionInspector"; } - (NSString *) inspectorClassName { return @"StepTalkInspector"; } @end @implementation StepTalkClass (StepTalkPalette) - (NSString *) connectInspectorClassName { return @"StepTalkConnectionInspector"; } - (NSString *) inspectorClassName { return @"StepTalkClassInspector"; } @end @implementation StepTalkMethod (StepTalkPalette) - (void) error: (NSException*) exc { NSString* title = [NSString stringWithFormat: @"Exception %@ in method %@", [exc name], signature]; NSRunAlertPanel (title, [exc reason], @"Ok", NULL, NULL); } @end @implementation StepTalkPalette + (void) initialize { if (self == [StepTalkPalette class]) { NSBundle* bundle = [NSBundle bundleForClass: [self class]]; NSString* path = [bundle pathForImageResource: @"StepTalkIcon.png"]; image = [[NSImage alloc] initWithContentsOfFile: path]; NSString* path2 = [bundle pathForImageResource: @"StepTalkViewIcon.png"]; imageView = [[NSImage alloc] initWithContentsOfFile: path]; } } - (void) finishInstantiate { id obj1 = [StepTalkObject new]; // associate the actual object with it's graphical representation. [buttonSTObject setImage: image]; [self associateObject: obj1 type: IBObjectPboardType with: buttonSTObject]; //id obj2 = [[StepTalkClass alloc] initWithName: @"MyClass"]; id obj2 = [StepTalkClass new]; // associate the actual object with it's graphical representation. [buttonSTClass setImage: image]; [self associateObject: obj2 type: IBObjectPboardType with: buttonSTClass]; } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkPalette.tiff0000644000175000000000000002245210257601661025526 0ustar gurkanrootMM*$[Tn0B@?>==<:94)z]Xn2CA=5110//.--2551z&r_Xn@B>3+'#"#""""! "$*/21r#kaZnBC;-&$$####"""!!! !#(-.k c5F&}T6%%$$#!^GhxcYPwPwPwPwPwPwPwUZc”sGy ne=V.f`* 'nb[nE/$${q=Y6$#ldfnפPwPwPwPwPwPwPwPwPwPwPwPwPw\f$~ x&}T.ldYTC=%%%$zpTGfIoyYPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwQzXr@vTC|aZ' #nb[nD-%%%$$$&}'}xPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwS|I jcRL5A%%%%$$#.!mYPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwU~G{qWQM FnH2%%%$$$$#yWmգPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwOvtc&~\V<8aZnC-%%$$$$!kcvPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwEg1!b[JF5@'%$$$$#a{{bPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwHly[.ofNHF7%$$$$$#zdYPwPwPwPwPwCd-# %8lSPwPwPwPwPwLqZhn5|LG62G5$$$$$$"vmrߪPwPwPwPwPwPw *Q>ImMs "B2PwPwPwPwPwPwPwPwPwPwPwPw@}_~P,wD?0 -C/$$####cEkcPwPwPwPwPwPwPwPwPwPwImPwPwPwPwPwPwPwPwPwPwPwPw7lRG,uB=/ ,B.$####" `Yh̛PwPwPwPwPwPw,";tYMsKp,VB PwPwPwPwPwPwPwPwPwPwPwPw-XCB+t@;- *B0####""!vmeƗPwPwPwPwPwPw8nT%(@}`PwPwPwPwPwPwPwPwPwPwPwPw*S?> }s>9A2####""!{[lpYPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPw~|r<807###"""!eBkZPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPw1`IC6~~}ne:6: 5e^;'#"""!! {]}RzPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwEgSI]=%}}z\T95?.""""!!!xpVPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPw%I7F/~}||rB=G B.4"""!!!!iAnOwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPw.[FE8~}|{lc629 4`Z9&"!!!! "Y{sMsPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPwPw:pVL@U>!~}|{xUN51,(?<."!!! %g[uHkLqPwPwPwPwPwPwPwPwPwPwPwPwPwDf.ZD|B}>,~}|{zvl<8F @]W7%!! &}A~UjkFiPwPwPwPwPwPwPwPwPwPwPw9pVQEZE?)}|{zxPJ3 /,(?:,!! #,nUx:qV=y\Ab@~`PwPwPw)~|{zzpMG1 .,(?({3% #)+48)}F<4., ~}|{tQK2 /e]* '?5.! xo8~}|yg^8 4%" * &?3+ rj3}|yja<8SM0" ' $?1*!nf1~}wjb?;TN,(xEB>$% #?/+"ja/~~sTN=8UO,(TPUC3$ "?-*!e],|{pSM;7) &c_YUNB4$i b)$aY*uc[FA:6g^phc\TMC6$! ?b[&z#~]V(zukc[LGB>JD,(c_\WRPPM; C[Uw$ov"ov~VO'~|yod]RMGCA=LF,(VUQNLIDCD4),(H84QKjcjckdc\d]KFo g]VZSWQNHHCOI> 8,(i=<<;;<>5*%"1.0 -. +, )+ () &( %& $% #> 9#########"00$ 8$@$%%"(R/home/nico/Projets/StepTalkPalette/StepTalkPalette.tiffHHsteptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkView.m0000644000175000000000000000415710257601661024350 0ustar gurkanroot/* All Rights reserved */ #include #include #include #include "StepTalkPalette.h" @implementation StepTalkView (StepTalkPaletteInspector) - (NSString*) findOutlet: (NSString*) sel { NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; if ([sel isEqualToString: method]) { return key; } } return nil; } - (id) performSelector: (SEL) selector withObject: (id) obj { NSString* sel = NSStringFromSelector(selector); NSLog (@"performSelector (%@) withObject: (%@)", sel, obj); NSString* ivar = [self findOutlet: sel]; if (ivar != nil) { [self setIVar: obj withName: ivar]; return self; } else { return [[self class] performSelector: selector withObject: obj]; } } - (BOOL) respondsToSelector: (SEL) selector { NSString* sel = NSStringFromSelector(selector); NSLog (@"respondsToSelector (%@)", sel); if ([self findOutlet: sel] != nil) { NSLog (@"findOutlet(%@) YES", sel); return YES; } BOOL ret = [[self class] instancesRespondToSelector: selector]; NSLog (@"respondsToSelector (%@) -> (%d)", sel, ret); return ret; } - (void) setOutlets { NSLog (@"setOutlets"); id cm = [NSApp classManager]; NSArray* outlets = [cm extraOutletsForObject: self]; NSLog (@"outlets <%@>", outlets); NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { NSLog (@"add outlet %@", key); [cm addOutlet: key forClassNamed: @"StepTalkView"]; NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; NSLog (@"add sel (%@)", method); SEL retsel = GSSelectorFromNameAndTypes ([method cString], NULL); NSLog (@"retsel(%d): %@", retsel, NSStringFromSelector(retsel)); } //[cm addOutlet: @"TestANico" forClassNamed: @"StepTalkView"]; //[cm addAction: @"ActionNico:" forClassNamed: @"StepTalkView"]; } @end steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/StepTalkViewIcon.png0000644000175000000000000000152010257601661025500 0ustar gurkanrootPNG  IHDR00WbKGD pHYs  tIME3(: IDATh՚kAǿ;,^z)R<R SPPA#H4Pċz1[KP"EM X_m50̆fgvn.ɒ7{a۟/{3P`+8C-|L V쀮5ɓ]ׁ~ a2z) .c"օ7W,^нx# *&:S` 5].xq~/{AL,{`u YYëUF #Baօ7̄N5\y>mmŃG7񱉿FqtiH[uJ^n7?҅{7x`lds'$ E? l{r{PZNM<3U,ݜ3xucWpcL>OV4X֩D>7Sǯct ;~yVv!M@8:٪cKmjꎋYLϒ-bX5.=gR,1я)8%]ak9ȫT]2/!=UU*hЊB>AjPJ ٳV(;cmH^ V+eZ9iZD¨ΒmBVd1a 1bKM&$JLH;00FR20/dRVGbzIENDB`steptalk-0.10.0/Incubator/STPalette-1.2/StepTalkPalette/palette.table0000644000175000000000000000024110257601661024245 0ustar gurkanroot{ NibFile = "StepTalkPalette"; Class = "StepTalkPalette"; Icon = "StepTalkPalette"; ExportClasses = ("StepTalkView","StepTalkObject","StepTalkClass"); } steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/0000755000175000000000000000000010257601744021606 5ustar gurkanrootsteptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/Authors0000644000175000000000000000004210257601744023152 0ustar gurkanrootNicolas Roard steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/COPYING0000644000175000000000000006347410257601744022657 0ustar gurkanroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/ChangeLog0000644000175000000000000000074710257601744023370 0ustar gurkanroot26/06/05: v1.2 - added StepTalkClass, StepTalkMethod, StepTalkRuntime ... 15/06/05: v1.1 - added a StepTalkObject, similar to StepTalkView but without being a view ;-) (and StepTalkView was refactored to use a StepTalkObject) - removed the object1,object2,.. object9 outlets -- now you can add outlets dynamically and give them any names ! - StepTalkView now has its target/action set to itself -- so if you click on it, it will execute the script. 14/06/05: initial release steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/GNUmakefile0000644000175000000000000000272010257601744023661 0ustar gurkanroot# GNUmakefile # # Copyright (C) 1999 Free Software Foundation, Inc. # # Author: Richard Frith-Macdonald # Date: 1999 # # This file is part of GNUstep. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include $(GNUSTEP_MAKEFILES)/common.make LIBRARY_NAME = StepTalkView StepTalkView_OBJC_FILES = StepTalkObject.m StepTalkClass.m \ StepTalkMethod.m StepTalkRuntime.m \ StepTalkMetadatas.m StepTalkView.m StepTalkView_HEADER_FILES = StepTalkObject.h StepTalkClass.h \ StepTalkMethod.h StepTalkRuntime.h \ StepTalkMetadatas.h StepTalkView.h StepTalkView_HEADER_FILES_INSTALL_DIR = StepTalkView ADDITIONAL_LDFLAGS += -lStepTalk -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/README0000644000175000000000000000147310257601744022473 0ustar gurkanroot What's in this library ? ======================== 1) StepTalkObject & StepTalkView This library contains StepTalkObject, a simple object that hold a script (a mere NSString). When the execute: method is called, it executes the script via the StepTalk framework. You can define outlets and connect other objects to it. StepTalkView is a NSButton containing a StepTalkObject. By default its target/action is set to itself, so when you click on it it will execute the script contained in its StepTalkObject. 2) StepTalkClass StepTalkClass is an object containing methods and variables; the methods are stored as StepTalkMethods, and are executed through StepTalk. StepTalkClass instances can receive normal objective-c messages, and you can thus uses it to build entire applications in Gorm, using the StepTalkPalette. steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/SEAction.h0000644000175000000000000000036110257601744023424 0ustar gurkanroot/* All Rights reserved */ #ifndef __SE_ACTION_H__ #define __SE_ACTION_H__ #include #include #include "StepTalkMethod.h" #include "StepTalkRuntime.h" @interface SEAction : NSObject { } @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/SEAction.m0000644000175000000000000000273210257601744023435 0ustar gurkanroot/* All Rights reserved */ #include "SEAction.h" @implementation SEAction - (void) forwardInvocation: (NSInvocation*) anInvocation { NSLog (@"invocation : %@", NSStringFromSelector([anInvocation selector])); NSString* methodSignature = NSStringFromSelector([anInvocation selector]); NSMutableDictionary* arguments = [NSMutableDictionary new]; int nbArgs = [[anInvocation methodSignature] numberOfArguments]; StepTalkMethod* method = [methods objectForKey: methodSignature]; if (method == nil) // not found in the StepTalk class ... { NSLog (@"not in the class"); NSString* ivar = [self findOutlet: methodSignature]; NSLog (@"ivar: %@", ivar); if (ivar != nil) { id obj; if (nbArgs == 3) { [anInvocation getArgument: &obj atIndex: 2]; [self setIVar: obj withName: ivar]; } } else { // ... and not an ivar... // we call the superclass [superClass forwardInvocation: anInvocation]; } } else { int i; for (i=2; i< nbArgs; i++) { id arg; [anInvocation getArgument: &arg atIndex: i]; id argName = [method argumentAtIndex: i-2]; NSLog (@"arg(%d):<%@>=><%@>", i, argName, arg); [arguments setObject: arg forKey: argName]; } [self executeMethod: NSStringFromSelector([anInvocation selector]) withArguments: arguments]; } } - (NSMethodSignature*) methodSignatureForSelector: (SEL) aSelector { return STConstructMethodSignatureForSelector (aSelector); } - (BOOL) respondsToSelector: (SEL) selector { } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkClass.h0000644000175000000000000000365010257601744024500 0ustar gurkanroot/* All Rights reserved */ #ifndef __STCLASS_H__ #define __STCLASS_H__ #include #include #include "StepTalkMethod.h" #include "StepTalkRuntime.h" #include "StepTalkMetadatas.h" @interface StepTalkClass : NSObject { NSMutableDictionary* variables; NSMutableDictionary* methods; NSString* name; id superClass; StepTalkMetadatas* metadatas; } - (id) initWithName: (NSString*) aName; - (id) initWithName: (NSString*) aName parent: (NSString*) parentName; - (StepTalkMetadatas*) metadatas; - (BOOL) registerClass; - (void) addIvarsFromSuperclass; - (void) setName: (NSString*) aName; - (NSString*) name; - (id) superClass; - (void) setParent: (NSString*) aName; - (void) addMethod: (NSString*) methodName withContent: (NSString*) content; - (void) addMethod: (NSString*) methodName withContent: (NSString*) content returnType: (NSString*) returnType; - (void) removeMethod: (NSString*) methodName; - (void) checkReturnType: (StepTalkMethod*) method; - (StepTalkMethod*) getMethod: (NSString*) signature; - (id) invocationOfMethod: (NSString*) methodSignature withArguments: (NSArray*) args inClass: (id) class returnType: (NSString**) type; - (void) forwardInvocation: (NSInvocation*) anInvocation; - (NSMethodSignature*) methodSignatureForSelector: (SEL) aSelector; - (void) addIvar: (NSString*) aName withValue: (id) aValue; - (void) removeIvar: (NSString*) aName; - (id) setIvar: (NSString*) aName withValue: (id) aValue; - (void) renameMethod: (id) key to: (id) aName; - (void) renameIvar: (id) key to: (id) aName; - (id) ivarWithName: (NSString*) aName; - (void) addIvar: (NSString*) aName; - (NSMutableDictionary*) variables; - (NSMutableArray*) variablesArray; - (NSMutableArray*) methodsArray; - (SEL) getSelectorFromMethod: (NSString*) method; - (NSMutableArray*) outlets; - (NSMutableArray*) actions; - (NSString*) findOutlet: (NSString*) sel; - (void) setActions; - (void) setOutlets; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkClass.m0000644000175000000000000003062410257601744024506 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkClass.h" @implementation StepTalkClass /* * object initialization.. * ============================================================================================== */ - (void) encodeWithCoder: (NSCoder*) coder { //[super encodeWithCoder: coder]; [coder encodeObject: variables]; [coder encodeObject: methods]; [coder encodeObject: name]; [coder encodeObject: superClass]; [coder encodeObject: metadatas]; } - (id) initWithCoder: (NSCoder*) coder { //if (self = [super initWithCoder: coder]) { ASSIGN (variables, [coder decodeObject]); ASSIGN (methods, [coder decodeObject]); ASSIGN (name, [coder decodeObject]); ASSIGN (superClass, [coder decodeObject]); ASSIGN (metadatas, [coder decodeObject]); [self setActions]; [self setOutlets]; } return self; } - (id) init { //NSLog (@"init.."); if (self = [super init]) { //NSLog (@"init StepTalkClass"); variables = [NSMutableDictionary new]; methods = [NSMutableDictionary new]; name = [[NSString alloc] initWithString: @"StepTalkClass"]; metadatas = [StepTalkMetadatas new]; } return self; } - (void) dealloc { [variables release]; [methods release]; [name release]; [metadatas release]; [super dealloc]; } - (id) initWithName: (NSString*) aName { return [self initWithName: aName parent: @"NSObject"]; } - (id) initWithName: (NSString*) aName parent: (NSString*) parentName { StepTalkClass* obj = [StepTalkClass new]; [obj setName: aName]; [obj setParent: parentName]; [obj registerClass]; [obj addIvarsFromSuperclass]; return obj; } /* * accessors/modifiers * ============================================================================================== */ - (StepTalkMetadatas*) metadatas { return metadatas; } - (BOOL) registerClass { id runtime = [StepTalkRuntime defaultRuntime]; [runtime addClass: self]; return YES; } - (void) addIvarsFromSuperclass { if ([superClass respondsToSelector: @selector(variables)]) { NSDictionary* ivars = [superClass variables]; NSEnumerator* enumerator = [ivars keyEnumerator]; id key; while ((key = [enumerator nextObject])) { [self addIvar: key withValue: [ivars objectForKey: key]]; } [self addIvar: @"self" withValue: self]; } } - (void) setName: (NSString*) aName { ASSIGN (name, aName); } - (NSString*) name { return name; } - (id) superClass { return superClass; } - (void) setParent: (NSString*) aName { id runtime = [StepTalkRuntime defaultRuntime]; id class = [runtime classForName: aName]; if (class == nil) // we can try to get an ObjC class { class = NSClassFromString(aName); } ASSIGN (superClass, class); } - (void) addMethod: (NSString*) methodName withContent: (NSString*) content { [self addMethod: methodName withContent: content returnType: @"id"]; } - (void) addMethod: (NSString*) methodName withContent: (NSString*) content returnType: (NSString*) returnType { //NSLog (@"addMethod: %@ withContent: %@", methodName, content); StepTalkMethod* method = [StepTalkMethod new]; [method setName: methodName]; [method setContent: content]; [method setReturnType: returnType]; [self checkReturnType: method]; [methods setObject: method forKey: [method signature]]; SEL retsel = [self getSelectorFromMethod: [method signature]]; [method release]; } - (void) removeMethod: (NSString*) methodName { [methods removeObjectForKey: methodName]; } - (void) checkReturnType: (StepTalkMethod*) method { //FIXME: that's ugly, I should find another way... if ([[method signature] isEqualToString: @"awakeFromNib"]) { //NSLog (@"awakeFromNib, we set the return value to void"); [method setReturnType: @"void"]; } } - (StepTalkMethod*) getMethod: (NSString*) signature { return [methods objectForKey: signature]; } /* * Method invocation * ============================================================================================== */ - (id) invocationOfMethod: (NSString*) methodSignature withArguments: (NSArray*) args inClass: (id) class returnType: (NSString**) type; { //NSLog (@"invocationOfMethod: %@ withArguments: %@ inClass: %@", // methodSignature, args, class); StepTalkMethod* method = [methods objectForKey: methodSignature]; id result; //NSLog (@"method: %@", method); if (method == nil) // we didn't find it in the methods, // butwe check if it corresponds to an accessor { id outlet; if ((outlet = [variables objectForKey: methodSignature])) { *type = @"id"; return outlet; } if ((outlet = [self findOutlet: methodSignature]) != nil) { [self setIvar: outlet withValue: [args objectAtIndex: 0]]; *type = @"id"; return nil; } } if (method == nil) // not found in this class ... { // we call the superclass result = [superClass invocationOfMethod: methodSignature withArguments: args inClass: class returnType: type]; } else // we found the method, so we execute it. { //NSLog (@"method returnType: %@", [method returnType]); // *type = [method returnType]; // NSLog (@"type: %@", type); if ([args count] == 0) { //NSLog (@"executeWithDictionary(%@)", [class variables]); result = [method executeWithDictionary: [class variables]]; //NSLog (@"result: %@", result); } else { //NSLog (@"executeWithDictionary(%@)andArguments:(%@)", [class variables], args); result = [method executeWithDictionary: [class variables] andArguments: args]; //NSLog (@"result: %@", result); } } //NSLog (@"invocationOfMethod: %@ withArguments: %@ inClass: %@ => (%@)", // methodSignature, args, class, result); return result; } - (void) forwardInvocation: (NSInvocation*) anInvocation { id result; int i; NSString* methodSignature = NSStringFromSelector([anInvocation selector]); NSMutableArray* args = [NSMutableArray new]; int nbArgs = [[anInvocation methodSignature] numberOfArguments]; //NSLog (@"invocation : %@", methodSignature); //NSLog (@"message return type: %s", [[anInvocation methodSignature] // methodReturnType]); //[anInvocation setType]; for (i=2; i< nbArgs; i++) { id arg; [anInvocation getArgument: &arg atIndex: i]; [args addObject: arg]; } //NSLog (@"args: %@", args); id type = [NSString stringWithString: @"id"]; result = [self invocationOfMethod: methodSignature withArguments: args inClass: self returnType: &type]; [args release]; //FIXME: At the moment, the only correct possibility is returning an object (id) // I think the problem is in the construction of the method signature. // it should be possible to specify int and char* return type. At least int would be useful :-) // update: tried setting an int as return in the signature, but that doesn't work.. /* if ([type isEqualToString: @"int"]) { int ret = [result intValue]; [anInvocation setReturnValue: &ret]; int retval = 0; [anInvocation getReturnValue: &retval]; //[anInvocation setType]; } else if ([type isEqualToString: @"char*"]) { const char* ret = [result cString]; [anInvocation setReturnValue: &ret]; //[anInvocation setType]; } else if ([type isEqualToString: @"id"]) */ { //NSLog (@"final result: (%@)", result); // if (result != nil) [anInvocation setReturnValue: &result]; // else // [anInvocation setReturnValue: self]; //[anInvocation setType]; } } - (NSString*) methodSignatureForSelector: (NSString*) sel withReturnType: (NSString*) type { const char *csel = [sel cString]; const char *ptr = csel; int nbargs = 0; int i; NSMutableString* selector = [NSMutableString new]; while (*ptr) { if (*ptr == ':') { nbargs++; } ptr++; } if ([type isEqualToString: @"void"]) { [selector appendString: @"v0@+4:+8"]; } else if ([type isEqualToString: @"int"]) { [selector appendString: @"i0@+4:+8"]; } else { [selector appendString: @"@0@+4:+8"]; } int base = 12; for (i=0; i < nbargs; i++) { [selector appendString: [NSString stringWithFormat: @"@+%d", base]]; base += 4; } //NSLog (@"methodSignatureForSelector: %@ ==> %@", sel, selector); return [selector autorelease]; } - (NSMethodSignature*) methodSignatureForSelector: (SEL) aSelector { NSMethodSignature* signature; signature = [super methodSignatureForSelector: aSelector]; if (signature == nil) { NSString* methodSel = NSStringFromSelector(aSelector); StepTalkMethod* method = [methods objectForKey: methodSel]; NSString* sel = [self methodSignatureForSelector: methodSel withReturnType: [method returnType]]; signature = [NSMethodSignature signatureWithObjCTypes: [sel cString]]; } return signature; } /* * internal variables * ============================================================================================== */ - (void) addIvar: (NSString*) aName withValue: (id) aValue { [variables setObject: aValue forKey: aName]; } - (void) removeIvar: (NSString*) aName { [variables removeObjectForKey: aName]; } - (id) setIvar: (NSString*) aName withValue: (id) aValue { if ([variables objectForKey: aName] != nil) { [variables setObject: aValue forKey: aName]; return aValue; } return nil; } - (void) renameMethod: (id) key to: (id) aName { StepTalkMethod* prev = [[methods objectForKey: key] retain]; if (prev != nil) { [prev setName: aName]; SEL retsel = [self getSelectorFromMethod: [prev signature]]; [self checkReturnType: prev]; [methods removeObjectForKey: key]; [methods setObject: prev forKey: [prev signature]]; [prev release]; [self setActions]; } } - (void) renameIvar: (id) key to: (id) aName { id prev = [[variables objectForKey: key] copy]; if (prev != nil) { [variables setObject: prev forKey: aName]; [prev release]; [variables removeObjectForKey: key]; [self setOutlets]; } } - (id) ivarWithName: (NSString*) aName { return [variables objectForKey: aName]; } - (void) addIvar: (NSString*) aName { [self addIvar: aName withValue: @""]; } - (NSMutableDictionary*) variables { return variables; } - (NSMutableArray*) variablesArray { NSMutableArray* array = [NSMutableArray new]; NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { [array addObject: key]; } return [array autorelease]; } - (NSMutableArray*) methodsArray { NSMutableArray* array = [NSMutableArray new]; NSEnumerator* enumerator = [methods keyEnumerator]; id key; while ((key = [enumerator nextObject])) { [array addObject: [methods objectForKey: key]]; } return [array autorelease]; } /* * Other stuff * ============================================================================================== */ - (SEL) getSelectorFromMethod: (NSString*) method { SEL sel; sel = NSSelectorFromString(method); if (!sel) { const char *aName = [method cString]; sel = sel_register_name(aName); } return sel; } - (NSMutableArray*) outlets { return [self variablesArray]; } - (NSMutableArray*) actions { NSMutableArray* array = [NSMutableArray new]; NSEnumerator* enumerator = [methods keyEnumerator]; id key; while ((key = [enumerator nextObject])) { [array addObject: key]; } return [array autorelease]; } - (NSString*) findOutlet: (NSString*) sel { NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; if ([sel isEqualToString: method]) { return key; } } return nil; } - (void) setActions { //NSLog (@"setActions"); NSEnumerator* enumerator = [methods keyEnumerator]; id key; while ((key = [enumerator nextObject])) { SEL retsel = [self getSelectorFromMethod: key]; } } - (void) setOutlets { NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { //NSLog (@"add outlet %@", key); //[cm addOutlet: key forClassNamed: @"StepTalkObject"]; NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; //NSLog (@"add sel (%@)", method); SEL retsel = GSSelectorFromNameAndTypes ([method cString], NULL); //NSLog (@"retsel(%d): %@", retsel, NSStringFromSelector(retsel)); } } - (BOOL) respondsToSelector: (SEL) sel { BOOL ret = NO; NSString* signature = NSStringFromSelector (sel); //NSLog (@"STClass respondsToSelector(%@)", signature); id method = [methods objectForKey: signature]; if (method != nil) ret = YES; if ([self findOutlet: signature] != nil) ret = YES; //NSLog (@"STClass respondsToSelector(%@) => %d", signature, ret); return ret; } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkMetadatas.h0000644000175000000000000000037210257601744025334 0ustar gurkanroot/* All Rights reserved */ #ifndef __STMETADATAS_H__ #define __STMETADATAS_H__ #include #include @interface StepTalkMetadatas : NSObject { NSMutableDictionary* tags; NSString* documentation; } @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkMetadatas.m0000644000175000000000000000166510257601744025347 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkMetadatas.h" @implementation StepTalkMetadatas - (void) encodeWithCoder: (NSCoder*) coder { //[super encodeWithCoder: coder]; [coder encodeObject: tags]; [coder encodeObject: documentation]; } - (id) initWithCoder: (NSCoder*) coder { //if (self = [super initWithCoder: coder]) { ASSIGN (tags, [coder decodeObject]); ASSIGN (documentation, [coder decodeObject]); } return self; } - (id) init { if (self = [super init]) { tags = [NSMutableDictionary new]; } return self; } - (void) dealloc { [tags release]; [documentation release]; [super dealloc]; } - (NSMutableDictionary*) tags { return tags; } - (void) addTag: (id) tag value: (id) value { [tags setObject: value forKey: tag]; } - (id) tag: (id) tag { return [tags objectForKey: tag]; } - (void) setDocumentation: (NSString*) doc { ASSIGN(documentation, doc); } - (NSString*) documentation { return documentation; } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkMethod.h0000644000175000000000000000177210257601744024656 0ustar gurkanroot/* All Rights reserved */ #ifndef __STMETHOD_H__ #define __STMETHOD_H__ #include #include #include "StepTalkMetadatas.h" @interface StepTalkMethod : NSObject { NSString* name; NSMutableString* signature; NSMutableArray* arguments; NSString* content; NSString* returnType; StepTalkMetadatas* metadatas; } - (NSString*) description; - (void) setName: (NSString*) aName; - (void) addArgument: (NSString*) anArgument; - (void) setContent: (NSString*) aContent; - (void) setReturnType: (NSString*) aType; - (NSString*) name; - (NSArray*) arguments; - (NSString*) argumentAtIndex: (int) index; - (NSString*) content; - (NSString*) signature; - (NSString*) returnType; - (StepTalkMetadatas*) metadatas; - (int) numberOfArguments; - (void) parseMethodName; - (void) error: (NSException*) exc; - (id) executeWithDictionary: (NSMutableDictionary*) variables andArguments: (NSArray*) args; - (id) executeWithDictionary: (NSMutableDictionary*) variables; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkMethod.m0000644000175000000000000001104710257601744024657 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkMethod.h" @implementation StepTalkMethod - (void) encodeWithCoder: (NSCoder*) coder { //[super encodeWithCoder: coder]; [coder encodeObject: name]; [coder encodeObject: signature]; [coder encodeObject: arguments]; [coder encodeObject: content]; [coder encodeObject: returnType]; [coder encodeObject: metadatas]; } - (id) initWithCoder: (NSCoder*) coder { //if (self = [super initWithCoder: coder]) { ASSIGN (name, [coder decodeObject]); ASSIGN (signature, [coder decodeObject]); ASSIGN (arguments, [coder decodeObject]); ASSIGN (content, [coder decodeObject]); ASSIGN (returnType, [coder decodeObject]); ASSIGN (metadatas, [coder decodeObject]); } return self; } - (id) init { if (self = [super init]) { name = [NSString new]; signature = [NSMutableString new]; arguments = [NSMutableArray new]; content = [NSString new]; metadatas = [StepTalkMetadatas new]; } return self; } - (void) dealloc { [name release]; [signature release]; [arguments release]; [content release]; [metadatas release]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ {%@}",name,content]; } - (void) setName: (NSString*) aName { ASSIGNCOPY (name, aName); [self parseMethodName]; } - (void) addArgument: (NSString*) anArgument { [arguments addObject: anArgument]; } - (void) setContent: (NSString*) aContent { ASSIGNCOPY (content, aContent); } - (void) setReturnType: (NSString*) aType { ASSIGNCOPY (returnType, aType); } - (NSString*) name { return name; } - (NSArray*) arguments { return arguments; } - (NSString*) argumentAtIndex: (int) index { return [arguments objectAtIndex: index]; } - (NSString*) content { return content; } - (NSString*) signature { return signature; } - (NSString*) returnType { return returnType; } - (StepTalkMetadatas*) metadatas { return metadatas; } - (int) numberOfArguments { return [arguments count]; } - (void) error: (NSException*) exc { NSLog (@"exception %@ in method %@ : %@", [exc name], signature, [exc reason]); } - (void) parseMethodName { NSMutableArray* final = [NSMutableArray new]; NSArray* array = [name componentsSeparatedByString: @":"]; [signature release]; signature = [NSMutableString new]; [arguments release]; arguments = [NSMutableArray new]; int i; for (i=0; i<[array count]; i++) { NSString* str = [array objectAtIndex: i]; NSArray* arr = [str componentsSeparatedByString: @" "]; int j; for (j=0; j<[arr count]; j++) { NSString* str = [arr objectAtIndex: j]; if ([str length] > 0) [final addObject: str]; } } for (i=1; i<[final count]; i+=2) { NSString* arg = [final objectAtIndex: i]; [arguments addObject: arg]; } for (i=0; i<[final count]; i+=2) { NSString* arg = [final objectAtIndex: i]; if (i>0) [signature appendString: @":"]; [signature appendString: arg]; } if ([arguments count] > 0) [signature appendString: @":"]; //NSLog (@"arguments (%d): {%@}", [arguments count], arguments); //NSLog (@"signature (%@)", signature); } - (id) executeWithDictionary: (NSMutableDictionary*) variables andArguments: (NSArray*) args { int i; id result; if ([args count] == [arguments count]) { for (i=0; i<[args count]; i++) { [variables setObject: [args objectAtIndex: i] forKey: [arguments objectAtIndex: i]]; } result = [self executeWithDictionary: variables]; } else { NSLog (@"Error in calling %@, number of arguments incorrects (%d/%d) (%@)", signature, [arguments count], [args count], args); } return result; } - (id) executeWithDictionary: (NSMutableDictionary*) variables { id key; id result = nil; //NSLog (@"STMethod executeWithDictionary (%@)", variables); STEngine* engine = [STEngine engineForLanguageWithName: @"Smalltalk"]; STEnvironment* env = [[STEnvironment alloc] initWithDefaultDescription]; NSEnumerator* enumerator = [variables keyEnumerator]; while ((key = [enumerator nextObject])) { id obj = [variables objectForKey: key]; [env setObject: obj forName: key]; } //NSLog (@"pre environment {%@}", [env objectDictionary]); NS_DURING result = [engine executeCode: content inEnvironment: env]; NS_HANDLER NSLog (@"Execution error in this method: {%@} with env {%@}", content, variables); [self error: localException]; NS_ENDHANDLER // We change back the variables.. enumerator = [variables keyEnumerator]; while ((key = [enumerator nextObject])) { id obj = [env objectWithName: key]; [variables setObject: obj forKey: key]; } [env release]; //NSLog (@"STMethod executeWithDictionary (%@) => (%@)", variables, result); return result; } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkObject.h0000644000175000000000000000137010257601744024636 0ustar gurkanroot/* All Rights reserved */ #ifndef __STOBJECT_H__ #define __STOBJECT_H__ #include #include @interface StepTalkObject : NSObject { NSString* script; NSMutableDictionary* variables; NSString* title; } - (NSString*) findOutlet: (NSString*) sel; - (void) setTitle: (NSString*) title; - (NSString*) title; - (void) addIVar: (NSString*) name; - (void) removeIVar: (NSString*) name; - (void) renameIVar: (id) key to: (id) name; - (void) setIVar: (id) obj withName: (NSString*) name; - (id) ivarWithName: (NSString*) name; - (NSMutableArray*) variablesArray; - (NSMutableDictionary*) variables; - (void) setOutlets; - (NSString*) script; - (void) execute: (id) sender; - (void) setScript: (NSString*) aScript; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkObject.m0000644000175000000000000001042410257601744024643 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkObject.h" @implementation StepTalkObject - (void) encodeWithCoder: (NSCoder*) coder { //[super encodeWithCoder: coder]; [coder encodeObject: script]; [coder encodeObject: variables]; } - (id) initWithCoder: (NSCoder*) coder { //if (self = [super initWithCoder: coder]) { ASSIGN (script, [coder decodeObject]); ASSIGN (variables, [coder decodeObject]); [self setOutlets]; } return self; } - (id) init { if (self = [super init]) { variables = [NSMutableDictionary new]; } return self; } - (void) dealloc { [variables release]; [super dealloc]; } - (void) setTitle: (NSString*) aTitle { ASSIGN (title, aTitle); } - (NSString*) title { return title; } - (void) addIVar: (NSString*) name { id obj = [variables objectForKey: name]; if (obj == nil) // no var.. { [self setIVar: @"" withName: name]; [self setOutlets]; } } - (void) removeIVar: (NSString*) name { [variables removeObjectForKey: name]; } - (void) renameIVar: (id) key to: (id) name { id prev = [[variables objectForKey: key] copy]; if (prev != nil) { [variables setObject: prev forKey: name]; [prev release]; [variables removeObjectForKey: key]; [self setOutlets]; } } - (void) setIVar: (id) obj withName: (NSString*) name { NSLog (@"setIVar (%@) withName: (%@)", obj, name); [variables setObject: obj forKey: name]; } - (id) ivarWithName: (NSString*) name { return [variables objectForKey: name]; } - (NSMutableDictionary*) variables { return variables; } - (NSMutableArray*) variablesArray { NSMutableArray* array = [NSMutableArray new]; NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { [array addObject: key]; } return [array autorelease]; } - (NSString*) script { return script; } - (void) setScript: (NSString*) aScript { NSLog (@"setScript: %@", aScript); ASSIGNCOPY (script, aScript); } - (void) execute: (id) sender { STEnvironment *env = [STEnvironment sharedEnvironment]; NSEnumerator *enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { id obj = [variables objectForKey: key]; [env setObject: obj forName: key]; NSLog (@"env set object: %@ for key: %@", obj, key); } STEngine *engine = [STEngine engineForLanguageWithName: @"Smalltalk"]; id result; NSLog (@"we execute the script: {{%@}}", script); NS_DURING result = [engine executeCode: script inEnvironment: env]; NS_HANDLER NSLog (@"Execution Error in the Script !"); NS_ENDHANDLER } - (NSString*) findOutlet: (NSString*) sel { NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; if ([sel isEqualToString: method]) { return key; } } return nil; } - (id) performSelector: (SEL) selector withObject: (id) obj { NSString* sel = NSStringFromSelector(selector); NSLog (@"performSelector (%@) withObject: (%@)", sel, obj); NSString* ivar = [self findOutlet: sel]; if (ivar != nil) { [self setIVar: obj withName: ivar]; return self; } else { return [[self class] performSelector: selector withObject: obj]; } } - (BOOL) respondsToSelector: (SEL) selector { NSString* sel = NSStringFromSelector(selector); NSLog (@"respondsToSelector (%@)", sel); if ([self findOutlet: sel] != nil) { NSLog (@"findOutlet(%@) YES", sel); return YES; } BOOL ret = [[self class] instancesRespondToSelector: selector]; NSLog (@"respondsToSelector (%@) -> (%d)", sel, ret); return ret; } - (void) setOutlets { NSLog (@"setOutlets"); /* id cm = [NSApp classManager]; NSArray* outlets = [cm extraOutletsForObject: self]; NSLog (@"outlets <%@>", outlets); */ NSEnumerator* enumerator = [variables keyEnumerator]; id key; while ((key = [enumerator nextObject])) { NSLog (@"add outlet %@", key); //[cm addOutlet: key forClassNamed: @"StepTalkObject"]; NSString* method = [NSString stringWithFormat: @"set%@%@:", [[key substringToIndex: 1] uppercaseString], [key substringFromIndex: 1]]; NSLog (@"add sel (%@)", method); SEL retsel = GSSelectorFromNameAndTypes ([method cString], NULL); NSLog (@"retsel(%d): %@", retsel, NSStringFromSelector(retsel)); } } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkProxy.h0000644000175000000000000000037110257601744024551 0ustar gurkanroot/* All Rights reserved */ #ifndef __STPROXY_H__ #define __STPROXY_H__ #include #include #include @interface StepTalkProxy : NSProxy { id STClass; } - (id) init; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkProxy.m0000644000175000000000000000124610257601744024560 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkProxy.h" @implementation StepTalkProxy - (id) init { // if (self = [super init]) { NSLog (@"proxy init..."); STClass = [StepTalkClass new]; } return self; } - (void) dealloc { [STClass release]; [super dealloc]; } - (void) forwardInvocation: (NSInvocation*) anInvocation { NSLog (@"STProxy: forwardInvocation(%@)", anInvocation); NSLog (@"invocation : %@", NSStringFromSelector([anInvocation selector])); [STClass executeMethod: NSStringFromSelector([anInvocation selector])]; } - (NSMethodSignature*) methodSignatureForSelector: (SEL) aSelector { return STConstructMethodSignatureForSelector (aSelector); } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkRuntime.h0000644000175000000000000000060610257601744025054 0ustar gurkanroot/* All Rights reserved */ #ifndef __STRUNTIME_H__ #define __STRUNTIME_H__ #include #include #include "StepTalkClass.h" @class StepTalkClass; @interface StepTalkRuntime : NSObject { NSMutableDictionary* classes; } + (id) defaultRuntime; - (void) addClass: (StepTalkClass*) aClass; - (StepTalkClass*) classForName: (NSString*) name; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkRuntime.m0000644000175000000000000000174310257601744025064 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkRuntime.h" static StepTalkRuntime* STRuntime; @implementation StepTalkRuntime - (void) encodeWithCoder: (NSCoder*) coder { //[super encodeWithCoder: coder]; [coder encodeObject: classes]; } - (id) initWithCoder: (NSCoder*) coder { //if (self = [super initWithCoder: coder]) { ASSIGN (classes, [coder decodeObject]); } return self; } + (id) defaultRuntime { if (STRuntime == nil) { STRuntime = [StepTalkRuntime new]; } return STRuntime; } - (id) init { if (self = [super init]) { classes = [NSMutableDictionary new]; } return self; } - (void) dealloc { [classes release]; [super dealloc]; } - (void) addClass: (StepTalkClass*) aClass { NSLog (@"RUNTIME addClass %@", [aClass name]); [classes setObject: aClass forKey: [aClass name]]; } - (StepTalkClass*) classForName: (NSString*) name { NSLog (@"RUNTIME classForName %@", name); id ret = [classes objectForKey: name]; NSLog (@"==> %@", ret); return ret; } @end steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkView.h0000644000175000000000000000122610257601744024342 0ustar gurkanroot/* All Rights reserved */ #ifndef __STVIEW_H__ #define __STVIEW_H__ #include #include #include "StepTalkObject.h" @interface StepTalkView : NSButton { StepTalkObject* object; } - (NSImage*) imageForView; - (void) addIVar: (NSString*) name; - (void) renameIVar: (id) key to: (id) name; - (void) removeIVar: (NSString*) name; - (void) setIVar: (id) obj withName: (NSString*) name; - (id) ivarWithName: (NSString*) name; - (NSMutableArray*) variablesArray; - (NSMutableDictionary*) variables; - (void) setOutlets; - (NSString*) script; - (void) execute: (id) sender; - (void) setScript: (NSString*) aScript; @end #endif steptalk-0.10.0/Incubator/STPalette-1.2/libStepTalkView/StepTalkView.m0000644000175000000000000000424010257601744024346 0ustar gurkanroot/* All Rights reserved */ #include "StepTalkView.h" @implementation StepTalkView - (NSImage*) imageForView { return nil; } - (void) encodeWithCoder: (NSCoder*) coder { [super encodeWithCoder: coder]; [coder encodeObject: object]; } - (id) initWithCoder: (NSCoder*) coder { if (self = [super initWithCoder: coder]) { ASSIGN (object, [coder decodeObject]); [self setOutlets]; } return self; } - (id) initWithFrame: (NSRect) frame { self = [super initWithFrame: frame]; object = [StepTalkObject new]; [self setTitle: @"ButtonScript"]; [self setImage: [self imageForView]]; [self setBordered: YES]; [self setImagePosition: NSImageAbove]; [self setTarget: self]; [self setAction: @selector(execute:)]; [self setOutlets]; return self; } - (void) dealloc { [object release]; [super dealloc]; } - (void) addIVar: (NSString*) name { [object addIVar: name]; } - (void) removeIVar: (NSString*) name { [object removeIVar: name]; } - (void) renameIVar: (id) key to: (id) name { [object renameIVar: key to: name]; } - (void) setIVar: (id) obj withName: (NSString*) name { [object setIVar: obj withName: name]; } - (id) ivarWithName: (NSString*) name { return [object ivarWithName: name]; } - (NSMutableDictionary*) variables { return [object variables]; } - (NSMutableArray*) variablesArray { return [object variablesArray]; } - (void) setOutlets { [object setOutlets]; } - (NSString*) script { return [object script]; } - (void) setScript: (NSString*) aScript { [object setScript: aScript]; } - (void) execute: (id) sender { [object execute: sender]; } - (BOOL) respondsToSelector: (SEL) selector { NSString* sel = NSStringFromSelector(selector); if ([object findOutlet: sel] != nil) { return YES; } BOOL ret = [[self class] instancesRespondToSelector: selector]; NSLog (@"respondsToSelector (%@) -> (%d)", sel, ret); return ret; } - (id) performSelector: (SEL) selector withObject: (id) obj { NSString* sel = NSStringFromSelector(selector); NSString* ivar = [object findOutlet: sel]; if (ivar != nil) { [self setIVar: obj withName: ivar]; return self; } else { return [[self class] performSelector: selector withObject: obj]; } } @end steptalk-0.10.0/Incubator/STPalette-integration.txt0000644000175000000000000000407610300172662021317 0ustar gurkanrootStepTalk and STPalette integration notes for StepTalk 1.0 There are going to be three frameworks, two of them are new: StepTalk.framework - core StepTalk AppStepTalk.framework - StepTalk for applications - with views StepTalkPrototyping.framework - StepTalk for fast prototyping of apps, no real application should be linked to this framework, it is only construction support Not everything mentioned below should go to the StepTalk 1.0 release. * STPalette 1.2 status: - StepTalkClass should be replaced with STActor - currently there are no traits, we have to live without them at the moment - StepTalkMetadatas should be replaced by infoDictionary/userDictionary to STActor/STMethod - no need for StepTalkMethod - there is STMethod - StepTalkRuntime - remove for this time (there should be similar class in the future) - StepTalkView -> move to StepTalkPrototyping.framework * StepTalk.framework Required changes: - add infoDictionary/userDictionary to STActor/STMethod (get functionality from rIO's StepTalkClass and StepTalkMethod) * AppStepTalk.framework - NSApplication setScriptingEnvironment:, scriptingEnvironment: - STScriptEditorView (:NSTextEditor with associated language) - STMethodEditorView (:STScriptEditorView) - STActorEditor (NSBrowser with associated actor, can edit attributes and methods) - STTranscriptView (actions: removeContents:, -saveContentsToFile:(id)sender) - STTranscriptPanel (make visible even app is not active) - STEnvironmentInspectorView (NSTableView with given environment variables) * StepTalkPrototyping.framework - use StepTalkView - NSView with associated STActor, represented by an icon in Gorm design view * StepTalkPalette - Gorm objects: STActor, script - STActor: definable outlets (attributes) as in StepTalkClass - script - STActor with one method: 'interpret:' - no difference from implementation point of view, only simplification for the user - abstract object: application scripting environment (for NSApplication), similar to font manager/first responder - Require AppStepTalk.framework * To be done in the near future: - traits steptalk-0.10.0/Languages/0000775000175000000000000000000010255627461014356 5ustar gurkanrootsteptalk-0.10.0/Languages/GNUmakefile0000644000175000000000000000211510132015527016411 0ustar gurkanroot# # Main Makefile for the StepTalk # # Copyright (C) 2000 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS = \ Smalltalk \ # Guile -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/Languages/Guile/0000775000175000000000000000000010132015527015407 5ustar gurkanrootsteptalk-0.10.0/Languages/Guile/ChangeLog0000644000175000000000000000010610132015527017154 0ustar gurkanroot2003 Apr 4 Stefan Urbanek * ChangeLog started steptalk-0.10.0/Languages/Guile/GNUmakefile0000644000175000000000000000254010132015527017460 0ustar gurkanroot# # Guile language bundle # # Copyright (C) 2000,2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = Guile BUNDLE_EXTENSION := .stlanguage BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Languages Guile_OBJC_FILES = \ GuileEngine.m Guile_PRINCIPAL_CLASS = GuileEngine ADDITIONAL_INCLUDE_DIRS += -I../../Source/Headers ADDITIONAL_LIBRARIES += -I../../Source/Headers Guile_BUNDLE_LIBS += -lgstep_guile -lScriptKit $(GUILE_LIBS) -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble steptalk-0.10.0/Languages/Guile/GNUmakefile.postamble0000644000175000000000000000372110132015527021447 0ustar gurkanroot# # GNUmakefile.postamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing after-install:: @( echo ; \ echo "NOTE: Each time after installing new language, please update\ your file extension to language mapping dictionary by running \ stupdate_languages for each user."; \ echo ; \ echo Updating languages...; \ stupdate_languages; \ ) # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling after-uninstall:: @( stupdate_languages; ) # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: steptalk-0.10.0/Languages/Guile/GuileEngine.h0000644000175000000000000000172310132015527017754 0ustar gurkanroot/** GuileEngine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jan 13 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import @interface GuileEngine:STEngine { } @end steptalk-0.10.0/Languages/Guile/GuileEngine.m0000644000175000000000000000416410132015527017763 0ustar gurkanroot/** GuileEngine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jan 13 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import "GuileEngine.h" #import #import #import @class NSEnumerator; @implementation GuileEngine - (BOOL)understandsCode:(NSString *)code { NSLog(@"Do not know how to chceck if code is Guile."); return NO; } - (id) executeCode:(NSString *)sourceCode inEnvironment:(STEnvironment *)env { GuileInterpreter *interp; GuileScript *script; GuileSCM *result; NSEnumerator *e; id *obj; /* call this multiple times initializes one interpreter you are stuck with it until exit */ scm_init_guile(); gstep_init(); // gstep_link_base(); [GuileInterpreter initializeInterpreter]; interp = AUTORELEASE([[GuileInterpreter alloc] init]); script = AUTORELEASE([[GuileScript alloc] init]); e = [[[env objectDictionary] allKeys] objectEnumerator]; /* FIXME: If we do not remove these, we get an exception */ [env removeObjectWithName:@"NSProxy"]; [env removeObjectWithName:@"NSDistantObject"]; [env setObject:env forName:@"Env"]; [script setUserDictionary:[env objectDictionary]]; [script setDelegate:sourceCode]; result = [interp executeScript:script]; } @end steptalk-0.10.0/Languages/Guile/GuileInfo.plist0000644000175000000000000000004110132015527020336 0ustar gurkanroot{ STFileTypes = ( "scm" ); } steptalk-0.10.0/Languages/Guile/Tests/0000775000175000000000000000000010132015527016511 5ustar gurkanrootsteptalk-0.10.0/Languages/Guile/Tests/hello.scm0000644000175000000000000000013110132015527020311 0ustar gurkanroot([] Transcript show: ($$ "Hello ")) ([] Transcript showLine: ([] Args objectAtIndex: 0)) steptalk-0.10.0/Languages/Guile/Tests/transcript.scm0000644000175000000000000000007010132015527021401 0ustar gurkanroot([] Transcript showLine: ($$ "Hello from Transcript!")) steptalk-0.10.0/Languages/MyLanguage/0000775000175000000000000000000010132015527016373 5ustar gurkanrootsteptalk-0.10.0/Languages/MyLanguage/GNUmakefile0000644000175000000000000000136610132015527020451 0ustar gurkanroot# # MyLanguage language bundle # # @COPYRIGHT@ # include $(GNUSTEP_MAKEFILES)/common.make ########################################################################### # Language name BUNDLE_NAME = MyLanguage MyLanguage_PRINCIPAL_CLASS = MyLanguageEngine ########################################################################### # Files MyLanguage_OBJC_FILES = \ MyLanguageEngine.m # MyLanguage_BUNDLE_LIBS += -lmylanguage ########################################################################### BUNDLE_EXTENSION := .stlanguage BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Languages -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Languages/MyLanguage/MyLanguageEngine.h0000644000175000000000000000025310132015527021721 0ustar gurkanroot/** MyLanguageEngine @COPYRIGHT@ Written by: @AUTHOR@ Date: @DATE@ */ #import @interface MyLanguageEngine:STEngine { } @end steptalk-0.10.0/Languages/MyLanguage/MyLanguageEngine.m0000644000175000000000000000105410132015527021726 0ustar gurkanroot/** MyLanguageEngine @COPYRIGHT@ Written by: @AUTHOR@ Date: @DATE@ */ #import "MyLanguageEngine.h" @implementation MyLanguageEngine - (id) executeCode:(NSString *)sourceCode inEnvironment:(STEnvironment *)env { id retval = nil; /* execute the code sourceCode using environment env */ /* use [env objectDictionary] to get environment objects (see STEnvironment.h to see what you can do) */ /* retval = return value from the interpreter; */ return retval; } @end steptalk-0.10.0/Languages/MyLanguage/MyLanguageInfo.plist0000644000175000000000000000013310132015527022310 0ustar gurkanroot{ /* Array of file types of your language scripts */ STFileTypes = ( "mylang" ); } steptalk-0.10.0/Languages/MyLanguage-20041021.tar.gz0000644000175000000000000000206010136073533020412 0ustar gurkanroot[wxAYmoF* :TphD _]^ӢS{\Iӥ~>}ٝgk˞Mf=ũ Y<׸Pdʊ Q״ N6€ "xL?/w?q$y~#oyVU9s`o ™lmDQV?E^?"_Af.'I)+bU]J:T@K<܀Uz?xg`5Er DȘ0~6=,J}JQ$!t<6$/}tzhF# ж>zvC7jZ#d=;ApS{0'J}xtm W)^քpd"Yf7ހr7݁izQ;X7,;f6[pD:T2*WoK Cq% #V@*KO:Z~e.xCh}6㎎ͱh,#-I"2?l.Xjc6|`_O'/jb2I{ ?#V=?q_[.#spNNqN^&g.AА9q,\FI4^Ȧ*40Y| N%0'fnP,) DR Nn`#j׉|矿Sa 6aNjS5dsX;2b2ǾW͎Z|~'෋?Ll;)_]οlb^BtW ¶sֹ´6K%]ˑ#G?%v;x(steptalk-0.10.0/Languages/Smalltalk/0000755000175000000000000000000010365363565016304 5ustar gurkanrootsteptalk-0.10.0/Languages/Smalltalk/.#ChangeLog.1.290000644000175000000000000001417210142064751020560 0ustar gurkanroot2004 Nov 2 Stefan Urbanek * Changed super of STBytecodes from NSData to NSObject - there were some OSX issues 2004 Jul 10 Stefan Urbanek * Applied patch from Alexander V. Diemand (fixed bug #9595) - fixed maximum number of literals, fixed longjmp 2004 Jun 28 Stefan Urbanek * Fixed expresion duplicating. 2004 Jun 27 Stefan Urbanek * Version 0.8.1 2004 Jun 20 Stefan Urbanek * Added a fix to the compiler from Mateu Batle 2004 May 27 Stefan Urbanek * Fixed bug with signed/unsigned bytecode, which made StepTalk to crash if has more than 127 literals in the array. (patch by Mateu Batle) 2003 Sep 28 Stefan Urbanek * NSNumber: fixed -NSNumber to:step:do: - now accepts negative step. (Patch by Alexander Diemand) 2003 Sep 24 Stefan Urbanek * Guard compilation with an autorelease pool 2003 Sep 23 Stefan Urbanek * STBytecodeInterpreter: fixed memory leak (reported by Alexander Diemand) 2003 Aug 5 Stefan Urbanek * STScriptObject renamed to STSmalltalkScriptObject, because of steptalk core change. 2003 May 17 Stefan Urbanek * STSourceReader: treat decimal point followed by whitespace as '.' dot - end of statement. 2003 May 9 Stefan Urbanek * NSString+additions: added 2003 May 4 Stefan Urbanek * SmalltalkEngine: remove exception guard to allow debugging 2003 Apr 29 Stefan Urbanek * STSourceReader: fixed reading of identifiers at the end of source 2003 Apr 21 Stefan Urbanek * Version 0.7.1 2003 Apr 6 Stefan Urbanek * STCompiler: compileString: fixed exception reporting. 2003 Apr 04 David Ayers * GNUmakefile: Added flags to show all warnings except for import. * STBlock.m: Initialzed variables to supress compiler warnings. * STCompiledMethod.m: Added needed import. * STCompiler.m: Added missing declaration. Wrapped declarations only needed for DEBUG into #ifdefs to supress compiler warnings. Initialzed variables to supress compiler warnings. * STExecutionContext.m: Unified name for private categories. 2003 Mar 25 Stefan Urbanek * STSourceReader: added missing [super dealloc] * STCompiledCode: do not retain bytecode data * STCompiler: various memory leak fixes * SmalltalkEngine: guard compilation exception and release the compiler 2003 Mar 23 Stefan Urbanek * STSourceReader: added some end of string checks 2003 Feb 3 Stefan Urbanek * Version 0.7.0 2003 Feb 3 Stefan Urbanek * STSourceReader: fixed reading of a number terminated with '.', we treat it as an integer. Reader was complaining about i := 1.; fixed reading of var:=something. It was terating 'var:' as a selector keyword. 2003 Jan 30 Stefan Urbanek * ChangeLog, STBlock.m, STBytecodes.h, STBytecodes.m, STCompiledMethod.m, STCompiler.h, STCompiler.m, STCompilerUtils.h, STCompilerUtils.m, STExecutionContext.m, STGrammar.m, STGrammar.y, STLiterals.h, STLiterals.m, STMethodContext.h, STSourceReader.h, SmalltalkEngine.m: Cleanup of compiler warnings 2002 Dec 25 Stefan Urbanek * Version 0.6.2 2002 Dec 21 Stefan Urbanek * STSourceReader, STCompiler, STGrammar: Added real number parsing 2002 Sep 15 Stefan Urbanek * Version 0.6.1 2002 Aug 30 Stefan Urbanek * Code cleanup. 2002 Jun 14 Stefan Urbanek * STMethodContext: Raise exception on invalid reference, not on undefined object 2002 Jun 13 Stefan Urbanek * STCompiledMethod: Removed unused methods * STBytecodeInterpreter: rewritten context handling; removed unused methods * STBlockContext: rewritten context handling; cleaned exception handler * STGrammar.y: fixed empty arrays #() * STExecutionContext: removed parent context as it is longer used 2002 Jun 7 Stefan Urbanek * STBytecodeInterpreter: fixed debug-log bug 2002 Jun 6 Stefan Urbanek * STSourceReader: fixed bug in reading number token type and binary selectors beginning with the '-' character. * Moved NSObject-additions to the StepTalk sources 2002 May 29 Stefan Urbanek * STCompiledScript: assign return value on executing single-method script 2002 May 15 Stefan Urbanek * STCompiler, Externs, STGrammar: fixed undefined exceptions (reported by Bjrn Gohla ) 2002 Mar 17 Stefan Urbanek * STCompiler, STGrammar: changed grammar to be able to have "methods" or "just statements" in source 2002 Feb 14 Stefan Urbanek * STSourceReader: Retain character sets 2002 Feb 5 Stefan Urbanek * STSelector+additions.[hm]: new files * STCompiler: use STSelector class for symbol literals 2002 Feb 3 Stefan Urbanek * STScriptObject: handle special method 'exit' * STBytecodeInterpreter: added code to halt the interpreter and return from all contexts 2002 Jan 31 Stefan Urbanek * STBlock: small speed improvements * STBlockContext: removed evaluateWithArguments:count:, and moved code into STBLock 2002 Jan 23 Stefan Urbanek * NSNumber+additions: moved arithmetic code to the library 2002 Jan 22 Stefan Urbanek * STCompiler: create one more duplicate of stack top when assigning to a variable. 2002 Jan 9 Stefan Urbanek * SmalltalkEngine: implemented executeScript:inEnvironment: 2001 Dec 8 Stefan Urbanek * Fixed temporary variable compilation * Added special handling of nil, YES and NO constants; added corresponding bytecodes 2001 Dec 8 Stefan Urbanek * CahgeLog started steptalk-0.10.0/Languages/Smalltalk/.#STCompiler.m.1.160000644000175000000000000007645410142063577021221 0ustar gurkanroot/** STCompiler.m Bytecode compiler. Generates STExecutableCode from source code. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiler.h" #import "STMessage.h" #import "STLiterals.h" #import "STBytecodes.h" #import "STCompiledScript.h" #import "STCompiledCode.h" #import "STCompiledMethod.h" #import "STCompilerUtils.h" #import "STSourceReader.h" #import "Externs.h" #import #import #import #import #import #import #import #import #import #import extern int STCparse(void *context); /* FIXME: rewrite parser We need three kinds of grammars: 1. = | 2. = '[|' ']' = | '!' = | 3. = = | Parser 1. are 2. are for scripts. Parser 3. is for script object methods. Because majority of the grammar is reused in all three parsers we use only one grammar definition. There is no problem in haveng 1. and 2. in one file. To be able to have 3. in the same file we do a hack: we add a prefix '!!' for method source. Then we diferentiate it in grammar file by changin the rule: 3. = '!' '!' See STGrammar.y */ @interface STCompiler(STCompilerPrivate) - (void)compile; - (void)initializeContext; - (void)destroyCompilationContext; - (unsigned)tempVariableIndex:(NSString *)varName; - (unsigned)externalVariableIndex:(NSString *)varName; - (void) initializeCompilationContext; - (NSDictionary *)exceptionInfo; - (unsigned)addSelectorLiteral:(NSString*)selector; - (unsigned)addLiteral:literal; - (void)compileMethod:(STCMethod *)method; - (STCompiledCode *) compileStatements:(STCStatements *)statements; - (void)compileStatements:(STCStatements *)statements blockFlag:(BOOL)blockFlag; - (void)compilePrimary:(STCPrimary *)primary; - (void)compileExpression:(STCExpression *)expr; - (void)emitPushReceiverVariable:(unsigned)index; - (void)emitPushSelf; - (void)emitPopAndStoreReceiverVariable:(unsigned)index; - (void)emitReturn; - (void)emitReturnFromBlock; - (void)emitPushTemporary:(unsigned)index; - (void)emitPushLiteral:(unsigned)index; - (void)emitPushVariable:(unsigned)index; - (void)emitPopAndStoreTemporary:(unsigned)index; - (void)emitPopAndStoreVariable:(unsigned)index ; - (void)emitPopStack; - (void)emitSendSelector:(unsigned)index argCount:(unsigned)argCount; - (void)emitBlockCopy; - (void)emitDuplicateStackTop; - (void)emitJump:(short)offset; - (void)emitLongJump:(short)offset; - (void)emitPushNil; - (void)emitPushTrue; - (void)emitPushFalse; - (void)fixupLongJumpAt:(unsigned)index with:(short)offset; - (unsigned)currentBytecode; @end #define MAX(a,b) (((a)>(b))?(a):(b)) @implementation STCompiler + compilerWithEnvironment:(STEnvironment *)env { return AUTORELEASE([[self alloc] initWithEnvironment:env]); } - initWithEnvironment:(STEnvironment *)env { self = [self init]; [self setEnvironment:env]; return self; } - init { [super init]; arrayLiteralClass = [NSMutableArray class]; stringLiteralClass = [NSMutableString class]; /* bytesLiteralClass = [NSMutableData class]; */ intNumberLiteralClass = [NSNumber class]; realNumberLiteralClass = [NSNumber class]; symbolLiteralClass = [STSelector class]; characterLiteralClass = [NSString class]; return self; } - (void)dealloc { [super dealloc]; } - (BOOL)beginScript { if(isSingleMethod) { [NSException raise:@"STCompilerException" format:@"Script source given for single method"]; return NO; } else { return YES; } } /* --------------------------------------------------------------------------- * Compilation * --------------------------------------------------------------------------- */ - (void)setEnvironment:(STEnvironment *)env { ASSIGN(environment,env); } - (STCompiledMethod *)compileMethodFromSource:(NSString *)aString forReceiver:(id )receiver { STCompiledMethod *result; NSString *hackedSource; NSString *exceptionFmt = @"Syntax error at line %i near '%@', " @"reason: %@."; int parsRetval = 0; NSDebugLLog(@"STCompiler", @"Compile method", aString); if(!environment) { [NSException raise:STCompilerGenericException format:@"Compilation environment is not initialized"]; return nil; } hackedSource = [@"!!" stringByAppendingString:aString]; reader = [[STSourceReader alloc] initWithString:hackedSource]; receiverVars = [[NSArray alloc] initWithArray:[receiver instanceVariableNames]]; isSingleMethod = YES; STParserContextInit(&context,self,reader); NS_DURING { // extern int STCdebug; // STCdebug = 1; parsRetval = STCparse(&context); } NS_HANDLER { if ([[localException name] isEqualToString: STCompilerSyntaxException]) { NSString *tokenString; int line; tokenString = [reader tokenString]; line = [reader currentLine]; RELEASE(reader); RELEASE(receiverVars); receiverVars = nil; reader = nil; [NSException raise:STCompilerSyntaxException format:exceptionFmt, line, tokenString, [localException reason]]; } [localException raise]; } NS_ENDHANDLER RELEASE(receiverVars); RELEASE(reader); result = AUTORELEASE(resultMethod); resultMethod = nil; return result; } - (STCompiledScript *)compileString:(NSString *)aString { NSAutoreleasePool *pool = [NSAutoreleasePool new]; STCompiledScript *result; NSString *exceptionFmt = @"Syntax error at line %i near '%@', " @"reason: %@."; int parsRetval = 0; NSDebugLLog(@"STCompiler", @"Compile string", aString); isSingleMethod = NO; if(!environment) { [NSException raise:STCompilerGenericException format:@"Compilation environment is not initialized"]; return nil; } reader = [[STSourceReader alloc] initWithString:aString]; receiverVars = [[NSMutableArray alloc] init]; STParserContextInit(&context,self,reader); NS_DURING { // extern int STCdebug; // STCdebug = 1; parsRetval = STCparse(&context); } NS_HANDLER { if ([[localException name] isEqualToString: STCompilerSyntaxException]) { NSString *tokenString; int line; tokenString = [reader tokenString]; line = [reader currentLine]; RELEASE(reader); RELEASE(receiverVars); receiverVars = nil; reader = nil; [NSException raise:STCompilerSyntaxException format:exceptionFmt, line, tokenString, [localException reason]]; } [localException raise]; } NS_ENDHANDLER RELEASE(receiverVars); RELEASE(reader); [pool release]; result = AUTORELEASE(resultScript); resultScript = nil; return result; } - (void)compileMethod:(STCMethod *)method { STCompiledMethod *compiledMethod; STCompiledCode *code; STMessage *messagePattern; /* FIXME: unite STCMessage and STMessage */ messagePattern = (STMessage *)[method messagePattern]; if(!messagePattern) { messagePattern = [STMessage messageWithSelector:@"_unnamed_method" arguments:nil]; } NSDebugLLog(@"STCompiler", @"Compile method %@", [messagePattern selector]); tempVars = [NSMutableArray arrayWithArray:[messagePattern arguments]]; code = [self compileStatements:[method statements]]; compiledMethod = [STCompiledMethod methodWithCode:AUTORELEASE(code) messagePattern:messagePattern]; if(!isSingleMethod) { if(resultMethod) { [NSException raise:@"STCompilerException" format:@"Method is present when compiling a script"]; return; } if(!resultScript) { NSDebugLLog(@"STCompiler", @"Creating script with %i variables",[receiverVars count]); resultScript = [[STCompiledScript alloc] initWithVariableCount: [receiverVars count]]; } [resultScript addMethod:compiledMethod]; } else { if(resultMethod) { [NSException raise:@"STCompilerException" format:@"More than one method compiled for single method request"]; return; } if(resultScript) { [NSException raise:@"STCompilerException" format:@"Compiled script is present when compiling single method"]; return; } resultMethod = RETAIN(compiledMethod); } } - (STCompiledCode *)compileStatements:(STCStatements *)statements { STCompiledCode *compiledCode; #ifdef DEBUG int count; int i; #endif /* FIXME: create another class */ [self initializeCompilationContext]; NSDebugLLog(@"STCompiler", @"compiling statements"); tempsSize = tempsCount = [tempVars count]; [self compileStatements:statements blockFlag:NO]; NSDebugLLog(@"STCompiler", @" temporaries %i stack %i", tempsSize,stackSize); #ifdef DEBUG count = [literals count]; NSDebugLLog(@"STCompiler", @" literals count %i", count); for(i=0;i 0; index--) { [self emitPopAndStoreTemporary:tempsSave + index - 1]; } } array = [statements expressions]; if(array) { BOOL first = YES; enumerator = [array objectEnumerator]; while((expr = [enumerator nextObject])) { [self compileExpression:expr]; /* Mateu Batle: ignore returned value on the stack ? */ /* FIXME: please check this !!! */ if (!first) { [self emitPopStack]; } else { first = NO; } } } expr = [statements returnExpression]; if(expr) { [self compileExpression:expr]; } if(blockFlag) { [blockInfo setStackSize:stackSize]; AUTORELEASE(blockInfo); stackSize = stackSizeSave; stackPos = stackPosSave; [self emitReturnFromBlock]; } else { [self emitReturn]; } /* fixup jump (if block) */ if(blockFlag) { [self fixupLongJumpAt:jumpIP with:[self currentBytecode] - jumpIP]; } /* cleanup unneeded temp variables */ [tempVars removeObjectsInRange:NSMakeRange(tempsSave, [tempVars count]-tempsSave)]; tempsCount = tempsSave; } - (void)compilePrimary:(STCPrimary *)primary { id object = [primary object]; int index; NSDebugLLog(@"STCompiler-misc",@" compile primary"); switch([primary type]) { case STCVariablePrimaryType: if([object isEqualToString:@"YES"] || [object isEqualToString:@"true"]) { [self emitPushTrue]; } else if([object isEqualToString:@"NO"] || [object isEqualToString:@"false"]) { [self emitPushFalse]; } else if([object isEqualToString:@"nil"]) { [self emitPushNil]; } else { index = [self tempVariableIndex:object]; if(index != NSNotFound) { [self emitPushTemporary:index]; break; } else if( (index = [self receiverVariableIndex:object])!= NSNotFound) { [self emitPushReceiverVariable:index]; break; } else if( [object isEqual:@"self"] ) { [self emitPushSelf]; break; } index = [self externalVariableIndex:object]; [self emitPushVariable:index]; } break; case STCLiteralPrimaryType: index = [self addLiteral:object]; [self emitPushLiteral:index]; break; case STCBlockPrimaryType: [self compileStatements:object blockFlag:YES]; break; case STCExpressionPrimaryType: [self compileExpression:object]; break; default: [NSException raise:STCompilerInconsistencyException format:@"Unknown primary type %i", [primary type]]; break; } } - (void)compileMessage:(STCMessage *)message { NSEnumerator *enumerator; NSArray *args; id obj; int index; args = [message arguments]; if(args && ([args count]>0)) { enumerator = [args objectEnumerator]; while((obj = [enumerator nextObject])) { if([obj isKindOfClass:[STCPrimary class]]) [self compilePrimary:obj]; else [self compileExpression:obj]; } } index = [self addSelectorLiteral:[message selector]]; [self emitSendSelector:index argCount:[args count]]; } - (void)compileExpression:(STCExpression *)expr { NSEnumerator *enumerator; NSArray *cascade; NSString *varName; NSArray *array; unsigned count; unsigned index,i; id obj; NSDebugLLog(@"STCompiler-misc",@" compile expression"); if([expr isPrimary]) { [self compilePrimary:[expr object]]; } else /* message expression */ { obj = [expr target]; /* target */ if([obj isKindOfClass:[STCPrimary class]]) [self compilePrimary:obj]; else [self compileExpression:obj]; cascade = [expr cascade]; if(cascade) { count = [cascade count]; for(i=0;i0) { for(i = 0; i>8)&0xff);\ bc[2] = (unsigned char)(bc2&0xff); \ [byteCodes appendBytes:bc length:3];\ bcpos+=3;\ } while(0) #define EMIT_TRIPPLE(bc1,bc2,bc3) \ do { \ unsigned char bc[5] = {bc1,0,0,0,0}; \ bc[1] = (unsigned char)((((unsigned short)bc2)>>8)&0xff);\ bc[2] = (unsigned char)(bc2&0xff); \ bc[3] = (unsigned char)((((unsigned short)bc3)>>8)&0xff);\ bc[4] = (unsigned char)(bc3&0xff); \ [byteCodes appendBytes:bc length:5];\ bcpos+=5;\ } while(0) #define STACK_PUSH \ do {\ stackPos++; \ stackSize = MAX(stackPos,stackSize);\ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize); */\ } while(0) #define STACK_PUSH_COUNT(count) \ do {\ stackPos+=count; \ stackSize = MAX(stackPos,stackSize);\ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize);*/ \ } while(0) #define STACK_POP \ stackPos--; \ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize) */; #define STACK_POP_COUNT(count) \ stackPos-=count; \ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize) */; - (void)emitPushSelf { NSDebugLLog(@"STCompiler-emit", @"#%04x push self", bcpos); EMIT_SINGLE(STPushReceiverBytecode); STACK_PUSH; } - (void)emitPushNil { NSDebugLLog(@"STCompiler-emit", @"#%04x push nil", bcpos); EMIT_SINGLE(STPushNilBytecode); STACK_PUSH; } - (void)emitPushTrue { NSDebugLLog(@"STCompiler-emit", @"#%04x push true", bcpos); EMIT_SINGLE(STPushTrueBytecode); STACK_PUSH; } - (void)emitPushFalse { NSDebugLLog(@"STCompiler-emit", @"#%04x push false", bcpos); EMIT_SINGLE(STPushFalseBytecode); STACK_PUSH; } - (void)emitPushReceiverVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push receiver variable %i (%@)", bcpos,index,[receiverVars objectAtIndex:index]); EMIT_DOUBLE(STPushRecVarBytecode,index); STACK_PUSH; } - (void)emitPushTemporary:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push temporary %i (%@)", bcpos,index,[tempVars objectAtIndex:index]); EMIT_DOUBLE(STPushTemporaryBytecode,index); STACK_PUSH; } - (void)emitPushLiteral:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push literal %i (%@)", bcpos,index,[literals objectAtIndex:index]); EMIT_DOUBLE(STPushLiteralBytecode,index); STACK_PUSH; stackSize++; } - (void)emitPushVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push external variable %i (%@)", bcpos,index,[externVars objectAtIndex:index]); EMIT_DOUBLE(STPushExternBytecode,index); STACK_PUSH; } - (void)emitPopAndStoreTemporary:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store temp %i (%@)", bcpos,index,[tempVars objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreTempBytecode,index); STACK_POP; } - (void)emitPopAndStoreVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store ext variable %i (%@)", bcpos,index,[externVars objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreExternBytecode,index); STACK_POP; } - (void)emitPopAndStoreReceiverVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store rec variable %i (%@)", bcpos,index,[receiverVars objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreRecVarBytecode,index); STACK_POP; } - (void)emitSendSelector:(unsigned)index argCount:(unsigned)argCount { NSDebugLLog(@"STCompiler-emit", @"#%04x send selector %i (%@) with %i args", bcpos,index,[literals objectAtIndex:index],argCount); EMIT_TRIPPLE(STSendSelectorBytecode,index,argCount); STACK_PUSH_COUNT(argCount); STACK_POP_COUNT(argCount); } - (void)emitDuplicateStackTop { NSDebugLLog(@"STCompiler-emit", @"#%04x dup",bcpos); EMIT_SINGLE(STDupBytecode); STACK_PUSH; } - (void)emitPopStack { NSDebugLLog(@"STCompiler-emit", @"#%04x pop stack",bcpos); EMIT_SINGLE(STPopStackBytecode); STACK_POP; } - (void)emitReturn { NSDebugLLog(@"STCompiler-emit", @"#%04x return",bcpos); EMIT_SINGLE(STReturnBytecode); } - (void)emitReturnFromBlock { NSDebugLLog(@"STCompiler-emit", @"#%04x return from block",bcpos); EMIT_SINGLE(STReturnBlockBytecode); } - (void)emitBlockCopy { NSDebugLLog(@"STCompiler-emit", @"#%04x create block",bcpos); EMIT_SINGLE(STBlockCopyBytecode); } - (void)emitLongJump:(short)offset { NSDebugLLog(@"STCompiler-emit", @"#%04x long jump %i (0x%04x)",bcpos,offset,bcpos+offset); /* EMIT_TRIPPLE(STLongJumpBytecode,STLongJumpFirstByte(offset), STLongJumpSecondByte(offset)); */ EMIT_DOUBLE(STLongJumpBytecode, offset); } - (void)fixupLongJumpAt:(unsigned)index with:(short)offset { //unsigned char bytes[4] = {0,STLongJumpFirstByte(offset),0,STLongJumpSecondByte(offset)}; unsigned char bytes[2] = { (offset >> 8) & 0xff, offset & 0xff }; NSDebugLLog(@"STCompiler-emit", @"# fixup long jump at 0x%04x to 0x%04x",index, index + offset); [byteCodes replaceBytesInRange:NSMakeRange(index+1,2) withBytes:bytes]; } - (unsigned)currentBytecode { return [byteCodes length]; } @end steptalk-0.10.0/Languages/Smalltalk/.cvsignore0000644000175000000000000000010510132015530020252 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Languages/Smalltalk/ChangeLog0000644000175000000000000001616310300724704020046 0ustar gurkanroot2005 Aug 17 Stefan Urbanek * NSObject+additions: new file, new method ifNil:block 2005 June 24 Stefan Urbanek * STCompiler: Fixed STUndefinedKeyException name as it was fixed in -base 2005 June 20 Stefan Urbanek * Rewritten parts of STCompiler, STBytecodeInterpreter, STCompiled* and ' ST*Context: Smalltalk now refers to instance variables by name not by index. This should allow creation of STActor class and final implementation of instance variables in STScriptObject. Instance variables are accessed by their name through Key-Value-Coding protocol. 2005 Mar 9 Stefan Urbanek * Patch by Matthew D Swank: patch that keeps the temp space allocated to a particular block, while avoiding naming conflicts by storing empty strings as placeholders _after_ the block has been compiled (and the names are no longer needed). 2004 Nov 9 Stefan Urbanek * Remove STMethodSignatureForSelector as it was deprecated because of inportability to OSX. 2004 Nov 2 Stefan Urbanek * Changed super of STBytecodes from NSData to NSObject - there were some OSX issues 2004 Jul 10 Stefan Urbanek * Applied patch from Alexander V. Diemand (fixed bug #9595) - fixed maximum number of literals, fixed longjmp 2004 Jun 28 Stefan Urbanek * Fixed expresion duplicating. 2004 Jun 27 Stefan Urbanek * Version 0.8.1 2004 Jun 20 Stefan Urbanek * Added a fix to the compiler from Mateu Batle 2004 May 27 Stefan Urbanek * Fixed bug with signed/unsigned bytecode, which made StepTalk to crash if has more than 127 literals in the array. (patch by Mateu Batle) 2003 Sep 28 Stefan Urbanek * NSNumber: fixed -NSNumber to:step:do: - now accepts negative step. (Patch by Alexander Diemand) 2003 Sep 24 Stefan Urbanek * Guard compilation with an autorelease pool 2003 Sep 23 Stefan Urbanek * STBytecodeInterpreter: fixed memory leak (reported by Alexander Diemand) 2003 Aug 5 Stefan Urbanek * STScriptObject renamed to STSmalltalkScriptObject, because of steptalk core change. 2003 May 17 Stefan Urbanek * STSourceReader: treat decimal point followed by whitespace as '.' dot - end of statement. 2003 May 9 Stefan Urbanek * NSString+additions: added 2003 May 4 Stefan Urbanek * SmalltalkEngine: remove exception guard to allow debugging 2003 Apr 29 Stefan Urbanek * STSourceReader: fixed reading of identifiers at the end of source 2003 Apr 21 Stefan Urbanek * Version 0.7.1 2003 Apr 6 Stefan Urbanek * STCompiler: compileString: fixed exception reporting. 2003 Apr 04 David Ayers * GNUmakefile: Added flags to show all warnings except for import. * STBlock.m: Initialzed variables to supress compiler warnings. * STCompiledMethod.m: Added needed import. * STCompiler.m: Added missing declaration. Wrapped declarations only needed for DEBUG into #ifdefs to supress compiler warnings. Initialzed variables to supress compiler warnings. * STExecutionContext.m: Unified name for private categories. 2003 Mar 25 Stefan Urbanek * STSourceReader: added missing [super dealloc] * STCompiledCode: do not retain bytecode data * STCompiler: various memory leak fixes * SmalltalkEngine: guard compilation exception and release the compiler 2003 Mar 23 Stefan Urbanek * STSourceReader: added some end of string checks 2003 Feb 3 Stefan Urbanek * Version 0.7.0 2003 Feb 3 Stefan Urbanek * STSourceReader: fixed reading of a number terminated with '.', we treat it as an integer. Reader was complaining about i := 1.; fixed reading of var:=something. It was terating 'var:' as a selector keyword. 2003 Jan 30 Stefan Urbanek * ChangeLog, STBlock.m, STBytecodes.h, STBytecodes.m, STCompiledMethod.m, STCompiler.h, STCompiler.m, STCompilerUtils.h, STCompilerUtils.m, STExecutionContext.m, STGrammar.m, STGrammar.y, STLiterals.h, STLiterals.m, STMethodContext.h, STSourceReader.h, SmalltalkEngine.m: Cleanup of compiler warnings 2002 Dec 25 Stefan Urbanek * Version 0.6.2 2002 Dec 21 Stefan Urbanek * STSourceReader, STCompiler, STGrammar: Added real number parsing 2002 Sep 15 Stefan Urbanek * Version 0.6.1 2002 Aug 30 Stefan Urbanek * Code cleanup. 2002 Jun 14 Stefan Urbanek * STMethodContext: Raise exception on invalid reference, not on undefined object 2002 Jun 13 Stefan Urbanek * STCompiledMethod: Removed unused methods * STBytecodeInterpreter: rewritten context handling; removed unused methods * STBlockContext: rewritten context handling; cleaned exception handler * STGrammar.y: fixed empty arrays #() * STExecutionContext: removed parent context as it is longer used 2002 Jun 7 Stefan Urbanek * STBytecodeInterpreter: fixed debug-log bug 2002 Jun 6 Stefan Urbanek * STSourceReader: fixed bug in reading number token type and binary selectors beginning with the '-' character. * Moved NSObject-additions to the StepTalk sources 2002 May 29 Stefan Urbanek * STCompiledScript: assign return value on executing single-method script 2002 May 15 Stefan Urbanek * STCompiler, Externs, STGrammar: fixed undefined exceptions (reported by Bjrn Gohla ) 2002 Mar 17 Stefan Urbanek * STCompiler, STGrammar: changed grammar to be able to have "methods" or "just statements" in source 2002 Feb 14 Stefan Urbanek * STSourceReader: Retain character sets 2002 Feb 5 Stefan Urbanek * STSelector+additions.[hm]: new files * STCompiler: use STSelector class for symbol literals 2002 Feb 3 Stefan Urbanek * STScriptObject: handle special method 'exit' * STBytecodeInterpreter: added code to halt the interpreter and return from all contexts 2002 Jan 31 Stefan Urbanek * STBlock: small speed improvements * STBlockContext: removed evaluateWithArguments:count:, and moved code into STBLock 2002 Jan 23 Stefan Urbanek * NSNumber+additions: moved arithmetic code to the library 2002 Jan 22 Stefan Urbanek * STCompiler: create one more duplicate of stack top when assigning to a variable. 2002 Jan 9 Stefan Urbanek * SmalltalkEngine: implemented executeScript:inEnvironment: 2001 Dec 8 Stefan Urbanek * Fixed temporary variable compilation * Added special handling of nil, YES and NO constants; added corresponding bytecodes 2001 Dec 8 Stefan Urbanek * CahgeLog started steptalk-0.10.0/Languages/Smalltalk/Externs.h0000644000175000000000000000055310132015530020062 0ustar gurkanroot/** Externs Misc. variables Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import extern NSString *STCompilerSyntaxException; extern NSString *STCompilerGenericException; extern NSString *STCompilerInconsistencyException; extern NSString *STInterpreterGenericException; steptalk-0.10.0/Languages/Smalltalk/Externs.m0000644000175000000000000000073010132015530020064 0ustar gurkanroot/** Externs.m Misc. variables Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import NSString *STCompilerSyntaxException = @"STCompilerSyntaxException"; NSString *STCompilerGenericException = @"STCompilerGenericException"; NSString *STCompilerInconsistencyException =@"STCompilerInconsistencyException"; NSString *STInterpreterGenericException = @"STInterpreterGenericException"; steptalk-0.10.0/Languages/Smalltalk/GNUmakefile0000644000175000000000000000441110300724726020343 0ustar gurkanroot# # Smalltalk language bundle # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = Smalltalk BUNDLE_EXTENSION := .stlanguage BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Languages Smalltalk_OBJC_FILES = \ SmalltalkEngine.m \ NSArray+additions.m \ NSNumber+additions.m \ NSObject+additions.m \ NSString+additions.m \ STBlock.m \ STBlockContext.m \ STBytecodeInterpreter.m \ STBytecodes.m \ STCompiledCode.m \ STCompiledMethod.m \ STCompiledScript.m \ STCompiler.m \ STCompilerUtils.m \ STExecutionContext.m \ STGrammar.m \ STLiterals.m \ STMessage.m \ STMethodContext.m \ STSmalltalkScriptObject.m \ STStack.m \ STUndefinedObject+additions.m \ STSelector+additions.m \ STSourceReader.m \ Externs.m Smalltalk_PRINCIPAL_CLASS = SmalltalkEngine ADDITIONAL_OBJCFLAGS = -Wall -Wno-import ADDITIONAL_INCLUDE_DIRS += -I../../Source/Headers ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) ifeq ($(check),yes) ADDITIONAL_OBJCFLAGS += -Werror endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble STGrammar.m: STGrammar.y $(BISON) -p STC -o $@ $< steptalk-0.10.0/Languages/Smalltalk/NSArray+additions.h0000644000175000000000000000215310132015530021721 0ustar gurkanroot/** NSArray-additions.h Various methods for NSArray Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STBlock; @interface NSArray (STCollecting) - do:(STBlock *)block; - select:(STBlock *)block; - reject:(STBlock *)block; - collect:(STBlock *)block; - detect:(STBlock *)block; @end steptalk-0.10.0/Languages/Smalltalk/NSArray+additions.m0000644000175000000000000000616410132015530021734 0ustar gurkanroot/** NSArray-additions.m Various methods for NSArray Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSArray+additions.h" #import "NSNumber+additions.h" #import "STBlock.h" #import #import @implementation NSArray (STCollecting) - do:(STBlock *)block { NSEnumerator *enumerator; id object; id retval = nil; enumerator = [self objectEnumerator]; while( (object = [enumerator nextObject]) ) { retval = [block valueWith:object]; } return retval; } - select:(STBlock *)block { NSMutableArray *array; NSEnumerator *enumerator; id object; id value; array = [NSMutableArray array]; enumerator = [self objectEnumerator]; while( (object = [enumerator nextObject]) ) { value = [block valueWith:object]; if([(NSNumber *)value isTrue]) { [array addObject:object]; } } return [NSArray arrayWithArray:array]; } - reject:(STBlock *)block { NSMutableArray *array; NSEnumerator *enumerator; id object; id value; array = [NSMutableArray array]; enumerator = [self objectEnumerator]; while( (object = [enumerator nextObject]) ) { value = [block valueWith:object]; if([(NSNumber *)value isFalse]) { [array addObject:object]; } } return [NSArray arrayWithArray:array]; } - collect:(STBlock *)block { NSMutableArray *array; NSEnumerator *enumerator; id object; id value; array = [NSMutableArray array]; enumerator = [self objectEnumerator]; while( (object = [enumerator nextObject]) ) { value = [block valueWith:object]; [array addObject:value]; } return [NSArray arrayWithArray:array]; } - detect:(STBlock *)block { NSEnumerator *enumerator; id object; id retval = nil; enumerator = [self objectEnumerator]; while( (object = [enumerator nextObject]) ) { retval = [block valueWith:object]; if([(NSNumber *)retval isTrue]) { return object; } } return retval; } @end steptalk-0.10.0/Languages/Smalltalk/NSNumber+additions.h0000644000175000000000000000244110132015530022073 0ustar gurkanroot/** NSNumber-additions.h Various methods for NSNumber Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STBlock; @interface NSNumber (STSmalltalkAdditions) - ifTrue:(STBlock *)block; - ifFalse:(STBlock *)block; - ifTrue:(STBlock *)trueBlock ifFalse:(STBlock *)falseBlock; - ifFalse:(STBlock *)falseBlock ifTrue:(STBlock *)trueBlock; - (BOOL)isTrue; - (BOOL)isFalse; - to:(int)number do:(STBlock *)block; - to:(int)number step:(int)step do:(STBlock *)block; @end steptalk-0.10.0/Languages/Smalltalk/NSNumber+additions.m0000644000175000000000000000324610132015530022104 0ustar gurkanroot/** NSNumber-additions.h Various methods for NSNumber Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "NSNumber+additions.h" #import "STBlock.h" #include #import @implementation NSNumber (STSmalltalkAdditions) - ifTrue:(STBlock *)block { if([self isTrue]) { return [block value]; } return self; } - ifFalse:(STBlock *)block { if([self isFalse]) { return [block value]; } return self; } - ifTrue:(STBlock *)trueBlock ifFalse:(STBlock *)falseBlock { if([self isTrue]) { return [trueBlock value]; } return [falseBlock value]; } - ifFalse:(STBlock *)falseBlock ifTrue:(STBlock *)trueBlock { if([self isFalse]) { return [falseBlock value]; } return [trueBlock value]; } - (BOOL)isTrue { return ([self intValue] != 0); } - (BOOL)isFalse { return ([self intValue] == 0); } /* FIXME: make it work with floats */ - to:(int)number do:(STBlock *)block { id retval = nil; int i; for(i=[self intValue];i<=number;i++) { retval = [block valueWith:[NSNumber numberWithInt:i]]; } return retval; } - to:(int)number step:(int)step do:(STBlock *)block { id retval = nil; int i; if (step > 0) { for(i=[self intValue];i<=number;i+=step) { retval = [block valueWith:[NSNumber numberWithInt:i]]; } } else { // step =< 0 for(i=[self intValue];i>=number;i+=step) { retval = [block valueWith:[NSNumber numberWithInt:i]]; } } return retval; } @end steptalk-0.10.0/Languages/Smalltalk/NSObject+additions.h0000644000175000000000000000207210300724560022060 0ustar gurkanroot/** NSObject+additions.h Smalltalk methods for NSObject Copyright (c) 2005 Free Software Foundation Date: 2005 Aug 17 Author: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STBlock; @interface NSObject (SmalltalkBlock) - ifNil:(STBlock *)block; @end steptalk-0.10.0/Languages/Smalltalk/NSObject+additions.m0000644000175000000000000000215110300724634022065 0ustar gurkanroot/** NSObject+additions.h Smalltalk methods for NSObject Copyright (c) 2005 Free Software Foundation Date: 2005 Aug 17 Author: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSObject+additions.h" @implementation NSObject (SmalltalkBlock) - ifNil:(STBlock *)block { /* Do nothing as we are not nil. */ return self; } @end steptalk-0.10.0/Languages/Smalltalk/NSString+additions.h0000644000175000000000000000212210132015530022105 0ustar gurkanroot/** NSString-additions.h Various methods for NSString Copyright (c) 2002 Free Software Foundation Date: 2003 May 9 Author: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSString (STSmalltalkAdditions) - (BOOL)containsString:(NSString *)aString; @end steptalk-0.10.0/Languages/Smalltalk/NSString+additions.m0000644000175000000000000000231310132015530022114 0ustar gurkanroot/** NSString-additions.h Various methods for NSString Copyright (c) 2002 Free Software Foundation Date: 2003 May 9 Author: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSString+additions.h" @implementation NSString (STSmalltalkAdditions) - (BOOL)containsString:(NSString *)aString { NSRange range; range = [self rangeOfString:aString]; return (range.location != NSNotFound); } @end steptalk-0.10.0/Languages/Smalltalk/STBlock.h0000644000175000000000000000353610132015530017737 0ustar gurkanroot/** STBlock.h Wrapper for STBlockContext to make it invisible Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STBlockLiteral; @class STBytecodeInterpreter; @class STMethodContext; @class STBlockContext; @interface STBlock:NSObject { STBytecodeInterpreter *interpreter; STMethodContext *homeContext; unsigned initialIP; unsigned argCount; unsigned stackSize; STBlockContext *cachedContext; BOOL usingCachedContext; } - initWithInterpreter:(STBytecodeInterpreter *)anInterpreter homeContext:(STMethodContext *)context initialIP:(unsigned)ptr argumentCount:(int)count stackSize:(int)size; - (unsigned)argumentCount; - value; - valueWith:arg; - valueWith:arg1 with:arg2; - valueWith:arg1 with:arg2 with:arg3; - valueWithArgs:(id *)args count:(unsigned)count; - whileTrue:(STBlock *)doBlock; - whileFalse:(STBlock *)doBlock; - handler:(STBlock *)handlerBlock; @end steptalk-0.10.0/Languages/Smalltalk/STBlock.m0000644000175000000000000001213010132015530017732 0ustar gurkanroot/** STBlock.m Wrapper for STBlockContext to make it invisible from the user Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBlock.h" #import "STLiterals.h" #import "STBlockContext.h" #import "STBytecodeInterpreter.h" #import "STStack.h" #import #import #import #import Class STBlockContextClass = nil; @implementation STBlock + (void)initialize { STBlockContextClass = [STBlockContext class]; } - initWithInterpreter:(STBytecodeInterpreter *)anInterpreter homeContext:(STMethodContext *)context initialIP:(unsigned)ptr argumentCount:(int)count stackSize:(int)size { homeContext = context; argCount = count; stackSize = size; initialIP = ptr; interpreter = anInterpreter; return [super init]; } - (unsigned)argumentCount { return argCount; } - value { if(argCount != 0) { [NSException raise:STScriptingException format:@"Block needs %i arguments", argCount]; return nil; } return [self valueWithArgs:(id*)0 count:0]; } - valueWith:arg { id args[1] = {arg}; id retval; retval = [self valueWithArgs:args count:1]; return retval; } - valueWith:arg1 with:arg2 { id args[2] = {arg1,arg2}; id retval; retval = [self valueWithArgs:args count:2]; return retval; } - valueWith:arg1 with:arg2 with:arg3 { id args[3] = {arg1,arg2,arg3}; id retval; retval = [self valueWithArgs:args count:3]; return retval; } - valueWith:arg1 with:arg2 with:arg3 with:arg4 { id args[4] = {arg1,arg2,arg3,arg4}; id retval; retval = [self valueWithArgs:args count:4]; return retval; } - valueWithArgs:(id *)args count:(unsigned)count; { STExecutionContext *parentContext; STBlockContext *context; STStack *stack; unsigned int i; id retval; if(argCount != count) { [NSException raise:STScriptingException format:@"Invalid block argument count %i, " @"wants to be %i", count, argCount]; return nil; } if(!usingCachedContext) { /* In case of recursive block nesting */ usingCachedContext = YES; if(!cachedContext) { cachedContext = [[STBlockContextClass alloc] initWithInterpreter:interpreter initialIP:initialIP stackSize:stackSize]; } /* Avoid allocation */ context = cachedContext; [[context stack] empty]; [context resetInstructionPointer]; } else { /* Create new context */ context = [[STBlockContextClass alloc] initWithInterpreter:interpreter initialIP:initialIP stackSize:stackSize]; AUTORELEASE(context); } /* push block arguments to the stack */ stack = [context stack]; for(i = 0; i #import #import #import @implementation STBlockContext - initWithInterpreter:(STBytecodeInterpreter *)anInterpreter initialIP:(unsigned)pointer stackSize:(unsigned)size { [super initWithStackSize:size]; interpreter = RETAIN(anInterpreter); initialIP = pointer; instructionPointer = initialIP; return self; } - (void)dealloc { RELEASE(interpreter); [super dealloc]; } - (BOOL)isBlockContext { return YES; } - (void)setHomeContext:(STMethodContext *)context { ASSIGN(homeContext,context); } - (STMethodContext *)homeContext { return homeContext; } - (void)invalidate { [self setHomeContext:nil]; } - (BOOL)isValid { return [homeContext isValid]; } - (unsigned)initialIP { return initialIP; } - temporaryAtIndex:(unsigned)index; { return [homeContext temporaryAtIndex:index]; } - (void)setTemporary:anObject atIndex:(unsigned)index; { [homeContext setTemporary:anObject atIndex:index]; } - (NSString *)referenceNameAtIndex:(unsigned)index { return [homeContext referenceNameAtIndex:index]; } - (STBytecodes *)bytecodes { return [homeContext bytecodes]; } - (id)literalObjectAtIndex:(unsigned)index { return [homeContext literalObjectAtIndex:index]; } - (id)receiver { return [homeContext receiver]; } - (void)resetInstructionPointer { instructionPointer = initialIP; } @end steptalk-0.10.0/Languages/Smalltalk/STBytecodeInterpreter.h0000644000175000000000000000370210132015530022662 0ustar gurkanroot/** STBytecodeInterpreter.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STCompiledMethod; @class STCompiledCode; @class STBytecodes; @class STExecutionContext; @class STStack; @class STEnvironment; @class NSArray; @class NSMutableArray; @class NSMutableDictionary; @interface STBytecodeInterpreter:NSObject { STEnvironment *environment; /* scripting environment */ STExecutionContext *activeContext; /* current execution context */ STStack *stack; /* from context */ STBytecodes *bytecodes; /* from context */ unsigned instructionPointer; /* IP */ id receiver; int entry; BOOL stopRequested; } + interpreterWithEnvrionment:(STEnvironment *)env; - initWithEnvironment:(STEnvironment *)env; - (void)setEnvironment:(STEnvironment *)env; - (id)interpretMethod:(STCompiledMethod *)method forReceiver:(id)anObject arguments:(NSArray*)args; - (void)setContext:(STExecutionContext *)context; - (STExecutionContext *)context; - (id)interpret; - (void)halt; @end steptalk-0.10.0/Languages/Smalltalk/STBytecodeInterpreter.m0000644000175000000000000003765210255624121022712 0ustar gurkanroot/** STBytecodeInterpreter.m Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBytecodeInterpreter.h" #import "Externs.h" #import "STBlock.h" #import "STBlockContext.h" #import "STBytecodes.h" #import "STCompiledMethod.h" #import "STExecutionContext.h" #import "STLiterals.h" #import "STMessage.h" #import "STMethodContext.h" #import "STSmalltalkScriptObject.h" #import "STStack.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import @interface STBytecodeInterpreter(STPrivateMethods) - (short)fetchBytecode; - (BOOL)dispatchBytecode:(STBytecode)bytecode; - (void)invalidBytecode:(STBytecode)bytecode; - (void)setInstructionPointer:(unsigned)newIP; - (unsigned)instructionPointer; - (void)sendSelectorAtIndex:(unsigned)index withArgs:(unsigned)argCount; - (id)interpret; - (void)returnValue:(id)value; @end static SEL sendSelectorAtIndexSel; static IMP sendSelectorAtIndexImp; static SEL pushSel; static IMP pushImp; static SEL popSel; static IMP popImp; static Class NSInvocation_class = nil; @implementation STBytecodeInterpreter + (void)initialize { sendSelectorAtIndexSel = @selector(sendSelectorAtIndex:withArgCount:); pushSel = @selector(push:); popSel = @selector(pop); sendSelectorAtIndexImp = [STBytecodeInterpreter instanceMethodForSelector:sendSelectorAtIndexSel]; pushImp = [STStack instanceMethodForSelector:pushSel]; popImp = [STStack instanceMethodForSelector:popSel]; NSInvocation_class = [NSInvocation class]; } + interpreterWithEnvrionment:(STEnvironment *)env { return AUTORELEASE([[self alloc] initWithEnvironment:env]); } - initWithEnvironment:(STEnvironment *)env { self = [super init]; environment = RETAIN(env); return self; } - (void)setEnvironment:(STEnvironment *)env { ASSIGN(environment,env); } - (id)interpretMethod:(STCompiledMethod *)method forReceiver:(id)anObject arguments:(NSArray*)args { // NSAutoreleasePool *pool = [NSAutoreleasePool new]; STExecutionContext *oldContext; STMethodContext *newContext; id retval; if(!environment) { [NSException raise:STInterpreterGenericException format:@"No execution environment set"]; return nil; } NSDebugLLog(@"STBytecodeInterpreter",@"Executing method %@ with %i args", [method selector],[args count]); if(!method) { return nil; } if([args count] != [method argumentCount]) { [NSException raise:STInterpreterGenericException format:@"Invalid argument count %i (should be %i)" @" for method %@ ", [args count],[method argumentCount], [method selector]]; } newContext = [[STMethodContext alloc] initWithMethod:method environment:environment]; [newContext setArgumentsFromArray:args]; [newContext setReceiver:anObject]; oldContext = activeContext; [self setContext:newContext]; retval = [self interpret]; [self setContext:oldContext]; RELEASE(newContext); // RETAIN(retval); // [pool release]; // AUTORELEASE(retval) return retval; } /* --------------------------------------------------------------------------- * Interpret * --------------------------------------------------------------------------- */ - (void)setContext:(STExecutionContext *)newContext { NSDebugLLog(@"STExecutionContext", @"Switch from context %@ to context %@", activeContext, newContext); if(!newContext) { RELEASE(activeContext); activeContext = nil; stack = nil; bytecodes = nil; instructionPointer = 0; receiver = nil; return; } if( ![newContext isValid]) { [NSException raise:STInterpreterGenericException format:@"Trying to set an invalid context"]; } [activeContext setInstructionPointer:instructionPointer]; ASSIGN(activeContext,newContext); stack = [activeContext stack]; receiver = [activeContext receiver]; if(!stack) { [NSException raise:STInternalInconsistencyException format:@"No execution stack"]; } instructionPointer = [activeContext instructionPointer]; bytecodes = [activeContext bytecodes]; } - (STExecutionContext *)context { return activeContext; } - (id)interpret { STBytecode bytecode; id retval; entry++; NSDebugLLog(@"STBytecodeInterpreter", @"Interpreter entry %i", entry); NSDebugLLog(@"STBytecodeInterpreter", @"IP %x %x", instructionPointer, [bytecodes length]); if(!bytecodes) { NSLog(@"Smalltalk: No bytecodes."); return nil; } stopRequested = NO; do { bytecode = [bytecodes fetchNextBytecodeAtPointer:&instructionPointer]; if(stopRequested) { break; } } while( [self dispatchBytecode:bytecode] ); if(!stopRequested) { retval = [stack pop]; } else { NSDebugLLog(@"STBytecode interpreter",@"Stop requested"); retval = nil; } NSDebugLLog(@"STBytecodeInterpreter", @"Returning '%@' from interpreter (entry %i)",retval,entry); entry --; return retval; } - (void)halt { NSDebugLLog(@"STBytecode interpreter",@"Halt!"); stopRequested = YES; } /* --------------------------------------------------------------------------- * Return * --------------------------------------------------------------------------- */ - (void)returnValue:(id)value { NSDebugLLog(@"STExecutionContext", @"%@ return value '%@' from method", activeContext,value); [activeContext invalidate]; [stack push:value]; } - (unsigned)instructionPointer { return instructionPointer; } /* --------------------------------------------------------------------------- * Block manipulation * --------------------------------------------------------------------------- */ - (void)createBlockWithArgumentCount:(int)argCount stackSize:(int)stackSize { unsigned ptr; STBlock *block; ptr = instructionPointer + STLongJumpBytecodeSize; NSDebugLLog(@"STExecutionContext", @"%@ Create block: argc:%i stack:%i ip:0x%04x", activeContext, argCount, stackSize, ptr); block = [STBlock alloc]; [block initWithInterpreter:self homeContext:[activeContext homeContext] initialIP:ptr argumentCount:argCount stackSize:stackSize]; [stack push:AUTORELEASE(block)]; } /* --------------------------------------------------------------------------- send selector (see also STEnvironment class) * --------------------------------------------------------------------------- */ - (void)sendSelectorAtIndex:(unsigned)selIndex withArgCount:(unsigned)argCount { NSString *selector; NSInvocation *invocation; id target; int index; id object; NSDebugLLog(@"STSending", @"send selector '%@' with %i args'", [activeContext literalObjectAtIndex:selIndex],argCount); target = [stack valueFromTop:argCount]; /* FIXME */ if(!target) { target = STNil; } selector = [activeContext literalObjectAtIndex:selIndex]; NSDebugLLog(@"STSending", @" %s receiver:%@ (%@) selector:%@", [receiver isProxy] ? "proxy for" : "", target, NSStringFromClass([target class]), selector); /* FIXME: this is too slow */ selector = [environment translateSelector:selector forReceiver:target]; invocation = [NSInvocation_class invocationWithTarget:target selectorName:selector]; if(!invocation) { [NSException raise:STInternalInconsistencyException format:@"Should not send selector '%@' to " @"receiver of type %@ (could not create invocation)", selector,[target className]]; return; } for(index = argCount + 1; index > 1; index--) { object = [stack pop]; if(object == STNil) { object = nil; } NSDebugLLog(@"STSending", @" argument %2i: '%@'",index - 2, object); [invocation setArgumentAsObject:object atIndex:index]; } /* ---------------------------- * invoke it! * ---------------------------- */ NSDebugLLog(@"STSending",@" invoking... (%@ %s)",invocation, [[invocation methodSignature] methodReturnType]); [invocation invoke]; NSDebugLLog(@"STSending",@" done invoking.",invocation); /* FIXME */ if(!stopRequested) { /* pop the receiver from the stack */ [stack pop]; [stack push: [invocation returnValueAsObject]]; } } /* --------------------------------------------------------------------------- Bytecode manipulation * --------------------------------------------------------------------------- */ #define STDebugBytecode(bc) \ NSDebugLLog(@"STBytecodeInterpreter", \ @"#%04x %@", \ (bc).pointer, \ STDissasembleBytecode(bc)) #define STDebugBytecodeWith(bc,object) \ NSDebugLLog(@"STBytecodeInterpreter", \ @"#%04x %@ (%@)", \ (bc).pointer, \ STDissasembleBytecode(bc), \ (object)) #define STPush(s, v) (*pushImp)(s, pushSel, v) // #define STPush(s, v) [s push:v] #define STPop(s) (*popImp)(s, popSel) // #define STPop(s) [s pop] - (BOOL)dispatchBytecode:(STBytecode)bytecode { NSString *refName; id object; switch(bytecode.code) { case STLongJumpBytecode: { /* int offset = STLongJumpOffset(bytecode.arg1,bytecode.arg2) - STLongJumpBytecodeSize; */ int offset = bytecode.arg1 - STLongJumpBytecodeSize; STDebugBytecode(bytecode); instructionPointer+=offset; break; } case STPushReceiverBytecode: STDebugBytecodeWith(bytecode,receiver); STPush(stack, receiver); break; case STPushNilBytecode: STDebugBytecodeWith(bytecode,receiver); STPush(stack,nil); break; case STPushTrueBytecode: STDebugBytecodeWith(bytecode,receiver); STPush(stack,[NSNumber numberWithInt:YES]); break; case STPushFalseBytecode: STDebugBytecodeWith(bytecode,receiver); STPush(stack,[NSNumber numberWithInt:NO]); break; case STPushRecVarBytecode: refName = [activeContext referenceNameAtIndex:bytecode.arg1]; object = [receiver valueForKey:refName]; STDebugBytecodeWith(bytecode,object); STPush(stack,object); break; case STPushExternBytecode: // NSLog(@"PUSH EXTERN ctx(%@): %@ %@", [activeContext className], [[activeContext method] selector], [[activeContext method] namedReferences]); refName = [activeContext referenceNameAtIndex:bytecode.arg1]; object = [environment objectWithName:refName]; STDebugBytecodeWith(bytecode,object); STPush(stack,object); break; case STPushTemporaryBytecode: object = [activeContext temporaryAtIndex:bytecode.arg1]; STPush(stack,object); STDebugBytecodeWith(bytecode,object); break; case STPushLiteralBytecode: object = [activeContext literalObjectAtIndex:bytecode.arg1]; STDebugBytecodeWith(bytecode,object); STPush(stack,object); break; case STPopAndStoreRecVarBytecode: STDebugBytecode(bytecode); refName = [activeContext referenceNameAtIndex:bytecode.arg1]; object = STPop(stack); [receiver setValue:object forKey:refName]; break; case STPopAndStoreExternBytecode: STDebugBytecode(bytecode); refName = [activeContext referenceNameAtIndex:bytecode.arg1]; object = STPop(stack); [environment setObject:object forName:refName]; break; case STPopAndStoreTempBytecode: STDebugBytecode(bytecode); [activeContext setTemporary:STPop(stack) atIndex:bytecode.arg1]; break; case STSendSelectorBytecode: STDebugBytecodeWith(bytecode, [activeContext literalObjectAtIndex:bytecode.arg1]); (*sendSelectorAtIndexImp)(self, sendSelectorAtIndexSel, bytecode.arg1,bytecode.arg2); /* [self sendSelectorAtIndex:bytecode.arg1 withArgCount:bytecode.arg2]; */ break; case STSuperSendSelectorBytecode: /* FIXME: not implemented */ [self invalidBytecode:bytecode]; break; case STDupBytecode: STDebugBytecode(bytecode); [stack duplicateTop]; break; case STPopStackBytecode: STDebugBytecode(bytecode); [stack pop]; break; case STReturnBytecode: case STReturnBlockBytecode: STDebugBytecode(bytecode); [self returnValue:[stack pop]]; return NO; case STBlockCopyBytecode: STDebugBytecode(bytecode); { STBlockLiteral *info = [stack pop]; [self createBlockWithArgumentCount:[info argumentCount] stackSize:[info stackSize]]; } break; default: [self invalidBytecode:bytecode]; break; }; return YES; } - (void)invalidBytecode:(STBytecode)bytecode { [NSException raise:STInternalInconsistencyException format:@"invalid bytecode (0x%02x) at 0x%06x", bytecode.code,bytecode.pointer]; } @end steptalk-0.10.0/Languages/Smalltalk/STBytecodes.h0000644000175000000000000000622510142062402020625 0ustar gurkanroot/** STBytecodes.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import /* Bytecode table */ /* #define STReceiverConstant 0x00 #define STTrueConstant 0x01 #define STFalseConstant 0x02 #define STNilConstant 0x03 */ #define STPushReceiverBytecode 0x00 /* push self */ #define STPushNilBytecode 0x01 #define STPushTrueBytecode 0x02 #define STPushFalseBytecode 0x03 /* 0x00 - 0x07 receiver,true,false,nil, -1,0,1,2 */ #define STPushRecVarBytecode 0x08 /* recvar index */ #define STPushExternBytecode 0x09 /* extern index */ #define STPushTemporaryBytecode 0x0a /* temp index */ #define STPushLiteralBytecode 0x0b /* lit index */ #define STPopAndStoreRecVarBytecode 0x0c /* recvar index */ #define STPopAndStoreExternBytecode 0x0d /* extern index */ #define STPopAndStoreTempBytecode 0x0e /* temp index */ /* 0x0f reserved */ #define STSendSelectorBytecode 0x10 /* lit index, arg count */ #define STSuperSendSelectorBytecode 0x11 /* lit index, arg count */ #define STBlockCopyBytecode 0x12 #define STLongJumpBytecode 0x13 /* byte 1, byte 2 */ #define STDupBytecode 0x14 #define STPopStackBytecode 0x15 #define STReturnBytecode 0x16 #define STReturnBlockBytecode 0x17 /* 0x18-0x27 reserved single bytecodes */ /* 0x27-0xfe reserved */ #define STBreakpointBytecode 0xff /* #define STLongJumpOffset(arg1, arg2) \ ( (((arg1) & 0xff) << 8) | ((arg2) & 0xff) ) #define STLongJumpFirstByte(offset)\ ( ((offset) >> 8) & 0xff ) #define STLongJumpSecondByte(offset)\ ( (offset) & 0xff ) */ #define STLongJumpBytecodeSize 3 @class NSArray; @class NSString; typedef struct { unsigned short code; unsigned short arg1; unsigned short arg2; unsigned pointer; } STBytecode; extern NSArray *STBytecodeNames; extern NSString *STBytecodeName(unsigned short code); extern NSString *STDissasembleBytecode(STBytecode bytecode); @interface STBytecodes:NSObject { NSData *bytes; } - (STBytecode)fetchNextBytecodeAtPointer:(unsigned *)pointer; @end steptalk-0.10.0/Languages/Smalltalk/STBytecodes.m0000644000175000000000000002157710142064664020655 0ustar gurkanroot/** STBytecodes.m Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STBytecodes.h" #import #import "Externs.h" #import #import #import #import NSArray *STBytecodeNames; static void initNamesArray(void) { NSString *invalid = @"invalid bytecode"; NSMutableArray *array; int i; array = [NSMutableArray arrayWithCapacity:256]; for(i=0;i<256;i++) { [array insertObject:invalid atIndex:i]; } [array replaceObjectAtIndex:STPushReceiverBytecode withObject:@"push self"]; [array replaceObjectAtIndex:STPushNilBytecode withObject:@"push nil"]; [array replaceObjectAtIndex:STPushTrueBytecode withObject:@"push true"]; [array replaceObjectAtIndex:STPushFalseBytecode withObject:@"push false"]; [array replaceObjectAtIndex:STPushRecVarBytecode withObject:@"push ivar"]; [array replaceObjectAtIndex:STPushExternBytecode withObject:@"push extern"]; [array replaceObjectAtIndex:STPushTemporaryBytecode withObject:@"push temporary"]; [array replaceObjectAtIndex:STPushLiteralBytecode withObject:@"push literal"]; [array replaceObjectAtIndex:STPopAndStoreRecVarBytecode withObject:@"pop and store ivar"]; [array replaceObjectAtIndex:STPopAndStoreExternBytecode withObject:@"pop and store extern"]; [array replaceObjectAtIndex:STPopAndStoreTempBytecode withObject:@"pop and store temp"]; [array replaceObjectAtIndex:STSendSelectorBytecode withObject:@"send selector"]; [array replaceObjectAtIndex:STSuperSendSelectorBytecode withObject:@"send super selector"]; [array replaceObjectAtIndex:STBlockCopyBytecode withObject:@"block copy"]; [array replaceObjectAtIndex:STDupBytecode withObject:@"dup"]; [array replaceObjectAtIndex:STPopStackBytecode withObject:@"pop"]; [array replaceObjectAtIndex:STReturnBytecode withObject:@"return"]; [array replaceObjectAtIndex:STReturnBlockBytecode withObject:@"return from block"]; [array replaceObjectAtIndex:STBreakpointBytecode withObject:@"breakpoint"]; [array replaceObjectAtIndex:STLongJumpBytecode withObject:@"long jump"]; STBytecodeNames = [[NSArray alloc] initWithArray:array]; } NSString *STBytecodeName(unsigned short code) { static NSString *invalid = @"invalid bytecode"; NSString *name; if( code > [STBytecodeNames count] ) { return invalid; } name = [STBytecodeNames objectAtIndex:code]; if(name == nil) { return invalid; } return name; } NSString *STDissasembleBytecode(STBytecode bytecode) { NSString *str; str = STBytecodeName(bytecode.code); switch(bytecode.code) { case STLongJumpBytecode: { //int offset = STLongJumpOffset(bytecode.arg1,bytecode.arg2); int offset = bytecode.arg1; return [NSString stringWithFormat:@"%@ %i (0x%06x)", str, offset, bytecode.pointer+offset]; } case STSendSelectorBytecode: case STSuperSendSelectorBytecode: return [NSString stringWithFormat:@"%@ %i with %i args", str, bytecode.arg1, bytecode.arg2]; case STPushRecVarBytecode: case STPushExternBytecode: case STPushTemporaryBytecode: case STPushLiteralBytecode: case STPopAndStoreRecVarBytecode: case STPopAndStoreExternBytecode: case STPopAndStoreTempBytecode: return [NSString stringWithFormat:@"%@ %i", str, bytecode.arg1]; case STPushReceiverBytecode: case STPushNilBytecode: case STPushTrueBytecode: case STPushFalseBytecode: case STBlockCopyBytecode: case STDupBytecode: case STPopStackBytecode: case STReturnBytecode: case STReturnBlockBytecode: case STBreakpointBytecode: return str; default: return [NSString stringWithFormat:@"invalid (0x%02x)", bytecode.code]; } } @implementation STBytecodes + (void)initialize { initNamesArray(); } /* - (id) initWithBytesNoCopy: (void*)someBytes length: (unsigned)length fromZone: (NSZone*)zone { bytes = [[NSData alloc] initWithBytesNoCopy:someBytes length:length fromZone:zone]; return self; } */ /* FIXME: rewrite this class - it is a leftover */ - (id) initWithData: (NSData *)data { self = [super init]; bytes = RETAIN(data); return self; } - (NSData *)data { return bytes; } - (void)dealloc { RELEASE(bytes); [super dealloc]; } - (const void *)bytes { return [bytes bytes]; } - (unsigned) length { return [bytes length]; } - (NSString *)description { return [bytes description]; } - (STBytecode)fetchNextBytecodeAtPointer:(unsigned *)pointer { STBytecode bytecode; const unsigned char *bytesPtr = (const unsigned char *)[bytes bytes]; unsigned length = [self length]; if(*pointer < length) { bytecode.pointer = *pointer; bytecode.code = bytesPtr[(*pointer)++]; switch(bytecode.code) { case STSendSelectorBytecode: case STSuperSendSelectorBytecode: if(*pointer + 2 >= length) { break; } /* bytecode.arg1 = bytesPtr[(*pointer)++]; bytecode.arg2 = bytesPtr[(*pointer)++]; */ bytecode.arg1 = (bytesPtr[(*pointer)++])<<8; bytecode.arg1 |= bytesPtr[(*pointer)++]; bytecode.arg2 = (bytesPtr[(*pointer)++])<<8; bytecode.arg2 |= bytesPtr[(*pointer)++]; return bytecode; case STLongJumpBytecode: case STPushRecVarBytecode: case STPushExternBytecode: case STPushTemporaryBytecode: case STPushLiteralBytecode: case STPopAndStoreRecVarBytecode: case STPopAndStoreExternBytecode: case STPopAndStoreTempBytecode: if(*pointer + 1 >= length) { break; } /* bytecode.arg1 = bytesPtr[(*pointer)++]; */ bytecode.arg1 = (bytesPtr[(*pointer)++])<<8; bytecode.arg1 |= bytesPtr[(*pointer)++]; bytecode.arg2 = 0; return bytecode; case STPushReceiverBytecode: case STPushNilBytecode: case STPushTrueBytecode: case STPushFalseBytecode: case STBlockCopyBytecode: case STDupBytecode: case STPopStackBytecode: case STReturnBytecode: case STReturnBlockBytecode: case STBreakpointBytecode: bytecode.arg1 = 0; bytecode.arg2 = 0; return bytecode; default: [NSException raise:STInternalInconsistencyException format:@"Invalid bytecode 0x%02x at 0x%06x", bytecode.code,*pointer-1]; } } [NSException raise:STInternalInconsistencyException format:@"Instruction pointer 0x%06x out of bounds (0x%06x)", *pointer,length]; return bytecode; } - (void)encodeWithCoder:(NSCoder *)coder { // [super encodeWithCoder: coder]; [coder encodeObject:bytes]; } - initWithCoder:(NSCoder *)decoder { self = [super init]; // super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &bytes]; return self; } @end steptalk-0.10.0/Languages/Smalltalk/STCompiledCode.h0000644000175000000000000000307510255607504021250 0ustar gurkanroot/** STCompiledCode.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSData; @class NSArray; @class NSMutableArray; @class STBytecodes; @interface STCompiledCode:NSObject { STBytecodes *bytecodes; NSArray *literals; NSMutableArray *namedRefs; short tempCount; short stackSize; } - initWithBytecodesData:(NSData *)data literals:(NSArray *)anArray temporariesCount:(unsigned)count stackSize:(unsigned)size namedReferences:(NSMutableArray *)refs; - (STBytecodes *)bytecodes; - (unsigned)temporariesCount; - (unsigned)stackSize; - (id)literalObjectAtIndex:(unsigned)index; - (NSMutableArray *)namedReferences; - (NSArray *)literals; @end steptalk-0.10.0/Languages/Smalltalk/STCompiledCode.m0000644000175000000000000000544010255623745021260 0ustar gurkanroot/** STCompiledCode.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiledCode.h" #import "STBytecodes.h" #import #import #import #import @implementation STCompiledCode - initWithBytecodesData:(NSData *)data literals:(NSArray *)anArray temporariesCount:(unsigned)count stackSize:(unsigned)size namedReferences:(NSMutableArray *)refs { [super init]; bytecodes = [[STBytecodes alloc] initWithData:data]; literals = [[NSArray alloc] initWithArray:anArray]; tempCount = count; stackSize = size; namedRefs = [[NSArray alloc] initWithArray:refs]; return self; } - (void)dealloc { RELEASE(bytecodes); RELEASE(literals); RELEASE(namedRefs); [super dealloc]; } - (STBytecodes *)bytecodes { return bytecodes; } - (unsigned)temporariesCount { return tempCount; } - (unsigned)stackSize { return stackSize; } - (NSArray *)literals { return literals; } - (id)literalObjectAtIndex:(unsigned)index { return [literals objectAtIndex:index]; } - (NSMutableArray *)namedReferences { return namedRefs; } - (void)encodeWithCoder:(NSCoder *)coder { // [super encodeWithCoder: coder]; [coder encodeObject:bytecodes]; [coder encodeObject:literals]; [coder encodeObject:namedRefs]; [coder encodeValueOfObjCType: @encode(short) at: &tempCount]; [coder encodeValueOfObjCType: @encode(short) at: &stackSize]; } - initWithCoder:(NSCoder *)decoder { self = [super init]; // [super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &bytecodes]; [decoder decodeValueOfObjCType: @encode(id) at: &literals]; [decoder decodeValueOfObjCType: @encode(id) at: &namedRefs]; [decoder decodeValueOfObjCType: @encode(short) at: &tempCount]; [decoder decodeValueOfObjCType: @encode(short) at: &stackSize]; return self; } @end steptalk-0.10.0/Languages/Smalltalk/STCompiledMethod.h0000644000175000000000000000270010255607547021617 0ustar gurkanroot/** STCompiledMethod.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiledCode.h" @protocol STMethod; @class STMessage; @interface STCompiledMethod:STCompiledCode { NSString *selector; short argCount; // unsigned primitive; } + methodWithCode:(STCompiledCode *)code messagePattern:(STMessage *)pattern; - initWithSelector:(NSString *)sel argumentCount:(unsigned)aCount bytecodesData:(NSData *)data literals:(NSArray *)anArray temporariesCount:(unsigned)tCount stackSize:(unsigned)size namedReferences:(NSMutableArray *)refs; - (NSString *)selector; - (unsigned)argumentCount; @end steptalk-0.10.0/Languages/Smalltalk/STCompiledMethod.m0000644000175000000000000000755510255624063021631 0ustar gurkanroot/** STCompiledMethod.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiledMethod.h" #import "STMessage.h" #import "STBytecodes.h" #import #import #import #import #import #import @implementation STCompiledMethod + methodWithCode:(STCompiledCode *)code messagePattern:(STMessage *)pattern { STCompiledMethod *method; method = [STCompiledMethod alloc]; [method initWithSelector:[pattern selector] argumentCount:[[pattern arguments] count] bytecodesData:[[code bytecodes] data] literals:[code literals] temporariesCount:[code temporariesCount] stackSize:[code stackSize] namedReferences:[code namedReferences]]; return AUTORELEASE(method); } - initWithSelector:(NSString *)sel argumentCount:(unsigned)aCount bytecodesData:(NSData *)data literals:(NSArray *)anArray temporariesCount:(unsigned)tCount stackSize:(unsigned)size namedReferences:(NSMutableArray *)refs; { self = [super initWithBytecodesData:data literals:anArray temporariesCount:tCount stackSize:size namedReferences:refs]; selector = RETAIN(sel); argCount = aCount; return self; } - (void)dealloc { RELEASE(selector); [super dealloc]; } - (NSString *)selector { return selector; } - (unsigned)argumentCount { return argCount; } - (NSString*)description { NSMutableString *desc = [NSMutableString string]; [desc appendFormat:@"%s:\n" @"Selector = %@\n" @"Literals Count = %i\n" @"Literals = %@\n" @"External References = %@\n" @"Temporaries Count = %i\n" @"Stack Size = %i\n" @"Byte Codes = %@\n", [self className], selector, [literals count], [literals description], [namedRefs description], tempCount, stackSize, [bytecodes description]]; return desc; } /* Script object method info */ - (NSString *)methodName { return selector; } - (NSString *)languageName { return @"Smalltalk"; } - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder: coder]; [coder encodeObject:selector]; [coder encodeValueOfObjCType: @encode(short) at: &argCount]; } - initWithCoder:(NSCoder *)decoder { self = [super initWithCoder: decoder]; [decoder decodeValueOfObjCType: @encode(id) at: &selector]; [decoder decodeValueOfObjCType: @encode(short) at: &argCount]; return self; } - (NSString *)source { return nil; } @end steptalk-0.10.0/Languages/Smalltalk/STCompiledScript.h0000644000175000000000000000255710255617340021645 0ustar gurkanroot/** STCompiledScript.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSDictionary; @class NSMutableDictionary; @class NSString; @class NSArray; @class STCompiledMethod; @class STEnvironment; @interface STCompiledScript:NSObject { NSMutableDictionary *methodDictionary; NSArray *variableNames; } - initWithVariableNames:(NSArray *)array; - (id)executeInEnvironment:(STEnvironment *)env; - (STCompiledMethod *)methodWithName:(NSString *)name; - (void)addMethod:(STCompiledMethod *)method; - (NSArray *)variableNames; @end steptalk-0.10.0/Languages/Smalltalk/STCompiledScript.m0000644000175000000000000000760110255617467021657 0ustar gurkanroot/** STCompiledScript.m Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiledScript.h" #import "STSmalltalkScriptObject.h" #import "STCompiledMethod.h" #import #import #import #import #import #import #import #import @class STEnvironment; static SEL mainSelector; static SEL initializeSelector; static SEL finalizeSelector; @implementation STCompiledScript:NSObject + (void)initialize { mainSelector = STSelectorFromString(@"main"); initializeSelector = STSelectorFromString(@"startUp"); finalizeSelector = STSelectorFromString(@"finalize"); } - initWithVariableNames:(NSArray *)array; { [super init]; variableNames = RETAIN(array); return self; } - (void)dealloc { RELEASE(methodDictionary); RELEASE(variableNames); [super dealloc]; } - (void)addMethod:(STCompiledMethod *)method { if(!methodDictionary) { methodDictionary = [[NSMutableDictionary alloc] init]; } if( ! [method isKindOfClass:[STCompiledMethod class]] ) { [NSException raise:STGenericException format:@"Invalid compiled method class '%@'", [method class]]; } [methodDictionary setObject:method forKey:[method selector]]; } - (STCompiledMethod *)methodWithName:(NSString *)name { return [methodDictionary objectForKey:name]; } - (NSArray*)variableNames { return variableNames; } - (id)executeInEnvironment:(STEnvironment *)env { STSmalltalkScriptObject *object; int methodCount; id retval = nil; object = [[STSmalltalkScriptObject alloc] initWithEnvironment:env compiledScript:self]; methodCount = [methodDictionary count]; if(methodCount == 0) { NSLog(@"Empty script executed"); return nil; } else if(methodCount == 1) { NSString *selName = [[methodDictionary allKeys] objectAtIndex:0]; SEL sel = STSelectorFromString(selName); NSDebugLog(@"Executing single-method script. (%@)", selName); retval = [object performSelector:sel]; } else if(![object respondsToSelector:mainSelector]) { NSLog(@"No 'main' method found"); return nil; } else { if( [object respondsToSelector:initializeSelector] ) { NSDebugLog(@"Sending 'startUp' to script object"); [object performSelector:initializeSelector]; } if( [object respondsToSelector:mainSelector] ) { retval = [object performSelector:mainSelector]; } else { NSLog(@"No 'main' found in script"); } if( [object respondsToSelector:finalizeSelector] ) { NSDebugLog(@"Sending 'finalize' to script object"); [object performSelector:finalizeSelector]; } } RELEASE(object); return retval; } @end steptalk-0.10.0/Languages/Smalltalk/STCompiler.h0000644000175000000000000001041010255605743020465 0ustar gurkanroot/** STCompiler.h Bytecode compiler. Generates STExecutableCode from source code. Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import @class STCompiledScript; @class STCompiledCode; @class STCompiledMethod; @class STEnvironment; @class STSourceReader; @class STCExpression; @class STCMethod; @class STCPrimary; @class STCStatements; @class STCompiler; @class NSMutableData; @class NSMutableArray; @protocol STScriptObject; /*" Parser context information "*/ typedef struct _STParserContext { STCompiler *compiler; STSourceReader *reader; } STParserContext; /*" Get compiler from parser context "*/ #define STParserContextGetCompiler(context)\ (((STParserContext *)context)->compiler) /*" Get source reader from parser context "*/ #define STParserContextGetReader(context)\ (((STParserContext *)context)->reader) /*" Initialize parser context "*/ #define STParserContextInit(context,aCompiler,aReader) \ do { \ ((STParserContext *)context)->compiler = aCompiler; \ ((STParserContext *)context)->reader = aReader; \ } while(0) @interface STCompiler:NSObject { STEnvironment *environment; STSourceReader *reader; STParserContext context; STCompiledScript *resultScript; STCompiledMethod *resultMethod; NSMutableData *byteCodes; NSMutableArray *tempVars; NSMutableArray *externVars; NSMutableArray *receiverVars; NSMutableArray *namedReferences; NSMutableArray *literals; id receiver; BOOL isSingleMethod; unsigned stackSize; /* Required stack size */ unsigned stackPos; /* Current stack pointer */ unsigned tempsSize; /* Required temp space */ unsigned tempsCount; /* Actual temp space */ unsigned bcpos; /* Bytecode position */ Class stringLiteralClass; /* default: NSMutableString */ Class arrayLiteralClass; /* default: NSMutableArray */ Class characterLiteralClass; /* default: NSString */ Class intNumberLiteralClass; /* default: NSNumber */ Class realNumberLiteralClass; /* default: NSNumber */ Class symbolLiteralClass; /* default: NSString */ } + compilerWithEnvironment:(STEnvironment *)env; - initWithEnvironment:(STEnvironment *)env; /*" Environment "*/ - (void)setEnvironment:(STEnvironment *)env; - (STSourceReader *)sourceReader; /*" Compilation "*/ - (STCompiledScript *)compileString:(NSString *)aString; - (STCompiledMethod *)compileMethodFromSource:(NSString *)aString forReceiver:(id )receiver; /* - (NSMutableArray *)compileString:(NSString *)string; - (NSMutableArray *)compileString:(NSString *)string range:(NSRange) range; */ /*" Literals "*/ - (Class)intNumberLiteralClass; - (Class)realNumberLiteralClass; - (Class)stringLiteralClass; - (Class)arrayLiteralClass; - (Class)symbolLiteralClass; - (void)setStringLiteralClass:(Class)aClass; - (void)setArrayLiteralClass:(Class)aClass; - (void)setSymbolLiteralClass:(Class)aClass; - (void)setIntNumberLiteralClass:(Class)aClass; - (void)setRealNumberLiteralClass:(Class)aClass; - (void)setReceiverVariables:(NSArray *)vars; - (void)addTempVariable:(NSString *)varName; - (BOOL)beginScript; @end steptalk-0.10.0/Languages/Smalltalk/STCompiler.m0000644000175000000000000010132010261057362020466 0ustar gurkanroot/** STCompiler.m Bytecode compiler. Generates STExecutableCode from source code. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STCompiler.h" #import "STMessage.h" #import "STLiterals.h" #import "STBytecodes.h" #import "STCompiledScript.h" #import "STCompiledCode.h" #import "STCompiledMethod.h" #import "STCompilerUtils.h" #import "STSourceReader.h" #import "Externs.h" #import #import #import #import #import #import #import #import #import #import #import extern int STCparse(void *context); /* FIXME: rewrite parser We need three kinds of grammars: 1. = | 2. = '[|' ']' = | '!' = | 3. = = | Parser 1. are 2. are for scripts. Parser 3. is for script object methods. Because majority of the grammar is reused in all three parsers we use only one grammar definition. There is no problem in haveng 1. and 2. in one file. To be able to have 3. in the same file we do a hack: we add a prefix '!!' for method source. Then we diferentiate it in grammar file by changin the rule: 3. = '!' '!' See STGrammar.y */ @interface STCompiler(STCompilerPrivate) - (void)compile; - (void)initializeContext; - (void)destroyCompilationContext; - (unsigned)indexOfTemporaryVariable:(NSString *)varName; - (void) initializeCompilationContext; - (NSDictionary *)exceptionInfo; - (unsigned)addSelectorLiteral:(NSString*)selector; - (unsigned)addLiteral:literal; - (void)compileMethod:(STCMethod *)method; - (STCompiledCode *) compileStatements:(STCStatements *)statements; - (void)compileStatements:(STCStatements *)statements blockFlag:(BOOL)blockFlag; - (void)compilePrimary:(STCPrimary *)primary; - (void)compileExpression:(STCExpression *)expr; - (void)emitPushReceiverVariable:(unsigned)index; - (void)emitPushSelf; - (void)emitPopAndStoreReceiverVariable:(unsigned)index; - (void)emitReturn; - (void)emitReturnFromBlock; - (void)emitPushTemporary:(unsigned)index; - (void)emitPushLiteral:(unsigned)index; - (void)emitPushVariable:(unsigned)index; - (void)emitPopAndStoreTemporary:(unsigned)index; - (void)emitPopAndStoreVariable:(unsigned)index ; - (void)emitPopStack; - (void)emitSendSelector:(unsigned)index argCount:(unsigned)argCount; - (void)emitBlockCopy; - (void)emitDuplicateStackTop; - (void)emitJump:(short)offset; - (void)emitLongJump:(short)offset; - (void)emitPushNil; - (void)emitPushTrue; - (void)emitPushFalse; - (void)fixupLongJumpAt:(unsigned)index with:(short)offset; - (unsigned)currentBytecode; @end #define MAX(a,b) (((a)>(b))?(a):(b)) @implementation STCompiler + compilerWithEnvironment:(STEnvironment *)env { return AUTORELEASE([[self alloc] initWithEnvironment:env]); } - initWithEnvironment:(STEnvironment *)env { self = [self init]; [self setEnvironment:env]; return self; } - init { [super init]; arrayLiteralClass = [NSMutableArray class]; stringLiteralClass = [NSMutableString class]; /* bytesLiteralClass = [NSMutableData class]; */ intNumberLiteralClass = [NSNumber class]; realNumberLiteralClass = [NSNumber class]; symbolLiteralClass = [STSelector class]; characterLiteralClass = [NSString class]; receiverVars = [[NSMutableArray alloc] init]; namedReferences = [[NSMutableArray alloc] init]; return self; } - (void)dealloc { RELEASE(receiverVars); RELEASE(namedReferences); [super dealloc]; } - (BOOL)beginScript { if(isSingleMethod) { [NSException raise:@"STCompilerException" format:@"Script source given for single method"]; return NO; } else { return YES; } } /* --------------------------------------------------------------------------- * Compilation * --------------------------------------------------------------------------- */ - (void)setEnvironment:(STEnvironment *)env { ASSIGN(environment,env); } - (STCompiledMethod *)compileMethodFromSource:(NSString *)aString forReceiver:(id)receiverObject { STCompiledMethod *result; NSString *hackedSource; NSString *exceptionFmt = @"Syntax error at line %i near '%@', " @"reason: %@."; int parsRetval = 0; NSDebugLLog(@"STCompiler", @"Compile method for receiver %@", [receiverObject className]); if(!environment) { [NSException raise:STCompilerGenericException format:@"Compilation environment is not initialized"]; return nil; } hackedSource = [@"!!" stringByAppendingString:aString]; reader = [[STSourceReader alloc] initWithString:hackedSource]; [receiverVars removeAllObjects]; receiver = RETAIN(receiverObject); isSingleMethod = YES; STParserContextInit(&context,self,reader); NS_DURING { // extern int STCdebug; // STCdebug = 1; parsRetval = STCparse(&context); } NS_HANDLER { if ([[localException name] isEqualToString: STCompilerSyntaxException]) { NSString *tokenString; int line; tokenString = [reader tokenString]; line = [reader currentLine]; RELEASE(reader); reader = nil; [NSException raise:STCompilerSyntaxException format:exceptionFmt, line, tokenString, [localException reason]]; } [localException raise]; } NS_ENDHANDLER RELEASE(reader); result = AUTORELEASE(resultMethod); resultMethod = nil; RELEASE(receiver); receiver = nil; return result; } - (STCompiledScript *)compileString:(NSString *)aString { NSAutoreleasePool *pool = [NSAutoreleasePool new]; STCompiledScript *result; NSString *exceptionFmt = @"Syntax error at line %i near '%@', " @"reason: %@."; int parsRetval = 0; NSDebugLLog(@"STCompiler", @"Compile string", aString); isSingleMethod = NO; if(!environment) { [NSException raise:STCompilerGenericException format:@"Compilation environment is not initialized"]; return nil; } reader = [[STSourceReader alloc] initWithString:aString]; [receiverVars removeAllObjects]; STParserContextInit(&context,self,reader); NS_DURING { // extern int STCdebug; // STCdebug = 1; parsRetval = STCparse(&context); } NS_HANDLER { RELEASE(reader); reader = nil; if ([[localException name] isEqualToString: STCompilerSyntaxException]) { NSString *tokenString; int line; tokenString = [reader tokenString]; line = [reader currentLine]; [NSException raise:STCompilerSyntaxException format:exceptionFmt, line, tokenString, [localException reason]]; } [localException raise]; } NS_ENDHANDLER RELEASE(reader); [pool release]; result = AUTORELEASE(resultScript); resultScript = nil; return result; } - (void)compileMethod:(STCMethod *)method { STCompiledMethod *compiledMethod; STCompiledCode *code; STMessage *messagePattern; /* FIXME: unite STCMessage and STMessage */ messagePattern = (STMessage *)[method messagePattern]; if(!messagePattern) { messagePattern = [STMessage messageWithSelector:@"_unnamed_method" arguments:nil]; } NSDebugLLog(@"STCompiler", @"Compile method %@", [messagePattern selector]); tempVars = [NSMutableArray arrayWithArray:[messagePattern arguments]]; code = [self compileStatements:[method statements]]; compiledMethod = [STCompiledMethod methodWithCode:AUTORELEASE(code) messagePattern:messagePattern]; if(!isSingleMethod) { if(resultMethod) { [NSException raise:@"STCompilerException" format:@"Method is present when compiling a script"]; return; } if(!resultScript) { NSDebugLLog(@"STCompiler", @"Creating script with %i variables",[receiverVars count]); resultScript = [[STCompiledScript alloc] initWithVariableNames: receiverVars]; } [resultScript addMethod:compiledMethod]; } else { if(resultMethod) { [NSException raise:@"STCompilerException" format:@"More than one method compiled for single method request"]; return; } if(resultScript) { [NSException raise:@"STCompilerException" format:@"Compiled script is present when compiling single method"]; return; } resultMethod = RETAIN(compiledMethod); } } - (STCompiledCode *)compileStatements:(STCStatements *)statements { STCompiledCode *compiledCode; #ifdef DEBUG int count; int i; #endif /* FIXME: create another class */ [self initializeCompilationContext]; NSDebugLLog(@"STCompiler", @"compiling statements"); tempsSize = tempsCount = [tempVars count]; [self compileStatements:statements blockFlag:NO]; NSDebugLLog(@"STCompiler", @" temporaries %i stack %i", tempsSize,stackSize); #ifdef DEBUG count = [literals count]; NSDebugLLog(@"STCompiler", @" literals count %i", count); for(i=0;i 0; index--) { [self emitPopAndStoreTemporary:tempsSave + index - 1]; } } array = [statements expressions]; if(array) { BOOL first = YES; enumerator = [array objectEnumerator]; while((expr = [enumerator nextObject])) { [self compileExpression:expr]; /* Mateu Batle: ignore returned value on the stack ? */ /* FIXME: please check this !!! */ if (!first) { [self emitPopStack]; } else { first = NO; } } } expr = [statements returnExpression]; if(expr) { [self compileExpression:expr]; } if(blockFlag) { [blockInfo setStackSize:stackSize]; AUTORELEASE(blockInfo); stackSize = stackSizeSave; stackPos = stackPosSave; [self emitReturnFromBlock]; } else { [self emitReturn]; } /* fixup jump (if block) */ if(blockFlag) { [self fixupLongJumpAt:jumpIP with:[self currentBytecode] - jumpIP]; } /* cleanup unneeded temp variables */ // // [tempVars removeObjectsInRange:NSMakeRange(tempsSave, // [tempVars count]-tempsSave)]; // tempsCount = tempsSave; tempsCount = [tempVars count]; if(blockFlag) { int i; /* Need to keep the block parameters allocated until we exit the method context, but we also need to harvest the names*/ for (i = tempsSave; i < tempsCount; ++i) [tempVars replaceObjectAtIndex: i withObject:@""]; } else { /* cleanup unneeded temp variables */ [tempVars removeObjectsInRange:NSMakeRange(tempsSave, tempsCount-tempsSave)]; tempsCount = tempsSave; } } - (void)compilePrimary:(STCPrimary *)primary { id object = [primary object]; int index; NSDebugLLog(@"STCompiler-misc",@" compile primary"); switch([primary type]) { case STCVariablePrimaryType: if([object isEqualToString:@"YES"] || [object isEqualToString:@"true"]) { [self emitPushTrue]; } else if([object isEqualToString:@"NO"] || [object isEqualToString:@"false"]) { [self emitPushFalse]; } else if([object isEqualToString:@"nil"]) { [self emitPushNil]; } else { index = [self indexOfTemporaryVariable:object]; if(index != NSNotFound) { [self emitPushTemporary:index]; break; } else if( [object isEqual:@"self"] ) { [self emitPushSelf]; break; } else { index = [self indexOfNamedReference:object]; if([self isReceiverVariable:object]) { [self emitPushReceiverVariable:index]; } else { [self emitPushVariable:index]; } } } break; case STCLiteralPrimaryType: index = [self addLiteral:object]; [self emitPushLiteral:index]; break; case STCBlockPrimaryType: [self compileStatements:object blockFlag:YES]; break; case STCExpressionPrimaryType: [self compileExpression:object]; break; default: [NSException raise:STCompilerInconsistencyException format:@"Unknown primary type %i", [primary type]]; break; } } - (void)compileMessage:(STCMessage *)message { NSEnumerator *enumerator; NSArray *args; id obj; int index; args = [message arguments]; if(args && ([args count]>0)) { enumerator = [args objectEnumerator]; while((obj = [enumerator nextObject])) { if([obj isKindOfClass:[STCPrimary class]]) [self compilePrimary:obj]; else [self compileExpression:obj]; } } index = [self addSelectorLiteral:[message selector]]; [self emitSendSelector:index argCount:[args count]]; } - (void)compileExpression:(STCExpression *)expr { NSEnumerator *enumerator; NSArray *cascade; NSString *varName; NSArray *array; unsigned count; unsigned index,i; id obj; NSDebugLLog(@"STCompiler-misc",@" compile expression"); if([expr isPrimary]) { [self compilePrimary:[expr object]]; } else /* message expression */ { obj = [expr target]; /* target */ if([obj isKindOfClass:[STCPrimary class]]) [self compilePrimary:obj]; else [self compileExpression:obj]; cascade = [expr cascade]; if(cascade) { count = [cascade count]; for(i=0;i0) { for(i = 0; i>8)&0xff);\ bc[2] = (unsigned char)(bc2&0xff); \ [byteCodes appendBytes:bc length:3];\ bcpos+=3;\ } while(0) #define EMIT_TRIPPLE(bc1,bc2,bc3) \ do { \ unsigned char bc[5] = {bc1,0,0,0,0}; \ bc[1] = (unsigned char)((((unsigned short)bc2)>>8)&0xff);\ bc[2] = (unsigned char)(bc2&0xff); \ bc[3] = (unsigned char)((((unsigned short)bc3)>>8)&0xff);\ bc[4] = (unsigned char)(bc3&0xff); \ [byteCodes appendBytes:bc length:5];\ bcpos+=5;\ } while(0) #define STACK_PUSH \ do {\ stackPos++; \ stackSize = MAX(stackPos,stackSize);\ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize); */\ } while(0) #define STACK_PUSH_COUNT(count) \ do {\ stackPos+=count; \ stackSize = MAX(stackPos,stackSize);\ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize);*/ \ } while(0) #define STACK_POP \ stackPos--; \ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize) */; #define STACK_POP_COUNT(count) \ stackPos-=count; \ /* NSDebugLLog(@"STCompiler",@"stack pointer %i/%i",stackPos,stackSize) */; - (void)emitPushSelf { NSDebugLLog(@"STCompiler-emit", @"#%04x push self", bcpos); EMIT_SINGLE(STPushReceiverBytecode); STACK_PUSH; } - (void)emitPushNil { NSDebugLLog(@"STCompiler-emit", @"#%04x push nil", bcpos); EMIT_SINGLE(STPushNilBytecode); STACK_PUSH; } - (void)emitPushTrue { NSDebugLLog(@"STCompiler-emit", @"#%04x push true", bcpos); EMIT_SINGLE(STPushTrueBytecode); STACK_PUSH; } - (void)emitPushFalse { NSDebugLLog(@"STCompiler-emit", @"#%04x push false", bcpos); EMIT_SINGLE(STPushFalseBytecode); STACK_PUSH; } - (void)emitPushReceiverVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push receiver variable %i (%@)", bcpos,index,[namedReferences objectAtIndex:index]); EMIT_DOUBLE(STPushRecVarBytecode,index); STACK_PUSH; } - (void)emitPushTemporary:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push temporary %i (%@)", bcpos,index,[tempVars objectAtIndex:index]); EMIT_DOUBLE(STPushTemporaryBytecode,index); STACK_PUSH; } - (void)emitPushLiteral:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push literal %i (%@)", bcpos,index,[literals objectAtIndex:index]); EMIT_DOUBLE(STPushLiteralBytecode,index); STACK_PUSH; stackSize++; } - (void)emitPushVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x push external variable %i (%@)", bcpos,index,[namedReferences objectAtIndex:index]); EMIT_DOUBLE(STPushExternBytecode,index); STACK_PUSH; } - (void)emitPopAndStoreTemporary:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store temp %i (%@)", bcpos,index,[tempVars objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreTempBytecode,index); STACK_POP; } - (void)emitPopAndStoreVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store ext variable %i (%@)", bcpos,index,[namedReferences objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreExternBytecode,index); STACK_POP; } - (void)emitPopAndStoreReceiverVariable:(unsigned)index { NSDebugLLog(@"STCompiler-emit", @"#%04x pop and store rec variable %i (%@)", bcpos,index,[namedReferences objectAtIndex:index]); EMIT_DOUBLE(STPopAndStoreRecVarBytecode,index); STACK_POP; } - (void)emitSendSelector:(unsigned)index argCount:(unsigned)argCount { NSDebugLLog(@"STCompiler-emit", @"#%04x send selector %i (%@) with %i args", bcpos,index,[literals objectAtIndex:index],argCount); EMIT_TRIPPLE(STSendSelectorBytecode,index,argCount); STACK_PUSH_COUNT(argCount); STACK_POP_COUNT(argCount); } - (void)emitDuplicateStackTop { NSDebugLLog(@"STCompiler-emit", @"#%04x dup",bcpos); EMIT_SINGLE(STDupBytecode); STACK_PUSH; } - (void)emitPopStack { NSDebugLLog(@"STCompiler-emit", @"#%04x pop stack",bcpos); EMIT_SINGLE(STPopStackBytecode); STACK_POP; } - (void)emitReturn { NSDebugLLog(@"STCompiler-emit", @"#%04x return",bcpos); EMIT_SINGLE(STReturnBytecode); } - (void)emitReturnFromBlock { NSDebugLLog(@"STCompiler-emit", @"#%04x return from block",bcpos); EMIT_SINGLE(STReturnBlockBytecode); } - (void)emitBlockCopy { NSDebugLLog(@"STCompiler-emit", @"#%04x create block",bcpos); EMIT_SINGLE(STBlockCopyBytecode); } - (void)emitLongJump:(short)offset { NSDebugLLog(@"STCompiler-emit", @"#%04x long jump %i (0x%04x)",bcpos,offset,bcpos+offset); /* EMIT_TRIPPLE(STLongJumpBytecode,STLongJumpFirstByte(offset), STLongJumpSecondByte(offset)); */ EMIT_DOUBLE(STLongJumpBytecode, offset); } - (void)fixupLongJumpAt:(unsigned)index with:(short)offset { //unsigned char bytes[4] = {0,STLongJumpFirstByte(offset),0,STLongJumpSecondByte(offset)}; unsigned char bytes[2] = { (offset >> 8) & 0xff, offset & 0xff }; NSDebugLLog(@"STCompiler-emit", @"# fixup long jump at 0x%04x to 0x%04x",index, index + offset); [byteCodes replaceBytesInRange:NSMakeRange(index+1,2) withBytes:bytes]; } - (unsigned)currentBytecode { return [byteCodes length]; } @end steptalk-0.10.0/Languages/Smalltalk/STCompilerUtils.h0000644000175000000000000001110410132015531021467 0ustar gurkanroot/** STCompilerUtils.h Various compiler utilities. Copyright (c) 2002 Free Software Foundation This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import @class STCMessage; @class STCStatements; @class STCExpression; enum{ STCVariablePrimaryType, STCLiteralPrimaryType, STCBlockPrimaryType, STCExpressionPrimaryType }; @interface STCompiler(Utils_private) - (STCompiledMethod *)compileMethod:(STCMethod *)method; - (id)createIntNumberLiteralFrom:(NSString *)aString; - (id)createRealNumberLiteralFrom:(NSString *)aString; - (id)createSymbolLiteralFrom:(NSString *)aString; - (id)createStringLiteralFrom:(NSString *)aString; - (id)createCharacterLiteralFrom:(NSString *)aString; - (id)createArrayLiteralFrom:(NSArray *)anArray; @end /* * STCMethod * --------------------------------------------------------------------------- */ @interface STCMethod:NSObject { STCMessage *messagePattern; STCStatements *statements; } + methodWithPattern:(STCMessage *)patt statements:(STCStatements *)stats; - initWithPattern:(STCMessage *)patt statements:(STCStatements *)stats; - (STCStatements *)statements; - (STCMessage *)messagePattern; @end /* * STCStatements * --------------------------------------------------------------------------- */ @interface STCStatements:NSObject { NSArray *variables; NSArray *expressions; STCExpression *retexpr; } + statements; - (void)setTemporaries:(NSArray *)vars; - (NSArray *)temporaries; - (void)setExpressions:(NSArray *)exprs; - (NSArray *)expressions; - (void)setReturnExpression:(STCExpression *)ret; - (STCExpression *)returnExpression; @end /* * STCMessage * --------------------------------------------------------------------------- */ @interface STCMessage:NSObject { NSMutableString *selector; NSMutableArray *args; } + message; - (void) addKeyword:(NSString *)keyword object:object; - (NSString *)selector; - (NSArray*)arguments; @end /* * STCExpression * --------------------------------------------------------------------------- */ @interface STCExpression:NSObject { NSArray *cascade; NSArray *assignments; } + (STCExpression *) primaryExpressionWithObject:(id)anObject; + (STCExpression *) messageExpressionWithTarget:(id)anObject message:(STCMessage *)message; - (void)setCascade:(NSArray *)casc; - (void)setAssignments:(NSArray *)asgs; - (NSArray *)cascade; - (NSArray *)assignments; - (BOOL) isPrimary; - (id) target; - (STCMessage *)message; - (id) object; @end @interface STCMessageExpression:STCExpression { id target; STCMessage *message; } - initWithTarget:(id)anObject message:(STCMessage *)message; @end @interface STCPrimaryExpression:STCExpression { id object; } - initWithObject:(id)anObject; @end /* * STCPrimary * --------------------------------------------------------------------------- */ @interface STCPrimary:NSObject { int type; id object; } + primaryWithVariable:(id)anObject; + primaryWithLiteral:(id)anObject; + primaryWithBlock:(id)anObject; + primaryWithExpression:(id)anObject; - initWithType:(int)newType object:(id)obj; - (int)type; - object; @end /* * Compiler additions for literals * --------------------------------------------------------------------------- */ @interface NSString(STCompilerAdditions) + (NSString *) symbolFromString:(NSString *)aString; + (id) characterFromString:(NSString *)aString; @end @interface NSMutableString(STCompilerAdditions) + (id) stringFromString:(NSString *)aString; @end @interface NSNumber(STCompilerAdditions) + (id) intNumberFromString:(NSString *)aString; + (id) realNumberFromString:(NSString *)aString; @end @interface NSMutableArray(STCompilerAdditions) + (id) arrayFromArray:(NSArray *)anArray; @end steptalk-0.10.0/Languages/Smalltalk/STCompilerUtils.m0000644000175000000000000001535110132015531021504 0ustar gurkanroot/** STCompilerUtils.m Various compiler utilities. Copyright (c) 2002 Free Software Foundation This file is part of StepTalk. */ #import "STCompiler.h" #import "STCompilerUtils.h" #import "STSourceReader.h" #import #import #import #import #import #import /* * Compiler utilities * -------------------------------------------------------------------------- */ /* * STCMethod * --------------------------------------------------------------------------- */ @implementation STCMethod + methodWithPattern:(STCMessage *)patt statements:(STCStatements *)stats { STCMethod *method; method = [[STCMethod alloc] initWithPattern:patt statements:stats]; return AUTORELEASE(method); } - initWithPattern:(STCMessage *)patt statements:(STCStatements *)stats { [super init]; messagePattern = RETAIN(patt); statements = RETAIN(stats); return self; } - (void)dealloc { RELEASE(messagePattern); RELEASE(statements); [super dealloc]; } - (STCStatements *)statements { return statements; } - (STCMessage *)messagePattern { return messagePattern; } @end /* * STCStatements * --------------------------------------------------------------------------- */ @implementation STCStatements + statements { STCStatements *statements = [[STCStatements alloc] init]; return AUTORELEASE(statements); } - (void)setTemporaries:(NSArray *)vars { ASSIGN(variables,vars); } - (void)setExpressions:(NSArray *)exprs { ASSIGN(expressions,exprs); } - (void)setReturnExpression:(STCExpression *)ret { ASSIGN(retexpr,ret); } - (void)dealloc { RELEASE(variables); RELEASE(expressions); RELEASE(retexpr); [super dealloc]; } - (NSArray *)temporaries { return variables; } - (NSArray *)expressions { return expressions; } - (STCExpression *)returnExpression { return retexpr; } @end /* * STCMessage * --------------------------------------------------------------------------- */ @implementation STCMessage + message { STCMessage *message = [[STCMessage alloc] init]; return AUTORELEASE(message); } - init { [super init]; selector = [[NSMutableString alloc] init]; args = [[NSMutableArray alloc] init]; return self; } - (void)dealloc { RELEASE(selector); RELEASE(args); [super dealloc]; } -(void) addKeyword:(NSString *)keyword object:object { [selector appendString:keyword]; if(object!=nil) [args addObject:object]; } - (NSString *)selector { return selector; } - (NSArray *)arguments { return args; } @end /* * STCExpression * --------------------------------------------------------------------------- */ @implementation STCExpression:NSObject + (STCExpression *) primaryExpressionWithObject:(id)anObject { STCPrimaryExpression *expr; expr = [[STCPrimaryExpression alloc] initWithObject:anObject]; return AUTORELEASE(expr); } + (STCExpression *) messageExpressionWithTarget:(id)anObject message:(STCMessage *)message { STCMessageExpression *expr; expr = [[STCMessageExpression alloc] initWithTarget:anObject message:message]; return AUTORELEASE(expr); } - (void)dealloc { RELEASE(cascade); RELEASE(assignments); [super dealloc]; } - (void)setCascade:(NSArray *)casc { ASSIGN(cascade,casc); } - (void)setAssignments:(NSArray *)asgs { ASSIGN(assignments,asgs); } - (NSArray *)cascade { return cascade; } - (NSArray *)assignments { return assignments; } - (BOOL)isPrimary { [self subclassResponsibility:_cmd]; return NO; } - (id) target { [self subclassResponsibility:_cmd]; return nil; } - (STCMessage *)message { [self subclassResponsibility:_cmd]; return nil; } - (id) object { [self subclassResponsibility:_cmd]; return nil; } @end @implementation STCMessageExpression:STCExpression - initWithTarget:(id)anObject message:(STCMessage *)aMessage; { [super init]; target = RETAIN(anObject); message = RETAIN(aMessage); return self; } - (void)dealloc { RELEASE(target); RELEASE(message); [super dealloc]; } - (id) target { return target; } - (STCMessage *)message { return message; } - (BOOL)isPrimary { return NO; } @end @implementation STCPrimaryExpression:STCExpression { id object; } - (void)dealloc { RELEASE(object); [super dealloc]; } - initWithObject:(id)anObject { [super init]; object = RETAIN(anObject); return self; } - (id) object { return object; } - (BOOL)isPrimary { return YES; } @end /* * STCPrimary * --------------------------------------------------------------------------- */ @implementation STCPrimary + primaryWithVariable:(id) anObject { STCPrimary *primary; primary = [STCPrimary alloc]; [primary initWithType:STCVariablePrimaryType object:anObject]; return AUTORELEASE(primary); } + primaryWithLiteral:(id) anObject { STCPrimary *primary; primary = [STCPrimary alloc]; [primary initWithType:STCLiteralPrimaryType object:anObject]; return AUTORELEASE(primary); } + primaryWithBlock:(id) anObject { STCPrimary *primary; primary = [STCPrimary alloc]; [primary initWithType:STCBlockPrimaryType object:anObject]; return AUTORELEASE(primary); } + primaryWithExpression:(id) anObject { STCPrimary *primary; primary = [STCPrimary alloc]; [primary initWithType:STCExpressionPrimaryType object:anObject]; return AUTORELEASE(primary); } - initWithType:(int)newType object:obj { type = newType; object = RETAIN(obj); return [super init]; } - (void)dealloc { RELEASE(object); [super dealloc]; } - (int)type { return type; } - object { return object; } @end /* * Compiler additions for literals * --------------------------------------------------------------------------- */ @implementation NSString(STCompilerAdditions) + (NSString *) symbolFromString:(NSString *)aString { return [self stringWithString:aString]; } + (id) characterFromString:(NSString *)aString { return [self stringWithString:aString]; } @end @implementation NSMutableString(STCompilerAdditions) + (id) stringFromString:(NSString *)aString { return [self stringWithString:aString]; } @end @implementation NSNumber(STCompilerAdditions) + (id) intNumberFromString:(NSString *)aString { return [self numberWithInt:[aString intValue]]; } + (id) realNumberFromString:(NSString *)aString { return [self numberWithDouble:[aString doubleValue]]; } @end @implementation NSMutableArray(STCompilerAdditions) + (id) arrayFromArray:(NSArray *)anArray { return [self arrayWithArray:anArray]; } @end steptalk-0.10.0/Languages/Smalltalk/STExecutionContext.h0000644000175000000000000000324110255610512022215 0ustar gurkanroot/** STExecutionContext.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STStack; @class STBytecodes; @class STMethodContext; @interface STExecutionContext:NSObject { unsigned contextId; /* for debugging */ STStack *stack; unsigned instructionPointer; } - initWithStackSize:(unsigned)stackSize; - (void)invalidate; - (BOOL)isValid; - (STMethodContext *)homeContext; - (void)setHomeContext:(STMethodContext *)context; - (BOOL)isBlockContext; - (unsigned)instructionPointer; - (void)setInstructionPointer:(unsigned)value; - (STBytecodes *)bytecodes; - (STStack *)stack; - (id)temporaryAtIndex:(unsigned)index; - (void)setTemporary:anObject atIndex:(unsigned)index; - (NSString *)referenceNameAtIndex:(unsigned)index; - (id)literalObjectAtIndex:(unsigned)index; - (id)receiver; @end steptalk-0.10.0/Languages/Smalltalk/STExecutionContext.m0000644000175000000000000000425610255610477022243 0ustar gurkanroot/** STExecutionContext.m Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "STExecutionContext.h" #import "STMethodContext.h" #import "STStack.h" #import #import #import static unsigned nextId = 1; @interface STExecutionContext(STPrivateMethods) - (unsigned)contextId; @end @implementation STExecutionContext - initWithStackSize:(unsigned)stackSize { [super init]; stack = [[STStack alloc] initWithSize:stackSize]; contextId = nextId ++; return self; } - (void)dealloc { RELEASE(stack); [super dealloc]; } - (unsigned)contextId { return contextId; } - (NSString *)description { NSMutableString *str; str = [NSMutableString stringWithFormat: @"%@ %i (home %i)", [self className], contextId, [[self homeContext] contextId]]; return str; } - (void)invalidate { [self subclassResponsibility:_cmd]; } - (BOOL)isValid { [self subclassResponsibility:_cmd]; return NO; } - (unsigned)instructionPointer { return instructionPointer; } - (void)setInstructionPointer:(unsigned)value { instructionPointer = value; } - (STMethodContext *)homeContext { [self subclassResponsibility:_cmd]; return nil; } - (void)setHomeContext:(STMethodContext *)newContext { [self subclassResponsibility:_cmd]; } - (STStack *)stack { return stack; } - (BOOL)isBlockContext; { [self subclassResponsibility:_cmd]; return NO; } - (id)temporaryAtIndex:(unsigned)index { [self subclassResponsibility:_cmd]; return nil; } - (void)setTemporary:anObject atIndex:(unsigned)index { [self subclassResponsibility:_cmd]; } - (NSString *)referenceNameAtIndex:(unsigned)index { [self subclassResponsibility:_cmd]; return nil; } - (STBytecodes *)bytecodes { [self subclassResponsibility:_cmd]; return nil; } - (id)literalObjectAtIndex:(unsigned)index { [self subclassResponsibility:_cmd]; return nil; } - (id)receiver { [self subclassResponsibility:_cmd]; return nil; } @end steptalk-0.10.0/Languages/Smalltalk/STGrammar.m0000644000175000000000000015761410166610026020317 0ustar gurkanroot/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* If NAME_PREFIX is specified substitute the variables and functions names. */ #define yyparse STCparse #define yylex STClex #define yyerror STCerror #define yylval STClval #define yychar STCchar #define yydebug STCdebug #define yynerrs STCnerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TK_SEPARATOR = 258, TK_BAR = 259, TK_ASSIGNMENT = 260, TK_LPAREN = 261, TK_RPAREN = 262, TK_BLOCK_OPEN = 263, TK_BLOCK_CLOSE = 264, TK_ARRAY_OPEN = 265, TK_DOT = 266, TK_COLON = 267, TK_SEMICOLON = 268, TK_RETURN = 269, TK_IDENTIFIER = 270, TK_BINARY_SELECTOR = 271, TK_KEYWORD = 272, TK_INTNUMBER = 273, TK_REALNUMBER = 274, TK_SYMBOL = 275, TK_STRING = 276, TK_CHARACTER = 277 }; #endif #define TK_SEPARATOR 258 #define TK_BAR 259 #define TK_ASSIGNMENT 260 #define TK_LPAREN 261 #define TK_RPAREN 262 #define TK_BLOCK_OPEN 263 #define TK_BLOCK_CLOSE 264 #define TK_ARRAY_OPEN 265 #define TK_DOT 266 #define TK_COLON 267 #define TK_SEMICOLON 268 #define TK_RETURN 269 #define TK_IDENTIFIER 270 #define TK_BINARY_SELECTOR 271 #define TK_KEYWORD 272 #define TK_INTNUMBER 273 #define TK_REALNUMBER 274 #define TK_SYMBOL 275 #define TK_STRING 276 #define TK_CHARACTER 277 /* Copy the first part of user declarations. */ #line 25 "STGrammar.y" #define YYSTYPE id #define YYLTYPE int #undef YYDEBUG #import #import "STCompiler.h" #import "STCompilerUtils.h" #import "STSourceReader.h" #import "Externs.h" #import /* extern int STCerror(const char *str); extern int STClex (YYSTYPE *lvalp, void *context); */ #define YYPARSE_PARAM context #define YYLEX_PARAM context #define YYERROR_VERBOSE #define CONTEXT ((STParserContext *)context) #define COMPILER (CONTEXT->compiler) #define READER (CONTEXT->reader) #define RESULT (CONTEXT->result) int STClex (YYSTYPE *lvalp, void *context); int STCerror(const char *str); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 171 "STGrammar.m" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # endif # else # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short int yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 50 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 244 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 23 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 37 /* YYNRULES -- Number of rules. */ #define YYNRULES 83 /* YYNRULES -- Number of states. */ #define YYNSTATES 120 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 277 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 4, 6, 10, 11, 17, 19, 22, 23, 27, 29, 31, 35, 38, 42, 44, 47, 49, 52, 56, 60, 62, 65, 68, 72, 78, 81, 85, 88, 90, 93, 98, 100, 104, 106, 109, 111, 114, 116, 119, 121, 124, 127, 130, 133, 137, 139, 142, 144, 146, 148, 150, 153, 157, 160, 163, 167, 169, 171, 173, 175, 177, 179, 181, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 207, 208, 210, 212, 215, 218, 220, 222 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 24, 0, -1, -1, 26, -1, 3, 3, 30, -1, -1, 8, 4, 25, 27, 9, -1, 37, -1, 33, 37, -1, -1, 36, 28, 29, -1, 29, -1, 30, -1, 29, 3, 30, -1, 31, 37, -1, 31, 33, 37, -1, 54, -1, 55, 53, -1, 32, -1, 56, 53, -1, 32, 56, 53, -1, 4, 34, 4, -1, 53, -1, 34, 53, -1, 8, 9, -1, 8, 37, 9, -1, 8, 36, 4, 37, 9, -1, 12, 53, -1, 36, 12, 53, -1, 14, 39, -1, 38, -1, 38, 11, -1, 38, 11, 14, 39, -1, 39, -1, 38, 11, 39, -1, 52, -1, 40, 52, -1, 45, -1, 40, 45, -1, 42, -1, 40, 42, -1, 41, -1, 40, 41, -1, 53, 5, -1, 45, 43, -1, 13, 44, -1, 43, 13, 44, -1, 54, -1, 55, 50, -1, 49, -1, 46, -1, 47, -1, 48, -1, 50, 54, -1, 51, 55, 50, -1, 51, 49, -1, 56, 51, -1, 49, 56, 51, -1, 52, -1, 46, -1, 50, -1, 47, -1, 53, -1, 57, -1, 35, -1, 6, 39, 7, -1, 15, -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, 21, -1, 22, -1, 10, 58, 7, -1, -1, 57, -1, 59, -1, 58, 57, -1, 58, 59, -1, 15, -1, 55, -1, 17, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { 0, 69, 69, 74, 79, 86, 85, 93, 98, 108, 107, 113, 116, 120, 126, 131, 140, 145, 150, 153, 158, 165, 169, 174, 181, 185, 189, 195, 200, 207, 212, 218, 223, 232, 237, 243, 248, 254, 255, 260, 261, 267, 272, 279, 282, 288, 293, 299, 304, 309, 312, 313, 314, 316, 325, 334, 341, 346, 352, 353, 355, 356, 358, 362, 366, 370, 375, 377, 379, 381, 384, 386, 388, 390, 392, 394, 397, 398, 400, 402, 403, 405, 407, 409 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "TK_SEPARATOR", "TK_BAR", "TK_ASSIGNMENT", "TK_LPAREN", "TK_RPAREN", "TK_BLOCK_OPEN", "TK_BLOCK_CLOSE", "TK_ARRAY_OPEN", "TK_DOT", "TK_COLON", "TK_SEMICOLON", "TK_RETURN", "TK_IDENTIFIER", "TK_BINARY_SELECTOR", "TK_KEYWORD", "TK_INTNUMBER", "TK_REALNUMBER", "TK_SYMBOL", "TK_STRING", "TK_CHARACTER", "$accept", "source", "@1", "plain_code", "methods", "@2", "method_list", "method", "message_pattern", "keyword_list", "temporaries", "variable_list", "block", "block_var_list", "statements", "expressions", "expression", "assignments", "assignment", "cascade", "cascade_list", "cascade_item", "message_expression", "unary_expression", "binary_expression", "keyword_expression", "keyword_expr_list", "unary_object", "binary_object", "primary", "variable_name", "unary_selector", "binary_selector", "keyword", "literal", "array", "symbol", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 23, 24, 24, 24, 25, 24, 26, 26, 28, 27, 27, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 41, 42, 43, 43, 44, 44, 44, 45, 45, 45, 46, 47, 48, 49, 49, 50, 50, 51, 51, 52, 52, 52, 52, 53, 54, 55, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 59, 59, 59 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 1, 3, 0, 5, 1, 2, 0, 3, 1, 1, 3, 2, 3, 1, 2, 1, 2, 3, 3, 1, 2, 2, 3, 5, 2, 3, 2, 1, 2, 4, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 1, 1, 1, 2, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 2, 0, 0, 0, 0, 76, 0, 66, 70, 71, 72, 73, 74, 0, 3, 0, 64, 7, 30, 33, 0, 41, 39, 37, 50, 51, 52, 60, 0, 35, 62, 63, 0, 0, 22, 0, 0, 5, 24, 0, 0, 0, 81, 68, 83, 82, 77, 0, 78, 29, 1, 8, 31, 42, 40, 38, 36, 0, 44, 67, 53, 69, 55, 0, 0, 43, 4, 0, 18, 16, 0, 0, 21, 23, 65, 0, 27, 0, 0, 25, 75, 79, 80, 0, 34, 45, 49, 47, 0, 0, 0, 59, 54, 58, 62, 61, 56, 0, 14, 0, 17, 19, 0, 11, 12, 9, 0, 28, 32, 48, 46, 57, 15, 20, 6, 0, 0, 26, 13, 10 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 13, 75, 14, 102, 116, 103, 104, 67, 68, 15, 33, 16, 40, 41, 18, 19, 20, 21, 22, 58, 85, 23, 24, 25, 26, 86, 27, 28, 29, 30, 69, 70, 71, 31, 47, 48 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -60 static const short int yypact[] = { 104, 11, 0, 38, 123, 222, 38, -60, -60, -60, -60, -60, -60, 17, -60, 176, -60, -60, 9, -60, 38, -60, -60, 8, 34, 10, -60, 18, 50, 78, 49, -60, 100, 7, -60, 159, 54, -60, -60, 0, 12, 55, -60, -60, -60, -60, -60, 209, -60, -60, -60, -60, 193, -60, -60, 8, 78, 100, 60, -60, -60, -60, 57, 38, 38, -60, -60, 142, 57, -60, 0, 0, -60, -60, -60, 13, -60, 176, 0, -60, -60, -60, -60, 38, -60, -60, 57, -60, 38, 100, 38, -60, 18, -60, -60, -60, 64, 176, -60, 0, -60, -60, 67, 79, -60, 71, 81, -60, -60, 18, -60, 64, -60, -60, -60, 100, 100, -60, -60, 79 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -60, -60, -60, -60, -60, -60, -28, -30, -60, -60, 29, -60, -60, 22, 4, -60, 3, -60, 80, 82, -60, 20, 84, -51, -59, -60, 83, -45, -56, 15, -1, -17, -5, -21, -2, -60, 52 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -62 static const yysigned_char yytable[] = { 45, 34, 66, 46, 17, 95, 36, 64, 96, 49, 60, 72, 91, 91, 32, 7, 77, 50, 92, 51, 52, 57, 7, 63, 78, 39, -61, -61, 59, 43, 61, 95, 73, 59, 111, 56, 64, 91, 76, 91, 87, 90, 45, 109, 3, 81, 35, 99, 5, -59, -59, -59, 88, 7, 65, 84, 8, 9, 10, 11, 12, 74, 94, 94, 79, 90, 43, 61, 64, 100, 101, 98, 87, 89, 61, 60, 114, 107, 93, 93, 43, 106, 115, 78, 88, 118, 108, 94, 119, 94, 117, 63, 60, -58, -58, -58, 97, 105, 113, 82, 53, 112, 54, 93, 55, 93, 63, 1, 2, 110, 3, 62, 4, 0, 5, 59, 43, 61, 6, 7, 0, 0, 8, 9, 10, 11, 12, 37, 0, 3, 0, 35, 38, 5, 0, 39, 0, 6, 7, 0, 0, 8, 9, 10, 11, 12, 2, 0, 3, 0, 35, 0, 5, 0, 0, 0, 6, 7, 0, 0, 8, 9, 10, 11, 12, 3, 0, 35, 38, 5, 0, 39, 0, 6, 7, 0, 0, 8, 9, 10, 11, 12, 3, 0, 35, 0, 5, 0, 0, 0, 6, 7, 0, 0, 8, 9, 10, 11, 12, 3, 0, 35, 0, 5, 0, 0, 0, 83, 7, 0, 0, 8, 9, 10, 11, 12, 80, 0, 0, 5, 0, 0, 0, 0, 42, 43, 44, 8, 9, 10, 11, 12, 5, 0, 0, 0, 0, 42, 43, 44, 8, 9, 10, 11, 12 }; static const yysigned_char yycheck[] = { 5, 2, 32, 5, 0, 64, 3, 28, 64, 6, 27, 4, 63, 64, 3, 15, 4, 0, 63, 15, 11, 13, 15, 28, 12, 12, 16, 17, 15, 16, 17, 90, 33, 15, 90, 20, 57, 88, 39, 90, 57, 62, 47, 88, 6, 47, 8, 68, 10, 15, 16, 17, 57, 15, 5, 52, 18, 19, 20, 21, 22, 7, 63, 64, 9, 86, 16, 17, 89, 70, 71, 67, 89, 13, 17, 92, 9, 78, 63, 64, 16, 77, 3, 12, 89, 115, 83, 88, 116, 90, 9, 96, 109, 15, 16, 17, 67, 75, 99, 47, 20, 97, 20, 88, 20, 90, 111, 3, 4, 89, 6, 28, 8, -1, 10, 15, 16, 17, 14, 15, -1, -1, 18, 19, 20, 21, 22, 4, -1, 6, -1, 8, 9, 10, -1, 12, -1, 14, 15, -1, -1, 18, 19, 20, 21, 22, 4, -1, 6, -1, 8, -1, 10, -1, -1, -1, 14, 15, -1, -1, 18, 19, 20, 21, 22, 6, -1, 8, 9, 10, -1, 12, -1, 14, 15, -1, -1, 18, 19, 20, 21, 22, 6, -1, 8, -1, 10, -1, -1, -1, 14, 15, -1, -1, 18, 19, 20, 21, 22, 6, -1, 8, -1, 10, -1, -1, -1, 14, 15, -1, -1, 18, 19, 20, 21, 22, 7, -1, -1, 10, -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, 10, -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 3, 4, 6, 8, 10, 14, 15, 18, 19, 20, 21, 22, 24, 26, 33, 35, 37, 38, 39, 40, 41, 42, 45, 46, 47, 48, 50, 51, 52, 53, 57, 3, 34, 53, 8, 39, 4, 9, 12, 36, 37, 15, 16, 17, 55, 57, 58, 59, 39, 0, 37, 11, 41, 42, 45, 52, 13, 43, 15, 54, 17, 49, 55, 56, 5, 30, 31, 32, 54, 55, 56, 4, 53, 7, 25, 53, 4, 12, 9, 7, 57, 59, 14, 39, 44, 49, 54, 55, 13, 56, 46, 50, 52, 53, 47, 51, 33, 37, 56, 53, 53, 27, 29, 30, 36, 37, 53, 39, 50, 44, 51, 37, 53, 9, 3, 28, 9, 30, 29 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).first_line = (Rhs)[1].first_line, \ (Current).first_column = (Rhs)[1].first_column, \ (Current).last_line = (Rhs)[N].last_line, \ (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) short int *bottom; short int *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short int yyssa[YYINITDEPTH]; short int *yyss = yyssa; register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 69 "STGrammar.y" { [COMPILER compileMethod:nil]; ;} break; case 3: #line 74 "STGrammar.y" { [COMPILER compileMethod:yyvsp[0]]; ;} break; case 4: #line 80 "STGrammar.y" { [COMPILER compileMethod:yyvsp[0]]; ;} break; case 5: #line 86 "STGrammar.y" { [COMPILER beginScript]; ;} break; case 7: #line 94 "STGrammar.y" { yyval = [STCMethod methodWithPattern:nil /**/ statements:yyvsp[0]]; ;} break; case 8: #line 99 "STGrammar.y" { [yyvsp[0] setTemporaries:yyvsp[-1]]; yyval = [STCMethod methodWithPattern:nil /**/ statements:yyvsp[0]]; ;} break; case 9: #line 108 "STGrammar.y" { [COMPILER setReceiverVariables:yyvsp[0]]; ;} break; case 12: #line 117 "STGrammar.y" { [COMPILER compileMethod:yyvsp[0]]; ;} break; case 13: #line 121 "STGrammar.y" { [COMPILER compileMethod:yyvsp[0]]; ;} break; case 14: #line 127 "STGrammar.y" { yyval = [STCMethod methodWithPattern:yyvsp[-1] /**/ statements:yyvsp[0]]; ;} break; case 15: #line 132 "STGrammar.y" { [yyvsp[0] setTemporaries:yyvsp[-1]]; yyval = [STCMethod methodWithPattern:yyvsp[-2] /**/ statements:yyvsp[0]]; ;} break; case 16: #line 141 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[0] object:nil]; ;} break; case 17: #line 146 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[-1] object:yyvsp[0]]; ;} break; case 19: #line 154 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[-1] object:yyvsp[0]]; ;} break; case 20: #line 159 "STGrammar.y" { [yyvsp[-2] addKeyword:yyvsp[-1] object:yyvsp[0]]; yyval = yyvsp[-2]; ;} break; case 21: #line 166 "STGrammar.y" { yyval = yyvsp[-1]; ;} break; case 22: #line 170 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 23: #line 175 "STGrammar.y" { yyval = yyvsp[-1]; [yyval addObject:yyvsp[0]]; ;} break; case 24: #line 182 "STGrammar.y" { yyval = [STCStatements statements]; ;} break; case 25: #line 186 "STGrammar.y" { yyval = yyvsp[-1]; ;} break; case 26: #line 190 "STGrammar.y" { yyval = yyvsp[-1]; [yyval setTemporaries:yyvsp[-3]]; ;} break; case 27: #line 196 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 28: #line 201 "STGrammar.y" { yyval = yyvsp[-2]; [yyval addObject:yyvsp[0]]; ;} break; case 29: #line 208 "STGrammar.y" { yyval = [STCStatements statements]; [yyval setReturnExpression:yyvsp[0]]; ;} break; case 30: #line 213 "STGrammar.y" { yyval = [STCStatements statements]; [yyval setExpressions:yyvsp[0]]; ;} break; case 31: #line 219 "STGrammar.y" { yyval = [STCStatements statements]; [yyval setExpressions:yyvsp[-1]]; ;} break; case 32: #line 224 "STGrammar.y" { yyval = [STCStatements statements]; [yyval setReturnExpression:yyvsp[0]]; [yyval setExpressions:yyvsp[-3]]; ;} break; case 33: #line 232 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 34: #line 238 "STGrammar.y" { yyval = yyvsp[-2]; [yyval addObject:yyvsp[0]]; ;} break; case 35: #line 244 "STGrammar.y" { yyval = [STCExpression /**/ primaryExpressionWithObject:yyvsp[0]]; ;} break; case 36: #line 249 "STGrammar.y" { yyval = [STCExpression /**/ primaryExpressionWithObject:yyvsp[0]]; [yyval setAssignments:yyvsp[-1]]; ;} break; case 38: #line 256 "STGrammar.y" { yyval = yyvsp[0]; [yyval setAssignments:yyvsp[-1]]; ;} break; case 40: #line 262 "STGrammar.y" { yyval = yyvsp[0]; [yyval setAssignments:yyvsp[-1]]; ;} break; case 41: #line 268 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 42: #line 273 "STGrammar.y" { yyval = yyvsp[-1]; [yyval addObject:yyvsp[0]]; ;} break; case 43: #line 280 "STGrammar.y" { yyval = yyvsp[-1];;} break; case 44: #line 283 "STGrammar.y" { /* FIXME: check if this is this OK */ [yyval setCascade:yyvsp[0]]; ;} break; case 45: #line 289 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 46: #line 294 "STGrammar.y" { yyval = yyvsp[-2]; [yyval addObject:yyvsp[0]]; ;} break; case 47: #line 300 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[0] object:nil]; ;} break; case 48: #line 305 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[-1] object:yyvsp[0]]; ;} break; case 53: #line 317 "STGrammar.y" { STCMessage *message = [STCMessage message]; [message addKeyword:yyvsp[0] object:nil]; yyval = [STCExpression /**/ messageExpressionWithTarget:yyvsp[-1] /**/ message:message]; ;} break; case 54: #line 326 "STGrammar.y" { STCMessage *message = [STCMessage message]; [message addKeyword:yyvsp[-1] object:yyvsp[0]]; yyval = [STCExpression /**/ messageExpressionWithTarget:yyvsp[-2] /**/ message:message]; ;} break; case 55: #line 335 "STGrammar.y" { yyval = [STCExpression /**/ messageExpressionWithTarget:yyvsp[-1] /**/ message:yyvsp[0]]; ;} break; case 56: #line 342 "STGrammar.y" { yyval = [STCMessage message]; [yyval addKeyword:yyvsp[-1] object:yyvsp[0]]; ;} break; case 57: #line 347 "STGrammar.y" { yyval = yyvsp[-2]; [yyval addKeyword:yyvsp[-1] object:yyvsp[0]]; ;} break; case 62: #line 359 "STGrammar.y" { yyval = [STCPrimary primaryWithVariable:yyvsp[0]]; ;} break; case 63: #line 363 "STGrammar.y" { yyval = [STCPrimary primaryWithLiteral:yyvsp[0]]; ;} break; case 64: #line 367 "STGrammar.y" { yyval = [STCPrimary primaryWithBlock:yyvsp[0]]; ;} break; case 65: #line 371 "STGrammar.y" { yyval = [STCPrimary primaryWithExpression:yyvsp[-1]]; ;} break; case 70: #line 385 "STGrammar.y" { yyval = [COMPILER createIntNumberLiteralFrom:yyvsp[0]]; ;} break; case 71: #line 387 "STGrammar.y" { yyval = [COMPILER createRealNumberLiteralFrom:yyvsp[0]]; ;} break; case 72: #line 389 "STGrammar.y" { yyval = [COMPILER createSymbolLiteralFrom:yyvsp[0]]; ;} break; case 73: #line 391 "STGrammar.y" { yyval = [COMPILER createStringLiteralFrom:yyvsp[0]]; ;} break; case 74: #line 393 "STGrammar.y" { yyval = [COMPILER createCharacterLiteralFrom:yyvsp[0]]; ;} break; case 75: #line 395 "STGrammar.y" { yyval = [COMPILER createArrayLiteralFrom:yyvsp[-1]]; ;} break; case 76: #line 397 "STGrammar.y" { yyval = [NSMutableArray array]; ;} break; case 77: #line 398 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 78: #line 400 "STGrammar.y" { yyval = [NSMutableArray array]; [yyval addObject:yyvsp[0]]; ;} break; case 79: #line 402 "STGrammar.y" { yyval = yyvsp[-1]; [yyval addObject:yyvsp[0]]; ;} break; case 80: #line 403 "STGrammar.y" { yyval = yyvsp[-1]; [yyval addObject:yyvsp[0]]; ;} break; case 81: #line 406 "STGrammar.y" { yyval = [COMPILER createSymbolLiteralFrom:yyvsp[0]]; ;} break; case 82: #line 408 "STGrammar.y" { yyval = [COMPILER createSymbolLiteralFrom:yyvsp[0]]; ;} break; case 83: #line 410 "STGrammar.y" { yyval = [COMPILER createSymbolLiteralFrom:yyvsp[0]]; ;} break; } /* Line 1010 of yacc.c. */ #line 1661 "STGrammar.m" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 412 "STGrammar.y" int STCerror(const char *str) { [NSException raise:STCompilerSyntaxException format:@"Unknown parse error (%s)", str]; return 0; } /* * Lexer * -------------------------------------------------------------------------- */ int STClex (YYSTYPE *lvalp, void *context) { STTokenType tokenType = [READER nextToken]; if(tokenType == STEndTokenType) { return 0; } *lvalp = [READER tokenString]; switch(tokenType) { case STBarTokenType: return TK_BAR; case STReturnTokenType: return TK_RETURN; case STColonTokenType: return TK_COLON; case STSemicolonTokenType: return TK_SEMICOLON; case STDotTokenType: return TK_DOT; case STLParenTokenType: return TK_LPAREN; case STRParenTokenType: return TK_RPAREN; case STBlockOpenTokenType: return TK_BLOCK_OPEN; case STBlockCloseTokenType: return TK_BLOCK_CLOSE; case STArrayOpenTokenType: return TK_ARRAY_OPEN; case STAssignTokenType: return TK_ASSIGNMENT; case STIdentifierTokenType: return TK_IDENTIFIER; case STKeywordTokenType: return TK_KEYWORD; case STBinarySelectorTokenType: return TK_BINARY_SELECTOR; case STSymbolTokenType: return TK_SYMBOL; case STStringTokenType: return TK_STRING; case STCharacterTokenType: return TK_CHARACTER; case STIntNumberTokenType: return TK_INTNUMBER; case STRealNumberTokenType: return TK_REALNUMBER; case STSeparatorTokenType: return TK_SEPARATOR; case STEndTokenType: return 0; case STSharpTokenType: case STInvalidTokenType: case STErrorTokenType: return 1; } return 1; } steptalk-0.10.0/Languages/Smalltalk/STGrammar.m.h0000644000175000000000000000075710132015531020531 0ustar gurkanroot#ifndef YYSTYPE #define YYSTYPE int #endif #define TK_SEPARATOR 258 #define TK_BAR 259 #define TK_ASSIGNMENT 260 #define TK_LPAREN 261 #define TK_RPAREN 262 #define TK_BLOCK_OPEN 263 #define TK_BLOCK_CLOSE 264 #define TK_ARRAY_OPEN 265 #define TK_DOT 266 #define TK_COLON 267 #define TK_SEMICOLON 268 #define TK_RETURN 269 #define TK_IDENTIFIER 270 #define TK_BINARY_SELECTOR 271 #define TK_KEYWORD 272 #define TK_NUMBER 273 #define TK_SYMBOL 274 #define TK_STRING 275 #define TK_CHARACTER 276 steptalk-0.10.0/Languages/Smalltalk/STGrammar.y0000644000175000000000000003737710132015531020327 0ustar gurkanroot/** STGrammar.y StepTalk grammar Copyright (c) 2000 Stefan Urbanek This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ %{ #define YYSTYPE id #define YYLTYPE int #undef YYDEBUG #import #import "STCompiler.h" #import "STCompilerUtils.h" #import "STSourceReader.h" #import "Externs.h" #import /* extern int STCerror(const char *str); extern int STClex (YYSTYPE *lvalp, void *context); */ #define YYPARSE_PARAM context #define YYLEX_PARAM context #define YYERROR_VERBOSE #define CONTEXT ((STParserContext *)context) #define COMPILER (CONTEXT->compiler) #define READER (CONTEXT->reader) #define RESULT (CONTEXT->result) int STClex (YYSTYPE *lvalp, void *context); int STCerror(const char *str); %} %pure_parser /* BISON declarations */ %token TK_SEPARATOR TK_BAR TK_ASSIGNMENT %token TK_LPAREN TK_RPAREN TK_BLOCK_OPEN TK_BLOCK_CLOSE TK_ARRAY_OPEN %token TK_DOT TK_COLON TK_SEMICOLON TK_RETURN %token TK_IDENTIFIER TK_BINARY_SELECTOR TK_KEYWORD %token TK_INTNUMBER TK_REALNUMBER TK_SYMBOL TK_STRING TK_CHARACTER /* Grammar */ %% source: /* empty string */ { [COMPILER compileMethod:nil]; } | plain_code { [COMPILER compileMethod:$1]; } /* FIXME: this is a hack */ | TK_SEPARATOR TK_SEPARATOR method { [COMPILER compileMethod:$3]; } | TK_BLOCK_OPEN TK_BAR { [COMPILER beginScript]; } methods TK_BLOCK_CLOSE ; plain_code: statements { $$ = [STCMethod methodWithPattern:nil /**/ statements:$1]; } | temporaries statements { [$2 setTemporaries:$1]; $$ = [STCMethod methodWithPattern:nil /**/ statements:$2]; } ; methods: block_var_list { [COMPILER setReceiverVariables:$1]; } method_list | method_list ; method_list: method { [COMPILER compileMethod:$1]; } | method_list TK_SEPARATOR method { [COMPILER compileMethod:$3]; } ; method: message_pattern statements { $$ = [STCMethod methodWithPattern:$1 /**/ statements:$2]; } | message_pattern temporaries statements { [$3 setTemporaries:$2]; $$ = [STCMethod methodWithPattern:$1 /**/ statements:$3]; } ; message_pattern: unary_selector { $$ = [STCMessage message]; [$$ addKeyword:$1 object:nil]; } | binary_selector variable_name { $$ = [STCMessage message]; [$$ addKeyword:$1 object:$2]; } | keyword_list ; keyword_list: keyword variable_name { $$ = [STCMessage message]; [$$ addKeyword:$1 object:$2]; } | keyword_list keyword variable_name { [$1 addKeyword:$2 object:$3]; $$ = $1; } ; temporaries: TK_BAR variable_list TK_BAR { $$ = $2; } ; variable_list: variable_name { $$ = [NSMutableArray array]; [$$ addObject:$1]; } | variable_list variable_name { $$ = $1; [$$ addObject:$2]; } ; block: TK_BLOCK_OPEN TK_BLOCK_CLOSE { $$ = [STCStatements statements]; } | TK_BLOCK_OPEN statements TK_BLOCK_CLOSE { $$ = $2; } | TK_BLOCK_OPEN block_var_list TK_BAR statements TK_BLOCK_CLOSE { $$ = $4; [$$ setTemporaries:$2]; } ; block_var_list: TK_COLON variable_name { $$ = [NSMutableArray array]; [$$ addObject:$2]; } | block_var_list TK_COLON variable_name { $$ = $1; [$$ addObject:$3]; } ; statements: TK_RETURN expression { $$ = [STCStatements statements]; [$$ setReturnExpression:$2]; } | expressions { $$ = [STCStatements statements]; [$$ setExpressions:$1]; } | expressions TK_DOT { $$ = [STCStatements statements]; [$$ setExpressions:$1]; } | expressions TK_DOT TK_RETURN expression { $$ = [STCStatements statements]; [$$ setReturnExpression:$4]; [$$ setExpressions:$1]; } ; expressions: expression { $$ = [NSMutableArray array]; [$$ addObject:$1]; } | expressions TK_DOT expression { $$ = $1; [$$ addObject:$3]; } ; expression: primary { $$ = [STCExpression /**/ primaryExpressionWithObject:$1]; } | assignments primary { $$ = [STCExpression /**/ primaryExpressionWithObject:$2]; [$$ setAssignments:$1]; } | message_expression | assignments message_expression { $$ = $2; [$$ setAssignments:$1]; } | cascade | assignments cascade { $$ = $2; [$$ setAssignments:$1]; } ; assignments: assignment { $$ = [NSMutableArray array]; [$$ addObject:$1]; } | assignments assignment { $$ = $1; [$$ addObject:$2]; } ; assignment: variable_name TK_ASSIGNMENT { $$ = $1;} ; cascade: message_expression cascade_list { /* FIXME: check if this is this OK */ [$$ setCascade:$2]; } ; cascade_list: TK_SEMICOLON cascade_item { $$ = [NSMutableArray array]; [$$ addObject:$2]; } | cascade_list TK_SEMICOLON cascade_item { $$ = $1; [$$ addObject:$3]; } ; cascade_item: unary_selector { $$ = [STCMessage message]; [$$ addKeyword:$1 object:nil]; } | binary_selector unary_object { $$ = [STCMessage message]; [$$ addKeyword:$1 object:$2]; } | keyword_expr_list ; message_expression: unary_expression | binary_expression | keyword_expression ; unary_expression: unary_object unary_selector { STCMessage *message = [STCMessage message]; [message addKeyword:$2 object:nil]; $$ = [STCExpression /**/ messageExpressionWithTarget:$1 /**/ message:message]; } ; binary_expression: binary_object binary_selector unary_object { STCMessage *message = [STCMessage message]; [message addKeyword:$2 object:$3]; $$ = [STCExpression /**/ messageExpressionWithTarget:$1 /**/ message:message]; } ; keyword_expression: binary_object keyword_expr_list { $$ = [STCExpression /**/ messageExpressionWithTarget:$1 /**/ message:$2]; } ; keyword_expr_list: keyword binary_object { $$ = [STCMessage message]; [$$ addKeyword:$1 object:$2]; } | keyword_expr_list keyword binary_object { $$ = $1; [$$ addKeyword:$2 object:$3]; } ; unary_object: primary | unary_expression ; binary_object: unary_object | binary_expression ; primary: variable_name { $$ = [STCPrimary primaryWithVariable:$1]; } | literal { $$ = [STCPrimary primaryWithLiteral:$1]; } | block { $$ = [STCPrimary primaryWithBlock:$1]; } | TK_LPAREN expression TK_RPAREN { $$ = [STCPrimary primaryWithExpression:$2]; } ; variable_name: TK_IDENTIFIER /* STCheckVariable ... */ ; unary_selector: TK_IDENTIFIER ; binary_selector: TK_BINARY_SELECTOR ; keyword: TK_KEYWORD ; literal: TK_INTNUMBER { $$ = [COMPILER createIntNumberLiteralFrom:$1]; } | TK_REALNUMBER { $$ = [COMPILER createRealNumberLiteralFrom:$1]; } | TK_SYMBOL { $$ = [COMPILER createSymbolLiteralFrom:$1]; } | TK_STRING { $$ = [COMPILER createStringLiteralFrom:$1]; } | TK_CHARACTER { $$ = [COMPILER createCharacterLiteralFrom:$1]; } | TK_ARRAY_OPEN array TK_RPAREN { $$ = [COMPILER createArrayLiteralFrom:$2]; } ; array: /* nothing */ { $$ = [NSMutableArray array]; } | literal { $$ = [NSMutableArray array]; [$$ addObject:$1]; } | symbol { $$ = [NSMutableArray array]; [$$ addObject:$1]; } | array literal { $$ = $1; [$$ addObject:$2]; } | array symbol { $$ = $1; [$$ addObject:$2]; } ; symbol: TK_IDENTIFIER { $$ = [COMPILER createSymbolLiteralFrom:$1]; } | binary_selector { $$ = [COMPILER createSymbolLiteralFrom:$1]; } | TK_KEYWORD { $$ = [COMPILER createSymbolLiteralFrom:$1]; } ; %% int STCerror(const char *str) { [NSException raise:STCompilerSyntaxException format:@"Unknown parse error (%s)", str]; return 0; } /* * Lexer * -------------------------------------------------------------------------- */ int STClex (YYSTYPE *lvalp, void *context) { STTokenType tokenType = [READER nextToken]; if(tokenType == STEndTokenType) { return 0; } *lvalp = [READER tokenString]; switch(tokenType) { case STBarTokenType: return TK_BAR; case STReturnTokenType: return TK_RETURN; case STColonTokenType: return TK_COLON; case STSemicolonTokenType: return TK_SEMICOLON; case STDotTokenType: return TK_DOT; case STLParenTokenType: return TK_LPAREN; case STRParenTokenType: return TK_RPAREN; case STBlockOpenTokenType: return TK_BLOCK_OPEN; case STBlockCloseTokenType: return TK_BLOCK_CLOSE; case STArrayOpenTokenType: return TK_ARRAY_OPEN; case STAssignTokenType: return TK_ASSIGNMENT; case STIdentifierTokenType: return TK_IDENTIFIER; case STKeywordTokenType: return TK_KEYWORD; case STBinarySelectorTokenType: return TK_BINARY_SELECTOR; case STSymbolTokenType: return TK_SYMBOL; case STStringTokenType: return TK_STRING; case STCharacterTokenType: return TK_CHARACTER; case STIntNumberTokenType: return TK_INTNUMBER; case STRealNumberTokenType: return TK_REALNUMBER; case STSeparatorTokenType: return TK_SEPARATOR; case STEndTokenType: return 0; case STSharpTokenType: case STInvalidTokenType: case STErrorTokenType: return 1; } return 1; } steptalk-0.10.0/Languages/Smalltalk/STLiterals.h0000644000175000000000000000260310132015531020457 0ustar gurkanroot/** STLiterals.h Literal objects Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STLiteral:NSObject @end @interface STObjectReferenceLiteral:STLiteral { NSString *poolName; NSString *objectName; } - initWithObjectName:(NSString *)anObject poolName:(NSString *)aPool; - (NSString *)poolName; - (NSString *)objectName; @end @interface STBlockLiteral:STLiteral { unsigned argCount; unsigned stackSize; } - initWithArgumentCount:(unsigned)count; - (void)setStackSize:(unsigned)size; - (unsigned)argumentCount; - (unsigned)stackSize; @end steptalk-0.10.0/Languages/Smalltalk/STLiterals.m0000644000175000000000000000367710132015531020500 0ustar gurkanroot/** STLiterals.h Literal objects Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STLiterals.h" #import @implementation STLiteral @end @implementation STObjectReferenceLiteral - initWithObjectName:(NSString *)anObject poolName:(NSString *)aPool { objectName = RETAIN(anObject); poolName = RETAIN(aPool); return [super init]; } #if 0 - copyWithZone:(NSZone *)zone { STObjectReferenceLiteral *copy = [super copyWithZone:zone]; return copy; } #endif - (void)dealloc { RELEASE(objectName); RELEASE(poolName); [super dealloc]; } - (NSString *)poolName { return poolName; } - (NSString *)objectName { return objectName; } - (NSString *)description { return [NSMutableString stringWithFormat: @"STObjectReferenceLiteral { object '%@', pool '%@' }", objectName,poolName]; } @end @implementation STBlockLiteral - initWithArgumentCount:(unsigned)count { argCount = count; return [super init]; } - (void)setStackSize:(unsigned)size { stackSize = size; } - (unsigned)argumentCount { return argCount; } - (unsigned)stackSize { return stackSize; } @end steptalk-0.10.0/Languages/Smalltalk/STMessage.h0000644000175000000000000000244310132015531020266 0ustar gurkanroot/** STMessage.h Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Jun 18 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSString; @class NSArray; @interface STMessage:NSObject { NSString *selector; NSArray *args; } + (STMessage *)messageWithSelector:(NSString *)selector arguments:(NSArray *)args; - initWithSelector:(NSString *)aString arguments:(NSArray *)anArray; - (NSString *)selector; - (NSArray*)arguments; @end steptalk-0.10.0/Languages/Smalltalk/STMessage.m0000644000175000000000000000342710132015531020276 0ustar gurkanroot/** STMessage.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Jun 18 This file is part of StepTalk. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STMessage.h" #import #import #import #import @implementation STMessage + (STMessage *)messageWithSelector:(NSString *)aString arguments:(NSArray *)anArray { STMessage *message; message = [[STMessage alloc] initWithSelector:aString arguments:anArray]; return AUTORELEASE(message); } - initWithSelector:(NSString *)aString arguments:(NSArray *)anArray { [super init]; selector = RETAIN(aString); args = RETAIN(anArray); return self; } - (void)dealloc { RELEASE(selector); RELEASE(args); [super dealloc]; } - (NSString *)selector { return selector; } - (NSArray *)arguments { return args; } @end steptalk-0.10.0/Languages/Smalltalk/STMethodContext.h0000644000175000000000000000320110255610714021472 0ustar gurkanroot/** STMethodContext.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STExecutionContext.h" @class STCompiledMethod; @class STEnvironment; @class NSMutableArray; @interface STMethodContext:STExecutionContext { STCompiledMethod *method; NSMutableArray *temporaries; id receiver; } + methodContextWithMethod:(STCompiledMethod *)newMethod environment:(STEnvironment *)env; - initWithMethod:(STCompiledMethod *)newMethod environment:(STEnvironment *)env; - (STCompiledMethod*)method; - (void)setReceiver:anObject; - (id)receiver; - (void)setArgumentsFromArray:(NSArray *)args; - (id)temporaryAtIndex:(unsigned)index; - (void)setTemporary:anObject atIndex:(unsigned)index; - (id)externAtIndex:(unsigned)index; - (void)setExtern:anObject atIndex:(unsigned)index; - (STBytecodes *)bytecodes; @end steptalk-0.10.0/Languages/Smalltalk/STMethodContext.m0000644000175000000000000000652610255624074021520 0ustar gurkanroot/** STMethodContext.m Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STMethodContext.h" #import "STBytecodes.h" #import "STCompiledMethod.h" #import "STLiterals.h" #import "STStack.h" #import #import #import #import #import #import @interface STMethodContext(STPrivateMethods) - (void)_resolveExternReferences:(NSArray *)array environment:(STEnvironment *)env; @end @implementation STMethodContext + methodContextWithMethod:(STCompiledMethod *)newMethod environment:(STEnvironment *)env { return AUTORELEASE([[self alloc] initWithMethod:newMethod environment:env]); } - initWithMethod:(STCompiledMethod *)newMethod environment:(STEnvironment *)env { unsigned int tempCount; unsigned int i; method = RETAIN(newMethod); tempCount = [method temporariesCount]; temporaries = [[NSMutableArray alloc] initWithCapacity:tempCount]; for(i=0;i @interface STSelector(SmalltalkCompiler) + symbolFromString:(NSString *)aString; @end steptalk-0.10.0/Languages/Smalltalk/STSelector+additions.m0000644000175000000000000000225310132015531022440 0ustar gurkanroot/* STSelector additions Copyright (c) 2002 Free Software Foundation Date: 2002 Feb 4 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STSelector+additions.h" #import @implementation STSelector(SmalltalkCompiler) + symbolFromString:(NSString *)aString { STSelector *aSel; aSel = [[STSelector alloc] initWithSelector:STSelectorFromString(aString)]; return AUTORELEASE(aSel); } @end steptalk-0.10.0/Languages/Smalltalk/STSmalltalkScriptObject.h0000644000175000000000000000262410255617217023162 0ustar gurkanroot/** STSmalltalkScriptObject.h Object that represents script Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class NSMutableArray; @class NSMutableDictionary; @class STBytecodeInterpreter; @class STCompiledScript; @class STEnvironment; @interface STSmalltalkScriptObject:NSObject { NSString *name; STBytecodeInterpreter *interpreter; STEnvironment *environment; STCompiledScript *script; NSMutableDictionary *variables; } - initWithEnvironment:(STEnvironment *)env compiledScript:(STCompiledScript *)compiledScript; @end steptalk-0.10.0/Languages/Smalltalk/STSmalltalkScriptObject.m0000644000175000000000000001200210255620064023150 0ustar gurkanroot/** STSmalltalkScriptObject.m Object that represents script Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STSmalltalkScriptObject.h" #import "STBytecodeInterpreter.h" #import "STCompiledScript.h" #import #import #import #import #import #import #import #import #import @implementation STSmalltalkScriptObject - initWithEnvironment:(STEnvironment *)env compiledScript:(STCompiledScript *)compiledScript { NSEnumerator *enumerator; NSString *varName; [super init]; NSDebugLLog(@"STEngine", @"creating script object %p with ivars %@",compiledScript, [compiledScript variableNames]); environment = RETAIN(env); script = RETAIN(compiledScript); variables = [[NSMutableDictionary alloc] init]; enumerator = [[compiledScript variableNames] objectEnumerator]; while( (varName = [enumerator nextObject]) ) { [variables setObject:STNil forKey:varName]; } return self; } - (void)dealloc { RELEASE(interpreter); RELEASE(script); RELEASE(variables); RELEASE(environment); [super dealloc]; } - (STCompiledScript *)script { return script; } - (void)setValue:(id)value forKey:(NSString *)key { if(value == nil) { value = STNil; } /* FIXME: check this for potential abuse and for speed improvements */ if([variables objectForKey:key]) { [variables setObject:value forKey:key]; } else { [super setValue:value forKey:key]; } } - (id)valueForKey:(NSString *)key { id value = [variables objectForKey:key]; if(value) { return value; } else { return [super valueForKey:key]; } } - (BOOL)respondsToSelector:(SEL)aSelector { NSDebugLLog(@"STSending", @"?? script object responds to %@", NSStringFromSelector(aSelector)); if( [super respondsToSelector:(SEL)aSelector] ) { return YES; } return ([script methodWithName:NSStringFromSelector(aSelector)] != nil); } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { NSMethodSignature *signature = nil; signature = [super methodSignatureForSelector:sel]; if(!signature) { signature = STConstructMethodSignatureForSelector(sel); } return signature; } - (void) forwardInvocation:(NSInvocation *)invocation { NSAutoreleasePool *pool = [NSAutoreleasePool new]; STCompiledMethod *method; NSString *methodName = NSStringFromSelector([invocation selector]); NSMutableArray *args; id arg; int index; int count; id retval = nil; if(!interpreter) { NSDebugLLog(@"STEngine", @"creating new interpreter for script '%@'", name); interpreter = [[STBytecodeInterpreter alloc] initWithEnvironment:environment]; } if([methodName isEqualToString:@"exit"]) { [interpreter halt]; return; } method = [script methodWithName:methodName]; count = [[invocation methodSignature] numberOfArguments]; NSDebugLLog(@"STSending", @"script object perform: %@ with %i args", methodName,count-2); args = [[NSMutableArray alloc] init]; for(index = 2; index < count; index++) { arg = [invocation getArgumentAsObjectAtIndex:index]; if (arg == nil) { [args addObject:STNil]; } else { [args addObject:arg]; } } // NSDebugLLog(@"STSending", // @">> forwarding to self ..."); retval = [interpreter interpretMethod:method forReceiver:self arguments:args]; RELEASE(args); // NSDebugLLog(@"STSending", // @"<< returned from forwarding"); [invocation setReturnValue:&retval]; [pool release]; } @end steptalk-0.10.0/Languages/Smalltalk/STSourceReader.h0000644000175000000000000000301310132015531021257 0ustar gurkanroot/** STSourceReader.h Source reader class. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #include "STTokenTypes.h" @class NSString; @interface STSourceReader:NSObject { NSString *source; // Source NSRange srcRange; // range of source in string unsigned int srcOffset; // Scan offset NSRange tokenRange; // Tokenn range STTokenType tokenType; // Token type } - initWithString:(NSString *)aString; - initWithString:(NSString *)aString range:(NSRange)range; - (STTokenType)nextToken; - (STTokenType)tokenType; - (NSString *)tokenString; - (NSRange)tokenRange; - (int)currentLine; @end steptalk-0.10.0/Languages/Smalltalk/STSourceReader.m0000644000175000000000000004525010132015531021275 0ustar gurkanroot/** STSourceReader.m Source reader class. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "STSourceReader.h" #import #import #import #import #import "Externs.h" static NSCharacterSet *identStartCharacterSet; static NSCharacterSet *identCharacterSet; static NSCharacterSet *wsCharacterSet; static NSCharacterSet *numericCharacterSet; static NSCharacterSet *symbolicSelectorCharacterSet; static NSCharacterSet *validCharacterCharacterSet; #define AT_END (srcOffset >= NSMaxRange(srcRange)) // #define AT_END ([self atEnd]) @interface NSString (LineCounting) - (int)lineNumberForIndex:(int)index; @end @implementation NSString (LineCounting) - (int)lineNumberForIndex:(int)index { int i, len; int cr = 0; int line = 1; len = [self length]; index = (index < len) ? index : len; for(i=0;i?@\\~"]; RETAIN(wsCharacterSet); RETAIN(numericCharacterSet); RETAIN(symbolicSelectorCharacterSet); set = [[NSCharacterSet controlCharacterSet] mutableCopy]; [set formUnionWithCharacterSet:[NSCharacterSet illegalCharacterSet]]; [set formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; validCharacterCharacterSet = RETAIN([set invertedSet]); RELEASE(set); } - (void)dealloc { RELEASE(source); [super dealloc]; } - initWithString:(NSString *)aString { return [self initWithString:aString range:NSMakeRange(0,[aString length])]; } - initWithString:(NSString *)aString range:(NSRange)range { [super init]; ASSIGN(source,aString); srcRange = range; srcOffset = range.location; tokenRange = NSMakeRange(0,0); tokenType = STInvalidTokenType; return self; } - (STTokenType) tokenType { return tokenType; } - (NSString *)tokenString { if(tokenType == STStringTokenType) { return _STNormalizeStringToken([source substringWithRange:tokenRange]); } else { return [source substringWithRange:tokenRange]; } } - (NSRange)tokenRange; { return tokenRange; } - (BOOL) atEnd { return (srcOffset >= NSMaxRange(srcRange)); } - (int) currentLine { return [source lineNumberForIndex:srcOffset]; } - (BOOL) eatWhiteSpace { unichar uc; for(;;) { if(AT_END) { return 0; } uc = PEEK_CHAR; /* treat comments as whitespace */ if(uc == '"') { unsigned int start = srcOffset; do { srcOffset++; if(AT_END) { tokenRange = NSMakeRange(start, 1); [NSException raise:STCompilerSyntaxException format:@"Unterminated comment"]; return 1; } } while(PEEK_CHAR != '"'); } else if([wsCharacterSet characterIsMember:uc] == NO) { return 0; } srcOffset++; } return 0; } - (STTokenType)readNextToken { unichar c; int start; if([self eatWhiteSpace]) { return STErrorTokenType; } if(AT_END) { return STEndTokenType; } c = PEEK_CHAR; if([identStartCharacterSet characterIsMember:c]) { BOOL isIdent = YES; start = srcOffset; srcOffset++; isIdent = [identCharacterSet characterIsMember:c]; while(isIdent) { if(AT_END) { tokenRange = NSMakeRange(start,srcOffset - start); return STIdentifierTokenType; } c = GET_CHAR; isIdent = [identCharacterSet characterIsMember:c]; } if(c == ':') { if(AT_END) { tokenRange = NSMakeRange(start,srcOffset - start); return STKeywordTokenType; } c = PEEK_CHAR; if(c == '=') { /* We have found := */ srcOffset --; tokenRange = NSMakeRange(start,srcOffset - start - 1); return STIdentifierTokenType; } else { tokenRange = NSMakeRange(start,srcOffset - start); return STKeywordTokenType; } } else { /* Put back that character */ srcOffset--; tokenRange = NSMakeRange(start,srcOffset - start); return STIdentifierTokenType; } } else if ( c == '-' || c == '+' || [numericCharacterSet characterIsMember:c]) { BOOL maybesym = (c == '-' || c == '+'); BOOL isReal = NO; BOOL isDigit = NO; start = srcOffset; srcOffset++; if(AT_END) { tokenRange = NSMakeRange(start, 1); if(maybesym) { return STBinarySelectorTokenType; } else { return STIntNumberTokenType; } } /* Take next character and see if it is binary selector */ c = GET_CHAR; if(![numericCharacterSet characterIsMember:c] && maybesym) { if([symbolicSelectorCharacterSet characterIsMember:c]) { /* Both characters are making one binary selector */ tokenRange = NSMakeRange(start,2); } else { /* Other character was neither number nor binary selector character, so we put it back. */ srcOffset--; tokenRange = NSMakeRange(start, 1); } return STBinarySelectorTokenType; } /* c should be a digit here */ isDigit = [numericCharacterSet characterIsMember:c]; while( isDigit ) { if(AT_END) { tokenRange = NSMakeRange(start, srcOffset-start); return STIntNumberTokenType; } c = GET_CHAR; isDigit = [numericCharacterSet characterIsMember:c]; } if(c == '.') { if(AT_END) { /* we have read a dot '.' at the end of string, do not treat it as decimal point. We rather put it back and treat it like end of statement. */ srcOffset--; tokenRange = NSMakeRange(start, srcOffset - start); return STIntNumberTokenType; } c = PEEK_CHAR; isDigit = [numericCharacterSet characterIsMember:c]; if(!isDigit) { if([wsCharacterSet characterIsMember:c]) { /* If there is whitespace or newline after a decimal point, we treat it as dot '.' - end of a statement. We have to put back that dot. */ srcOffset --; tokenRange = NSMakeRange(start,srcOffset - start); return STIntNumberTokenType; } else { tokenRange = NSMakeRange(start,srcOffset - start + 1); [NSException raise:STCompilerSyntaxException format:@"Invalid character '%c' after decimal point", c]; } return STErrorTokenType; } while(isDigit) { if(AT_END) { tokenRange = NSMakeRange(start, srcOffset - start); return STRealNumberTokenType; } c = GET_CHAR; isDigit = [numericCharacterSet characterIsMember:c]; } isReal = YES; /* Here we are either at the end or just scanned non-digit character. */ } if(c == 'e' || c == 'E') { if(AT_END) { /* We have reached end of wource without specifying exponent. This is error. */ tokenRange = NSMakeRange(start,srcOffset - start); [NSException raise:STCompilerSyntaxException format:@"Unexpected end of source. " @"Exponent is missing."]; return STErrorTokenType; } c = GET_CHAR; if(c == '+' || c == '-') { if(AT_END) { /* We have reached end of wource without specifying exponent. This is error. */ tokenRange = NSMakeRange(start,srcOffset - start); [NSException raise:STCompilerSyntaxException format:@"Unexpected end of source. " @"Exponent is missing after '%c'.", c]; return STErrorTokenType; } c = GET_CHAR; } isDigit = [numericCharacterSet characterIsMember:c]; while(isDigit) { if(AT_END) { tokenRange = NSMakeRange(start, srcOffset - start); return STRealNumberTokenType; } c = GET_CHAR; isDigit = [numericCharacterSet characterIsMember:c]; } if([identStartCharacterSet characterIsMember:c]) { tokenRange = NSMakeRange(start,srcOffset - start); [NSException raise:STCompilerSyntaxException format:@"Invalid character '%c' in real number.", c]; return STErrorTokenType; } isReal = YES; } else if([identStartCharacterSet characterIsMember:c]) { tokenRange = NSMakeRange(start,srcOffset - start); [NSException raise:STCompilerSyntaxException format:@"Invalid character '%c' in integer.", c]; return STErrorTokenType; } srcOffset --; tokenRange = NSMakeRange(start,srcOffset - start); if([identStartCharacterSet characterIsMember:c] && c != 'e' && c != 'E') { tokenRange = NSMakeRange(start,srcOffset - start + 1); [NSException raise:STCompilerSyntaxException format:@"Letter '%c' in number", c]; return STErrorTokenType; } if(isReal) { return STRealNumberTokenType; } else { return STIntNumberTokenType; } } else if ([symbolicSelectorCharacterSet characterIsMember:c]) { start = srcOffset++; c = PEEK_CHAR; if ([symbolicSelectorCharacterSet characterIsMember:c]) { srcOffset++; tokenRange = NSMakeRange(start,2); } else tokenRange = NSMakeRange(start,1); return STBinarySelectorTokenType; } else { switch(c) { case '$': srcOffset++; c = GET_CHAR; if(AT_END) { tokenRange = NSMakeRange(srcOffset-2, 1); [NSException raise:STCompilerSyntaxException format:@"Character expected"]; return STErrorTokenType; }; if([validCharacterCharacterSet characterIsMember:c]) { c = PEEK_CHAR; if([identCharacterSet characterIsMember:c]) { tokenRange = NSMakeRange(srcOffset-2, 3); [NSException raise:STCompilerSyntaxException format:@"Too many characters"]; return STErrorTokenType; } tokenRange = NSMakeRange(srcOffset++,1);\ return STCharacterTokenType; } tokenRange = NSMakeRange(srcOffset-2,2);\ [NSException raise:STCompilerSyntaxException format:@"Invalid character literal"]; return STErrorTokenType; case '#': start=srcOffset++; c = PEEK_CHAR; if(c=='(') { srcOffset++; tokenRange = NSMakeRange(start,2); return STArrayOpenTokenType; } if([identStartCharacterSet characterIsMember:c]) { start=srcOffset++; while([identCharacterSet characterIsMember:c] || c == ':') { c = GET_CHAR; if(AT_END) break; } srcOffset--; tokenRange = NSMakeRange(start,srcOffset - start); return STSymbolTokenType; } tokenRange = NSMakeRange(start,srcOffset - start); return STSharpTokenType; case ':': start=srcOffset++; c = PEEK_CHAR; if(c == '=') { srcOffset++; tokenRange = NSMakeRange(start,srcOffset - start); return STAssignTokenType; } tokenRange = NSMakeRange(start,srcOffset - start); return STColonTokenType; #define SIMPLE_TOKEN_RETURN(type) \ tokenRange = NSMakeRange(srcOffset++,1);\ return type case '(':SIMPLE_TOKEN_RETURN(STLParenTokenType); case ')':SIMPLE_TOKEN_RETURN(STRParenTokenType); case '|':SIMPLE_TOKEN_RETURN(STBarTokenType); case ';':SIMPLE_TOKEN_RETURN(STSemicolonTokenType); case '[':SIMPLE_TOKEN_RETURN(STBlockOpenTokenType); case ']':SIMPLE_TOKEN_RETURN(STBlockCloseTokenType); case '^':SIMPLE_TOKEN_RETURN(STReturnTokenType); case '!':SIMPLE_TOKEN_RETURN(STSeparatorTokenType); case '.':SIMPLE_TOKEN_RETURN(STDotTokenType); case '\'': start= 1 + srcOffset++; for(;;) { if(AT_END) { tokenRange = NSMakeRange(start-1,1);\ [NSException raise:STCompilerSyntaxException format:@"Unterminated string"]; return STErrorTokenType; }; c = GET_CHAR; if( c=='\\') { if(AT_END) { [NSException raise:STCompilerSyntaxException format:@"\\ at end"]; return STErrorTokenType; } GET_CHAR; } else if( c=='\'' ) { if(AT_END) { return STStringTokenType; } c = GET_CHAR; if(c != '\'') { srcOffset--; tokenRange = NSMakeRange(start, srcOffset - start - 1); return STStringTokenType; } } } default: return STErrorTokenType; } } } - (STTokenType)nextToken { tokenType = [self readNextToken]; return tokenType; } - (void)unreadLastToken { srcOffset = tokenRange.location; } @end steptalk-0.10.0/Languages/Smalltalk/STStack.h0000644000175000000000000000235210132015531017746 0ustar gurkanroot/** STStack.h Stack object Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STStack:NSObject { unsigned size; unsigned pointer; id *stack; } + stackWithSize:(unsigned)newSize; - initWithSize:(unsigned)newSize; - (void)push:anObject; - (id) pop; - (void)popCount:(unsigned)count; - (id) valueAtTop; - (id) valueFromTop:(unsigned)offset; - (void)duplicateTop; - (void)empty; @end steptalk-0.10.0/Languages/Smalltalk/STStack.m0000644000175000000000000000467110132015531017761 0ustar gurkanroot/** STStack.m Temporaries and stack storage. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "STStack.h" #import #import #import @implementation STStack + stackWithSize:(unsigned)newSize { return AUTORELEASE([[self alloc] initWithSize:newSize]); } - initWithSize:(unsigned)newSize { size = newSize; pointer = 0; stack = NSZoneMalloc( NSDefaultMallocZone(), size * sizeof(id) ); return [super init]; } - (void)invalidPointer:(unsigned)ptr { [NSException raise:STInternalInconsistencyException format:@"%@: invalid pointer %i (sp=%i size=%i)", self, ptr, pointer, size]; } - (void)dealloc { NSZoneFree(NSDefaultMallocZone(),stack); [super dealloc]; } #define INDEX_IS_VALID(index) \ ((index >= 0) && (index < size)) #define CHECK_POINTER(value) \ do {\ if(!INDEX_IS_VALID(value)) \ {\ [self invalidPointer:value];\ } \ }\ while(0) /* - (void)setPointer:(unsigned)newPointer { CHECK_POINTER(newPointer); pointer=newPointer; } */ - (int)pointer { return pointer; } - (void)push:(id)value { CHECK_POINTER(pointer); NSDebugLLog(@"STStack",@"stack:%p %02i push '%@'",self,pointer,value); stack[pointer++] = value; } - (void)duplicateTop { [self push:[self valueAtTop]]; } #define CONVERT_NIL(obj) ((obj == STNil) ? nil : (obj)) - (id)valueAtTop { CHECK_POINTER(pointer-1); return CONVERT_NIL(stack[pointer-1]); } - (id)valueFromTop:(unsigned)index { id value; CHECK_POINTER(pointer-index-1); value = stack[pointer - index - 1]; NSDebugLLog(@"STStack",@"stack:%p %02i from top %i '%@'", self,pointer,index,value); return CONVERT_NIL(value); } - (id)pop { CHECK_POINTER(pointer-1); NSDebugLLog(@"STStack",@"stack:%p %02i pop '%@'",self,pointer,stack[pointer-1]); pointer --; return CONVERT_NIL(stack[pointer]); } - (void)popCount:(unsigned)count { CHECK_POINTER(pointer-count); NSDebugLLog(@"STStack",@"stack:%p %02i pop count %i (%i)",self, pointer,count,pointer-count); pointer -= count; } - (void)empty { pointer = 0; } @end steptalk-0.10.0/Languages/Smalltalk/STTokenTypes.h0000644000175000000000000000377510132015531021020 0ustar gurkanroot/* STTokenTypes.h STSourceReader token types Copyright (c) 2002 Free Software Foundation This file is part of the StpTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ typedef enum { STInvalidTokenType, STSeparatorTokenType, // ! STBarTokenType, // | STReturnTokenType, // ^ STColonTokenType, // : STSemicolonTokenType, // ; STDotTokenType, // . STLParenTokenType, // ( STRParenTokenType, // ) STBlockOpenTokenType, // [ STBlockCloseTokenType, // ] STArrayOpenTokenType, // #( STSharpTokenType, // # STAssignTokenType, // := STErrorTokenType, STIdentifierTokenType, // thisIsIdentifier STKeywordTokenType, // thisIsKeyword: STBinarySelectorTokenType, // +,-,*,/ STSymbolTokenType, // #thisIsSymbol STStringTokenType, // 'This is string' STCharacterTokenType, // $a (any single alphanum character) STIntNumberTokenType, // [+-]?[0-9]+ STRealNumberTokenType, // [+-]?[0-9]+.[0-9]+[eE][+-][0-9]+ STEndTokenType } STTokenType; steptalk-0.10.0/Languages/Smalltalk/STUndefinedObject+additions.h0000644000175000000000000000235110132015531023702 0ustar gurkanroot/** STUndefinedObject.h Wrapper for nil object Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @class STBlock; @interface STUndefinedObject(SmalltalkAdditions) - ifFalse:(STBlock *)block ifTrue:(STBlock *)anotherBlock; - ifTrue:(STBlock *)block ifFalse:(STBlock *)anotherBlock; - ifTrue:(STBlock *)block; - ifFalse:(STBlock *)block; - ifNil:(STBlock *)block; - notNil:(STBlock *)block; - (BOOL)isNil; @end steptalk-0.10.0/Languages/Smalltalk/SmalltalkEngine.h0000644000175000000000000000177610132015531021515 0ustar gurkanroot/** SmalltalkEngine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Oct 24 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface SmalltalkEngine:STEngine { } @end steptalk-0.10.0/Languages/Smalltalk/STUndefinedObject+additions.m0000644000175000000000000000145010132015531023706 0ustar gurkanroot/** STUndefinedObject.m Wrapper for nil object Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. */ #import "STUndefinedObject+additions.h" #import "STBlock.h" #import #import #import @implementation STUndefinedObject(SmalltalkAdditions) - (BOOL)isNil { return YES; } - ifNil:(STBlock *)block { return [block value]; } - notNil:(STBlock *)block { return nil; } - ifFalse:(STBlock *)block { return [block value]; } - ifTrue:(STBlock *)block { return nil; } - ifFalse:(STBlock *)block ifTrue:(STBlock *)anotherBlock { return [block value]; } - ifTrue:(STBlock *)block ifFalse:(STBlock *)anotherBlock { return [anotherBlock value]; } @end steptalk-0.10.0/Languages/Smalltalk/SmalltalkEngine.m0000644000175000000000000001033310302054241021507 0ustar gurkanroot/** SmalltalkEngine Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Oct 24 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "SmalltalkEngine.h" #import "STCompiler.h" #import "STCompiledCode.h" #import "STCompiledMethod.h" #import "STCompiledScript.h" #import "STBytecodeInterpreter.h" #import #import #import #import #import @implementation SmalltalkEngine - (BOOL)canInterpret:(NSString *)sourceCode { STCompiler *compiler; STCompiledScript *script = nil; BOOL retval = NO; compiler = [[STCompiler alloc] init]; NS_DURING script = [compiler compileString:sourceCode]; NS_HANDLER NSLog(@"Smalltalk: Ignoring: %@", [localException reason]); NS_ENDHANDLER if(script) { retval = YES; } RELEASE(compiler); return retval; } - (id) executeCode:(NSString *)sourceCode inEnvironment:(STEnvironment *)env { NSLog(@"%@ is depreciated, use interpretScript:inContext: instead", NSStringFromSelector(_cmd)); return [self interpretScript:sourceCode inContext:env]; } - (id)interpretScript:(NSString *)script inContext:(STContext *)context { STCompiler *compiler; STCompiledScript *compiledScript; id retval = nil; compiler = [[STCompiler alloc] init]; [compiler setEnvironment:context]; compiledScript = [compiler compileString:script]; retval = [compiledScript executeInEnvironment:context]; AUTORELEASE(compiler); return retval; } - (id )methodFromSource:(NSString *)sourceString forReceiver:(id)receiver inEnvironment:(STEnvironment *)env { NSLog(@"%@ is depreciated, use methodFromSource:forReceiver:inContext: instead", NSStringFromSelector(_cmd)); return [self methodFromSource:sourceString forReceiver:receiver inContext:env]; } - (id )methodFromSource:(NSString *)sourceString forReceiver:(id)receiver inContext:(STContext *)context { STCompiler *compiler; id method; compiler = [STCompiler compilerWithEnvironment:context]; method = [compiler compileMethodFromSource:sourceString forReceiver:receiver]; return method; } - (id) executeMethod:(id )aMethod forReceiver:(id)anObject withArguments:(NSArray *)args inEnvironment:(STEnvironment *)env { NSLog(@"%@ is depreciated, use ...inContext: instead", NSStringFromSelector(_cmd)); return [self executeMethod:aMethod forReceiver:anObject withArguments:args inContext:env]; } - (id) executeMethod:(id )aMethod forReceiver:(id)anObject withArguments:(NSArray *)args inContext:(STContext *)context { STBytecodeInterpreter *interpreter; id result; interpreter = [STBytecodeInterpreter interpreterWithEnvrionment:context]; result = [interpreter interpretMethod:(STCompiledMethod *)aMethod forReceiver:anObject arguments:args]; return result; } @end steptalk-0.10.0/Languages/Smalltalk/SmalltalkInfo.plist0000644000175000000000000000030410305156262022102 0ustar gurkanroot{ STFileTypes = ( "st", "stalk" ); StepTalkLanguages = { Smalltalk = { FileTypes = ("st"); EngineClass = "SmalltalkEngine"; } } } steptalk-0.10.0/Modules/0000775000175000000000000000000010132015542014041 5ustar gurkanrootsteptalk-0.10.0/Modules/AppKit/0000775000175000000000000000000010365363565015254 5ustar gurkanrootsteptalk-0.10.0/Modules/AppKit/.cvsignore0000644000175000000000000000010510132015536017226 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Modules/AppKit/AppKitConstants.list0000644000175000000000000002177210132015537021226 0ustar gurkanroot# AppKit Constants # # id NSApp id NSModalPanelRunLoopMode id NSEventTrackingRunLoopMode id NSFontAttributeName id NSParagraphStyleAttributeName id NSForegroundColorAttributeName id NSUnderlineStyleAttributeName id NSSuperscriptAttributeName id NSBackgroundColorAttributeName id NSAttachmentAttributeName id NSLigatureAttributeName id NSBaselineOffsetAttributeName id NSKernAttributeName id NSLinkAttributeName id NSDataLinkFileNameExtension id NSAFMAscender id NSAFMCapHeight id NSAFMCharacterSet id NSAFMDescender id NSAFMEncodingScheme id NSAFMFamilyName id NSAFMFontName id NSAFMFormatVersion id NSAFMFullName id NSAFMItalicAngle id NSAFMMappingScheme id NSAFMNotice id NSAFMUnderlinePosition id NSAFMUnderlineThickness id NSAFMVersion id NSAFMWeight id NSAFMXHeight id NSCalibratedWhiteColorSpace id NSCalibratedBlackColorSpace id NSCalibratedRGBColorSpace id NSDeviceWhiteColorSpace id NSDeviceBlackColorSpace id NSDeviceRGBColorSpace id NSDeviceCMYKColorSpace id NSNamedColorSpace id NSCustomColorSpace int NSDefaultDepth int NSTwoBitGrayDepth int NSEightBitGrayDepth int NSEightBitRGBDepth int NSTwelveBitRGBDepth int GSSixteenBitRGBDepth int NSTwentyFourBitRGBDepth float NSBlack float NSDarkGray float NSWhite float NSLightGray float NSGray id NSDeviceResolution id NSDeviceColorSpaceName id NSDeviceBitsPerSample id NSDeviceIsScreen id NSDeviceIsPrinter id NSDeviceSize id NSInterfaceStyleDefault id NSColorPboardType id NSFileContentsPboardType id NSFilenamesPboardType id NSFontPboardType id NSRulerPboardType id NSPostScriptPboardType id NSTabularTextPboardType id NSRTFPboardType id NSRTFDPboardType id NSTIFFPboardType id NSDataLinkPboardType id NSGeneralPboardType id NSDragPboard id NSFindPboard id NSFontPboard id NSGeneralPboard id NSRulerPboard id NSPrintAllPages id NSPrintBottomMargin id NSPrintCopies id NSPrintFaxCoverSheetName id NSPrintFaxHighResolution id NSPrintFaxModem id NSPrintFaxReceiverNames id NSPrintFaxReceiverNumbers id NSPrintFaxReturnReceipt id NSPrintFaxSendTime id NSPrintFaxTrimPageEnds id NSPrintFaxUseCoverSheet id NSPrintFirstPage id NSPrintHorizontalPagination id NSPrintHorizontallyCentered id NSPrintJobDisposition id NSPrintJobFeatures id NSPrintLastPage id NSPrintLeftMargin id NSPrintManualFeed id NSPrintOrientation id NSPrintPagesPerSheet id NSPrintPaperFeed id NSPrintPaperName id NSPrintPaperSize id NSPrintPrinter id NSPrintReversePageOrder id NSPrintRightMargin id NSPrintSavePath id NSPrintScalingFactor id NSPrintTopMargin id NSPrintVerticalPagination id NSPrintVerticallyCentered id NSPrintCancelJob id NSPrintFaxJob id NSPrintPreviewJob id NSPrintSaveJob id NSPrintSpoolJob id NSOldSelectedCharacterRange # FIXME: # NSSize NSIconSize # NSSize NSTokenSize id NSPlainFileType id NSDirectoryFileType id NSApplicationFileType id NSFilesystemFileType id NSShellCommandFileType id NSWorkspaceCompressOperation id NSWorkspaceCopyOperation id NSWorkspaceDecompressOperation id NSWorkspaceDecryptOperation id NSWorkspaceDestroyOperation id NSWorkspaceDuplicateOperation id NSWorkspaceEncryptOperation id NSWorkspaceLinkOperation id NSWorkspaceMoveOperation id NSWorkspaceRecycleOperation int NSRunStoppedResponse int NSRunAbortedResponse int NSRunContinuesResponse int GSNoUnderlineStyle int NSSingleUnderlineStyle int NSButtLineCapStyle int NSRoundLineCapStyle int NSSquareLineCapStyle int NSMiterLineJoinStyle int NSRoundLineJoinStyle int NSBevelLineJoinStyle int NSNonZeroWindingRule int NSEvenOddWindingRule int NSMoveToBezierPathElement int NSLineToBezierPathElement int NSCurveToBezierPathElement int NSClosePathBezierPathElement int NSNoTitle int NSAboveTop int NSAtTop int NSBelowTop int NSAboveBottom int NSAtBottom int NSBelowBottom int NSTIFFCompressionNone int NSTIFFCompressionCCITTFAX3 int NSTIFFCompressionCCITTFAX4 int NSTIFFCompressionLZW int NSTIFFCompressionJPEG int NSTIFFCompressionNEXT int NSTIFFCompressionPackBits int NSTIFFCompressionOldJPEG int NSTIFFFileType int NSBMPFileType int NSGIFFileType int NSJPEGFileType int NSPNGFileType int NSMomentaryPushButton int NSPushOnPushOffButton int NSToggleButton int NSSwitchButton int NSRadioButton int NSMomentaryChangeButton int NSOnOffButton int NSMomentaryLight int NSRoundedBezelStyle int NSRegularSquareBezelStyle int NSThickSquareBezelStyle int NSThickerSquareBezelStyle int NSNeXTBezelStyle int NSPushButtonBezelStyle int NSSmallIconButtonBezelStyle int NSMediumIconButtonBezelStyle int NSLargeIconButtonBezelStyle int NSGradientNone int NSGradientConcaveWeak int NSGradientConcaveStrong int NSGradientConvexWeak int NSGradientConvexStrong # int NSLeftAlignedParagraph # int NSRightAlignedParagraph # int NSCenterAlignedParagraph # int NSJustificationAlignedParagraph # int NSFirstIndentParagraph # int NSIndentParagraph # int NSAddTabParagraph # int NSRemoveTabParagraph # int NSLeftMarginParagraph # int NSRightMarginParagraph # int NSTextBlockSize int NSNullCellType int NSTextCellType int NSImageCellType int NSAnyType int NSIntType int NSPositiveIntType int NSFloatType int NSPositiveFloatType int NSDateType int NSDoubleType int NSPositiveDoubleType int NSNoImage int NSImageOnly int NSImageLeft int NSImageRight int NSImageBelow int NSImageAbove int NSImageOverlaps int NSCellDisabled int NSCellState int NSPushInCell int NSCellEditable int NSChangeGrayCell int NSCellHighlighted int NSCellLightsByContents int NSCellLightsByGray int NSChangeBackgroundCell int NSCellLightsByBackground int NSCellIsBordered int NSCellHasOverlappingImage int NSCellHasImageHorizontal int NSCellHasImageOnLeftOrBottom int NSCellChangesContents int NSCellIsInsetButton int NSCellAllowsMixedState int NSNoCellMask int NSContentsCellMask int NSPushInCellMask int NSChangeGrayCellMask int NSChangeBackgroundCellMask int NSOffState int NSOnState int NSMixedState int NSDefaultControlTint int NSClearControlTint int NSGrayModeColorPanel int NSRGBModeColorPanel int NSCMYKModeColorPanel int NSHSBModeColorPanel int NSCustomPaletteModeColorPanel int NSColorListModeColorPanel int NSWheelModeColorPanel int NSColorPanelGrayModeMask int NSColorPanelRGBModeMask int NSColorPanelCMYKModeMask int NSColorPanelHSBModeMask int NSColorPanelCustomPaletteModeMask int NSColorPanelColorListModeMask int NSColorPanelWheelModeMask int NSColorPanelAllModesMask # GSCursorTypes int GSArrowCursor int GSIBeamCursor # NSDataLinkDisposition int NSLinkInDestination int NSLinkInSource int NSLinkBroken # NSDataLinkUpdateMode int NSUpdateContinuously int NSUpdateWhenSourceSaved int NSUpdateManually int NSUpdateNever int NSChangeDone int NSChangeUndone int NSChangeCleared int NSSaveOperation int NSSaveAsOperation int NSSaveToOperation int NSDragOperationNone int NSDragOperationCopy int NSDragOperationLink int NSDragOperationGeneric int NSDragOperationPrivate int NSDragOperationAll # GSFileWrapperType # int GSFileWrapperDirectoryType # int GSFileWrapperRegularFileType # int GSFileWrapperSymbolicLinkType int NSControlGlyph int NSNullGlyph # NSGlyphRelation int NSGlyphBelow int NSGlyphAbove # NSMultibyteGlyphPacking int NSOneByteGlyphPacking int NSJapaneseEUCGlyphPacking int NSAsciiWithDoubleByteEUCGlyphPacking int NSTwoByteGlyphPacking int NSFourByteGlyphPacking int NSItalicFontMask int NSUnitalicFontMask int NSBoldFontMask int NSUnboldFontMask int NSNarrowFontMask int NSExpandedFontMask int NSCondensedFontMask int NSSmallCapsFontMask int NSPosterFontMask int NSCompressedFontMask int NSNonStandardCharacterSetFontMask int NSFixedPitchFontMask # NSFontTag int NSNoFontChangeAction int NSViaPanelFontAction int NSAddTraitFontAction int NSRemoveTraitFontAction int NSSizeUpFontAction int NSSizeDownFontAction int NSHeavierFontAction int NSLighterFontAction int NSFPPreviewButton int NSFPRevertButton int NSFPSetButton int NSFPPreviewField int NSFPSizeField int NSFPSizeTitle int NSFPCurrentField int NSFPFamilyBrowser int NSFPFaceBrowser int NSFPSizeBrowser # NSBackingStoreType int NSBackingStoreRetained int NSBackingStoreNonretained int NSBackingStoreBuffered # NSCompositingOperation int NSCompositeClear int NSCompositeCopy int NSCompositeSourceOver int NSCompositeSourceIn int NSCompositeSourceOut int NSCompositeSourceAtop int NSCompositeDestinationOver int NSCompositeDestinationIn int NSCompositeDestinationOut int NSCompositeDestinationAtop int NSCompositeXOR int NSCompositePlusDarker int NSCompositeHighlight int NSCompositePlusLighter # NSWindowOrderingMode int NSWindowAbove int NSWindowBelow int NSWindowOut # GSWindowInputState int GSTitleBarKey int GSTitleBarNormal int GSTitleBarMain # NSImageScaling int NSScaleProportionally int NSScaleToFit int NSScaleNone # NSImageAlignment int NSImageAlignCenter int NSImageAlignTop int NSImageAlignTopLeft int NSImageAlignTopRight int NSImageAlignLeft int NSImageAlignBottom int NSImageAlignBottomLeft int NSImageAlignBottomRight int NSImageAlignRight # NSImageFrameStyle int NSImageFrameNone int NSImageFramePhoto int NSImageFrameGrayBezel int NSImageFrameGroove int NSImageFrameButton # NSPanel int NSUtilityWindowMask int NSDocModalWindowMask int NSOKButton int NSCancelButton int NSAlertDefaultReturn int NSAlertAlternateReturn int NSAlertOtherReturn int NSAlertErrorReturn steptalk-0.10.0/Modules/AppKit/AppKitConstants.m0000644000175000000000000006045210132015537020505 0ustar gurkanroot/** AppKitConstants.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import NSDictionary *STGetAppKitConstants(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) ADD_id_OBJECT(NSModalPanelRunLoopMode,@"NSModalPanelRunLoopMode"); ADD_id_OBJECT(NSEventTrackingRunLoopMode,@"NSEventTrackingRunLoopMode"); ADD_id_OBJECT(NSFontAttributeName,@"NSFontAttributeName"); ADD_id_OBJECT(NSParagraphStyleAttributeName,@"NSParagraphStyleAttributeName"); ADD_id_OBJECT(NSForegroundColorAttributeName,@"NSForegroundColorAttributeName"); ADD_id_OBJECT(NSUnderlineStyleAttributeName,@"NSUnderlineStyleAttributeName"); ADD_id_OBJECT(NSSuperscriptAttributeName,@"NSSuperscriptAttributeName"); ADD_id_OBJECT(NSBackgroundColorAttributeName,@"NSBackgroundColorAttributeName"); ADD_id_OBJECT(NSAttachmentAttributeName,@"NSAttachmentAttributeName"); ADD_id_OBJECT(NSLigatureAttributeName,@"NSLigatureAttributeName"); ADD_id_OBJECT(NSBaselineOffsetAttributeName,@"NSBaselineOffsetAttributeName"); ADD_id_OBJECT(NSKernAttributeName,@"NSKernAttributeName"); ADD_id_OBJECT(NSLinkAttributeName,@"NSLinkAttributeName"); ADD_id_OBJECT(NSDataLinkFileNameExtension,@"NSDataLinkFileNameExtension"); ADD_id_OBJECT(NSAFMAscender,@"NSAFMAscender"); ADD_id_OBJECT(NSAFMCapHeight,@"NSAFMCapHeight"); ADD_id_OBJECT(NSAFMCharacterSet,@"NSAFMCharacterSet"); ADD_id_OBJECT(NSAFMDescender,@"NSAFMDescender"); ADD_id_OBJECT(NSAFMEncodingScheme,@"NSAFMEncodingScheme"); ADD_id_OBJECT(NSAFMFamilyName,@"NSAFMFamilyName"); ADD_id_OBJECT(NSAFMFontName,@"NSAFMFontName"); ADD_id_OBJECT(NSAFMFormatVersion,@"NSAFMFormatVersion"); ADD_id_OBJECT(NSAFMFullName,@"NSAFMFullName"); ADD_id_OBJECT(NSAFMItalicAngle,@"NSAFMItalicAngle"); ADD_id_OBJECT(NSAFMMappingScheme,@"NSAFMMappingScheme"); ADD_id_OBJECT(NSAFMNotice,@"NSAFMNotice"); ADD_id_OBJECT(NSAFMUnderlinePosition,@"NSAFMUnderlinePosition"); ADD_id_OBJECT(NSAFMUnderlineThickness,@"NSAFMUnderlineThickness"); ADD_id_OBJECT(NSAFMVersion,@"NSAFMVersion"); ADD_id_OBJECT(NSAFMWeight,@"NSAFMWeight"); ADD_id_OBJECT(NSAFMXHeight,@"NSAFMXHeight"); ADD_id_OBJECT(NSCalibratedWhiteColorSpace,@"NSCalibratedWhiteColorSpace"); ADD_id_OBJECT(NSCalibratedBlackColorSpace,@"NSCalibratedBlackColorSpace"); ADD_id_OBJECT(NSCalibratedRGBColorSpace,@"NSCalibratedRGBColorSpace"); ADD_id_OBJECT(NSDeviceWhiteColorSpace,@"NSDeviceWhiteColorSpace"); ADD_id_OBJECT(NSDeviceBlackColorSpace,@"NSDeviceBlackColorSpace"); ADD_id_OBJECT(NSDeviceRGBColorSpace,@"NSDeviceRGBColorSpace"); ADD_id_OBJECT(NSDeviceCMYKColorSpace,@"NSDeviceCMYKColorSpace"); ADD_id_OBJECT(NSNamedColorSpace,@"NSNamedColorSpace"); ADD_id_OBJECT(NSCustomColorSpace,@"NSCustomColorSpace"); ADD_int_OBJECT(NSDefaultDepth,@"NSDefaultDepth"); ADD_int_OBJECT(NSTwoBitGrayDepth,@"NSTwoBitGrayDepth"); ADD_int_OBJECT(NSEightBitGrayDepth,@"NSEightBitGrayDepth"); ADD_int_OBJECT(NSEightBitRGBDepth,@"NSEightBitRGBDepth"); ADD_int_OBJECT(NSTwelveBitRGBDepth,@"NSTwelveBitRGBDepth"); ADD_int_OBJECT(GSSixteenBitRGBDepth,@"GSSixteenBitRGBDepth"); ADD_int_OBJECT(NSTwentyFourBitRGBDepth,@"NSTwentyFourBitRGBDepth"); ADD_float_OBJECT(NSBlack,@"NSBlack"); ADD_float_OBJECT(NSDarkGray,@"NSDarkGray"); ADD_float_OBJECT(NSWhite,@"NSWhite"); ADD_float_OBJECT(NSLightGray,@"NSLightGray"); ADD_float_OBJECT(NSGray,@"NSGray"); ADD_id_OBJECT(NSDeviceResolution,@"NSDeviceResolution"); ADD_id_OBJECT(NSDeviceColorSpaceName,@"NSDeviceColorSpaceName"); ADD_id_OBJECT(NSDeviceBitsPerSample,@"NSDeviceBitsPerSample"); ADD_id_OBJECT(NSDeviceIsScreen,@"NSDeviceIsScreen"); ADD_id_OBJECT(NSDeviceIsPrinter,@"NSDeviceIsPrinter"); ADD_id_OBJECT(NSDeviceSize,@"NSDeviceSize"); ADD_id_OBJECT(NSInterfaceStyleDefault,@"NSInterfaceStyleDefault"); ADD_id_OBJECT(NSColorPboardType,@"NSColorPboardType"); ADD_id_OBJECT(NSFileContentsPboardType,@"NSFileContentsPboardType"); ADD_id_OBJECT(NSFilenamesPboardType,@"NSFilenamesPboardType"); ADD_id_OBJECT(NSFontPboardType,@"NSFontPboardType"); ADD_id_OBJECT(NSRulerPboardType,@"NSRulerPboardType"); ADD_id_OBJECT(NSPostScriptPboardType,@"NSPostScriptPboardType"); ADD_id_OBJECT(NSTabularTextPboardType,@"NSTabularTextPboardType"); ADD_id_OBJECT(NSRTFPboardType,@"NSRTFPboardType"); ADD_id_OBJECT(NSRTFDPboardType,@"NSRTFDPboardType"); ADD_id_OBJECT(NSTIFFPboardType,@"NSTIFFPboardType"); ADD_id_OBJECT(NSDataLinkPboardType,@"NSDataLinkPboardType"); ADD_id_OBJECT(NSGeneralPboardType,@"NSGeneralPboardType"); ADD_id_OBJECT(NSDragPboard,@"NSDragPboard"); ADD_id_OBJECT(NSFindPboard,@"NSFindPboard"); ADD_id_OBJECT(NSFontPboard,@"NSFontPboard"); ADD_id_OBJECT(NSGeneralPboard,@"NSGeneralPboard"); ADD_id_OBJECT(NSRulerPboard,@"NSRulerPboard"); ADD_id_OBJECT(NSPrintAllPages,@"NSPrintAllPages"); ADD_id_OBJECT(NSPrintBottomMargin,@"NSPrintBottomMargin"); ADD_id_OBJECT(NSPrintCopies,@"NSPrintCopies"); ADD_id_OBJECT(NSPrintFaxCoverSheetName,@"NSPrintFaxCoverSheetName"); ADD_id_OBJECT(NSPrintFaxHighResolution,@"NSPrintFaxHighResolution"); ADD_id_OBJECT(NSPrintFaxModem,@"NSPrintFaxModem"); ADD_id_OBJECT(NSPrintFaxReceiverNames,@"NSPrintFaxReceiverNames"); ADD_id_OBJECT(NSPrintFaxReceiverNumbers,@"NSPrintFaxReceiverNumbers"); ADD_id_OBJECT(NSPrintFaxReturnReceipt,@"NSPrintFaxReturnReceipt"); ADD_id_OBJECT(NSPrintFaxSendTime,@"NSPrintFaxSendTime"); ADD_id_OBJECT(NSPrintFaxTrimPageEnds,@"NSPrintFaxTrimPageEnds"); ADD_id_OBJECT(NSPrintFaxUseCoverSheet,@"NSPrintFaxUseCoverSheet"); ADD_id_OBJECT(NSPrintFirstPage,@"NSPrintFirstPage"); ADD_id_OBJECT(NSPrintHorizontalPagination,@"NSPrintHorizontalPagination"); ADD_id_OBJECT(NSPrintHorizontallyCentered,@"NSPrintHorizontallyCentered"); ADD_id_OBJECT(NSPrintJobDisposition,@"NSPrintJobDisposition"); ADD_id_OBJECT(NSPrintJobFeatures,@"NSPrintJobFeatures"); ADD_id_OBJECT(NSPrintLastPage,@"NSPrintLastPage"); ADD_id_OBJECT(NSPrintLeftMargin,@"NSPrintLeftMargin"); ADD_id_OBJECT(NSPrintManualFeed,@"NSPrintManualFeed"); ADD_id_OBJECT(NSPrintOrientation,@"NSPrintOrientation"); ADD_id_OBJECT(NSPrintPagesPerSheet,@"NSPrintPagesPerSheet"); ADD_id_OBJECT(NSPrintPaperFeed,@"NSPrintPaperFeed"); ADD_id_OBJECT(NSPrintPaperName,@"NSPrintPaperName"); ADD_id_OBJECT(NSPrintPaperSize,@"NSPrintPaperSize"); ADD_id_OBJECT(NSPrintPrinter,@"NSPrintPrinter"); ADD_id_OBJECT(NSPrintReversePageOrder,@"NSPrintReversePageOrder"); ADD_id_OBJECT(NSPrintRightMargin,@"NSPrintRightMargin"); ADD_id_OBJECT(NSPrintSavePath,@"NSPrintSavePath"); ADD_id_OBJECT(NSPrintScalingFactor,@"NSPrintScalingFactor"); ADD_id_OBJECT(NSPrintTopMargin,@"NSPrintTopMargin"); ADD_id_OBJECT(NSPrintVerticalPagination,@"NSPrintVerticalPagination"); ADD_id_OBJECT(NSPrintVerticallyCentered,@"NSPrintVerticallyCentered"); ADD_id_OBJECT(NSPrintCancelJob,@"NSPrintCancelJob"); ADD_id_OBJECT(NSPrintFaxJob,@"NSPrintFaxJob"); ADD_id_OBJECT(NSPrintPreviewJob,@"NSPrintPreviewJob"); ADD_id_OBJECT(NSPrintSaveJob,@"NSPrintSaveJob"); ADD_id_OBJECT(NSPrintSpoolJob,@"NSPrintSpoolJob"); ADD_id_OBJECT(NSOldSelectedCharacterRange,@"NSOldSelectedCharacterRange"); ADD_id_OBJECT(NSPlainFileType,@"NSPlainFileType"); ADD_id_OBJECT(NSDirectoryFileType,@"NSDirectoryFileType"); ADD_id_OBJECT(NSApplicationFileType,@"NSApplicationFileType"); ADD_id_OBJECT(NSFilesystemFileType,@"NSFilesystemFileType"); ADD_id_OBJECT(NSShellCommandFileType,@"NSShellCommandFileType"); ADD_id_OBJECT(NSWorkspaceCompressOperation,@"NSWorkspaceCompressOperation"); ADD_id_OBJECT(NSWorkspaceCopyOperation,@"NSWorkspaceCopyOperation"); ADD_id_OBJECT(NSWorkspaceDecompressOperation,@"NSWorkspaceDecompressOperation"); ADD_id_OBJECT(NSWorkspaceDecryptOperation,@"NSWorkspaceDecryptOperation"); ADD_id_OBJECT(NSWorkspaceDestroyOperation,@"NSWorkspaceDestroyOperation"); ADD_id_OBJECT(NSWorkspaceDuplicateOperation,@"NSWorkspaceDuplicateOperation"); ADD_id_OBJECT(NSWorkspaceEncryptOperation,@"NSWorkspaceEncryptOperation"); ADD_id_OBJECT(NSWorkspaceLinkOperation,@"NSWorkspaceLinkOperation"); ADD_id_OBJECT(NSWorkspaceMoveOperation,@"NSWorkspaceMoveOperation"); ADD_id_OBJECT(NSWorkspaceRecycleOperation,@"NSWorkspaceRecycleOperation"); ADD_int_OBJECT(NSRunStoppedResponse,@"NSRunStoppedResponse"); ADD_int_OBJECT(NSRunAbortedResponse,@"NSRunAbortedResponse"); ADD_int_OBJECT(NSRunContinuesResponse,@"NSRunContinuesResponse"); ADD_int_OBJECT(GSNoUnderlineStyle,@"GSNoUnderlineStyle"); ADD_int_OBJECT(NSSingleUnderlineStyle,@"NSSingleUnderlineStyle"); ADD_int_OBJECT(NSButtLineCapStyle,@"NSButtLineCapStyle"); ADD_int_OBJECT(NSRoundLineCapStyle,@"NSRoundLineCapStyle"); ADD_int_OBJECT(NSSquareLineCapStyle,@"NSSquareLineCapStyle"); ADD_int_OBJECT(NSMiterLineJoinStyle,@"NSMiterLineJoinStyle"); ADD_int_OBJECT(NSRoundLineJoinStyle,@"NSRoundLineJoinStyle"); ADD_int_OBJECT(NSBevelLineJoinStyle,@"NSBevelLineJoinStyle"); ADD_int_OBJECT(NSNonZeroWindingRule,@"NSNonZeroWindingRule"); ADD_int_OBJECT(NSEvenOddWindingRule,@"NSEvenOddWindingRule"); ADD_int_OBJECT(NSMoveToBezierPathElement,@"NSMoveToBezierPathElement"); ADD_int_OBJECT(NSLineToBezierPathElement,@"NSLineToBezierPathElement"); ADD_int_OBJECT(NSCurveToBezierPathElement,@"NSCurveToBezierPathElement"); ADD_int_OBJECT(NSClosePathBezierPathElement,@"NSClosePathBezierPathElement"); ADD_int_OBJECT(NSNoTitle,@"NSNoTitle"); ADD_int_OBJECT(NSAboveTop,@"NSAboveTop"); ADD_int_OBJECT(NSAtTop,@"NSAtTop"); ADD_int_OBJECT(NSBelowTop,@"NSBelowTop"); ADD_int_OBJECT(NSAboveBottom,@"NSAboveBottom"); ADD_int_OBJECT(NSAtBottom,@"NSAtBottom"); ADD_int_OBJECT(NSBelowBottom,@"NSBelowBottom"); ADD_int_OBJECT(NSTIFFCompressionNone,@"NSTIFFCompressionNone"); ADD_int_OBJECT(NSTIFFCompressionCCITTFAX3,@"NSTIFFCompressionCCITTFAX3"); ADD_int_OBJECT(NSTIFFCompressionCCITTFAX4,@"NSTIFFCompressionCCITTFAX4"); ADD_int_OBJECT(NSTIFFCompressionLZW,@"NSTIFFCompressionLZW"); ADD_int_OBJECT(NSTIFFCompressionJPEG,@"NSTIFFCompressionJPEG"); ADD_int_OBJECT(NSTIFFCompressionNEXT,@"NSTIFFCompressionNEXT"); ADD_int_OBJECT(NSTIFFCompressionPackBits,@"NSTIFFCompressionPackBits"); ADD_int_OBJECT(NSTIFFCompressionOldJPEG,@"NSTIFFCompressionOldJPEG"); ADD_int_OBJECT(NSTIFFFileType,@"NSTIFFFileType"); ADD_int_OBJECT(NSBMPFileType,@"NSBMPFileType"); ADD_int_OBJECT(NSGIFFileType,@"NSGIFFileType"); ADD_int_OBJECT(NSJPEGFileType,@"NSJPEGFileType"); ADD_int_OBJECT(NSPNGFileType,@"NSPNGFileType"); ADD_int_OBJECT(NSMomentaryPushButton,@"NSMomentaryPushButton"); ADD_int_OBJECT(NSPushOnPushOffButton,@"NSPushOnPushOffButton"); ADD_int_OBJECT(NSToggleButton,@"NSToggleButton"); ADD_int_OBJECT(NSSwitchButton,@"NSSwitchButton"); ADD_int_OBJECT(NSRadioButton,@"NSRadioButton"); ADD_int_OBJECT(NSMomentaryChangeButton,@"NSMomentaryChangeButton"); ADD_int_OBJECT(NSOnOffButton,@"NSOnOffButton"); ADD_int_OBJECT(NSMomentaryLight,@"NSMomentaryLight"); ADD_int_OBJECT(NSRoundedBezelStyle,@"NSRoundedBezelStyle"); ADD_int_OBJECT(NSRegularSquareBezelStyle,@"NSRegularSquareBezelStyle"); ADD_int_OBJECT(NSThickSquareBezelStyle,@"NSThickSquareBezelStyle"); ADD_int_OBJECT(NSThickerSquareBezelStyle,@"NSThickerSquareBezelStyle"); ADD_int_OBJECT(NSNeXTBezelStyle,@"NSNeXTBezelStyle"); ADD_int_OBJECT(NSPushButtonBezelStyle,@"NSPushButtonBezelStyle"); ADD_int_OBJECT(NSSmallIconButtonBezelStyle,@"NSSmallIconButtonBezelStyle"); ADD_int_OBJECT(NSMediumIconButtonBezelStyle,@"NSMediumIconButtonBezelStyle"); ADD_int_OBJECT(NSLargeIconButtonBezelStyle,@"NSLargeIconButtonBezelStyle"); ADD_int_OBJECT(NSGradientNone,@"NSGradientNone"); ADD_int_OBJECT(NSGradientConcaveWeak,@"NSGradientConcaveWeak"); ADD_int_OBJECT(NSGradientConcaveStrong,@"NSGradientConcaveStrong"); ADD_int_OBJECT(NSGradientConvexWeak,@"NSGradientConvexWeak"); ADD_int_OBJECT(NSGradientConvexStrong,@"NSGradientConvexStrong"); ADD_int_OBJECT(NSNullCellType,@"NSNullCellType"); ADD_int_OBJECT(NSTextCellType,@"NSTextCellType"); ADD_int_OBJECT(NSImageCellType,@"NSImageCellType"); ADD_int_OBJECT(NSAnyType,@"NSAnyType"); ADD_int_OBJECT(NSIntType,@"NSIntType"); ADD_int_OBJECT(NSPositiveIntType,@"NSPositiveIntType"); ADD_int_OBJECT(NSFloatType,@"NSFloatType"); ADD_int_OBJECT(NSPositiveFloatType,@"NSPositiveFloatType"); ADD_int_OBJECT(NSDateType,@"NSDateType"); ADD_int_OBJECT(NSDoubleType,@"NSDoubleType"); ADD_int_OBJECT(NSPositiveDoubleType,@"NSPositiveDoubleType"); ADD_int_OBJECT(NSNoImage,@"NSNoImage"); ADD_int_OBJECT(NSImageOnly,@"NSImageOnly"); ADD_int_OBJECT(NSImageLeft,@"NSImageLeft"); ADD_int_OBJECT(NSImageRight,@"NSImageRight"); ADD_int_OBJECT(NSImageBelow,@"NSImageBelow"); ADD_int_OBJECT(NSImageAbove,@"NSImageAbove"); ADD_int_OBJECT(NSImageOverlaps,@"NSImageOverlaps"); ADD_int_OBJECT(NSCellDisabled,@"NSCellDisabled"); ADD_int_OBJECT(NSCellState,@"NSCellState"); ADD_int_OBJECT(NSPushInCell,@"NSPushInCell"); ADD_int_OBJECT(NSCellEditable,@"NSCellEditable"); ADD_int_OBJECT(NSChangeGrayCell,@"NSChangeGrayCell"); ADD_int_OBJECT(NSCellHighlighted,@"NSCellHighlighted"); ADD_int_OBJECT(NSCellLightsByContents,@"NSCellLightsByContents"); ADD_int_OBJECT(NSCellLightsByGray,@"NSCellLightsByGray"); ADD_int_OBJECT(NSChangeBackgroundCell,@"NSChangeBackgroundCell"); ADD_int_OBJECT(NSCellLightsByBackground,@"NSCellLightsByBackground"); ADD_int_OBJECT(NSCellIsBordered,@"NSCellIsBordered"); ADD_int_OBJECT(NSCellHasOverlappingImage,@"NSCellHasOverlappingImage"); ADD_int_OBJECT(NSCellHasImageHorizontal,@"NSCellHasImageHorizontal"); ADD_int_OBJECT(NSCellHasImageOnLeftOrBottom,@"NSCellHasImageOnLeftOrBottom"); ADD_int_OBJECT(NSCellChangesContents,@"NSCellChangesContents"); ADD_int_OBJECT(NSCellIsInsetButton,@"NSCellIsInsetButton"); ADD_int_OBJECT(NSCellAllowsMixedState,@"NSCellAllowsMixedState"); ADD_int_OBJECT(NSNoCellMask,@"NSNoCellMask"); ADD_int_OBJECT(NSContentsCellMask,@"NSContentsCellMask"); ADD_int_OBJECT(NSPushInCellMask,@"NSPushInCellMask"); ADD_int_OBJECT(NSChangeGrayCellMask,@"NSChangeGrayCellMask"); ADD_int_OBJECT(NSChangeBackgroundCellMask,@"NSChangeBackgroundCellMask"); ADD_int_OBJECT(NSOffState,@"NSOffState"); ADD_int_OBJECT(NSOnState,@"NSOnState"); ADD_int_OBJECT(NSMixedState,@"NSMixedState"); ADD_int_OBJECT(NSDefaultControlTint,@"NSDefaultControlTint"); ADD_int_OBJECT(NSClearControlTint,@"NSClearControlTint"); ADD_int_OBJECT(NSGrayModeColorPanel,@"NSGrayModeColorPanel"); ADD_int_OBJECT(NSRGBModeColorPanel,@"NSRGBModeColorPanel"); ADD_int_OBJECT(NSCMYKModeColorPanel,@"NSCMYKModeColorPanel"); ADD_int_OBJECT(NSHSBModeColorPanel,@"NSHSBModeColorPanel"); ADD_int_OBJECT(NSCustomPaletteModeColorPanel,@"NSCustomPaletteModeColorPanel"); ADD_int_OBJECT(NSColorListModeColorPanel,@"NSColorListModeColorPanel"); ADD_int_OBJECT(NSWheelModeColorPanel,@"NSWheelModeColorPanel"); ADD_int_OBJECT(NSColorPanelGrayModeMask,@"NSColorPanelGrayModeMask"); ADD_int_OBJECT(NSColorPanelRGBModeMask,@"NSColorPanelRGBModeMask"); ADD_int_OBJECT(NSColorPanelCMYKModeMask,@"NSColorPanelCMYKModeMask"); ADD_int_OBJECT(NSColorPanelHSBModeMask,@"NSColorPanelHSBModeMask"); ADD_int_OBJECT(NSColorPanelCustomPaletteModeMask,@"NSColorPanelCustomPaletteModeMask"); ADD_int_OBJECT(NSColorPanelColorListModeMask,@"NSColorPanelColorListModeMask"); ADD_int_OBJECT(NSColorPanelWheelModeMask,@"NSColorPanelWheelModeMask"); ADD_int_OBJECT(NSColorPanelAllModesMask,@"NSColorPanelAllModesMask"); ADD_int_OBJECT(GSArrowCursor,@"GSArrowCursor"); ADD_int_OBJECT(GSIBeamCursor,@"GSIBeamCursor"); ADD_int_OBJECT(NSLinkInDestination,@"NSLinkInDestination"); ADD_int_OBJECT(NSLinkInSource,@"NSLinkInSource"); ADD_int_OBJECT(NSLinkBroken,@"NSLinkBroken"); ADD_int_OBJECT(NSUpdateContinuously,@"NSUpdateContinuously"); ADD_int_OBJECT(NSUpdateWhenSourceSaved,@"NSUpdateWhenSourceSaved"); ADD_int_OBJECT(NSUpdateManually,@"NSUpdateManually"); ADD_int_OBJECT(NSUpdateNever,@"NSUpdateNever"); ADD_int_OBJECT(NSChangeDone,@"NSChangeDone"); ADD_int_OBJECT(NSChangeUndone,@"NSChangeUndone"); ADD_int_OBJECT(NSChangeCleared,@"NSChangeCleared"); ADD_int_OBJECT(NSSaveOperation,@"NSSaveOperation"); ADD_int_OBJECT(NSSaveAsOperation,@"NSSaveAsOperation"); ADD_int_OBJECT(NSSaveToOperation,@"NSSaveToOperation"); ADD_int_OBJECT(NSDragOperationNone,@"NSDragOperationNone"); ADD_int_OBJECT(NSDragOperationCopy,@"NSDragOperationCopy"); ADD_int_OBJECT(NSDragOperationLink,@"NSDragOperationLink"); ADD_int_OBJECT(NSDragOperationGeneric,@"NSDragOperationGeneric"); ADD_int_OBJECT(NSDragOperationPrivate,@"NSDragOperationPrivate"); ADD_int_OBJECT(NSDragOperationAll,@"NSDragOperationAll"); ADD_int_OBJECT(NSControlGlyph,@"NSControlGlyph"); ADD_int_OBJECT(NSNullGlyph,@"NSNullGlyph"); ADD_int_OBJECT(NSGlyphBelow,@"NSGlyphBelow"); ADD_int_OBJECT(NSGlyphAbove,@"NSGlyphAbove"); ADD_int_OBJECT(NSOneByteGlyphPacking,@"NSOneByteGlyphPacking"); ADD_int_OBJECT(NSJapaneseEUCGlyphPacking,@"NSJapaneseEUCGlyphPacking"); ADD_int_OBJECT(NSAsciiWithDoubleByteEUCGlyphPacking,@"NSAsciiWithDoubleByteEUCGlyphPacking"); ADD_int_OBJECT(NSTwoByteGlyphPacking,@"NSTwoByteGlyphPacking"); ADD_int_OBJECT(NSFourByteGlyphPacking,@"NSFourByteGlyphPacking"); ADD_int_OBJECT(NSItalicFontMask,@"NSItalicFontMask"); ADD_int_OBJECT(NSUnitalicFontMask,@"NSUnitalicFontMask"); ADD_int_OBJECT(NSBoldFontMask,@"NSBoldFontMask"); ADD_int_OBJECT(NSUnboldFontMask,@"NSUnboldFontMask"); ADD_int_OBJECT(NSNarrowFontMask,@"NSNarrowFontMask"); ADD_int_OBJECT(NSExpandedFontMask,@"NSExpandedFontMask"); ADD_int_OBJECT(NSCondensedFontMask,@"NSCondensedFontMask"); ADD_int_OBJECT(NSSmallCapsFontMask,@"NSSmallCapsFontMask"); ADD_int_OBJECT(NSPosterFontMask,@"NSPosterFontMask"); ADD_int_OBJECT(NSCompressedFontMask,@"NSCompressedFontMask"); ADD_int_OBJECT(NSNonStandardCharacterSetFontMask,@"NSNonStandardCharacterSetFontMask"); ADD_int_OBJECT(NSFixedPitchFontMask,@"NSFixedPitchFontMask"); ADD_int_OBJECT(NSNoFontChangeAction,@"NSNoFontChangeAction"); ADD_int_OBJECT(NSViaPanelFontAction,@"NSViaPanelFontAction"); ADD_int_OBJECT(NSAddTraitFontAction,@"NSAddTraitFontAction"); ADD_int_OBJECT(NSRemoveTraitFontAction,@"NSRemoveTraitFontAction"); ADD_int_OBJECT(NSSizeUpFontAction,@"NSSizeUpFontAction"); ADD_int_OBJECT(NSSizeDownFontAction,@"NSSizeDownFontAction"); ADD_int_OBJECT(NSHeavierFontAction,@"NSHeavierFontAction"); ADD_int_OBJECT(NSLighterFontAction,@"NSLighterFontAction"); ADD_int_OBJECT(NSFPPreviewButton,@"NSFPPreviewButton"); ADD_int_OBJECT(NSFPRevertButton,@"NSFPRevertButton"); ADD_int_OBJECT(NSFPSetButton,@"NSFPSetButton"); ADD_int_OBJECT(NSFPPreviewField,@"NSFPPreviewField"); ADD_int_OBJECT(NSFPSizeField,@"NSFPSizeField"); ADD_int_OBJECT(NSFPSizeTitle,@"NSFPSizeTitle"); ADD_int_OBJECT(NSFPCurrentField,@"NSFPCurrentField"); ADD_int_OBJECT(NSFPFamilyBrowser,@"NSFPFamilyBrowser"); ADD_int_OBJECT(NSFPFaceBrowser,@"NSFPFaceBrowser"); ADD_int_OBJECT(NSFPSizeBrowser,@"NSFPSizeBrowser"); ADD_int_OBJECT(NSBackingStoreRetained,@"NSBackingStoreRetained"); ADD_int_OBJECT(NSBackingStoreNonretained,@"NSBackingStoreNonretained"); ADD_int_OBJECT(NSBackingStoreBuffered,@"NSBackingStoreBuffered"); ADD_int_OBJECT(NSCompositeClear,@"NSCompositeClear"); ADD_int_OBJECT(NSCompositeCopy,@"NSCompositeCopy"); ADD_int_OBJECT(NSCompositeSourceOver,@"NSCompositeSourceOver"); ADD_int_OBJECT(NSCompositeSourceIn,@"NSCompositeSourceIn"); ADD_int_OBJECT(NSCompositeSourceOut,@"NSCompositeSourceOut"); ADD_int_OBJECT(NSCompositeSourceAtop,@"NSCompositeSourceAtop"); ADD_int_OBJECT(NSCompositeDestinationOver,@"NSCompositeDestinationOver"); ADD_int_OBJECT(NSCompositeDestinationIn,@"NSCompositeDestinationIn"); ADD_int_OBJECT(NSCompositeDestinationOut,@"NSCompositeDestinationOut"); ADD_int_OBJECT(NSCompositeDestinationAtop,@"NSCompositeDestinationAtop"); ADD_int_OBJECT(NSCompositeXOR,@"NSCompositeXOR"); ADD_int_OBJECT(NSCompositePlusDarker,@"NSCompositePlusDarker"); ADD_int_OBJECT(NSCompositeHighlight,@"NSCompositeHighlight"); ADD_int_OBJECT(NSCompositePlusLighter,@"NSCompositePlusLighter"); ADD_int_OBJECT(NSWindowAbove,@"NSWindowAbove"); ADD_int_OBJECT(NSWindowBelow,@"NSWindowBelow"); ADD_int_OBJECT(NSWindowOut,@"NSWindowOut"); ADD_int_OBJECT(GSTitleBarKey,@"GSTitleBarKey"); ADD_int_OBJECT(GSTitleBarNormal,@"GSTitleBarNormal"); ADD_int_OBJECT(GSTitleBarMain,@"GSTitleBarMain"); ADD_int_OBJECT(NSScaleProportionally,@"NSScaleProportionally"); ADD_int_OBJECT(NSScaleToFit,@"NSScaleToFit"); ADD_int_OBJECT(NSScaleNone,@"NSScaleNone"); ADD_int_OBJECT(NSImageAlignCenter,@"NSImageAlignCenter"); ADD_int_OBJECT(NSImageAlignTop,@"NSImageAlignTop"); ADD_int_OBJECT(NSImageAlignTopLeft,@"NSImageAlignTopLeft"); ADD_int_OBJECT(NSImageAlignTopRight,@"NSImageAlignTopRight"); ADD_int_OBJECT(NSImageAlignLeft,@"NSImageAlignLeft"); ADD_int_OBJECT(NSImageAlignBottom,@"NSImageAlignBottom"); ADD_int_OBJECT(NSImageAlignBottomLeft,@"NSImageAlignBottomLeft"); ADD_int_OBJECT(NSImageAlignBottomRight,@"NSImageAlignBottomRight"); ADD_int_OBJECT(NSImageAlignRight,@"NSImageAlignRight"); ADD_int_OBJECT(NSImageFrameNone,@"NSImageFrameNone"); ADD_int_OBJECT(NSImageFramePhoto,@"NSImageFramePhoto"); ADD_int_OBJECT(NSImageFrameGrayBezel,@"NSImageFrameGrayBezel"); ADD_int_OBJECT(NSImageFrameGroove,@"NSImageFrameGroove"); ADD_int_OBJECT(NSImageFrameButton,@"NSImageFrameButton"); ADD_int_OBJECT(NSUtilityWindowMask,@"NSUtilityWindowMask"); ADD_int_OBJECT(NSDocModalWindowMask,@"NSDocModalWindowMask"); ADD_int_OBJECT(NSOKButton,@"NSOKButton"); ADD_int_OBJECT(NSCancelButton,@"NSCancelButton"); ADD_int_OBJECT(NSAlertDefaultReturn,@"NSAlertDefaultReturn"); ADD_int_OBJECT(NSAlertAlternateReturn,@"NSAlertAlternateReturn"); ADD_int_OBJECT(NSAlertOtherReturn,@"NSAlertOtherReturn"); ADD_int_OBJECT(NSAlertErrorReturn,@"NSAlertErrorReturn"); return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/AppKit/AppKitEvents.list0000644000175000000000000000542010132015537020506 0ustar gurkanroot# AppKit Events and Keys # int NSLeftMouseDown int NSLeftMouseUp int NSOtherMouseDown int NSOtherMouseUp int NSRightMouseDown int NSRightMouseUp int NSMouseMoved int NSLeftMouseDragged int NSOtherMouseDragged int NSRightMouseDragged int NSMouseEntered int NSMouseExited int NSKeyDown int NSKeyUp int NSFlagsChanged int NSAppKitDefined int NSSystemDefined int NSApplicationDefined int NSPeriodic int NSCursorUpdate int NSScrollWheel int NSBackspaceKey int NSCarriageReturnKey int NSDeleteKey int NSBacktabKey int NSUpArrowFunctionKey int NSDownArrowFunctionKey int NSLeftArrowFunctionKey int NSRightArrowFunctionKey int NSF1FunctionKey int NSF2FunctionKey int NSF3FunctionKey int NSF4FunctionKey int NSF5FunctionKey int NSF6FunctionKey int NSF7FunctionKey int NSF8FunctionKey int NSF9FunctionKey int NSF10FunctionKey int NSF11FunctionKey int NSF12FunctionKey int NSF13FunctionKey int NSF14FunctionKey int NSF15FunctionKey int NSF16FunctionKey int NSF17FunctionKey int NSF18FunctionKey int NSF19FunctionKey int NSF20FunctionKey int NSF21FunctionKey int NSF22FunctionKey int NSF23FunctionKey int NSF24FunctionKey int NSF25FunctionKey int NSF26FunctionKey int NSF27FunctionKey int NSF28FunctionKey int NSF29FunctionKey int NSF30FunctionKey int NSF31FunctionKey int NSF32FunctionKey int NSF33FunctionKey int NSF34FunctionKey int NSF35FunctionKey int NSInsertFunctionKey int NSDeleteFunctionKey int NSHomeFunctionKey int NSBeginFunctionKey int NSEndFunctionKey int NSPageUpFunctionKey int NSPageDownFunctionKey int NSPrintScreenFunctionKey int NSScrollLockFunctionKey int NSPauseFunctionKey int NSSysReqFunctionKey int NSBreakFunctionKey int NSResetFunctionKey int NSStopFunctionKey int NSMenuFunctionKey int NSUserFunctionKey int NSSystemFunctionKey int NSPrintFunctionKey int NSClearLineFunctionKey int NSClearDisplayFunctionKey int NSInsertLineFunctionKey int NSDeleteLineFunctionKey int NSInsertCharFunctionKey int NSDeleteCharFunctionKey int NSPrevFunctionKey int NSNextFunctionKey int NSSelectFunctionKey int NSExecuteFunctionKey int NSUndoFunctionKey int NSRedoFunctionKey int NSFindFunctionKey int NSHelpFunctionKey int NSModeSwitchFunctionKey int NSLeftMouseDownMask int NSLeftMouseUpMask int NSOtherMouseDownMask int NSOtherMouseUpMask int NSRightMouseDownMask int NSRightMouseUpMask int NSMouseMovedMask int NSLeftMouseDraggedMask int NSOtherMouseDraggedMask int NSRightMouseDraggedMask int NSMouseEnteredMask int NSMouseExitedMask int NSFlagsChangedMask int NSAppKitDefinedMask int NSSystemDefinedMask int NSApplicationDefinedMask int NSPeriodicMask int NSCursorUpdateMask int NSScrollWheelMask int NSAnyEventMask int NSAlphaShiftKeyMask int NSAlternateKeyMask int NSCommandKeyMask int NSControlKeyMask int NSFunctionKeyMask int NSHelpKeyMask int NSKeyDownMask int NSKeyUpMask int NSNumericPadKeyMask int NSShiftKeyMask steptalk-0.10.0/Modules/AppKit/AppKitEvents.m0000644000175000000000000002340010132015537017765 0ustar gurkanroot/** AppKitEvents.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import NSDictionary *STGetAppKitEvents(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) ADD_int_OBJECT(NSLeftMouseDown,@"NSLeftMouseDown"); ADD_int_OBJECT(NSLeftMouseUp,@"NSLeftMouseUp"); ADD_int_OBJECT(NSOtherMouseDown,@"NSOtherMouseDown"); ADD_int_OBJECT(NSOtherMouseUp,@"NSOtherMouseUp"); ADD_int_OBJECT(NSRightMouseDown,@"NSRightMouseDown"); ADD_int_OBJECT(NSRightMouseUp,@"NSRightMouseUp"); ADD_int_OBJECT(NSMouseMoved,@"NSMouseMoved"); ADD_int_OBJECT(NSLeftMouseDragged,@"NSLeftMouseDragged"); ADD_int_OBJECT(NSOtherMouseDragged,@"NSOtherMouseDragged"); ADD_int_OBJECT(NSRightMouseDragged,@"NSRightMouseDragged"); ADD_int_OBJECT(NSMouseEntered,@"NSMouseEntered"); ADD_int_OBJECT(NSMouseExited,@"NSMouseExited"); ADD_int_OBJECT(NSKeyDown,@"NSKeyDown"); ADD_int_OBJECT(NSKeyUp,@"NSKeyUp"); ADD_int_OBJECT(NSFlagsChanged,@"NSFlagsChanged"); ADD_int_OBJECT(NSAppKitDefined,@"NSAppKitDefined"); ADD_int_OBJECT(NSSystemDefined,@"NSSystemDefined"); ADD_int_OBJECT(NSApplicationDefined,@"NSApplicationDefined"); ADD_int_OBJECT(NSPeriodic,@"NSPeriodic"); ADD_int_OBJECT(NSCursorUpdate,@"NSCursorUpdate"); ADD_int_OBJECT(NSScrollWheel,@"NSScrollWheel"); ADD_int_OBJECT(NSBackspaceKey,@"NSBackspaceKey"); ADD_int_OBJECT(NSCarriageReturnKey,@"NSCarriageReturnKey"); ADD_int_OBJECT(NSDeleteKey,@"NSDeleteKey"); ADD_int_OBJECT(NSBacktabKey,@"NSBacktabKey"); ADD_int_OBJECT(NSUpArrowFunctionKey,@"NSUpArrowFunctionKey"); ADD_int_OBJECT(NSDownArrowFunctionKey,@"NSDownArrowFunctionKey"); ADD_int_OBJECT(NSLeftArrowFunctionKey,@"NSLeftArrowFunctionKey"); ADD_int_OBJECT(NSRightArrowFunctionKey,@"NSRightArrowFunctionKey"); ADD_int_OBJECT(NSF1FunctionKey,@"NSF1FunctionKey"); ADD_int_OBJECT(NSF2FunctionKey,@"NSF2FunctionKey"); ADD_int_OBJECT(NSF3FunctionKey,@"NSF3FunctionKey"); ADD_int_OBJECT(NSF4FunctionKey,@"NSF4FunctionKey"); ADD_int_OBJECT(NSF5FunctionKey,@"NSF5FunctionKey"); ADD_int_OBJECT(NSF6FunctionKey,@"NSF6FunctionKey"); ADD_int_OBJECT(NSF7FunctionKey,@"NSF7FunctionKey"); ADD_int_OBJECT(NSF8FunctionKey,@"NSF8FunctionKey"); ADD_int_OBJECT(NSF9FunctionKey,@"NSF9FunctionKey"); ADD_int_OBJECT(NSF10FunctionKey,@"NSF10FunctionKey"); ADD_int_OBJECT(NSF11FunctionKey,@"NSF11FunctionKey"); ADD_int_OBJECT(NSF12FunctionKey,@"NSF12FunctionKey"); ADD_int_OBJECT(NSF13FunctionKey,@"NSF13FunctionKey"); ADD_int_OBJECT(NSF14FunctionKey,@"NSF14FunctionKey"); ADD_int_OBJECT(NSF15FunctionKey,@"NSF15FunctionKey"); ADD_int_OBJECT(NSF16FunctionKey,@"NSF16FunctionKey"); ADD_int_OBJECT(NSF17FunctionKey,@"NSF17FunctionKey"); ADD_int_OBJECT(NSF18FunctionKey,@"NSF18FunctionKey"); ADD_int_OBJECT(NSF19FunctionKey,@"NSF19FunctionKey"); ADD_int_OBJECT(NSF20FunctionKey,@"NSF20FunctionKey"); ADD_int_OBJECT(NSF21FunctionKey,@"NSF21FunctionKey"); ADD_int_OBJECT(NSF22FunctionKey,@"NSF22FunctionKey"); ADD_int_OBJECT(NSF23FunctionKey,@"NSF23FunctionKey"); ADD_int_OBJECT(NSF24FunctionKey,@"NSF24FunctionKey"); ADD_int_OBJECT(NSF25FunctionKey,@"NSF25FunctionKey"); ADD_int_OBJECT(NSF26FunctionKey,@"NSF26FunctionKey"); ADD_int_OBJECT(NSF27FunctionKey,@"NSF27FunctionKey"); ADD_int_OBJECT(NSF28FunctionKey,@"NSF28FunctionKey"); ADD_int_OBJECT(NSF29FunctionKey,@"NSF29FunctionKey"); ADD_int_OBJECT(NSF30FunctionKey,@"NSF30FunctionKey"); ADD_int_OBJECT(NSF31FunctionKey,@"NSF31FunctionKey"); ADD_int_OBJECT(NSF32FunctionKey,@"NSF32FunctionKey"); ADD_int_OBJECT(NSF33FunctionKey,@"NSF33FunctionKey"); ADD_int_OBJECT(NSF34FunctionKey,@"NSF34FunctionKey"); ADD_int_OBJECT(NSF35FunctionKey,@"NSF35FunctionKey"); ADD_int_OBJECT(NSInsertFunctionKey,@"NSInsertFunctionKey"); ADD_int_OBJECT(NSDeleteFunctionKey,@"NSDeleteFunctionKey"); ADD_int_OBJECT(NSHomeFunctionKey,@"NSHomeFunctionKey"); ADD_int_OBJECT(NSBeginFunctionKey,@"NSBeginFunctionKey"); ADD_int_OBJECT(NSEndFunctionKey,@"NSEndFunctionKey"); ADD_int_OBJECT(NSPageUpFunctionKey,@"NSPageUpFunctionKey"); ADD_int_OBJECT(NSPageDownFunctionKey,@"NSPageDownFunctionKey"); ADD_int_OBJECT(NSPrintScreenFunctionKey,@"NSPrintScreenFunctionKey"); ADD_int_OBJECT(NSScrollLockFunctionKey,@"NSScrollLockFunctionKey"); ADD_int_OBJECT(NSPauseFunctionKey,@"NSPauseFunctionKey"); ADD_int_OBJECT(NSSysReqFunctionKey,@"NSSysReqFunctionKey"); ADD_int_OBJECT(NSBreakFunctionKey,@"NSBreakFunctionKey"); ADD_int_OBJECT(NSResetFunctionKey,@"NSResetFunctionKey"); ADD_int_OBJECT(NSStopFunctionKey,@"NSStopFunctionKey"); ADD_int_OBJECT(NSMenuFunctionKey,@"NSMenuFunctionKey"); ADD_int_OBJECT(NSUserFunctionKey,@"NSUserFunctionKey"); ADD_int_OBJECT(NSSystemFunctionKey,@"NSSystemFunctionKey"); ADD_int_OBJECT(NSPrintFunctionKey,@"NSPrintFunctionKey"); ADD_int_OBJECT(NSClearLineFunctionKey,@"NSClearLineFunctionKey"); ADD_int_OBJECT(NSClearDisplayFunctionKey,@"NSClearDisplayFunctionKey"); ADD_int_OBJECT(NSInsertLineFunctionKey,@"NSInsertLineFunctionKey"); ADD_int_OBJECT(NSDeleteLineFunctionKey,@"NSDeleteLineFunctionKey"); ADD_int_OBJECT(NSInsertCharFunctionKey,@"NSInsertCharFunctionKey"); ADD_int_OBJECT(NSDeleteCharFunctionKey,@"NSDeleteCharFunctionKey"); ADD_int_OBJECT(NSPrevFunctionKey,@"NSPrevFunctionKey"); ADD_int_OBJECT(NSNextFunctionKey,@"NSNextFunctionKey"); ADD_int_OBJECT(NSSelectFunctionKey,@"NSSelectFunctionKey"); ADD_int_OBJECT(NSExecuteFunctionKey,@"NSExecuteFunctionKey"); ADD_int_OBJECT(NSUndoFunctionKey,@"NSUndoFunctionKey"); ADD_int_OBJECT(NSRedoFunctionKey,@"NSRedoFunctionKey"); ADD_int_OBJECT(NSFindFunctionKey,@"NSFindFunctionKey"); ADD_int_OBJECT(NSHelpFunctionKey,@"NSHelpFunctionKey"); ADD_int_OBJECT(NSModeSwitchFunctionKey,@"NSModeSwitchFunctionKey"); ADD_int_OBJECT(NSLeftMouseDownMask,@"NSLeftMouseDownMask"); ADD_int_OBJECT(NSLeftMouseUpMask,@"NSLeftMouseUpMask"); ADD_int_OBJECT(NSOtherMouseDownMask,@"NSOtherMouseDownMask"); ADD_int_OBJECT(NSOtherMouseUpMask,@"NSOtherMouseUpMask"); ADD_int_OBJECT(NSRightMouseDownMask,@"NSRightMouseDownMask"); ADD_int_OBJECT(NSRightMouseUpMask,@"NSRightMouseUpMask"); ADD_int_OBJECT(NSMouseMovedMask,@"NSMouseMovedMask"); ADD_int_OBJECT(NSLeftMouseDraggedMask,@"NSLeftMouseDraggedMask"); ADD_int_OBJECT(NSOtherMouseDraggedMask,@"NSOtherMouseDraggedMask"); ADD_int_OBJECT(NSRightMouseDraggedMask,@"NSRightMouseDraggedMask"); ADD_int_OBJECT(NSMouseEnteredMask,@"NSMouseEnteredMask"); ADD_int_OBJECT(NSMouseExitedMask,@"NSMouseExitedMask"); ADD_int_OBJECT(NSFlagsChangedMask,@"NSFlagsChangedMask"); ADD_int_OBJECT(NSAppKitDefinedMask,@"NSAppKitDefinedMask"); ADD_int_OBJECT(NSSystemDefinedMask,@"NSSystemDefinedMask"); ADD_int_OBJECT(NSApplicationDefinedMask,@"NSApplicationDefinedMask"); ADD_int_OBJECT(NSPeriodicMask,@"NSPeriodicMask"); ADD_int_OBJECT(NSCursorUpdateMask,@"NSCursorUpdateMask"); ADD_int_OBJECT(NSScrollWheelMask,@"NSScrollWheelMask"); ADD_int_OBJECT(NSAnyEventMask,@"NSAnyEventMask"); ADD_int_OBJECT(NSAlphaShiftKeyMask,@"NSAlphaShiftKeyMask"); ADD_int_OBJECT(NSAlternateKeyMask,@"NSAlternateKeyMask"); ADD_int_OBJECT(NSCommandKeyMask,@"NSCommandKeyMask"); ADD_int_OBJECT(NSControlKeyMask,@"NSControlKeyMask"); ADD_int_OBJECT(NSFunctionKeyMask,@"NSFunctionKeyMask"); ADD_int_OBJECT(NSHelpKeyMask,@"NSHelpKeyMask"); ADD_int_OBJECT(NSKeyDownMask,@"NSKeyDownMask"); ADD_int_OBJECT(NSKeyUpMask,@"NSKeyUpMask"); ADD_int_OBJECT(NSNumericPadKeyMask,@"NSNumericPadKeyMask"); ADD_int_OBJECT(NSShiftKeyMask,@"NSShiftKeyMask"); return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/AppKit/AppKitExceptions.list0000644000175000000000000000213510132015537021363 0ustar gurkanroot# AppKit Exceptions id NSAbortModalException id NSAbortPrintingException id NSAppKitIgnoredException id NSAppKitVirtualMemoryException id NSBadBitmapParametersException id NSBadComparisonException id NSBadRTFColorTableException id NSBadRTFDirectiveException id NSBadRTFFontTableException id NSBadRTFStyleSheetException id NSBrowserIllegalDelegateException id NSColorListIOException id NSColorListNotEditableException id NSDraggingException id NSFontUnavailableException id NSIllegalSelectorException id NSImageCacheException id NSNibLoadingException id NSPPDIncludeNotFoundException id NSPPDIncludeStackOverflowException id NSPPDIncludeStackUnderflowException id NSPPDParseException id NSPasteboardCommunicationException id NSPrintOperationExistsException id NSPrintPackageException id NSPrintingCommunicationException id NSRTFPropertyStackOverflowException id NSTIFFException id NSTextLineTooLongException id NSTextNoSelectionException id NSTextReadException id NSTextWriteException id NSTypedStreamVersionException id NSWindowServerCommunicationException id NSWordTablesReadException id NSWordTablesWriteException steptalk-0.10.0/Modules/AppKit/AppKitExceptions.m0000644000175000000000000001206410132015537020646 0ustar gurkanroot/** AppKitExceptions.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import NSDictionary *STGetAppKitExceptions(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [numberClass methodForSelector:numberWithInt_sel]; numberWithFloat = [numberClass methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) ADD_id_OBJECT(NSAbortModalException,@"NSAbortModalException"); ADD_id_OBJECT(NSAbortPrintingException,@"NSAbortPrintingException"); ADD_id_OBJECT(NSAppKitIgnoredException,@"NSAppKitIgnoredException"); ADD_id_OBJECT(NSAppKitVirtualMemoryException,@"NSAppKitVirtualMemoryException"); ADD_id_OBJECT(NSBadBitmapParametersException,@"NSBadBitmapParametersException"); ADD_id_OBJECT(NSBadComparisonException,@"NSBadComparisonException"); ADD_id_OBJECT(NSBadRTFColorTableException,@"NSBadRTFColorTableException"); ADD_id_OBJECT(NSBadRTFDirectiveException,@"NSBadRTFDirectiveException"); ADD_id_OBJECT(NSBadRTFFontTableException,@"NSBadRTFFontTableException"); ADD_id_OBJECT(NSBadRTFStyleSheetException,@"NSBadRTFStyleSheetException"); ADD_id_OBJECT(NSBrowserIllegalDelegateException,@"NSBrowserIllegalDelegateException"); ADD_id_OBJECT(NSColorListIOException,@"NSColorListIOException"); ADD_id_OBJECT(NSColorListNotEditableException,@"NSColorListNotEditableException"); ADD_id_OBJECT(NSDraggingException,@"NSDraggingException"); ADD_id_OBJECT(NSFontUnavailableException,@"NSFontUnavailableException"); ADD_id_OBJECT(NSIllegalSelectorException,@"NSIllegalSelectorException"); ADD_id_OBJECT(NSImageCacheException,@"NSImageCacheException"); ADD_id_OBJECT(NSNibLoadingException,@"NSNibLoadingException"); ADD_id_OBJECT(NSPPDIncludeNotFoundException,@"NSPPDIncludeNotFoundException"); ADD_id_OBJECT(NSPPDIncludeStackOverflowException,@"NSPPDIncludeStackOverflowException"); ADD_id_OBJECT(NSPPDIncludeStackUnderflowException,@"NSPPDIncludeStackUnderflowException"); ADD_id_OBJECT(NSPPDParseException,@"NSPPDParseException"); ADD_id_OBJECT(NSPasteboardCommunicationException,@"NSPasteboardCommunicationException"); ADD_id_OBJECT(NSPrintOperationExistsException,@"NSPrintOperationExistsException"); ADD_id_OBJECT(NSPrintPackageException,@"NSPrintPackageException"); ADD_id_OBJECT(NSPrintingCommunicationException,@"NSPrintingCommunicationException"); ADD_id_OBJECT(NSRTFPropertyStackOverflowException,@"NSRTFPropertyStackOverflowException"); ADD_id_OBJECT(NSTIFFException,@"NSTIFFException"); ADD_id_OBJECT(NSTextLineTooLongException,@"NSTextLineTooLongException"); ADD_id_OBJECT(NSTextNoSelectionException,@"NSTextNoSelectionException"); ADD_id_OBJECT(NSTextReadException,@"NSTextReadException"); ADD_id_OBJECT(NSTextWriteException,@"NSTextWriteException"); ADD_id_OBJECT(NSTypedStreamVersionException,@"NSTypedStreamVersionException"); ADD_id_OBJECT(NSWindowServerCommunicationException,@"NSWindowServerCommunicationException"); ADD_id_OBJECT(NSWordTablesReadException,@"NSWordTablesReadException"); ADD_id_OBJECT(NSWordTablesWriteException,@"NSWordTablesWriteException"); return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/AppKit/AppKitNotifications.list0000644000175000000000000000474310132015537022062 0ustar gurkanroot# AppKit Notifications id NSColorListChangedNotification id NSColorPanelColorChangedNotification # id NSComboBoxWillPopUpNotification # id NSComboBoxWillDismissNotification # id NSComboBoxSelectionDidChangeNotification # id NSComboBoxSelectionIsChangingNotification id NSControlTextDidBeginEditingNotification id NSControlTextDidEndEditingNotification id NSControlTextDidChangeNotification id NSDrawerDidCloseNotification id NSDrawerDidOpenNotification id NSDrawerWillCloseNotification id NSDrawerWillOpenNotification id NSImageRepRegistryChangedNotification ################################################## # FIXME: Undefined symbols # # id NSOutlineViewColumnDidMoveNotification # id NSOutlineViewColumnDidResizeNotification # id NSOutlineViewSelectionDidChangeNotification # id NSOutlineViewSelectionIsChangingNotification # id NSOutlineViewItemDidExpandNotification # id NSOutlineViewItemDidCollapseNotification # ################################################## id NSPopUpButtonWillPopUpNotification id NSSplitViewDidResizeSubviewsNotification id NSSplitViewWillResizeSubviewsNotification id NSTableViewColumnDidMoveNotification id NSTableViewColumnDidResizeNotification id NSTableViewSelectionDidChangeNotification id NSTableViewSelectionIsChangingNotification id NSTextDidBeginEditingNotification id NSTextDidEndEditingNotification id NSTextDidChangeNotification id NSTextStorageWillProcessEditingNotification id NSTextStorageDidProcessEditingNotification id NSTextViewWillChangeNotifyingTextViewNotification id NSTextViewDidChangeSelectionNotification id NSViewFrameDidChangeNotification id NSViewBoundsDidChangeNotification id NSViewFocusDidChangeNotification id NSWindowDidBecomeKeyNotification id NSWindowDidBecomeMainNotification id NSWindowDidChangeScreenNotification id NSWindowDidDeminiaturizeNotification id NSWindowDidExposeNotification id NSWindowDidMiniaturizeNotification id NSWindowDidMoveNotification id NSWindowDidResignKeyNotification id NSWindowDidResignMainNotification id NSWindowDidResizeNotification id NSWindowDidUpdateNotification id NSWindowWillCloseNotification id NSWindowWillMiniaturizeNotification id NSWindowWillMoveNotification id NSWorkspaceDidLaunchApplicationNotification id NSWorkspaceDidMountNotification id NSWorkspaceDidPerformFileOperationNotification id NSWorkspaceDidTerminateApplicationNotification id NSWorkspaceDidUnmountNotification id NSWorkspaceWillLaunchApplicationNotification id NSWorkspaceWillPowerOffNotification id NSWorkspaceWillUnmountNotification steptalk-0.10.0/Modules/AppKit/AppKitNotifications.m0000644000175000000000000001556310132015537021345 0ustar gurkanroot/** AppKitNotifications.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import NSDictionary *STGetAppKitNotifications(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [numberClass methodForSelector:numberWithInt_sel]; numberWithFloat = [numberClass methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) ADD_id_OBJECT(NSColorListChangedNotification,@"NSColorListChangedNotification"); ADD_id_OBJECT(NSColorPanelColorChangedNotification,@"NSColorPanelColorChangedNotification"); ADD_id_OBJECT(NSControlTextDidBeginEditingNotification,@"NSControlTextDidBeginEditingNotification"); ADD_id_OBJECT(NSControlTextDidEndEditingNotification,@"NSControlTextDidEndEditingNotification"); ADD_id_OBJECT(NSControlTextDidChangeNotification,@"NSControlTextDidChangeNotification"); ADD_id_OBJECT(NSDrawerDidCloseNotification,@"NSDrawerDidCloseNotification"); ADD_id_OBJECT(NSDrawerDidOpenNotification,@"NSDrawerDidOpenNotification"); ADD_id_OBJECT(NSDrawerWillCloseNotification,@"NSDrawerWillCloseNotification"); ADD_id_OBJECT(NSDrawerWillOpenNotification,@"NSDrawerWillOpenNotification"); ADD_id_OBJECT(NSImageRepRegistryChangedNotification,@"NSImageRepRegistryChangedNotification"); ADD_id_OBJECT(NSPopUpButtonWillPopUpNotification,@"NSPopUpButtonWillPopUpNotification"); ADD_id_OBJECT(NSSplitViewDidResizeSubviewsNotification,@"NSSplitViewDidResizeSubviewsNotification"); ADD_id_OBJECT(NSSplitViewWillResizeSubviewsNotification,@"NSSplitViewWillResizeSubviewsNotification"); ADD_id_OBJECT(NSTableViewColumnDidMoveNotification,@"NSTableViewColumnDidMoveNotification"); ADD_id_OBJECT(NSTableViewColumnDidResizeNotification,@"NSTableViewColumnDidResizeNotification"); ADD_id_OBJECT(NSTableViewSelectionDidChangeNotification,@"NSTableViewSelectionDidChangeNotification"); ADD_id_OBJECT(NSTableViewSelectionIsChangingNotification,@"NSTableViewSelectionIsChangingNotification"); ADD_id_OBJECT(NSTextDidBeginEditingNotification,@"NSTextDidBeginEditingNotification"); ADD_id_OBJECT(NSTextDidEndEditingNotification,@"NSTextDidEndEditingNotification"); ADD_id_OBJECT(NSTextDidChangeNotification,@"NSTextDidChangeNotification"); ADD_id_OBJECT(NSTextStorageWillProcessEditingNotification,@"NSTextStorageWillProcessEditingNotification"); ADD_id_OBJECT(NSTextStorageDidProcessEditingNotification,@"NSTextStorageDidProcessEditingNotification"); ADD_id_OBJECT(NSTextViewWillChangeNotifyingTextViewNotification,@"NSTextViewWillChangeNotifyingTextViewNotification"); ADD_id_OBJECT(NSTextViewDidChangeSelectionNotification,@"NSTextViewDidChangeSelectionNotification"); ADD_id_OBJECT(NSViewFrameDidChangeNotification,@"NSViewFrameDidChangeNotification"); ADD_id_OBJECT(NSViewBoundsDidChangeNotification,@"NSViewBoundsDidChangeNotification"); ADD_id_OBJECT(NSViewFocusDidChangeNotification,@"NSViewFocusDidChangeNotification"); ADD_id_OBJECT(NSWindowDidBecomeKeyNotification,@"NSWindowDidBecomeKeyNotification"); ADD_id_OBJECT(NSWindowDidBecomeMainNotification,@"NSWindowDidBecomeMainNotification"); ADD_id_OBJECT(NSWindowDidChangeScreenNotification,@"NSWindowDidChangeScreenNotification"); ADD_id_OBJECT(NSWindowDidDeminiaturizeNotification,@"NSWindowDidDeminiaturizeNotification"); ADD_id_OBJECT(NSWindowDidExposeNotification,@"NSWindowDidExposeNotification"); ADD_id_OBJECT(NSWindowDidMiniaturizeNotification,@"NSWindowDidMiniaturizeNotification"); ADD_id_OBJECT(NSWindowDidMoveNotification,@"NSWindowDidMoveNotification"); ADD_id_OBJECT(NSWindowDidResignKeyNotification,@"NSWindowDidResignKeyNotification"); ADD_id_OBJECT(NSWindowDidResignMainNotification,@"NSWindowDidResignMainNotification"); ADD_id_OBJECT(NSWindowDidResizeNotification,@"NSWindowDidResizeNotification"); ADD_id_OBJECT(NSWindowDidUpdateNotification,@"NSWindowDidUpdateNotification"); ADD_id_OBJECT(NSWindowWillCloseNotification,@"NSWindowWillCloseNotification"); ADD_id_OBJECT(NSWindowWillMiniaturizeNotification,@"NSWindowWillMiniaturizeNotification"); ADD_id_OBJECT(NSWindowWillMoveNotification,@"NSWindowWillMoveNotification"); ADD_id_OBJECT(NSWorkspaceDidLaunchApplicationNotification,@"NSWorkspaceDidLaunchApplicationNotification"); ADD_id_OBJECT(NSWorkspaceDidMountNotification,@"NSWorkspaceDidMountNotification"); ADD_id_OBJECT(NSWorkspaceDidPerformFileOperationNotification,@"NSWorkspaceDidPerformFileOperationNotification"); ADD_id_OBJECT(NSWorkspaceDidTerminateApplicationNotification,@"NSWorkspaceDidTerminateApplicationNotification"); ADD_id_OBJECT(NSWorkspaceDidUnmountNotification,@"NSWorkspaceDidUnmountNotification"); ADD_id_OBJECT(NSWorkspaceWillLaunchApplicationNotification,@"NSWorkspaceWillLaunchApplicationNotification"); ADD_id_OBJECT(NSWorkspaceWillPowerOffNotification,@"NSWorkspaceWillPowerOffNotification"); ADD_id_OBJECT(NSWorkspaceWillUnmountNotification,@"NSWorkspaceWillUnmountNotification"); return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/AppKit/Functions.h0000644000175000000000000000256710132015537017366 0ustar gurkanroot/** Functions.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 14 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @class NSDictionary; @class NSString; #define _STCreateConstantsDictionaryForType(t, v, n, c) \ _ST_##t##_namesDictionary(v, n, c); #define function_header(type) \ NSDictionary *_ST_##type##_namesDictionary(type *vals, \ NSString **names, \ int count) function_header(int); function_header(float); function_header(id); steptalk-0.10.0/Modules/AppKit/Functions.m0000644000175000000000000000377510132015537017375 0ustar gurkanroot/** Functions.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 14 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #define function_template(type, class, selector) \ NSDictionary *_ST_##type##_namesDictionary(type *vals, \ NSString **names, \ int count) \ { \ NSMutableDictionary *dict = [NSMutableDictionary dictionary]; \ \ for(i = 0; i $@; \ cat $< | awk -f create_constants.awk >> $@;\ cat footer.m >> $@; ) steptalk-0.10.0/Modules/AppKit/NSApplication+additions.h0000644000175000000000000000357210132015537022071 0ustar gurkanroot/** NSApplication additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface NSApplication(STAdditions) - (int)runAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton; - (int)runCriticalAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton; - (int)runInformationalAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton; @end steptalk-0.10.0/Modules/AppKit/NSApplication+additions.m0000644000175000000000000000444510132015537022076 0ustar gurkanroot/** NSApplication additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 15 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "NSApplication+additions.h" #import @implementation NSApplication(STAdditions) - (int)runAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton { return NSRunAlertPanel(title, message, defaultButton, alternateButton, otherButton); } - (int)runCriticalAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton { return NSRunCriticalAlertPanel(title, message, defaultButton, alternateButton, otherButton); } - (int)runInformationalAlertPanelWithTitle:(NSString *)title message:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton { return NSRunInformationalAlertPanel(title, message, defaultButton, alternateButton, otherButton); } @end steptalk-0.10.0/Modules/AppKit/STAppKitModule.h0000644000175000000000000000202610132015537020211 0ustar gurkanroot/** STAppKitModule.h AppKit bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 16 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STAppKitModule:NSObject { } @end steptalk-0.10.0/Modules/AppKit/STAppKitModule.m0000644000175000000000000000344210132015537020221 0ustar gurkanroot/** STAppKitModule.m AppKit bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 16 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STAppKitModule.h" #import #import #import @class NSApplication; extern NSDictionary *STGetAppKitConstants(); extern NSDictionary *STGetAppKitNotifications(); extern NSDictionary *STGetAppKitExceptions(); extern NSDictionary *STGetAppKitEvents(); @implementation STAppKitModule + (void)initialize { [NSApplication sharedApplication]; } + (NSDictionary *)namedObjectsForScripting { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict addEntriesFromDictionary:STGetAppKitConstants()]; [dict addEntriesFromDictionary:STGetAppKitNotifications()]; [dict addEntriesFromDictionary:STGetAppKitExceptions()]; [dict addEntriesFromDictionary:STGetAppKitEvents()]; return [NSDictionary dictionaryWithDictionary:dict]; } @end steptalk-0.10.0/Modules/AppKit/ScriptingInfo.plist0000644000175000000000000000602010132015537021064 0ustar gurkanroot{ ScriptingInfoClass = STAppKitModule; Classes = ( NSActionCell, NSAffineTransform, NSApplication, NSAttributedString, NSBezierPath, NSBitmapImageRep, NSBox, NSBrowser, NSBrowserCell, NSBundle, NSButton, NSButtonCell, NSCachedImageRep, NSCell, NSClipView, NSCoder, NSColor, NSColorList, NSColorPanel, NSColorPicker, NSColorWell, NSComboBox, NSComboBoxCell, NSControl, NSCursor, NSCustomImageRep, NSDataLink, NSDataLinkManager, NSDataLinkPanel, NSDocument, NSDocumentController, NSDrawer, NSEPSImageRep, NSEvent, NSFileWrapper, NSFont, NSFontManager, NSFontPanel, NSForm, NSFormCell, NSGraphicsContext, NSHelpManager, NSHelpPanel, NSImage, NSImageCell, NSImageRep, NSImageView, NSInputManager, NSInputServer, NSLayoutManager, NSMatrix, NSMenu, NSMenuItem, NSMenuItemCell, NSMenuView, NSMutableAttributedString, NSMutableParagraphStyle, NSNib, NSNibConnector, NSNibControlConnector, NSNibOutletConnector, NSOpenPanel, NSOutlineView, NSPageLayout, NSPanel, NSParagraphStyle, NSPasteboard, NSPopUpButton, NSPopUpButtonCell, NSPrintInfo, NSPrintOperation, NSPrintPanel, NSPrinter, NSProgressIndicator, NSResponder, NSRulerMarker, NSRulerView, NSSavePanel, NSScreen, NSScrollView, NSScroller, NSSecureTextField, NSSecureTextFieldCell, NSSelection, /* NSSimpleHorizontalTypesetter,*/ NSSlider, NSSliderCell, NSSound, NSSpellChecker, NSSpellServer, NSSplitView, NSStepper, NSStepperCell, NSString, NSTabView, NSTabViewItem, NSTableColumn, NSTableHeaderCell, NSTableHeaderView, NSTableView, NSText, NSTextAttachment, NSTextAttachmentCell, NSTextContainer, NSTextField, NSTextFieldCell, NSTextStorage, NSTextTab, NSTextView, /* NSTypesetter,*/ NSView, NSWindow, NSWindowController, NSWorkspace /* GMArchiver, GMModel, GMUnarchiver, GSCustomView, GSFontEnumerator, GSFontInfo, GSHbox, GSHelpManagerPanel, GSInfoPanel, GSNibContainer, GSNibItem, GSServicesManager, GSTable, GSTrackingRect, GSVbox, IMConnector, IMControlConnector, IMCustomObject, IMCustomView, IMOutletConnector, */ ); } steptalk-0.10.0/Modules/AppKit/create_constants.awk0000644000175000000000000000017110132015537021275 0ustar gurkanroot($0 !~ /^[\t ]*#.*$/) && ($0 !~ /^[\t ]*$/) && (NF == 2) { printf " ADD_%s_OBJECT(%s,@\"%s\");\n", $1, $2, $2 } steptalk-0.10.0/Modules/AppKit/footer.m0000644000175000000000000000005510132015537016707 0ustar gurkanroot return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/AppKit/header.m0000644000175000000000000000437510132015537016652 0ustar gurkanroot/** @@NAME@@.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import NSDictionary *STGet@@NAME@@(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) steptalk-0.10.0/Modules/CommonEnvironment/0000775000175000000000000000000010132015542017516 5ustar gurkanrootsteptalk-0.10.0/Modules/CommonEnvironment/some.m0000644000175000000000000000163510132015542020642 0ustar gurkanrootObjects: FileManager - NSFileManager defaultManager NotificationCenter - NSNotificationCenter defaultCenter DistributedNotificationCenter - NSDistributedNotificationCenter defaultCenter CurrentHost - NSHost currentHost UserDefaults CurrentDate - active object UserName HomeDirectory TemporaryDirectory Application ColorPanel FontManager FontPanel InputManager OpenPanel GeneralPasteboard FontPasteboard RulerPasteboard FindPasteboard DragPasteboard PrintPanel Screen - NSScreen mainScreen Screens - NSScreen screens Workspace - NSWorkspace sharedWorkspace Application mainWindow keyWindow firstResponder keyView selectedText ScriptControllerClass/environment resetObjectsForBundle: resetObject: name - read it from bundle Localizer - localizedString: steptalk-0.10.0/Modules/Foundation/0000775000175000000000000000000010365363565016172 5ustar gurkanrootsteptalk-0.10.0/Modules/Foundation/.cvsignore0000644000175000000000000000010510132015540020137 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Modules/Foundation/FoundationConstants.list0000644000175000000000000000773510132015540023057 0ustar gurkanroot# Objective-C constants int NO int YES # Foundation constants NSPoint NSZeroPoint NSSize NSZeroSize NSRect NSZeroRect int NSOrderedAscending int NSOrderedSame int NSOrderedDescending int NSNotFound int NSMinXEdge int NSMinYEdge int NSMaxXEdge int NSMaxYEdge int NS_UnknownByteOrder int NS_LittleEndian int NS_BigEndian int NSOpenStepUnicodeReservedBase int NSCaseInsensitiveSearch int NSLiteralSearch int NSBackwardsSearch int NSAnchoredSearch # Language defs keys id NSAMPMDesignation id NSCurrencyString id NSCurrencySymbol id NSDateFormatString id NSDateTimeOrdering id NSDecimalDigits id NSDecimalSeparator id NSEarlierTimeDesignations id NSHourNameDesignations id NSInternationalCurrencyString id NSLaterTimeDesignations id NSMonthNameArray id NSNextDayDesignations id NSNextNextDayDesignations id NSPriorDayDesignations id NSShortMonthNameArray id NSShortTimeDateFormatString id NSShortWeekDayNameArray id NSThisDayDesignations id NSThousandsSeparator id NSTimeDateFormatString id NSTimeFormatString id NSWeekDayNameArray id NSYearMonthWeekDesignations # File / File System attributes id NSFileDeviceIdentifier id NSFileGroupOwnerAccountID id NSFileModificationDate id NSFileOwnerAccountID id NSFilePosixPermissions id NSFileReferenceCount id NSFileSize id NSFileSystemFileNumber id NSFileSystemNumber id NSFileType id NSFileTypeBlockSpecial id NSFileTypeCharacterSpecial id NSFileTypeDirectory id NSFileTypeRegular id NSFileTypeSocket id NSFileTypeSymbolicLink id NSFileTypeUnknown id NSFileSystemSize id NSFileSystemFreeSize id NSFileSystemNodes id NSFileSystemFreeNodes # ObjC types # FIXME: It seeems, that they are not defined anywhere # int NSObjCNoType # int NSObjCVoidType # int NSObjCCharType # int NSObjCShortType # int NSObjCLongType # int NSObjCLonglongType # int NSObjCFloatType # int NSObjCDoubleType # int NSObjCSelectorType # int NSObjCObjectType # int NSObjCStructType # int NSObjCPointerType # int NSObjCStringType # int NSObjCArrayType # int NSObjCUnionType # int NSObjCBitfield # String encodings int NSASCIIStringEncoding int NSISO2022JPStringEncoding int NSISOLatin1StringEncoding int NSISOLatin2StringEncoding int NSJapaneseEUCStringEncoding int NSNEXTSTEPStringEncoding int NSNonLossyASCIIStringEncoding int NSShiftJISStringEncoding int NSSymbolStringEncoding int NSUTF8StringEncoding int NSUnicodeStringEncoding int NSWindowsCP1250StringEncoding int NSWindowsCP1251StringEncoding int NSWindowsCP1252StringEncoding int NSWindowsCP1253StringEncoding int NSWindowsCP1254StringEncoding # Exception names id NSInconsistentArchiveException # id NSByteStoreLockedException # id NSByteStoreVersionException # id NSBTreeStoreKeyTooLargeException # id NSByteStoreDamagedException # id NSPosixFileOperationException id NSCharacterConversionException # id NSDestinationInvalidException id NSGenericException id NSInternalInconsistencyException id NSInvalidArgumentException # id NSInvalidReceivePort # id NSInvalidReceivePortException # id NSInvalidSendPort # id NSInvalidSendPortException id NSMallocException # id NSObjectInaccessibleException # id NSObjectNotAvailableException # id NSOldStyleException # id NSPortReceiveError # id NSPortReceiveException # id NSPortSendError # id NSPortSendException id NSPortTimeoutException id NSRangeException id NSFailedAuthenticationException # Notification names # id NSBundleLoaded id NSConnectionDidDieNotification id NSPortDidBecomeInvalidNotification # id NSPPLDidBecomeDirtyNotification # id NSPPLDidSaveNotification id NSBecomingMultiThreaded id NSThreadExiting id NSGlobalDomain id NSArgumentDomain id NSRegistrationDomain int NSApplicationDirectory int NSDemoApplicationDirectory int NSDeveloperApplicationDirectory int NSAdminApplicationDirectory int NSLibraryDirectory int NSDeveloperDirectory int NSUserDirectory int NSDocumentationDirectory int NSAllApplicationsDirectory int NSAllLibrariesDirectory int GSLibrariesDirectory int GSToolsDirectory int NSUserDomainMask int NSLocalDomainMask int NSNetworkDomainMask int NSSystemDomainMask int NSAllDomainsMask steptalk-0.10.0/Modules/Foundation/FoundationConstants.m0000644000175000000000000002444110132015540022331 0ustar gurkanroot/** FoundationConstants.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import NSDictionary *STGetFoundationConstants(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) #define ADD_NSPoint_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithPoint:obj], \ name) #define ADD_NSRange_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRange:obj], \ name) #define ADD_NSSize_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithSize:obj], \ name) #define ADD_NSRect_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRect:obj], \ name) ADD_int_OBJECT(NO,@"NO"); ADD_int_OBJECT(YES,@"YES"); ADD_NSPoint_OBJECT(NSZeroPoint,@"NSZeroPoint"); ADD_NSSize_OBJECT(NSZeroSize,@"NSZeroSize"); ADD_NSRect_OBJECT(NSZeroRect,@"NSZeroRect"); ADD_int_OBJECT(NSOrderedAscending,@"NSOrderedAscending"); ADD_int_OBJECT(NSOrderedSame,@"NSOrderedSame"); ADD_int_OBJECT(NSOrderedDescending,@"NSOrderedDescending"); ADD_int_OBJECT(NSNotFound,@"NSNotFound"); ADD_int_OBJECT(NSMinXEdge,@"NSMinXEdge"); ADD_int_OBJECT(NSMinYEdge,@"NSMinYEdge"); ADD_int_OBJECT(NSMaxXEdge,@"NSMaxXEdge"); ADD_int_OBJECT(NSMaxYEdge,@"NSMaxYEdge"); ADD_int_OBJECT(NS_UnknownByteOrder,@"NS_UnknownByteOrder"); ADD_int_OBJECT(NS_LittleEndian,@"NS_LittleEndian"); ADD_int_OBJECT(NS_BigEndian,@"NS_BigEndian"); ADD_int_OBJECT(NSOpenStepUnicodeReservedBase,@"NSOpenStepUnicodeReservedBase"); ADD_int_OBJECT(NSCaseInsensitiveSearch,@"NSCaseInsensitiveSearch"); ADD_int_OBJECT(NSLiteralSearch,@"NSLiteralSearch"); ADD_int_OBJECT(NSBackwardsSearch,@"NSBackwardsSearch"); ADD_int_OBJECT(NSAnchoredSearch,@"NSAnchoredSearch"); ADD_id_OBJECT(NSAMPMDesignation,@"NSAMPMDesignation"); ADD_id_OBJECT(NSCurrencyString,@"NSCurrencyString"); ADD_id_OBJECT(NSCurrencySymbol,@"NSCurrencySymbol"); ADD_id_OBJECT(NSDateFormatString,@"NSDateFormatString"); ADD_id_OBJECT(NSDateTimeOrdering,@"NSDateTimeOrdering"); ADD_id_OBJECT(NSDecimalDigits,@"NSDecimalDigits"); ADD_id_OBJECT(NSDecimalSeparator,@"NSDecimalSeparator"); ADD_id_OBJECT(NSEarlierTimeDesignations,@"NSEarlierTimeDesignations"); ADD_id_OBJECT(NSHourNameDesignations,@"NSHourNameDesignations"); ADD_id_OBJECT(NSInternationalCurrencyString,@"NSInternationalCurrencyString"); ADD_id_OBJECT(NSLaterTimeDesignations,@"NSLaterTimeDesignations"); ADD_id_OBJECT(NSMonthNameArray,@"NSMonthNameArray"); ADD_id_OBJECT(NSNextDayDesignations,@"NSNextDayDesignations"); ADD_id_OBJECT(NSNextNextDayDesignations,@"NSNextNextDayDesignations"); ADD_id_OBJECT(NSPriorDayDesignations,@"NSPriorDayDesignations"); ADD_id_OBJECT(NSShortMonthNameArray,@"NSShortMonthNameArray"); ADD_id_OBJECT(NSShortTimeDateFormatString,@"NSShortTimeDateFormatString"); ADD_id_OBJECT(NSShortWeekDayNameArray,@"NSShortWeekDayNameArray"); ADD_id_OBJECT(NSThisDayDesignations,@"NSThisDayDesignations"); ADD_id_OBJECT(NSThousandsSeparator,@"NSThousandsSeparator"); ADD_id_OBJECT(NSTimeDateFormatString,@"NSTimeDateFormatString"); ADD_id_OBJECT(NSTimeFormatString,@"NSTimeFormatString"); ADD_id_OBJECT(NSWeekDayNameArray,@"NSWeekDayNameArray"); ADD_id_OBJECT(NSYearMonthWeekDesignations,@"NSYearMonthWeekDesignations"); ADD_id_OBJECT(NSFileDeviceIdentifier,@"NSFileDeviceIdentifier"); ADD_id_OBJECT(NSFileGroupOwnerAccountID,@"NSFileGroupOwnerAccountID"); ADD_id_OBJECT(NSFileModificationDate,@"NSFileModificationDate"); ADD_id_OBJECT(NSFileOwnerAccountID,@"NSFileOwnerAccountID"); ADD_id_OBJECT(NSFilePosixPermissions,@"NSFilePosixPermissions"); ADD_id_OBJECT(NSFileReferenceCount,@"NSFileReferenceCount"); ADD_id_OBJECT(NSFileSize,@"NSFileSize"); ADD_id_OBJECT(NSFileSystemFileNumber,@"NSFileSystemFileNumber"); ADD_id_OBJECT(NSFileSystemNumber,@"NSFileSystemNumber"); ADD_id_OBJECT(NSFileType,@"NSFileType"); ADD_id_OBJECT(NSFileTypeBlockSpecial,@"NSFileTypeBlockSpecial"); ADD_id_OBJECT(NSFileTypeCharacterSpecial,@"NSFileTypeCharacterSpecial"); ADD_id_OBJECT(NSFileTypeDirectory,@"NSFileTypeDirectory"); ADD_id_OBJECT(NSFileTypeRegular,@"NSFileTypeRegular"); ADD_id_OBJECT(NSFileTypeSocket,@"NSFileTypeSocket"); ADD_id_OBJECT(NSFileTypeSymbolicLink,@"NSFileTypeSymbolicLink"); ADD_id_OBJECT(NSFileTypeUnknown,@"NSFileTypeUnknown"); ADD_id_OBJECT(NSFileSystemSize,@"NSFileSystemSize"); ADD_id_OBJECT(NSFileSystemFreeSize,@"NSFileSystemFreeSize"); ADD_id_OBJECT(NSFileSystemNodes,@"NSFileSystemNodes"); ADD_id_OBJECT(NSFileSystemFreeNodes,@"NSFileSystemFreeNodes"); ADD_int_OBJECT(NSASCIIStringEncoding,@"NSASCIIStringEncoding"); ADD_int_OBJECT(NSISO2022JPStringEncoding,@"NSISO2022JPStringEncoding"); ADD_int_OBJECT(NSISOLatin1StringEncoding,@"NSISOLatin1StringEncoding"); ADD_int_OBJECT(NSISOLatin2StringEncoding,@"NSISOLatin2StringEncoding"); ADD_int_OBJECT(NSJapaneseEUCStringEncoding,@"NSJapaneseEUCStringEncoding"); ADD_int_OBJECT(NSNEXTSTEPStringEncoding,@"NSNEXTSTEPStringEncoding"); ADD_int_OBJECT(NSNonLossyASCIIStringEncoding,@"NSNonLossyASCIIStringEncoding"); ADD_int_OBJECT(NSShiftJISStringEncoding,@"NSShiftJISStringEncoding"); ADD_int_OBJECT(NSSymbolStringEncoding,@"NSSymbolStringEncoding"); ADD_int_OBJECT(NSUTF8StringEncoding,@"NSUTF8StringEncoding"); ADD_int_OBJECT(NSUnicodeStringEncoding,@"NSUnicodeStringEncoding"); ADD_int_OBJECT(NSWindowsCP1250StringEncoding,@"NSWindowsCP1250StringEncoding"); ADD_int_OBJECT(NSWindowsCP1251StringEncoding,@"NSWindowsCP1251StringEncoding"); ADD_int_OBJECT(NSWindowsCP1252StringEncoding,@"NSWindowsCP1252StringEncoding"); ADD_int_OBJECT(NSWindowsCP1253StringEncoding,@"NSWindowsCP1253StringEncoding"); ADD_int_OBJECT(NSWindowsCP1254StringEncoding,@"NSWindowsCP1254StringEncoding"); ADD_id_OBJECT(NSInconsistentArchiveException,@"NSInconsistentArchiveException"); ADD_id_OBJECT(NSCharacterConversionException,@"NSCharacterConversionException"); ADD_id_OBJECT(NSGenericException,@"NSGenericException"); ADD_id_OBJECT(NSInternalInconsistencyException,@"NSInternalInconsistencyException"); ADD_id_OBJECT(NSInvalidArgumentException,@"NSInvalidArgumentException"); ADD_id_OBJECT(NSMallocException,@"NSMallocException"); ADD_id_OBJECT(NSPortTimeoutException,@"NSPortTimeoutException"); ADD_id_OBJECT(NSRangeException,@"NSRangeException"); ADD_id_OBJECT(NSFailedAuthenticationException,@"NSFailedAuthenticationException"); ADD_id_OBJECT(NSConnectionDidDieNotification,@"NSConnectionDidDieNotification"); ADD_id_OBJECT(NSPortDidBecomeInvalidNotification,@"NSPortDidBecomeInvalidNotification"); ADD_id_OBJECT(NSBecomingMultiThreaded,@"NSBecomingMultiThreaded"); ADD_id_OBJECT(NSThreadExiting,@"NSThreadExiting"); ADD_id_OBJECT(NSGlobalDomain,@"NSGlobalDomain"); ADD_id_OBJECT(NSArgumentDomain,@"NSArgumentDomain"); ADD_id_OBJECT(NSRegistrationDomain,@"NSRegistrationDomain"); ADD_int_OBJECT(NSApplicationDirectory,@"NSApplicationDirectory"); ADD_int_OBJECT(NSDemoApplicationDirectory,@"NSDemoApplicationDirectory"); ADD_int_OBJECT(NSDeveloperApplicationDirectory,@"NSDeveloperApplicationDirectory"); ADD_int_OBJECT(NSAdminApplicationDirectory,@"NSAdminApplicationDirectory"); ADD_int_OBJECT(NSLibraryDirectory,@"NSLibraryDirectory"); ADD_int_OBJECT(NSDeveloperDirectory,@"NSDeveloperDirectory"); ADD_int_OBJECT(NSUserDirectory,@"NSUserDirectory"); ADD_int_OBJECT(NSDocumentationDirectory,@"NSDocumentationDirectory"); ADD_int_OBJECT(NSAllApplicationsDirectory,@"NSAllApplicationsDirectory"); ADD_int_OBJECT(NSAllLibrariesDirectory,@"NSAllLibrariesDirectory"); ADD_int_OBJECT(GSLibrariesDirectory,@"GSLibrariesDirectory"); ADD_int_OBJECT(GSToolsDirectory,@"GSToolsDirectory"); ADD_int_OBJECT(NSUserDomainMask,@"NSUserDomainMask"); ADD_int_OBJECT(NSLocalDomainMask,@"NSLocalDomainMask"); ADD_int_OBJECT(NSNetworkDomainMask,@"NSNetworkDomainMask"); ADD_int_OBJECT(NSSystemDomainMask,@"NSSystemDomainMask"); ADD_int_OBJECT(NSAllDomainsMask,@"NSAllDomainsMask"); return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/Foundation/Functions.h0000644000175000000000000000256710132015540020276 0ustar gurkanroot/** Functions.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 14 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @class NSDictionary; @class NSString; #define _STCreateConstantsDictionaryForType(t, v, n, c) \ _ST_##t##_namesDictionary(v, n, c); #define function_header(type) \ NSDictionary *_ST_##type##_namesDictionary(type *vals, \ NSString **names, \ int count) function_header(int); function_header(float); function_header(id); steptalk-0.10.0/Modules/Foundation/Functions.m0000644000175000000000000000377510132015540020305 0ustar gurkanroot/** Functions.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Nov 14 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #define function_template(type, class, selector) \ NSDictionary *_ST_##type##_namesDictionary(type *vals, \ NSString **names, \ int count) \ { \ NSMutableDictionary *dict = [NSMutableDictionary dictionary]; \ \ for(i = 0; i $@; \ cat $< | awk -f create_constants.awk >> $@;\ cat footer.m >> $@; ) steptalk-0.10.0/Modules/Foundation/NSFileManager+additions.m0000644000175000000000000000366210132015540022715 0ustar gurkanroot/** NSFileManager+additions.m File manager additions - GNUstep path functions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Jan 22 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import @implementation NSFileManager(STAdditions) + (NSString *)homeDirectory { return NSHomeDirectory(); } + (NSString *)homeDirectoryForUser:(NSString *)user { return NSHomeDirectoryForUser(user); } + (NSString *)openStepRootDirectory { return NSOpenStepRootDirectory(); } + (NSArray *)searchPathForDirectories:(int)dir inDomains:(int)domainMask expandTilde:(BOOL)flag { return NSSearchPathForDirectoriesInDomains(dir, domainMask, flag); } + (NSArray *)searchPathForDirectories:(int)dir inDomains:(int)domainMask { return [self searchPathForDirectories:dir inDomains:domainMask expandTilde:YES]; } + (NSString *)temporaryDirectory { return NSTemporaryDirectory(); } + (NSArray *)standardLibraryPaths { return NSStandardLibraryPaths(); } @end steptalk-0.10.0/Modules/Foundation/NSString+additions.m0000644000175000000000000000230610132015541022004 0ustar gurkanroot/** NSFileManager+additions.m File manager additions - GNUstep path functions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2003 Jan 22 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @implementation NSString(STAdditions) - (BOOL)containsString:(NSString *)string { NSRange range = [self rangeOfString:string]; return range.location != NSNotFound; } @end steptalk-0.10.0/Modules/Foundation/STFoundationModule.h0000644000175000000000000000204210132015540022035 0ustar gurkanroot/** STFoundationModule.h Foundation bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 16 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STFoundationModule:NSObject { } @end steptalk-0.10.0/Modules/Foundation/STFoundationModule.m0000644000175000000000000000260410132015540022046 0ustar gurkanroot/** STFoundationModule.m Foundation bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jan 21 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STFoundationModule.h" #import #import extern NSDictionary *STGetFoundationConstants(); @implementation STFoundationModule + (NSDictionary *)namedObjectsForScripting { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict addEntriesFromDictionary:STGetFoundationConstants()]; return [NSDictionary dictionaryWithDictionary:dict]; } @end steptalk-0.10.0/Modules/Foundation/ScriptingInfo.plist0000644000175000000000000000410310132015540021774 0ustar gurkanroot{ ScriptingInfoClass = STFoundationModule; Classes = ( GSMimeCodingContext, GSMimeDocument, GSMimeParser, GSMimeHeader, GSHTMLParser, GSHTMLSAXHandler, GSSAXHandler, GSXMLAttribute, GSXMLDocument, GSXMLNamespace, GSXMLNode, GSXMLParser, NSArchiver, NSArray, NSAssertionHandler, NSAttributedString, NSAutoreleasePool, NSBitmapCharSet, NSBundle, NSCalendarDate, NSCharacterSet, NSClassDescription, NSCoder, NSConditionLock, NSConnection, NSCountedSet, NSData, NSDate, NSDateFormatter, NSDecimalNumber, NSDecimalNumberHandler, NSDeserializer, NSDictionary, NSDirectoryEnumerator, NSDistantObject, NSDistributedLock, NSDistributedNotificationCenter, NSEnumerator, NSException, NSFileHandle, NSFileManager, NSFormatter, NSGDate, NSHost, NSInvocation, NSKeyedArchiver, NSKeyedUnarchiver, NSLock, NSMethodSignature, NSMutableArray, NSMutableAttributedString, NSMutableBitmapCharSet, NSMutableCharacterSet, NSMutableData, NSMutableDictionary, NSMutableSet, NSMutableString, NSNotification, NSNotificationCenter, NSNotificationQueue, NSNull, NSNumber, NSNumberFormatter, NSObject, NSPipe, NSPort, NSPortCoder, NSPortMessage, NSPortNameServer, NSProcessInfo, NSProtocolChecker, NSProxy, NSRecursiveLock, NSRunLoop, NSScanner, NSSerializer, NSSet, NSString, NSTask, NSThread, NSTimeZone, NSTimeZoneDetail, NSTimer, NSURL, NSURLHandle, NSUnarchiver, NSUndoManager, NSUserDefaults, NSValue ); } steptalk-0.10.0/Modules/Foundation/create_constants.awk0000644000175000000000000000017110132015540022205 0ustar gurkanroot($0 !~ /^[\t ]*#.*$/) && ($0 !~ /^[\t ]*$/) && (NF == 2) { printf " ADD_%s_OBJECT(%s,@\"%s\");\n", $1, $2, $2 } steptalk-0.10.0/Modules/Foundation/footer.m0000644000175000000000000000005510132015540017617 0ustar gurkanroot return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/Foundation/header.m0000644000175000000000000000547710132015540017566 0ustar gurkanroot/** @@NAME@@.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import NSDictionary *STGet@@NAME@@(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) #define ADD_NSPoint_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithPoint:obj], \ name) #define ADD_NSRange_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRange:obj], \ name) #define ADD_NSSize_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithSize:obj], \ name) #define ADD_NSRect_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRect:obj], \ name) steptalk-0.10.0/Modules/GDL2/0000775000175000000000000000000010301377026014537 5ustar gurkanrootsteptalk-0.10.0/Modules/GDL2/GDL2.stenv0000644000175000000000000000035110132015541016276 0ustar gurkanroot/** GDL2.stenv To use: > stexec -env GDL2 script_name or > stshell -env GDL2 */ { Name = "GDL2"; /* Finders = (DistributedFinder); */ Modules = (GDL2, ObjectiveC); Use = ("Standard"); } steptalk-0.10.0/Modules/GDL2/GDL2Constants.list0000644000175000000000000000003310132015541020004 0ustar gurkanroot# GDL2 constants # # None steptalk-0.10.0/Modules/GDL2/GDL2Constants.m0000644000175000000000000000557410132015541017304 0ustar gurkanroot/** GDL2Constants.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import NSDictionary *STGetGDL2Constants(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [numberClass methodForSelector:numberWithInt_sel]; numberWithFloat = [numberClass methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) #define ADD_NSPoint_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithPoint:obj], \ name) #define ADD_NSRange_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRange:obj], \ name) #define ADD_NSSize_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithSize:obj], \ name) #define ADD_NSRect_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRect:obj], \ name) return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/GDL2/GNUmakefile0000644000175000000000000000371710132015541016610 0ustar gurkanroot# # GDL2 module # # Copyright (C) 2002 Stefan Urbanek # # Author: Stefan Urbanek # Date: 2002 Nov 29 # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = GDL2 GDL2_OBJC_FILES = \ STGDL2Module.m \ GDL2Constants.m GDL2_PRINCIPAL_CLASS = STGDL2Module GDL2_RESOURCE_FILES = ScriptingInfo.plist GDL2_BUNDLE_LIBS += -lgnustep-db2 -lgnustep-db2control -lgnustep-db2modeler ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Modules ADDITIONAL_OBJCFLAGS = -Wall -Wno-import # Include gdl2.make IF there -include $(GNUSTEP_MAKEFILES)/Auxiliary/gdl2.make # If gdl2.make was included, compile the bundle; else, do nothing ifneq ($(GDL2_VERSION),) include $(GNUSTEP_MAKEFILES)/bundle.make else include $(GNUSTEP_MAKEFILES)/rules.make endif GDL2Constants.m : GDL2Constants.list %.m : %.list @( echo Creating $@ ...; \ cat header.m | sed "s/@@NAME@@/`basename $< .list`/g" > $@; \ cat $< | awk -f create_constants.awk >> $@;\ cat footer.m >> $@; ) steptalk-0.10.0/Modules/GDL2/GNUmakefile.postamble0000644000175000000000000000343710132015541020574 0ustar gurkanroot# # GNUmakefile.postamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing after-install:: @(echo Copying scripting environments...; \ cp GDL2.stenv $(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Environments; \ ) # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: steptalk-0.10.0/Modules/GDL2/STGDL2Module.h0000644000175000000000000000201710132015541017004 0ustar gurkanroot/** STGDL2Module.h GDL bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Nov 29 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface STGDL2Module:NSObject { } @end steptalk-0.10.0/Modules/GDL2/STGDL2Module.m0000644000175000000000000000272010132015541017012 0ustar gurkanroot/** STGDL2Module.m GDL bindings Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Nov 29 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STGDL2Module.h" #import #import extern NSDictionary *STGetGDL2Constants(); @class EODatabase; @class EOQualifier; @implementation STGDL2Module + (void)initialize { [EODatabase class]; [EOQualifier class]; } + (NSDictionary *)namedObjectsForScripting { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict addEntriesFromDictionary:STGetGDL2Constants()]; return [NSDictionary dictionaryWithDictionary:dict]; } @end steptalk-0.10.0/Modules/GDL2/ScriptingInfo.plist0000644000175000000000000000370710132015541020370 0ustar gurkanroot{ ScriptingInfoClass = STGDL2Module; Classes = ( /* Classes from EOAccess */ EOAccessArrayFaultHandler, EOAccessFaultHandler, EOAccessGenericFaultHandler, EOAdaptor, EOAdaptor, EOAdaptorChannel, EOAdaptorContext, EOAdaptorOperation, EOAndQualifier, EOAttribute, EODatabase, EODatabaseChannel, EODatabaseContext, EODatabaseDataSource, EODatabaseOperation, EOEditingContext, EOEntity, EOEntityClassDescription, EOExpressionArray, EOJoin, EOKeyComparisonQualifier, EOKeyValueQualifier, /* EOLoginPanel, */ EOModel, EOModelGroup, EONotQualifier, EOObjectStoreCoordinator, EOOrQualifier, EORelationship, EOSQLExpression, EOSQLQualifier, EOStoredProcedure, /* Classees from EOControl */ EOAndQualifier, EOCheapCopyArray, EOCheapCopyMutableArray, EOClassDescription, EOCooperatingObjectStore, EODataSource, /* EODelayedObserver, */ /* EODelayedObserverQueue, */ EODetailDataSource, EOEditingContext, EOFault, EOFaultHandler, EOFetchSpecification, EOGenericRecord, EOGlobalID, EOKeyComparisonQualifier, EOKeyGlobalID, EOKeyValueArchiver, EOKeyValueQualifier, EOKeyValueUnarchiver, EOMKKDArrayMapping, EOMKKDInitializer, EOMKKDKeyEnumerator, EOMKKDSubsetMapping, EOMutableKnownKeyDictionary, EONotQualifier, EONull, EOObjectStore, EOObjectStoreCoordinator, EOObserverCenter, /* EOObserverProxy, */ EOOrQualifier, EOQualifier, EOQualifierVariable, EOSortOrdering, EOTemporaryGlobalID, EOUndoManager ); } steptalk-0.10.0/Modules/GDL2/create_constants.awk0000644000175000000000000000017110132015541020570 0ustar gurkanroot($0 !~ /^[\t ]*#.*$/) && ($0 !~ /^[\t ]*$/) && (NF == 2) { printf " ADD_%s_OBJECT(%s,@\"%s\");\n", $1, $2, $2 } steptalk-0.10.0/Modules/GDL2/footer.m0000644000175000000000000000005510132015541016202 0ustar gurkanroot return dict; } /* -- End of file -- */ steptalk-0.10.0/Modules/GDL2/header.m0000644000175000000000000000547710132015541016151 0ustar gurkanroot/** @@NAME@@.m NOTE: Do not edit this file, it is automaticaly generated. Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import NSDictionary *STGet@@NAME@@(void) { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; Class numberClass = [NSNumber class]; IMP numberWithInt; IMP numberWithFloat; IMP setObject_forKey; SEL numberWithInt_sel = @selector(numberWithInt:); SEL numberWithFloat_sel = @selector(numberWithFloat:); SEL setObject_forKey_sel = @selector(setObject:forKey:); numberWithInt = [NSNumber methodForSelector:numberWithInt_sel]; numberWithFloat = [NSNumber methodForSelector:numberWithFloat_sel]; setObject_forKey = [dict methodForSelector:setObject_forKey_sel]; #define ADD_id_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, obj, name) #define ADD_int_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithInt(numberClass, numberWithInt_sel, obj), \ name) #define ADD_float_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ numberWithFloat(numberClass, numberWithInt_sel, obj), \ name) #define ADD_NSPoint_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithPoint:obj], \ name) #define ADD_NSRange_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRange:obj], \ name) #define ADD_NSSize_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithSize:obj], \ name) #define ADD_NSRect_OBJECT(obj, name) \ setObject_forKey(dict, setObject_forKey_sel, \ [NSValue valueWithRect:obj], \ name) steptalk-0.10.0/Modules/GNUmakefile0000644000175000000000000000227310132015540016113 0ustar gurkanroot# # Main Makefile for the StepTalk # # Copyright (C) 2000 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make APPKIT=AppKit ifeq ($(appkit),no) APPKIT= endif SUBPROJECTS = \ SimpleTranscript \ Foundation \ ObjectiveC \ GDL2 \ $(APPKIT) -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/Modules/ObjectiveC/0000775000175000000000000000000010365363565016101 5ustar gurkanrootsteptalk-0.10.0/Modules/ObjectiveC/.cvsignore0000644000175000000000000000010510132015541020047 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Modules/ObjectiveC/GNUmakefile0000644000175000000000000000305410132015541020127 0ustar gurkanroot# # ObjectiveC module # # Copyright (C)2002 Stefan Urbanek # # Written by: Stefan Urbanek # Date: 2002 Jun 14 # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = ObjectiveC ObjectiveC_OBJC_FILES = \ ObjectiveCModule.m \ ObjectiveCRuntime.m \ NSObject+additions.m ObjectiveC_PRINCIPAL_CLASS = ObjectiveCModule ObjectiveC_RESOURCE_FILES = ScriptingInfo.plist ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Modules ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Modules/ObjectiveC/NSObject+additions.h0000644000175000000000000000215310132015541021646 0ustar gurkanroot/** NSObject+additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 14 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import @class NSArray; @interface NSObject(ObjectiveCRuntime) - (NSArray *)methodNames; + (NSArray *)methodNames; + (NSArray *)instanceMethodNames; + (NSArray *)instanceVariableNames; @end steptalk-0.10.0/Modules/ObjectiveC/NSObject+additions.m0000644000175000000000000000503710132015541021657 0ustar gurkanroot/** NSObject+additions Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 14 This file is part of the StepTalk project. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. */ #import "NSObject+additions.h" #import #import static NSArray *methods_for_class(Class class) { NSMutableArray *array = [NSMutableArray array]; struct objc_method_list *methods; SEL sel; int i; if(!class) return nil; methods = class->methods; while(methods) { for(i = 0; i < methods->method_count; i++) { sel = methods->method_list[i].method_name; [array addObject:NSStringFromSelector(sel)]; } methods = methods->method_next; } return [NSArray arrayWithArray:array]; } static NSArray *ivars_for_class(Class class) { NSMutableArray *array; struct objc_ivar_list* ivars; const char *cname; int i; if(!class) return nil; array = [NSMutableArray array]; ivars = class->ivars; if(ivars) { for(i=0;iivar_count;i++) { cname = ivars->ivar_list[i].ivar_name; [array addObject:[NSString stringWithCString:cname]]; } } return [NSArray arrayWithArray:array]; } @implementation NSObject(ObjectiveCRuntime) + (NSArray *)instanceMethodNames { return methods_for_class(self); } - (NSArray *)methodNames { return [[[self class] instanceMethodNames] sortedArrayUsingSelector:@selector(compare:)]; } + (NSArray *)methodNames { return methods_for_class(class_get_meta_class(self)); } + (NSArray *)instanceVariableNames { return ivars_for_class(self); } @end steptalk-0.10.0/Modules/ObjectiveC/ObjectiveCModule.h0000644000175000000000000000176110132015541021414 0ustar gurkanroot/** ObjectiveCModule.h Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface ObjectiveCModule:NSObject @end steptalk-0.10.0/Modules/ObjectiveC/ObjectiveCModule.m0000644000175000000000000000240710132015541021417 0ustar gurkanroot/** ObjectiveCModule.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ObjectiveCModule.h" #import "ObjectiveCRuntime.h" #import #import @implementation ObjectiveCModule + (NSDictionary *)namedObjectsForScripting { return [NSDictionary dictionaryWithObject:[ObjectiveCRuntime sharedRuntime] forKey:@"Runtime"]; } @end steptalk-0.10.0/Modules/ObjectiveC/ObjectiveCRuntime.h0000644000175000000000000000200410132015541021601 0ustar gurkanroot/** ObjectiveCRuntime.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface ObjectiveCRuntime:NSObject + sharedRuntime; @end steptalk-0.10.0/Modules/ObjectiveC/ObjectiveCRuntime.m0000644000175000000000000000627310132015541021622 0ustar gurkanroot/** ObjectiveCRuntime.m Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2002 Jun 10 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ObjectiveCRuntime.h" #import "NSObject+additions.h" #import #import #import #import #import static ObjectiveCRuntime *sharedRuntime=nil; @implementation ObjectiveCRuntime + sharedRuntime { if(!sharedRuntime) { sharedRuntime = [[ObjectiveCRuntime alloc] init]; } return sharedRuntime; } - (NSArray *)allClasses { NSMutableArray *array; Class class; void *state = NULL; array = [NSMutableArray array]; while( (class = objc_next_class(&state)) ) { [array addObject:class]; } return [NSArray arrayWithArray:array]; } - (Class )classWithName:(NSString *)string { return NSClassFromString(string); } - (NSString *)nameOfClass:(Class)class { return NSStringFromClass(class); } - (NSArray *)selectorsContainingString:(NSString *)string { NSMutableArray *sels = [NSMutableArray array]; NSEnumerator *enumerator; NSArray *array = STAllObjectiveCSelectors(); NSString *sel; NSRange range; enumerator = [array objectEnumerator]; while( (sel = [enumerator nextObject]) ) { range = [sel rangeOfString:string]; if(range.location != NSNotFound) { [sels addObject:sel]; } } return [NSArray arrayWithArray:sels]; } - (NSArray *)implementorsOfSelector:(id)selector { NSMutableArray *array = [NSMutableArray array]; NSEnumerator *enumerator; NSDictionary *classes = STAllObjectiveCClasses(); NSString *className; NSArray *methods; Class class; enumerator = [classes keyEnumerator]; if([selector isKindOfClass:[STSelector class]]) { selector = [selector stringValue]; } while( (className = [enumerator nextObject]) ) { class = [classes objectForKey:className]; if([class respondsToSelector:@selector(instanceMethodNames)]) { methods = [class instanceMethodNames]; if([methods containsObject:selector]) { [array addObject:className]; } } } return [NSArray arrayWithArray:array]; } @end steptalk-0.10.0/Modules/ObjectiveC/ScriptingInfo.plist0000644000175000000000000000014010132015541021701 0ustar gurkanroot{ ScriptingInfoClass = ObjectiveCModule; Classes = ( ObjectiveCRuntime ); } steptalk-0.10.0/Modules/ReadlineTranscript/0000755000175000000000000000000010132015542017634 5ustar gurkanrootsteptalk-0.10.0/Modules/ReadlineTranscript/.cvsignore0000644000175000000000000000010510132015542021630 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Modules/ReadlineTranscript/GNUmakefile0000600000175000000000000000267110132015542021704 0ustar gurkanroot# # ReadlineTranscript module # # Copyright (C)2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = ReadlineTranscript ReadlineTranscript_OBJC_FILES = \ ReadlineTranscriptModule.m \ ReadlineTranscript.m \ ReadlineTranscript_PRINCIPAL_CLASS = ReadlineTranscriptModule ReadlineTranscript_RESOURCE_FILES = ScriptingInfo.plist BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Modules ReadlineTranscript_BUNDLE_LIBS = -lStepTalk -lreadline ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Modules/ReadlineTranscript/ReadlineTranscript.h0000600000175000000000000000222210132015542023570 0ustar gurkanroot/** ReadlineTranscript.h StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface ReadlineTranscript:NSObject + sharedTranscript; - show:(id)anObject; - showLine:(id)anObject; - (NSString*)readLine:(NSString*)prompt; @end steptalk-0.10.0/Modules/ReadlineTranscript/ReadlineTranscript.m0000600000175000000000000000446510132015542023610 0ustar gurkanroot/** ReadlineTranscript.m StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ReadlineTranscript.h" #import #import #include #include static Class NSString_class; static Class NSNumber_class; static ReadlineTranscript *sharedTranscript; @implementation ReadlineTranscript:NSObject + (void)initialize { NSString_class = [NSString class]; NSNumber_class = [NSNumber class]; } + sharedTranscript { if(!sharedTranscript) { sharedTranscript = [[ReadlineTranscript alloc] init]; } return sharedTranscript; } - show:(id)anObject { NSString *string; if( [anObject isKindOfClass:NSString_class] ) { string = anObject; } else if ( [anObject isKindOfClass:NSNumber_class] ) { string = [anObject stringValue]; } else { string = [anObject description]; } printf("%s", [string cString]); return self; } - showLine:(id)anObject { [self show:anObject]; putchar('\n'); return self; } -(NSString*)readLine:(NSString*)prompt { NSString *resret=nil; char *res; res = readline([prompt cString]); if (res) { resret = [[NSString alloc] initWithCStringNoCopy: res length: strlen(res) freeWhenDone: YES]; } return AUTORELEASE(resret); } @end steptalk-0.10.0/Modules/ReadlineTranscript/ReadlineTranscriptModule.h0000600000175000000000000000205010132015542024735 0ustar gurkanroot/** ReadlineTranscriptModule.h Transcript module Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface ReadlineTranscriptModule:NSObject @end steptalk-0.10.0/Modules/ReadlineTranscript/ReadlineTranscriptModule.m0000600000175000000000000000251610132015542024751 0ustar gurkanroot/** ReadlineTranscriptModule.m Transcript module Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "ReadlineTranscriptModule.h" #import "ReadlineTranscript.h" #import #import @implementation ReadlineTranscriptModule + (NSDictionary *)namedObjectsForScripting { return [NSDictionary dictionaryWithObject:[ReadlineTranscript sharedTranscript] forKey:@"Transcript"]; } @end steptalk-0.10.0/Modules/ReadlineTranscript/ScriptingInfo.plist0000600000175000000000000000011610132015542023455 0ustar gurkanroot{ ScriptingInfoClass = ReadlineTranscriptModule; Classes = ( ); } steptalk-0.10.0/Modules/ReadlineTranscript/shell.st0000644000175000000000000000174610132015542021323 0ustar gurkanroot" Script shell - shell written in script. This is just an example. Run it by: stexec shell.st Author: Stefan Urbanek Date: 2003 Oct 3 " [| :done main | line env engine result | Environment includeFramework:'StepTalk'. Environment loadModule:'ReadlineTranscript'. " Create environment " env := STEnvironment defaultScriptingEnvironment. env setObject:env forName:'Environment'. env setObject:Transcript forName:'Transcript'. env setObject:self forName:'Shell'. " Create and setup engine " engine := STEngine engineForLanguageWithName:'Smalltalk'. " Do the loop! " [ done ] whileFalse: [ line := Transcript readLine:'Shell > '. (line = 'exit') ifTrue: [ done := YES ]. result := engine executeCode: (line, ' ') inEnvironment:env. Transcript showLine: result. ]. ^self ! exit Transcript showLine: 'BLAH'. done := YES. ^self ] steptalk-0.10.0/Modules/ReadlineTranscript/test.st0000644000175000000000000000025710132015542021167 0ustar gurkanrootEnvironment loadModule:'ReadlineTranscript'. Transcript showLine: 'Readline test'. line := Transcript readLine:'Write something: '. Transcript showLine: line uppercaseString. steptalk-0.10.0/Modules/SimpleTranscript/0000775000175000000000000000000010365363565017367 5ustar gurkanrootsteptalk-0.10.0/Modules/SimpleTranscript/.cvsignore0000644000175000000000000000010510132015542021336 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Modules/SimpleTranscript/GNUmakefile0000644000175000000000000000300410132015542021411 0ustar gurkanroot# # SimpleTranscript module # # Copyright (C)2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = SimpleTranscript SimpleTranscript_OBJC_FILES = \ SimpleTranscriptModule.m \ SimpleTranscript.m \ SimpleTranscript_PRINCIPAL_CLASS = SimpleTranscriptModule SimpleTranscript_RESOURCE_FILES = ScriptingInfo.plist BUNDLE_INSTALL_DIR:=$(GNUSTEP_INSTALLATION_DIR)/Library/StepTalk/Modules ADDITIONAL_BUNDLE_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../../Frameworks/ ADDITIONAL_LIB_DIRS += -L../../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUMakefile.postamble steptalk-0.10.0/Modules/SimpleTranscript/ScriptingInfo.plist0000644000175000000000000000011410132015542023171 0ustar gurkanroot{ ScriptingInfoClass = SimpleTranscriptModule; Classes = ( ); } steptalk-0.10.0/Modules/SimpleTranscript/SimpleTranscript.h0000644000175000000000000000214510132015542023020 0ustar gurkanroot/** SimpleTranscript.h StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface SimpleTranscript:NSObject + sharedTranscript; - show:(id)anObject; - showLine:(id)anObject; @end steptalk-0.10.0/Modules/SimpleTranscript/SimpleTranscript.m0000644000175000000000000000365610132015542023035 0ustar gurkanroot/** SimpleTranscript.m StepTalk simple transcript Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 Apr 13 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "SimpleTranscript.h" #import #import #include static Class NSString_class; static Class NSNumber_class; static SimpleTranscript *sharedTranscript; @implementation SimpleTranscript:NSObject + (void)initialize { NSString_class = [NSString class]; NSNumber_class = [NSNumber class]; } + sharedTranscript { if(!sharedTranscript) { sharedTranscript = [[SimpleTranscript alloc] init]; } return sharedTranscript; } - show:(id)anObject { NSString *string; if( [anObject isKindOfClass:NSString_class] ) { string = anObject; } else if ( [anObject isKindOfClass:NSNumber_class] ) { string = [anObject stringValue]; } else { string = [anObject description]; } printf("%s", [string cString]); return self; } - showLine:(id)anObject { [self show:anObject]; putchar('\n'); return self; } @end steptalk-0.10.0/Modules/SimpleTranscript/SimpleTranscriptModule.h0000644000175000000000000000204410132015542024164 0ustar gurkanroot/** SimpleTranscriptModule.h Transcript module Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import @interface SimpleTranscriptModule:NSObject @end steptalk-0.10.0/Modules/SimpleTranscript/SimpleTranscriptModule.m0000644000175000000000000000250410132015542024172 0ustar gurkanroot/** SimpleTranscriptModule.m Transcript module Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 May 18 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "SimpleTranscriptModule.h" #import "SimpleTranscript.h" #import #import @implementation SimpleTranscriptModule + (NSDictionary *)namedObjectsForScripting { return [NSDictionary dictionaryWithObject:[SimpleTranscript sharedTranscript] forKey:@"Transcript"]; } @end steptalk-0.10.0/Testing/0000775000175000000000000000000010305155122014047 5ustar gurkanrootsteptalk-0.10.0/Testing/.#gdbstexec.1.20000755000175000000000000000045510142063265016374 0ustar gurkanroot#!/bin/csh # # gdbstexec - GDB wrapper for stexec # # Put this file to be reachable from your PATH # # Use like stexec: # gdbstexec script_name ... # This will run stexec in gdb and run it with script script_name. After # finishing, backtrace is displayed # gdb --args `which stexec` $*:q steptalk-0.10.0/Testing/Objects/0000755000175000000000000000000010132015543015436 5ustar gurkanrootsteptalk-0.10.0/Testing/Smalltalk/0000775000175000000000000000000010300725774016006 5ustar gurkanrootsteptalk-0.10.0/Testing/Smalltalk/appobject.st0000644000175000000000000000072110132015543020310 0ustar gurkanroot[| main nc := NSWorkspace sharedWorkspace notificationCenter. nc addObserver:self selector:#didLaunch: name:NSWorkspaceDidLaunchApplicationNotification object: nil. NSWorkspace sharedWorkspace launchApplication:'Affiche'. NSRunLoop currentRunLoop runUntilDate: (NSDate dateWithTimeIntervalSinceNow:5). ^self ! didLaunch:notif Transcript showLine: ((notif userInfo) description). ^self ] steptalk-0.10.0/Testing/Smalltalk/block_test.st0000644000175000000000000000013010132015543020464 0ustar gurkanroot| array | array := NSMutableArray array. 1 to: 200000 do: [ :i | array addObject: i]. steptalk-0.10.0/Testing/Smalltalk/distant.st0000644000175000000000000000263010301373711020012 0ustar gurkanroot" Distant environment example Date: 2005 Aug 17 Author: Stefan Urbanek Usage: 1. run: stenvironment -name test 2. run: stexec distant.st 3. repeat step 2. as many times as you like Step 1. creates a scripting environment. Step 2. executes this script. " "Create a conversation with distant environment" conversation := (STDistantConversation alloc) initWithEnvironmentName:'test' host:nil language:nil. Transcript showLine: '-- Conversation created:', (conversation description). "Interpret some scripts in the distant environment" conversation interpretScript:'Transcript showLine:\'Hello StepTalk!\'.'. conversation interpretScript:'Environment class description'. "Get run count" conversation interpretScript:'runCount'. result := conversation resultByCopy. "If there is no run count, then we are running first time and we have to define and set the run count to 1" result ifNil: [ Transcript showLine: ('This script was run for first time.'). conversation interpretScript:'runCount := 0'. result := 1. ]. conversation interpretScript:'runCount := runCount + 1'. result := conversation resultByCopy. Transcript showLine: ('This script was run ', (result description), ' times.'). conversation close. steptalk-0.10.0/Testing/Smalltalk/extern.st0000644000175000000000000000062710132015543017653 0ustar gurkanroot1 to: 100000 do: [ :i | extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. extern := nil. ] steptalk-0.10.0/Testing/Smalltalk/ivar.st0000644000175000000000000000076310132015543017310 0ustar gurkanroot[| :local main 1 to: 100000 do: [ :i | local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. ] ] steptalk-0.10.0/Testing/Smalltalk/local.st0000644000175000000000000000061610132015543017436 0ustar gurkanroot| local | 1 to: 100000 do: [ :i | local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. local := nil. ] steptalk-0.10.0/Testing/Smalltalk/method.st0000644000175000000000000000004310132015543017616 0ustar gurkanrootqwe Transcript showLine:'Test' steptalk-0.10.0/Testing/Smalltalk/nil.st0000644000175000000000000000002510132015543017120 0ustar gurkanrootnil objectAtIndex:1. steptalk-0.10.0/Testing/Smalltalk/observer.st0000644000175000000000000000063310132015543020172 0ustar gurkanroot[| main |center| center := NSDistributedNotificationCenter defaultCenter. Transcript showLine:'Registering'. center addObserver:self selector:#notification: name:nil object:'s'. NSRunLoop currentRunLoop run. ! notification:notif Transcript showLine:'Notification received: ', (notif description). ^self ] steptalk-0.10.0/Testing/Smalltalk/send.st0000644000175000000000000000050110132015543017266 0ustar gurkanroot| array | 1 to: 500 do: [ :i | i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. i class. ]. steptalk-0.10.0/Testing/Smalltalk/speed.st0000644000175000000000000000335510132015543017447 0ustar gurkanroot 1 to: 2000 do:[ :i| nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. nil showLine:'Hello ... who?'. ] steptalk-0.10.0/Testing/Smalltalk/test0000755000175000000000000000007410132015543016677 0ustar gurkanroot#!/bin/csh foreach i ( `seq 0 5` ) stexec speed.st end steptalk-0.10.0/Testing/Smalltalk/test.st0000644000175000000000000000145210132015543017322 0ustar gurkanroot[| :array main self testBlock. self testExceptions. ^self ! testBlock | count array | Transcript showLine:'> Block test'. array := #( ). 1 to: 5 do: [ :i | array addObject:i ]. count := 0. array do: [ :element | count := count + 1. ]. Transcript showLine:'count ', (count stringValue). array do: [ :i | array do: [ :j | Transcript show:((i stringValue), (j stringValue),' '). ]. Transcript show:'\n'. ]. ^self ! testExceptions Transcript showLine:'> Exception handler test'. [ NSException raise:'Some exception' format:' '. ] handler: [ :localException | Transcript showLine:(' Exception: ', localException name). ]. ^self ] steptalk-0.10.0/Testing/gdbstexec0000755000175000000000000000063510166610152015753 0ustar gurkanroot#!/bin/csh # # gdbstexec - GDB wrapper for stexec # # Put this file to be reachable from your PATH # # Use like stexec: # gdbstexec script_name ... # This will run stexec in gdb and run it with script script_name. After # finishing, backtrace is displayed # # set temp = `tempfile -p stexec` # echo set args $*:q > $temp # echo run >> $temp # echo bt >> $temp gdb --args `which stexec` $*:q # rm $temp steptalk-0.10.0/Testing/languageManager.st0000644000175000000000000000060610305155533017503 0ustar gurkanrootmanager := STLanguageManager defaultManager. Transcript showLine:(manager description). languages := manager availableLanguages. Transcript showLine:'Available languages: ', (languages description). engine := manager createEngineForLanguage:'Smalltalk'. Transcript showLine:'Engine: ', (engine description). engine interpretScript:'Transcript showLine:\'Hi\'.' inContext:Environment. steptalk-0.10.0/Testing/leaks/0000755000175000000000000000000010132015543015144 5ustar gurkanrootsteptalk-0.10.0/Testing/leaks/GNUmakefile0000644000175000000000000000221710132015543017220 0ustar gurkanroot# # StepTalk tools # # Copyright (C) 2000,2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = leaktest leaktest_OBJC_FILES = leaktest.m ADDITIONAL_TOOL_LIBS = -lStepTalk ADDITIONAL_OBJCFLAGS = -Wall -Wno-import ifeq ($(check),yes) ADDITIONAL_OBJCFLAGS += -Werror endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUMakefile.postamble steptalk-0.10.0/Testing/leaks/leaktest.m0000644000175000000000000000221210132015543017133 0ustar gurkanroot#import #import #import #import #import int main(void) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSAutoreleasePool *innerPool; NSString *theScript; NSString *fname = @"script.st"; STEnvironment *env; STEngine *engine; id result; theScript = [NSString stringWithContentsOfFile:fname]; GSDebugAllocationActive(YES); NSLog(@"allocated objects on starting script\n%s",GSDebugAllocationList(NO)); env = [STEnvironment defaultScriptingEnvironment]; engine = [STEngine engineForLanguageWithName:@"Smalltalk"]; NS_DURING //innerPool = [NSAutoreleasePool new]; result = [engine executeCode:theScript inEnvironment:env]; //[innerPool release]; NS_HANDLER /* handle the exception */ NSLog(@"%@",localException); NS_ENDHANDLER //NSLog(@"change of allocated objects\n%s",GSDebugAllocationList(YES)); printf("%s",GSDebugAllocationList(NO)); [pool release]; } steptalk-0.10.0/Testing/leaks/script.st0000644000175000000000000000033210132015543017016 0ustar gurkanroot[| main | tval | tval := 1. tval to: 20000 do: [ :counter | self testme: counter. ]. ! testme: tval | retval | retval := tval + 1. ^retval ] steptalk-0.10.0/Testing/leaks/test0000755000175000000000000000005110132015543016045 0ustar gurkanrootmake debug=yes && obj/leaktest | sort -n steptalk-0.10.0/Testing/sobjtest.st0000644000175000000000000000206310132015543016253 0ustar gurkanroot" Test for script objects. Author: Stefan Urbanek Date: 2003 Aug 6 " | object method source engine | Environment includeFramework:'StepTalk'. " Create a script object and set it's environment " object := STScriptObject scriptObject. object setEnvironment:Environment. " Get the proper engine " engine := STEngine engineForLanguageWithName:'Smalltalk'. " This is the source of new method " source := 'sayHi Transcript showLine: \'Hi.\'. ^self'. " Create method " method := engine methodFromSource:source forReceiver:object inEnvironment:Environment. " Add the method to the object " object addMethod:method. " Add another method with an argument " source := 'sayHiTo:someone Transcript showLine: (\'Hi \', someone). ^self'. method := engine methodFromSource:source forReceiver:object inEnvironment:Environment. object addMethod:method. " Sent it! " object sayHi. object sayHiTo:'GNUstep'. steptalk-0.10.0/Tools/0000775000175000000000000000000010365363565013554 5ustar gurkanrootsteptalk-0.10.0/Tools/.cvsignore0000644000175000000000000000010510132015543015524 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage steptalk-0.10.0/Tools/GNUmakefile0000644000175000000000000000303010305160434015600 0ustar gurkanroot# # StepTalk tools # # Copyright (C) 2000,2001 Stefan Urbanek # # This file is part of the StepTalk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. # include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = \ stexec \ stenvironment COMMON_OBJC_FILES = \ STExecutor.m stexec_OBJC_FILES = \ $(COMMON_OBJC_FILES) \ $(DEBUG_FILES) \ stexec.m stenvironment_OBJC_FILES = \ stenvironment.m \ STEnvironmentProcess.m ADDITIONAL_TOOL_LIBS = -lStepTalk ADDITIONAL_INCLUDE_DIRS += -I../Frameworks/ ADDITIONAL_LIB_DIRS += -L../Frameworks/StepTalk/StepTalk.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR) ADDITIONAL_OBJCFLAGS = -Wall -Wno-import ifeq ($(check),yes) ADDITIONAL_OBJCFLAGS += -Werror endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUMakefile.postamble steptalk-0.10.0/Tools/GNUmakefile.preamble0000644000175000000000000000332710132015543017375 0ustar gurkanroot# # GNUmakefile.preamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile variables, and additional # # Do not put any Makefile rules in this file, instead they should # be put into Makefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS += #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += ADDITIONAL_TOOL_LIBS += # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation ADDITIONAL_INSTALL_DIRS += # # Local configuration # steptalk-0.10.0/Tools/STEnvironmentProcess.h0000644000175000000000000000042210307122762020017 0ustar gurkanroot#import #import @class STConversation; @class STEnvironment; @interface STEnvironmentProcess:NSObject { STEnvironment *environment; } - initWithDescriptionName:(NSString *)descName; @end steptalk-0.10.0/Tools/STEnvironmentProcess.m0000644000175000000000000000227510307114542020031 0ustar gurkanroot#import "STEnvironmentProcess.h" #import #import #import @implementation STEnvironmentProcess - initWithDescriptionName:(NSString *)descName { STEnvironmentDescription *desc; self = [super init]; if(descName) { NSLog(@"Creating environment from description '%@'", descName); desc = [STEnvironmentDescription descriptionWithName:descName]; environment = [[STEnvironment alloc] initWithDescription:desc]; } else { environment = [[STEnvironment alloc] initWithDefaultDescription]; } /* FIXME: use some configurable mechanism */ [environment setObject:environment forName:@"Environment"]; [environment loadModule:@"SimpleTranscript"]; return self; } - (void)dealloc { RELEASE(environment); [super dealloc]; } - (STConversation *)createConversation { STConversation *conversation; conversation = [[STConversation alloc] initWithContext:environment language:nil]; /* FIXME: create list of open conversations */ return AUTORELEASE(conversation); } @end steptalk-0.10.0/Tools/STExecutor.h0000644000175000000000000000355410307122272015757 0ustar gurkanroot/** STExecutor.h Common class for stalk and stexec tools Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import extern NSString *STExecutorException; extern const char *STExecutorCommonOptions; extern void STPrintCassStats(void); enum { STListNone, STListObjects, STListClasses, STListAll }; @class STConversation; @class STEnvironment; @class NSString; @class NSArray; @interface STExecutor:NSObject { STConversation *conversation; NSString *langName; NSArray *arguments; unsigned int currentArg; BOOL contFlag; int listObjects; } - (void)createConversation; - (void)printHelp; - (int)processOption:(NSString *)option; - (void)executeScript:(NSString *)fileName withArguments:(NSArray *)args; - (void)executeScriptFromStandardInputArguments:(NSArray *)args; - (int)parseOptions; - (void)executeScripts; - (NSString *)nextArgument; - (void)reuseArgument; - (void)runWithArguments:(NSArray *)argsArray; @end steptalk-0.10.0/Tools/STExecutor.m0000644000175000000000000002550610307122420015760 0ustar gurkanroot/** STExecutor.m Common class for stalk and stexec tools Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2001 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STExecutor.h" #import #import #import #import #import #import #import #import #import NSString *STExecutorException = @"STExecutorException"; const char *STExecutorCommonOptions = " -help print this message\n" " -list-all-objects list all available objects\n" " -list-classes list available classes\n" " -list-objects list named instances\n\n" " -language lang force use of language lang\n" " -list-languages list available languages\n" " -continue do not stop when one of scripts failed to execute\n\n"; //" -set obj=value define named object 'obj' with string value 'value'\n" @implementation STExecutor - (void)createEnvironment { [self subclassResponsibility:_cmd]; } - (void) dealloc { RELEASE(conversation); [super dealloc]; } - (void)executeScripts { #ifndef DEBUG NSString *logFmt = @"'%@': execution failed, reason: %@"; #endif NSMutableArray *scriptArgs; NSString *scriptFileName; NSString *arg; scriptFileName = [self nextArgument]; if(!scriptFileName) { [self executeScriptFromStandardInputArguments:nil]; return; } scriptArgs = [NSMutableArray array]; do { [scriptArgs removeAllObjects]; arg = [self nextArgument]; while(![arg isEqualToString:@","] && arg != nil) { [scriptArgs addObject:arg]; arg = [self nextArgument]; } #ifndef DEBUG NS_DURING #endif if([scriptFileName isEqualToString:@"-"]) { [self executeScriptFromStandardInputArguments:scriptArgs]; } else { [self executeScript:scriptFileName withArguments:scriptArgs]; } #ifndef DEBUG NS_HANDLER if(contFlag) { NSLog(logFmt,scriptFileName,[localException reason]); } else { [localException raise]; } NS_ENDHANDLER #endif } while( (scriptFileName = [self nextArgument]) ); } - (void)executeScriptFromStandardInputArguments:(NSArray *)args { NSFileHandle *handle; STContext *env; NSString *source; NSData *data; handle = [NSFileHandle fileHandleWithStandardInput]; data = [handle readDataToEndOfFile]; source = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if(langName) { [conversation setLanguage:langName]; } else { STLanguageManager *langManager = [STLanguageManager defaultManager]; [conversation setLanguage:[langManager defaultLanguage]]; } if(conversation) { NSDebugLog(@"Executing script from stdin"); if([args count] > 0) { if([conversation isKindOfClass:[STRemoteConversation class]]) { [NSException raise:@"STExecutorException" format:@"Passing arguments to distant environment" @" is not implemented."]; } else { env = [conversation context]; [env setObject:args forName:@"Args"]; } } [conversation interpretScript:source]; } RELEASE(source); } - (void)executeScript:(NSString *)file withArguments:(NSArray *)args; { NSFileManager *manager = [NSFileManager defaultManager]; STEnvironment *env; NSString *useLanguage; NSString *source; /* Get proper language name */ if( [manager fileExistsAtPath:file isDirectory:NO] ) { source = [NSString stringWithContentsOfFile:file]; if(langName) { NSDebugLog(@"Using language %@", langName); useLanguage = langName; } else { STLanguageManager *langManager = [STLanguageManager defaultManager]; NSDebugLog(@"Using language for file extension %@", [file pathExtension]); useLanguage = [langManager languageForFileType:[file pathExtension]]; } } else { STScriptsManager *sm; STFileScript *script; /* Try to find it in standard script locations */ sm = [[STScriptsManager alloc] initWithDomainName:@"Shell"]; script = [sm scriptWithName:file]; source = [script source]; if(!source) { [NSException raise:STExecutorException format:@"Could not find script '%@'", file]; return; } else { useLanguage = [script language]; } } [conversation setLanguage:useLanguage]; if(conversation) { NSDebugLog(@"Executing script '%@'",file); if([args count] > 0) { if([conversation isKindOfClass:[STRemoteConversation class]]) { [NSException raise:@"STExecutorException" format:@"Passing arguments to distant environment" @" is not implemented."]; } else { /* FIXME: do not cast */ env = (STEnvironment *)[conversation context]; [env setObject:args forName:@"Args"]; } } [conversation interpretScript:source]; } else { [NSException raise:STExecutorException format:@"Unable to create a StepTalk conversation."]; } } - (void)listLanguages { NSArray *languages; NSEnumerator *enumerator; NSString *name; languages = [[STLanguageManager defaultManager] availableLanguages]; enumerator = [languages objectEnumerator]; while( (name = [enumerator nextObject]) ) { printf("%s\n", [name cString]); } } - (NSString *)nextArgument { if(currentArg < [arguments count]) { return [arguments objectAtIndex:currentArg++]; } return nil; } - (void)reuseArgument { currentArg--; } - (void)listObjects { NSEnumerator *enumerator; NSDictionary *dict; NSString *name; NSArray *objects; dict = [[conversation context] objectDictionary]; objects = [[dict allKeys] sortedArrayUsingSelector:@selector(compare:)]; enumerator = [objects objectEnumerator]; if(listObjects == STListAll) { while( (name = [enumerator nextObject]) ) { printf("%s\n", [name cString]); } } else if (listObjects == STListClasses) { while( (name = [enumerator nextObject]) ) { if([[dict objectForKey:name] isClass]) { printf("%s\n", [name cString]); } } } else /* (listObjects == STListInstances) */ { while( (name = [enumerator nextObject]) ) { if(! [[dict objectForKey:name] isClass]) { printf("%s\n", [name cString]); } } } } - (int)parseOptions { BOOL isOption = NO; NSString *arg; listObjects = STListNone; while( (arg = [self nextArgument]) ) { isOption = NO; if( [arg isEqualToString:@"-"] ) { isOption = NO; } else if( [arg hasPrefix:@"--"] ) { arg = [arg substringFromIndex:2]; isOption = YES; } else if( [arg hasPrefix:@"-"] ) { arg = [arg substringFromIndex:1]; isOption = YES; } if ([@"help" hasPrefix:arg]) { [self printHelp]; return 1; } else if ([@"list-languages" hasPrefix:arg]) { [self listLanguages]; return 1; } /* else if ([@"list-engines" hasPrefix:arg]) { [self listEngines]; return 1; } */ else if ([@"list-objects" hasPrefix:arg]) { listObjects = STListObjects; } else if ([@"list-classes" hasPrefix:arg]) { listObjects = STListClasses; } else if ([@"list-all-objects" hasPrefix:arg]) { listObjects = STListAll; } else if ([@"continue" hasPrefix:arg]) { contFlag = YES; } else if ([@"language" hasPrefix:arg]) { RELEASE(langName); langName = [self nextArgument]; if(!langName) { [NSException raise:STExecutorException format:@"Language name expected"]; } } else { if(!isOption) { break; } else { if( [self processOption:arg] ) { return 1; } } } } if(arg) { [self reuseArgument]; } return 0; } - (void)beforeExecuting { } - (void)afterExecuting { } - (void)runWithArguments:(NSArray *)args { arguments = RETAIN(args); currentArg = 1; if([self parseOptions]) { return; } [self beforeExecuting]; [self createConversation]; [self executeScripts]; [self afterExecuting]; if(listObjects != STListNone) { [self listObjects]; } } - (void)printHelp { [self subclassResponsibility:_cmd]; } - (int)processOption:(NSString *)option { [self subclassResponsibility:_cmd]; return 0; } - (void)createConversation { [self subclassResponsibility:_cmd]; } @end steptalk-0.10.0/Tools/distant.st0000644000175000000000000000030610132015544015546 0ustar gurkanroot" Create distant environment " env := STSharedEnvironment environment. Transcript showLine:('Created environment with identifier: ', (env identifier)). Transcript showLine:('Available languages: steptalk-0.10.0/Tools/stalk.m0000644000175000000000000001140110140324376015027 0ustar gurkanroot/** stalk.m Program for 'talking' to scriptable objects Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STExecutor.h" #import #import #import #import #import #import #import #import #import #import #import @interface NSObject (STPrivateMethodDeclarations) - (STEnvironment *)scriptingEnvironment; @end @interface Executor:STExecutor { NSString *hostName; NSString *objectName; id target; } - (void)setTargetWithName:(NSString *)name; @end @implementation Executor - (void)dealloc { RELEASE(objectName); RELEASE(hostName); [super dealloc]; } - (void)setTargetWithName:(NSString *)targetName { NSDebugLog(@"connecting object '%@' on host '%@'",targetName,hostName); if(!targetName) { [NSException raise:STExecutorException format:@"No target specified"]; } target = [NSConnection rootProxyForConnectionWithRegisteredName:targetName host:hostName]; /* [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:object]; */ if(!target) { [NSException raise:STExecutorException format:@"Unable to connect to target named '%@' " @"on host '%@'", targetName, hostName]; return; } ASSIGN(objectName,targetName); } /* FIXME: This definitely needs to be rewritten. It is a quick hack after moving from STEngnie to STConversation */ - (void)createConversation { STEnvironment *env; if([target respondsToSelector:@selector(scriptingEnvironment)]) { env = [target scriptingEnvironment]; } else { [NSException raise:STExecutorException format:@"Target '%@' on host '%@' " @"does not provide scripting environment.", objectName, hostName]; return; } RETAIN(env); [env setObject:target forName:objectName]; conversation = [[STConversation alloc] initWithContext:env language:nil]; } - (int)processOption:(NSString *)option { if ([@"host" hasPrefix:option]) { ASSIGN(hostName,[self nextArgument]); if(!hostName) { [NSException raise:STExecutorException format:@"Hostname expected"]; } } else { [NSException raise:STExecutorException format:@"Unknown option -%@", option]; } return NO; } -(void) beforeExecuting { [self setTargetWithName:[self nextArgument]]; } - (void)printHelp { printf( "stalk - 'talk' to objects with StepTalk script\n" "Usage: stalk [options] target script [args ...] [ , script ...]\n" " Options:\n" "%s" " -host hostName look for target on specified host\n", STExecutorCommonOptions ); } @end int main(int argc, const char **argv) { Executor *executor; NSArray *args; NSAutoreleasePool *pool; NSProcessInfo *procInfo; pool = [NSAutoreleasePool new]; procInfo = [NSProcessInfo processInfo]; if (procInfo == nil) { NSLog(@"Unable to get process information"); [pool release]; exit(1); } executor = [[Executor alloc] init]; args = [procInfo arguments]; NSLog(@"Warning: This tool is obsolete."); [executor runWithArguments:args]; [pool release]; return 0; } steptalk-0.10.0/Tools/stenvironment.m0000644000175000000000000001251610307122742016632 0ustar gurkanroot/** stenvironment.m Scripting environment process Copyright (c) 2005 Free Software Foundation Written by: Stefan Urbanek Date: 2005-08 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STEnvironmentProcess.h" #import #import #import #import #import #import #import #include const int MAX_SEQUENCES = 100; /* Maximal number of environment sequence numbers */ void print_help(void) { printf( "stenvironment - create StepTalk environment process\n" "Usage: stenvironment [options]\n" " Options:\n" " -name name set name of environment\n" " -type env use scripting environment description with name 'env'\n" " -observer name observer 'name' will receive notification\n" "\n" "Notes:\n" "- DO server will be created with name 'STEnvironment:name'\n" "- if no name is given then 'UnnamedNN' will be created, where NN is sequence\n" "- observer is a distributed notification observer\n" "\n" ); } int main(int argc, const char **argv) { NSNotificationCenter *dnc; STEnvironmentProcess *envprocess; NSAutoreleasePool *pool; NSUserDefaults *defs; NSString *envIdentifier; NSString *observerIdentifier; BOOL isRegistered = NO; int sequence = 0; NSConnection *connection; NSDictionary *dict; NSString *serverName; NSArray *args; NSString *str; NSString *descriptionName; pool = [NSAutoreleasePool new]; args = [[NSProcessInfo processInfo] arguments]; if([args count] >= 2) { str = [args objectAtIndex:1]; if([str isEqualToString:@"-h"] || [str isEqualToString:@"--h"] || [str isEqualToString:@"-help"] || [str isEqualToString:@"--help"]) { print_help(); RELEASE(pool); exit(0); } } // [NSAutoreleasePool enableDoubleReleaseCheck:YES]; defs = [NSUserDefaults standardUserDefaults]; observerIdentifier = [defs objectForKey:@"observer"]; envIdentifier = [defs objectForKey:@"name"]; descriptionName = [defs objectForKey:@"type"]; /* FIXME: use environment description name */ envprocess = [[STEnvironmentProcess alloc] initWithDescriptionName:descriptionName]; /* Register environment */ connection = RETAIN([NSConnection defaultConnection]); [connection setRootObject:envprocess]; if(!envIdentifier) { for(sequence = 0; sequence < MAX_SEQUENCES; sequence++) { envIdentifier = [NSString stringWithFormat:@"Unnamed%i", sequence]; serverName = [NSString stringWithFormat:@"STEnvironment:%@", envIdentifier]; NSLog(@"Trying to register environment with name '%@'", envIdentifier); if([connection registerName:serverName]) { isRegistered = YES; } if(isRegistered) { break; } } } else { serverName = [NSString stringWithFormat:@"STEnvironment:%@", envIdentifier]; if([connection registerName:serverName]) { isRegistered = YES; } else { NSLog(@"Unable to register '%@'", serverName); } } /* Finish */ if(isRegistered) { NSLog(@"Environment : '%@'", envIdentifier); NSLog(@"DO Server : '%@'", serverName); if(observerIdentifier) { NSLog(@"Notifying : '%@'", observerIdentifier); dict = [NSDictionary dictionaryWithObjectsAndKeys: envIdentifier, @"STDistantEnvironmentName", nil, nil]; dnc = [NSDistributedNotificationCenter defaultCenter]; [dnc postNotificationName:@"STDistantEnvironmentConnectNotification" object:observerIdentifier userInfo:dict]; } [[NSRunLoop currentRunLoop] run]; NSLog(@"Terminating environment process %@", envIdentifier); } else { NSLog(@"Unable to register environment '%@'.", envIdentifier); } RELEASE(pool); return 0; } steptalk-0.10.0/Tools/stexec.m0000644000175000000000000001275410307113136015213 0ustar gurkanroot/** stexec.m Script executor Copyright (c) 2002 Free Software Foundation Written by: Stefan Urbanek Date: 2000 This file is part of the StepTalk project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "STExecutor.h" #import #import #import #import #import #import #import #import #include @interface Executor:STExecutor { NSString *typeName; NSString *environmentName; NSString *hostName; BOOL enableFull; } @end @implementation Executor - (void)createConversation { STEnvironmentDescription *desc; STEnvironment *environment; if(environmentName) { /* user wants to connect to a distant environment */ conversation = [[STRemoteConversation alloc] initWithEnvironmentName:environmentName host:hostName language:langName]; if(!conversation) { NSLog(@"Unable to connect to %@@%@", environmentName, hostName); return; } } else { /* User wants local temporary environment */ if(!typeName || [typeName isEqualToString:@""]) { environment = [STEnvironment environmentWithDefaultDescription]; } else { desc = [STEnvironmentDescription descriptionWithName:typeName]; environment = [STEnvironment environmentWithDescription:desc]; } /* Register basic objects: Environment, Transcript */ [environment setObject:environment forName:@"Environment"]; [environment loadModule:@"SimpleTranscript"]; [environment setCreatesUnknownObjects:YES]; /* FIXME: remove this or use some command-line flag */ [environment setFullScriptingEnabled:enableFull]; conversation = [[STConversation alloc] initWithContext:environment language:langName]; } } - (void)dealloc { RELEASE(typeName); RELEASE(environmentName); RELEASE(hostName); [super dealloc]; } - (int)processOption:(NSString *)option { if ([@"type" hasPrefix:option]) { ASSIGN(typeName, [self nextArgument]); if(!typeName) { [NSException raise:STExecutorException format:@"Environment description (type) name expected"]; } } else if ([@"environment" hasPrefix:option]) { ASSIGN(environmentName,[self nextArgument]); if(!environmentName) { [NSException raise:STExecutorException format:@"Environment name expected"]; } } else if ([@"host" hasPrefix:option]) { ASSIGN(hostName,[self nextArgument]); if(!hostName) { [NSException raise:STExecutorException format:@"Host name expected"]; } } else if ([@"full" hasPrefix:option]) { enableFull = YES; } else { [NSException raise:STExecutorException format:@"Unknown option -%@", option]; } return 0; } - (void)beforeExecuting { } - (void) printHelp { printf( "stexec - execute StepTalk script (in GNUstep-base environment)\n" "Usage: stexec [options] [script] [args ...] [ , script ...]\n" " Options:\n" "%s" " -full enable full scripting\n" " -environment env use scripting environment with name env\n" " -host host find environment on host\n" " -type desc use environment description with name 'desc'\n" "\n" "Notes:\n" "- if -environment is used, then -type is ignored" "- if no script is specified, standard input is used without arguments\n" "- if script name is '-' then standard input is used and arguments are passed" " to the script\n", STExecutorCommonOptions ); } @end int main(int argc, const char **argv) { Executor *executor; NSArray *args; NSAutoreleasePool *pool; NSProcessInfo *procInfo; pool = [NSAutoreleasePool new]; // [NSAutoreleasePool enableDoubleReleaseCheck:YES]; procInfo = [NSProcessInfo processInfo]; if (procInfo == nil) { NSLog(@"Unable to get process information"); RELEASE(pool); exit(1); } //GSDebugAllocationActive(YES); executor = [[Executor alloc] init]; args = [procInfo arguments]; [executor runWithArguments:args]; RELEASE(executor); //printf("%s\n",GSDebugAllocationList(NO)); RELEASE(pool); return 0; } steptalk-0.10.0/COPYING0000644000175000000000000006347410132015522013476 0ustar gurkanroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! steptalk-0.10.0/ChangeLog0000644000175000000000000005077210307124555014225 0ustar gurkanroot2005 Sep 5 Stefan Urbanek * Version 0.10.0 2005 Sep 5 Stefan Urbanek * Frameworks/StepTalk: compiler warnings removed 2005 Aug 30 Stefan Urbanek * STLanguageManager: new class * STLanguage: removed * STEngine: engineForLanguageWithName: and engineForFileType: removed, use STLanguageManager instead, added engineForLanguage: * Tools/stexec - updated to use STLanguageManager * Tools/stupdate_languages - removed as it was replaced by STLanguageManager * Examples/Server - removed as it was replaced by stenvironment and distant scripting Notes: - you can delete */Library/StepTalk/Configuration directories 2005 Aug 17 Stefan Urbanek * STConversation: renamed run* method to interpret*, interpretScript: does not return value anymore (because of distant conversations), new methods result and resultByCopy were added * STEnvironment: removed depreciated methods * STDistantConversation: new class for conversations with distant objects * Tools/stenvironment: new tool for semi-persistent scripting environments * Tools/stexec: added reading from stdin; reflect library changes * Tools/stalk: removed * STEngine: renamed methods (see STEngine.h for more information) 2005 June 30 Version 0.9.1 2005 June 30 * STActor: new class * Examples/Smalltalk/actor - new actor example 2005 June 19 Version 0.9.0 2005 June 19 Stefan Urbanek * STEnvironment: search class name namespace when no object is found for given name and full scripting is enabled. 2005 Jan 4 Stefan Urbanek * First step of introducing contexts NOTE: This version is unstable. 2004 Nov 9 Stefan Urbanek * Remove STMethodSignatureForSelector as it was deprecated because of inportability to OSX. 2004 Sep 23 Stefan Urbanek * STContext: new class * STEnvironment: make it subclass of STContext, move several methods 2004 Sep 6 Stefan Urbanek * stshell: fix for compiler * added missing STEnvironmentDescription installation 2004 Aug 2 Stefan Urbanek * Search for scripts in */Library/Scripts/* * stexec: use scripts manager to look for scripts in default locations. For this tool it is .../Library/Scripts/Shell or .../Library/StepTalk/Scripts/Shell 2004 Jul 26 Stefan Urbanek * Added NSString containsString: to Foundation module. 2004 Jun 27 Stefan Urbanek * Added examples: - Developer/StepUnit.st from Mateu Batle - awlaunch.sh from Frederico Munoz * Version 0.8.1 2004 Apr 25 Stefan Urbanek * Changed license to LGPL 2004 Apr 19 Stefan Urbanek * applied patch from Mateu Batle to replace nil valuse with STNil on message sending * fixed STConversation issue 2004 Mar 28 Stefan Urbanek Changes according to the Helge Hess: * STBundleInfo: fix to use string instead of constant (OSX compatibility) * STFileScript, STLanguage, STScript: added missing #imports 2003 Nov 24 Stefan Urbanek * Version 0.8.1 2003 Nov 24 Stefan Urbanek * Few fixes, removed some compiler warnings. Fixed Shell to use proper environment. 2003 Nov 8 Stefan Urbanek * Updated tools to use STConversation object. 2003 Oct 23 Stefan Urbanek * Added STEnvironment +sharedEnvironment, +defaultScriptingEnvironment and initWithDefaultDescription. Deprecated initDefault, environmentWithDescriptionName, environmentWithDescriptionName * Added STConversation class 2003 Oct 6 Stefan Urbanek * Added STFileScript - moved all unnecessary stuff from STScript there. * Fixed STScriptsManager to use STFileScript 2003 Oct 3 Stefan Urbanek * Added ReadlineTranscript module (Idea by Alexander Diemand + patch from David Ayers) * Added shell.st example. 2003 Sep 24 Stefan Urbanek * STEnvironmentDescription: guard initialisation in Autorelease pool 2003 Sep 23 Stefan Urbanek * STEngine: setValueForOption: added 2003 Aug 13 Stefan Urbanek * Version 0.8.0 2003 Aug 9 Stefan Urbanek * Removed compiler warnings in StepTalk.framework, Smalltalk and Tools 2003 Aug 6 Stefan Urbanek * Frameworks: new directory * Changed StepTalk from library to framework * Modules: Removed StepTalk module as it is no more needed, because we have framework and it can provide scripting capabilities by it self * All GNUMakefiles modified to reflect change to Framework * Added Framework loading in .stenv description files. Use: Frameworks = (name1, name2); NOTE: You HAVE to remove your previous installation of StepTalk to be able to install new one. (especially Local/Library/Headers/StepTalk). 2003 Aug 5 Stefan Urbanek * Added STScriptObject and STMethod. 2003 Jun 15 * NSInvocation+additions: added unknown selector creation; created a workaround for gnustep DO bug * STObjCRuntime: Fixed creation of signature. 2003 May 11 Stefan Urbanek * Fixed linking of some bundles 2003 May 10 Stefan Urbanek * Fixed linking under mingw32 * STBundleInfo: implemented framework searching * STEnvironment: includeFramework: new method. 2003 May 2 Stefan Urbanek * STBundleInfo: added objectReferenceDictionary; removed unnecessary ST prefix from ScriptingInfo.plist keys and added warnings for the change.; check for existence of ScriptingInfo.plist before using it * Modules: reflect changes to STBundleInfo * Updated all GNUmakefiles to use new path * STEnvironment: added initDefault - this will replace confusing defaultScriptingEnvironment. * Added Applications * Added ScriptPapers application 2003 Apr 22 Stefan Urbanek * Added library reference documentation generated by autogsdoc. * Added TroubleShooting.txt document 2003 Apr 21 Stefan Urbanek * Version 0.7.1 2003 Apr 04 David Ayers * STEngine.h: Fixed declaration to match implementation to avoid compiler warnings. * STEnvironment.h: Ditto. * STScriptsManager.h: Ditto. * STLanguage.h: Corrected declaration. * STScriptsManager.m: Added needed interface declaration. * GNUmakefile: Added flags to show all warnings except for import. * Module/ObjectiveC/GNUmakefile: Added flags to show all warnings except for import. * Module/Foundation/GNUmakefile: Added flags to show all warnings except for import. * Module/AppKit/AppKitExceptions.m: Used variable to supress compiler warnings. * Module/AppKit/AppKitNotifications.m: Ditto. * Module/AppKit/GNUmakefile: Added flags to show all warnings except for import. * Module/GDL2/GDL2Constants.m: Used variable to supress compiler warnings. * Module/GDL2/GNUmakefile: Added flags to show all warnings except for import. * Module/SimpleTranscripts/GNUmakefile: Added flags to show all warnings except for import. * Module/StepTalk/GNUmakefile: Added flags to show all warnings except for import. * Tools/stalk.m: Added needed interface declaration. * Tools/stupdate_languages.m: Corrected variable declaration and added cast. 2003 Apr 3 Stefan Urbanek * STScript: added compareByLocalizedName: 2003 Mar 30 Stefan Urbanek * WISH: new file 2003 Mar 25 Stefan Urbanek * STScriptsManager: new method setScriptSearchPathsToDefaults; new method setScriptSearchPaths:; added instance variable scriptSearchPaths 2003 Mar 24 Stefan Urbanek * Documentation: Updated ApplicationScripting.txt 2003 Mar 23 Stefan Urbanek * Added ApplicationScripting * GNUMakefile: add ApplicationScripting. Can be ignored when appkit=no * Languages/Guile: Fixed steptalk interface changes (patch from Matt Rice ) 2003 Mar 22 Stefan Urbanek * STEnvironment: includeBundle returns NO on failure * STScriptsManager: added method allScripts that returns all scripts for domainand; added private method _scriptsAtPath: * STScript: do not delete original extension when looking for script info file, so some.st will have some.st.stinfo; renamed localizedScriptName to localizedName * STLanguage: new methods: updateFileTypeDictionary and allKnownFileTypes 2003 Feb 21 Stefan Urbanek * StepTalk.h: Removed #import of STModule.h as it is no longer there 2003 Feb 11 Stefan Urbanek * Source/GNUmakefile: fixed installation of documentation 2003 Feb 4 Stefan Urbanek * STBundleInfo: warn instead of raise an exception if there is no scripting info class. 2003 Feb 3 Stefan Urbanek * Version 0.7.0 2003 Jan 30 Stefan Urbanek * STBundleInfo: Removed compiler warning * Modules/*: Cleanup for compiler warnings 2003 Jan 29 Stefan Urbanek * Modules/ObjectiveC: fixed GNUmakefile to include source headers 2003 Jan 25 Stefan Urbanek * STBundleInfo: Fixed NSBundle stepTalkBundleNames to use .bundle file extension * Modules/*/GNUmakefile: Removed now unnecesary -lStepTalk, because modules do not have to be linked with StepTalk anymore 2003 Jan 25 Stefan Urbanek * Version 0.7.0pre1 2003 Jan 24 Stefan Urbanek * STBundleInfo: Use info from ScriptingInfo.plist instead of bundle's main info dictionary * Modules/*: Create ScriptingInfo.plist * Modules/GNUmakefile: Compile GDL2 module if it is available. 2003 Jan 22 Stefan Urbanek * STEnvironment: added includeBundle: method 2003 Jan 22 Stefan Urbanek * STModule: removed * STBundleInfo: added new class STBundleInfo and additional methods to NSBundle * STEnvironment: reflect change from STModule to NSBundle/STBundleInfo; * Modules/*: reflect change from STModule to NSBundle/STBundleInfo IMPORTANT NOTE: You have to rebuild all modules, because the format has changed. 2003 Jan 22 Stefan Urbanek * NSNumber+additions: Added -modulo: method. * Foundation bundle: added NSFileManager extensions; added missing constants * Documentation/Additions.txt: new file 2003 Jan 20 Stefan Urbanek * GNUMakefile: Removed inclusion of source-distribution.make, as it is not needed (suggested by Nicola Pero ) * Examples/Developer: new directory containing developer examples 2003 Jan 15 Stefan Urbanek * GDL2: added installation of GDL2.stenv * Documentation/Tools.txt: new file documenting steptalk tools 2002 Dec 25 Stefan Urbanek * Version 0.6.2 2002 Dec 21 Stefan Urbanek * Languages/GNUmakefile, Modules/GNUmakefile, Finders/GNUmakefile: removed forced installation to the GNUSTEP_USER_ROOT. ~/Library/StepTalk/* should be deleted. * Documentation/Modules.txt: added 2002 Nov 29 Stefan Urbanek * Added GDL2 module * STModule: more details on module loading fault 2002 Nov 11 Stefan Urbanek * ObjectiveC module: added selectorsContainingString: and implementorsOfSelector: 2002 Nov 5 Stefan Urbanek * Added MyLanguage as empty example language bundle 2002 Sep 17 Stefan Urbanek * Patch from Jeff Teunissen with various bug-fixes * Added .cvsignore files 2002 Sep 15 Stefan Urbanek * Version 0.6.1 2002 Sep 15 Stefan Urbanek * Modules/AppKit/AppKitConstants.list: commented out undefined constants 2002 Sep 7 Stefan Urbanek * Modules/AppKit/AppKitInfo.plist: added NSSound class 2002 Aug 27 Stefan Urbanek * Source/*.m: Cleanup to remove compiler warnings. 2002 Jun 18 Stefan Urbanek * STScript: new class (from AppTalk) * STScriptsManager: new class (from AppTalk) * Modules/StepTalk: new module 2002 Jun 14 Stefan Urbanek * Modules/ObjectiveC: new module 2002 Jun 10 Stefan Urbanek * NSObject+additions: removed -className as it was added to the base library 2002 Jun 9 Stefan Urbanek * Version 0.6.0 released 2002 Jun 8 Stefan Urbanek * STEnvironmentDescription: added module amd finder list; little code cleanup; removed descriptionFromFile: and initFromFile: methods * STEnvironment: removed methods environmentWithDescriptionFromFile: environmentWithDescriptionFromDictionary: initWithDescriptionFromFile: init addAllClasses addObject:withName: allObjectNames new methods: environmentWithDescription: initWithDescription: renamed methods: defaultObjectPool to objectDictionary registerObjectFinderWithName: to registerObjectFinderNamed: load modules and finders from description at initialization; * STExecutor: reflect STEnvironment changes * stexec: removed loading of the Foundation module as this is handled by the STEnvironment * Environments: new descriptions AppKit.stenv and Distributed.stenv 2002 Jun 7 Stefan Urbanek * STEnvironmentDescription: added abstract class 'All' that is root class for all classes * Foundation-operators.stenv: add symbolic selector '->' to all classes 2002 Jun 6 Stefan Urbanek * Added symbolic selector '->' for valueForKeyPath: * StepTalk.stenv: allow whileTrue: and whileFalse: in STBlock * NSObject+additions: moved from Smalltalk; added -isSame: method * DistributedFinder: prevent NSDictionary log when there is no file for a requested object; changed NSLogs to NSDebugLLogs with 'STFinder'; do not try to launch nil tool 2002 Jun 4 Stefan Urbanek * STEnvironment: new methods -addObjectFinder:name:, -addObjectFinderWithName:, -removeObjectFinderWithName:; new method knownObjectNames; objectReferenceForObjectWithName: changed to use nil reference on known object that cannot be currently found * Finders: new directory containing object finders * STObjCRuntime: include selectors of metaclasses in STAllObjectiveCSelectors() * Documentation/HowTo.txt: rewritten 2002 Jun 3 Stefan Urbanek * STFunctions: renamed "StepTalk/Config" directory to "StepTalk/Configuration"; fixed bug in STFindAllResources (resourceDir was ignored) * STEnvironment: changed method allObjectsDictionary to allObjectNames 2002 May 30 Stefan Urbanek * STEnvironment: removed pools * STObjectReference: removed method initWithObjectName:pool:create: 2002 May 29 Stefan Urbanek * STExecutor: fixed typo * STEnvironment: new method -allObjectsDictionary that returns a NSDictionary with all named objects * STObjCRuntime: new function STAllObjectiveCSelectors 2002 May 24 Stefan Urbanek * STEngine: engineForLanguage: renamed to engineForLanguageWithName:. Some method documentation added. * STExecutor: reflect method renaming * STLanguage: read default language name from actual user defaults (not from the StepTalk domain) and renamed the key to STDefaultLanguageName. Renamed languageWithBundle: to languageWithPath:. Some method documentation added. * STEnvironmentDescription: read default description name from actual user defaults (not from the StepTalk domain) * STEnvironment: Some method documentation added. * StepTalk.gsdoc: new file 2002 May 13 Stefan Urbanek * Uploaded to the GNUstep CVS repository by Adam Fedor 2002 Apr 20 Stefan Urbanek * COPYING: updated * STExterns: Removed unused exceptions * STStructure: Changed exception to STInternalIncosistencyException 2002 Apr 13 Stefan Urbanek * Modules/GNUmakefile: added option that disables making of appkit support Use make appkit=no. * Separated AppTalk 2002 Mar 17 Stefan Urbanek * STEngine: removed executeScript: methods and use only executeSource: engine does not make difference between script and statements anymore * Tools: removed --expressions option * Examples: fixed Smalltalk examples to use new grammar * STLanguage: new method languageNameForFileType: 2002 Mar 13 Stefan Urbanek * AppKit module: removed old AppKit constants and renamed MiddleButton events to OtherButton. 2002 Feb 14 Stefan Urbanek * added make option 'appkit'. if you set it to 'no' (make appkit=no), no appkit stuff will be compiled. 2002 Feb 5 Stefan Urbanek * StepTalk 0.5.0 released 2002 Feb 5 Stefan Urbanek * STSelector: new file * NSInvocation+additions: handle SEL type with STSelector * Examples: added selector.st, notification.st, scope.st and pldes.st 2002 Feb 3 Stefan Urbanek * Testing: new directory 2002 Jan 30 Stefan Urbanek * STEnvironment: Removed unused variables, 2002 Jan 23 Stefan Urbanek * NSNumber+additions: moved from Smalltalk, added methods for creation of range, point and size 2002 Jan 21 Stefan Urbanek * StepTalk 0.4.1 released 2002 Jan 21 Stefan Urbanek * Removed Foundation constants to separate module * stexec: load Foundation module instead of loading all ObjC classes 2002 Jan 13 Stefan Urbanek * Guile: new language bundle 2002 Jan 9 Stefan Urbanek * StepTalk 0.4.0 released 2002 Jan 9 Stefan Urbanek * STFunctions: new function STUserConfigPath * STLanguage: new method languageForFileType: * new tool stupdate_languages to create/update languages configuration file 2001 Dec 8 Stefan Urbanek * NSInvocation+addition: return receiver (target) when return type is void 2001 Nov 19 Stefan Urbanek * STModule: New method -classNames; returns array of names of exported classes 2001 Nov 14 Stefan Urbanek * removed force of use of users home directory for installation * new module AppKit * STEnvironment: new method -addAllClasses to add all Objective-C classes 2001 Nov 10 Stefan Urbanek * StepTalk 0.3.0 released 2001 Nov 10 Stefan Urbanek * Added scriptable server example. 2001 Nov 9 Stefan Urbanek * STExecutor: new options: --list-objects, --list-classes and --list-all-objects * Tools/stalk.m: resurected * Tools/GNUmakefile: uncommented stalk tool * moved initialization of STNil from STUndefinedObject to STEngine 2001 Nov 6 Stefan Urbanek * STProtocolInfo: removed * STBehaviourInfo, STClassInfo, STEnvironmentDescription: rewritten * Environment description files changed 2001 Nov 5 Stefan Urbanek * Tools/stexec: fixed bug, that caused segfault (reported by Nicola Pero ) * Examples: new directory with Smalltalk script examples * STEnvironment: fixed restricted/full scripting. translateSelector:forReceiver: now raises an exception if selector is not allowed for receiver; standardScriptingEnvironemnt renamed to defaultScriptingEnvironment and calls STEnvironmentDescription defaultEnvironmentDescriptionName * STEnvrionmentDescription: New method +defaultEnvironmentDescriptionName. 2001 Nov 3 Stefan Urbanek * Tools: implemented --environment switch to use environment description with name. 2001 Nov 1 Stefan Urbanek * New ChangeLog started. Rewritten and redesigned. * Added support for multiple languages. Created Smalltalk language bundle. steptalk-0.10.0/GNUmakefile0000644000175000000000000000243310132015522014501 0ustar gurkanroot# # Main Makefile for the StepTalk # # Copyright (C) 2000 Stefan Urbanek # # Written by: Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA # include $(GNUSTEP_MAKEFILES)/common.make include Version PACKAGE_NAME = StepTalk CVS_MODULE_NAME = StepTalk APPSCRIPT=ApplicationScripting ifeq ($(appkit),no) APPSCRIPT= endif SUBPROJECTS = \ Frameworks \ Languages \ Finders \ Modules \ Tools \ $(APPSCRIPT) -include GNUMakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUMakefile.postamble steptalk-0.10.0/NEWS0000644000175000000000000001527310307125370013143 0ustar gurkanroot0.10.0 * introduced new language management (STLanguageManager) * introduced remote scripting (STRemoteConversation) * new tool for semi-persistent environments: stenvironment * added reading from stdin to stexec * added remote scripting to stshell and stexec * new conversation methods * removed tools: stalk, stupdate_languages * removed depreciated methods from STEnvironment, removed class STLanguage Notes: - you can delete */Library/StepTalk/Configuration directories 0.9.1 * Actor class - STActor. For more information see attached example or Examples/Smalltalk/stactor.st * fixes after GNUstep-base fixes of NSUnknownKey 0.9.0 * Changed "full scripting" behaviour. When enabled, all classes are available for scripting, not only those published by frameworks. * There was done design fix in the Smalltalk language bundle. Instance variables of script objects were accessed by index, now they are referenced by names. This allows further creation of STActor (STScriptObject successor) object that is composed of script methods and ivars. Also it would be possible to create script methods for any objc receiver. Ivar access is done through KVC. For more information do not hesitate to ask. 0.8.2 * Fixed and changed license to LGPL * Several fixes from Mateu Batle for the framework and Smalltalk bundle * Fixed bug with signed/unsigned bytecode in the Smalltalk bundle 0.8.1 * Added ReadlineTranscript * Renamed, added and deprecated some STEnvironment methods. Methods were not removed, NSLog warnings were added. * Added STConversation object. Basically, it's a conversation with objects in an environment using a scripting language. The reason for creating this clas was to open a path for easier remote scripting where you can 'talk in a conversation' with a remote DO server or application. However, this remote part is just going to be implemented. 0.8.0 NOTE: You HAVE to remove your previous installation of StepTalk to be able to install new one. (especially Local/Library/Headers/StepTalk). Major changes: * Changed StepTalk from library to a framework * Added script objects. Other: * StepTalk module was removed, because it was no longer required. * Added framework loading support in environment description files (.stenv) * Added some autogsdoc generated documentation * Implemented Framework support and new Environment method: includeFramework: * Created a workaround for gnustep-base Distributed Objects bug. Now DO shold work correctly. * Some smalltalk parser fixes. 0.7.1 * Prepared StepTalk for application scripting support * Added application scripting support bundle * Added documentation for application scripting * Many source cleanups by David Ayers * Some bugfixes in Smalltalk source reader For more information about scripting bundle see ApplicationScripting directory. 0.7.0 * Added ability to use any bundle or framework for scripting * Moved scripting information from bundle info dictionary into separate file. * Replaced .stmodules with plain bundles. * Removed STModule class * Added conditional GDL2 module installation. * Small improvements and bug-fixes. IMPORTANT NOTE: You have to rebuild and reinstall all modules, because the bundle format has changed. 0.6.2 * Smalltalk: Added parsing of real numbers * ObjectiveC: added two new methods into the Runtime object: selectorsContainingString: returns an array of selectors that contain specified string implementorsOfSelector: returns an array of all classes that implement specified selector * Created an empty language bundle MyLanguage as an example * Added GDL2 module * Fixed installation: removed forced installation to the user's home directory NOTE: Please delete all standard StepTalk language bundles, modules and finders from your home directory if it is not your default installation directory so new bundles can be found. 0.6.1 * Code cleanup * New modules: ObjectiveC and StepTalk * New classes: STScript and STScriptManager 0.6.0 * Created 'Object Finders' Distributed Object Finder Application Finder * New example tool stshell - the StepTalk shell * Automated loading of modules and finders using scripting environment descriptions * StepTalk defaults changed * Some source documentation added * Bugfixes in Smalltalk language 0.5.2 * Separated AppTalk * Added option to make "appkit=no" to disable making of AppKit stuff. 0.5.1 * Added AppTalk application scripting library * Smalltalk syntax changed. See Documentation/Smalltalk section Source. * Fixed AppKit constants * Make it build with latest GNUstep release * Various bugfixes 0.5.0 * support for NSRange, NSPoint and NSSize (see example range.st) * Implemented SEL type handling (see examples selector.st and notification.st) * New example pldes.st - pldes tool written in smalltalk Smalltalk: * Small (10-15%)speed improvements of block evaluation * Handle 'exit' method in script object. 'self exit' will terminate script execution. * Documentation describing smalltalk features (exception handling, symbolic selector and iterators) 0.4.1 * Guile - new language bundle. gstep-guile library is needed. Guile bundle is not build by default. You have to make it in Languages/Guile directory (make; make install). You may try to execute very simple piece of code in Languages/Guile/Tests using stexec. NOTE: do not forget to run 'stupdate_languages' after installing any new language bundle. To find out if languages were updated, try 'stexec -list-languages' * Separated Foundation binding stuff to Foundation module 0.4.0 * AppKit - new module * AppKit examples openPanel - shows NSOpenPanel rtf2text - converts RTF document to plain text * Added execution of script with more methods * Tools will now try to get language type from file extension * Added new tool stupdate_languages to create file extensions dictionary 0.3.0 for more details see ChangeLog file * Added few examples to show how scripting works. See Examples directory in source package. * Added tool 'stalk' to talk to named servers. * Added new tool options. * Some known bugs were fixed. * Little bit of documentation added (see Documentation directory) * STEnvironment interface changed steptalk-0.10.0/README0000644000175000000000000000614010132015522013306 0ustar gurkanrootStepTalk -------- Ahthor: Stefan Urbanek (Google the name for contact) License: LGPL (see file COPYING) What is StepTalk ? ------------------ StepTalk is a scripting framework for creating scriptable servers or applications. StepTalk, when combined with the dynamism that the Objective-C language provides, goes way beyond mere scripting. It is written using GNUstep. Where to get it? ---------------- StepTalk requires GNUstep http://www.gnustep.org You can download StepTalk from http://www.gnustep.org/experience/StepTalk.html Documentation for users and developers: http://wiki.gnustep.org/index.php/Scripting Installation ------------ You need to have GNUstep which you can get from http://www.gnustep.org To install StepTalk type: > make > make install If you do not want to build AppKit extensions, then type > make appkit=no > make appkit=no install If something goes wrong while build process and it is not while building in the Source directory, then try to do make and make install in that directory first. In any case of problem, do not hesitate to contact the author. StepTalk Shell is included in Examples/Shell directory. It requires libncurses. Tools ----- stexec - execute a StepTalk script in the GNUstep Foundation environment stalk - talk to named server stupdate_languages - update the available languages info stshell - StepTalk shell - interactive tool (in Examples/Shell) Predefined objects for executing scripts by 'stexec' Args - command line arguments Engine - scripting engine Environment - scripting environment Transcript - simple transcript Sripting environment description ------------------------------------------- Scripting environment description is used to translate the method names and/or allow or deny the methods for concrete classes. Denying methods can be used to create safe scripting environment as prevention against script viruses. It contains: - list of methods, that are available for scripting for particular class - symbolic selector (operator) to selector mapping - list of modules to be loaded - list of object finders Standard vs. full scripting --------------------------- Before each message send, selector is translated using scipting description. When standard scripting is used and there is no such selector avilable for scripting for target object, then an exception is raised. With full scripting, any message should be sent to any target object. Files ----- StepTalk is looking for its files in GNUSTEP_*_ROOT/Library/StepTalk There should be these directories: Configuration - Configuration files Environments - Directory containig environment descriptions Finders - Object finders Languages - StepTalk language bundles Modules - StepTalk modules Scripts - Directory containig StepTalk scripts Defaults -------- See Documentation/Defaults.txt Feedback -------- Send comments, questions and suggestions to: discus-gnustep@gnu.org Send bug reports to: bug-gnustep@gnu.org steptalk-0.10.0/TODO0000644000175000000000000000271610305164224013131 0ustar gurkanrootTODO list - find all defaults and document them - find all debug logs and document them - find all used .plist keys/values and document them (STLanguageManager,...) - optimalise method execution - each time language manager is fetched -can be expensive HIGH PRIORITY - implement NSRect object - Rewrite Smalltalk compiler (grammar) Remove STBytecodeInterpreter and use only STCompiler. How? Simply convert language constructions into 'command' objects like SmalltalkStatement, SmalltalkPrimary, SmalltalkMethodSend, ... and implement executeInEnvironment:context:receiver: - Update application scripting to use STConversation LOW PRIORITY UNDEFINED - handle 'connection did die' notification for distant objects in STEnvironment - fix class-info lookup for proxies in STEnvironment - Smalltalk: separate compiler and compilation context - create a 'Shell' scripting environment - Create ApplicationScripting framework, instead of bundle. It should offer passive application scripting (without linking) and active app. scripting (linking with the framewotk). Give it some reasonable name, becauase that one is already used by Apple - Add framework list into environment description - Change Modules to Frameworks - Fill implementation of STScriptObject, STMethod and related STEngine methods - Remove empty directories (Source, Modules/StepTalk) - Replace STMethod languageName with map table of method class->engine class steptalk-0.10.0/Version0000644000175000000000000000051710301671126014006 0ustar gurkanroot# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The version number of this release. MAJOR_VERSION=0 MINOR_VERSION=10 SUBMINOR_VERSION=0 STEPTALK_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} VERSION=${STEPTALK_VERSION} steptalk-0.10.0/WISH0000644000175000000000000000736310132015522013133 0ustar gurkanrootDear all, users and developers... This text describes my intentions and wishes for StepTalk. Author: Stefan Urbanek E-Mail: google the name for contact Home : http://stefan.agentfarms.net Content: What is the goal of StepTalk? Language and Interaction The Framework What is the goal of StepTalk? ----------------------------- StepTalk was meant to be an 'distributed object glue' or 'application glue'. The primary intention was to create a framework that will allow users to join functionalities of different applications (or distributed objects) to complete desired tasks. It should allow users to 'talk' to their applications with some language that is understandable to both - to the user and to the application. Another intention was to allow users to extend applications with functionality they miss, or want to automatize, or want to do in a batch. StepTalk is a framework that wants to fill the gap between application author and users with their needs. It wants to provide a feel of single common object universe. Language and Interaction ------------------------ StepTalk is rather language abstraction than a (scripting) language. The idea of abstraction is, that users and developers are dealing with an universe of interacting objects. It is based on two basic principles: 1. Every thing is an object 2. Objects are communicating by sending messages "Objects are 'nouns' and messages are 'verbs' of a language. ", to add a famous quote. Nouns in a (scripting) language are objects with name. That name usually depends on the context it is present or it should be globally well known object. Now, why I have chosen Smalltalk as default language? Because ... "In essence, Smalltalk is a programming language focused on human beings rather than the computer." - Alan Kinght I do not say, that it is the best language, but it is more understandable by users than other, usual, programming languages. Nevertheless, that does not mean, that some day there will not be other language. The Framework ------------- (this part is for mainly for developers and curious users) This part will be something more concrete and will describe desired concepts and their StepTalk objects. Language - STLanguage provides language information and execution mechanisms. Language context - is represented by STEnvironment. Maybe not very good name and it should be changed to STContext rather. Context defines names for concrete objects and defines mappings of verbs (selectors). Nouns - Objects with names. Some names should refer no non-concrete objects. The meaning of such names is provided by object finders, which will assign concrete object to that name, when requested. Script - Just plain NSString. Script execution - Concrete subclasses of STEngine will execute a script written in specific language. Engines should refer to the language context to find out the objects behind names refered by users and provided by developers. Future ------ What needs to be done? - make it be real object glue that will join functionalities of different applications - provide 'script objects' where one can create an object, define its behaviour with 'script methods' in any language. Make it similar to prototype based language - Self. (Google for: self language) Conclusion ---------- I had no time to achieve this goal by implementing all I wanted and in the way I wanted. Please, keep it simple and make the interface focused on users. Any further comments, questions and suggestions are welcome. steptalk-0.10.0/.cvsignore0000644000175000000000000000011610132015521014422 0ustar gurkanroot*.app *.debug *.profile shared_*obj *.bundle *.stmodule *.stlanguage New Old steptalk-0.10.0/.dist-ignore0000644000175000000000000000015310301734442014660 0ustar gurkanrootCVS obj shared_obj shared_debug_obj *.app *.debug *.bundle *.o New Old Extensions .snap-ignore .stlanguage steptalk-0.10.0/GNUmakefile.postamble0000644000175000000000000000326610132015522016473 0ustar gurkanroot# # GNUmakefile.postamble # # Copyright (C) 2000 Stefan Urbanek # # This file is part of the StepTalk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; see the file COPYING.LIB. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling before-all:: ln -sf Source/Headers . # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check::