From a60df5a20a698c86552c608a3d8c539c02d273ae Mon Sep 17 00:00:00 2001 From: Stefan Urbanek Date: Fri, 2 May 2003 09:37:07 +0000 Subject: [PATCH] Added ScriptPapers application git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@16601 72102866-910b-0410-8b05-ffd578937521 --- Applications/ScriptPapers/AppController.h | 31 ++++ Applications/ScriptPapers/AppController.m | 58 +++++++ .../English.lproj/Paper.gorm/data.classes | 154 +++++++++++++++++ .../English.lproj/Paper.gorm/objects.gorm | Bin 0 -> 1992 bytes .../ScriptPapers.gorm/data.classes | 155 ++++++++++++++++++ .../ScriptPapers.gorm/objects.gorm | Bin 0 -> 13008 bytes Applications/ScriptPapers/GNUmakefile | 62 +++++++ .../ScriptPapers/NSObject+NibLoading.h | 31 ++++ .../ScriptPapers/NSObject+NibLoading.m | 58 +++++++ .../ScriptPapers/NSTextView+additions.h | 31 ++++ .../ScriptPapers/NSTextView+additions.m | 40 +++++ Applications/ScriptPapers/ScriptPaper.h | 35 ++++ Applications/ScriptPapers/ScriptPaper.m | 109 ++++++++++++ .../ScriptPapers/ScriptPaperController.h | 38 +++++ .../ScriptPapers/ScriptPaperController.m | 103 ++++++++++++ .../ScriptPapers/ScriptPapersInfo.plist | 20 +++ Applications/ScriptPapers/main.m | 37 +++++ Applications/ScriptPapers/run | 1 + ChangeLog | 4 + Documentation/Reference/STEnvironment.gsdoc | 7 + Documentation/Reference/STEnvironment.html | 11 ++ Documentation/Reference/StepTalk.igsdoc | 4 + Source/Headers/StepTalk/STEnvironment.h | 1 + Source/STEnvironment.m | 13 ++ 24 files changed, 1003 insertions(+) create mode 100644 Applications/ScriptPapers/AppController.h create mode 100644 Applications/ScriptPapers/AppController.m create mode 100644 Applications/ScriptPapers/English.lproj/Paper.gorm/data.classes create mode 100644 Applications/ScriptPapers/English.lproj/Paper.gorm/objects.gorm create mode 100644 Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/data.classes create mode 100644 Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/objects.gorm create mode 100644 Applications/ScriptPapers/GNUmakefile create mode 100644 Applications/ScriptPapers/NSObject+NibLoading.h create mode 100644 Applications/ScriptPapers/NSObject+NibLoading.m create mode 100644 Applications/ScriptPapers/NSTextView+additions.h create mode 100644 Applications/ScriptPapers/NSTextView+additions.m create mode 100644 Applications/ScriptPapers/ScriptPaper.h create mode 100644 Applications/ScriptPapers/ScriptPaper.m create mode 100644 Applications/ScriptPapers/ScriptPaperController.h create mode 100644 Applications/ScriptPapers/ScriptPaperController.m create mode 100644 Applications/ScriptPapers/ScriptPapersInfo.plist create mode 100644 Applications/ScriptPapers/main.m create mode 100755 Applications/ScriptPapers/run diff --git a/Applications/ScriptPapers/AppController.h b/Applications/ScriptPapers/AppController.h new file mode 100644 index 0000000..4a6cd4d --- /dev/null +++ b/Applications/ScriptPapers/AppController.h @@ -0,0 +1,31 @@ +/** 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 diff --git a/Applications/ScriptPapers/AppController.m b/Applications/ScriptPapers/AppController.m new file mode 100644 index 0000000..675c93f --- /dev/null +++ b/Applications/ScriptPapers/AppController.m @@ -0,0 +1,58 @@ +/** 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 diff --git a/Applications/ScriptPapers/English.lproj/Paper.gorm/data.classes b/Applications/ScriptPapers/English.lproj/Paper.gorm/data.classes new file mode 100644 index 0000000..89feb74 --- /dev/null +++ b/Applications/ScriptPapers/English.lproj/Paper.gorm/data.classes @@ -0,0 +1,154 @@ +{ + 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; + }; +} \ No newline at end of file diff --git a/Applications/ScriptPapers/English.lproj/Paper.gorm/objects.gorm b/Applications/ScriptPapers/English.lproj/Paper.gorm/objects.gorm new file mode 100644 index 0000000000000000000000000000000000000000..00b8aa874710ca231feb7938a414981f26e5fb65 GIT binary patch literal 1992 zcmah~OK;mo5MHihy{OodWvOYMHqNtk(#NbD1gS5T${ER!WCP5f{lcMP>(zK+vs8;3GSH;3pI&W)Gp zmv$j)bH_{kIDP8IGNI^_ChmYMDO5-Im#-OZ~D}{1} zKbOCyFMW9k6;Wa}+nKIWor^Ln=^b1dqCzXuRjVp9ZReRB#!=W;Fd2-@vaHiFd%rVg z(xPKp{~R&X`U9sOwR3WtGkgthP=Gwkpekx?r9ifqB(4V4WM$i#E;Vi})4$U1_$o8> zg_@|7wiN{t)o+P`sS|G&i8m2x+a1WhQgUL~lTg=6r9!F1oe#*N0i4&8Rv~He6mk2- z^?uz?qEV==%q95f!p9?%21*cC#`WCH>#(W~RSQE^Wk>}v!Aku@Sv0h6t zTupJFXm-3q_#IaOS49Q>!>RS>LItMV6d(ae6HUSKyQnu`=hMosyr7?{mv!yMATLH<$!ios25qrQ?sQt3R-(bGR7^#A(mwW2t|$I` z8D+V^vtoPJe*?4ZX#d(4d?uPiZc7G%@&Fe!_$-6Z#Ttq3qkj}(UA|bX;R6{Q$kg{- z%BE!Y-r{HS%+9%DEWv%|OYo?spny`d(*`^#NPeZvS>D_>SdCTR^dpVi&VktO!p`mP z-CR+Y)2T3fn~2c-fN>akdm0UF=*;Q`+K=iJB%3ybDIHJriRrcqa)zZ}&GDxRm*|ASrq1A$BYas)W*h3E z%Id@+hAWFECh1>2Q*!MrNyq&8h*1BRFt~rQ%haGSnIxpUmf{0k7wgow9uC}niO3iz zgB#lPeCO)Lae!>2OXr~%g&BOU(I_eY!8f8!Jyc&~AzoUl4KkK*z?L?5%9WGB&2c-Y zqj3wrW&D0CI&58;c``}^nc@+gHMWK3zFSOOqYB@TJNZVw1wUww*(;|n1G(>}cqOCG TR$d07b!I!=Fd8MEq>l4Hhr3WW literal 0 HcmV?d00001 diff --git a/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/data.classes b/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/data.classes new file mode 100644 index 0000000..7b27e31 --- /dev/null +++ b/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/data.classes @@ -0,0 +1,155 @@ +{ + 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; + }; +} \ No newline at end of file diff --git a/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/objects.gorm b/Applications/ScriptPapers/English.lproj/ScriptPapers.gorm/objects.gorm new file mode 100644 index 0000000000000000000000000000000000000000..f0f6bb6849ab75f3bcd73df76b1e237c47e76db7 GIT binary patch literal 13008 zcma)D37lL-nXl?Odor2a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)5`8rfsPYiRCwK-=t$xrf%_#fJ)H_i4>fJ?rCT&wJD z9Wy*2`9`ue1BX6=P$wimnQod(CiE7J~jK=M~wnRcp!lAmd1+NCa${45L8D2&$il9%3kFW3W7NWN~6e5(~}MBOO) z*;b~l>MqHJm1$J1k=*9Jb`(ZygX9q_)^@c?a`O$i-`nyi>rk5|k6N*Isx6YYS($dJ zGbC@fFztZR`ibNnR;FR~bICicOe5-7l6R4*nU&y2UHIjddS3EwE2dWUTglHMQ}Y2p z&%^|Nx0cPM;DZ9m&ke&vK>ama>BBD0X81X)S1*FJ6`l{m&wzLYfi>+ss|rNbA0$8D z%Ct@WQSxn8rtRu4l5e*%?NEQ0yoXHnPNSo#+2`{)7|^dvzQfu)j5}7ZwRuGSSn@uL zdPkrlmrK6W$~3GFNxsW4EqyZ54=&NPejWXPf%GiWc{(;LN1>f?@h&Xxqa~o$(>?NX-_(A!Q2XyJ5n;#NDESehtuV>q@N~4;Jj1)d4sZ(be!}C3 zuOggAybCVDCWH7OTmqgzd@(tH$tHY z<^w?RAY6dv2eCA)9t3y~!ia|VB5c+0K7>&X??>3C;R6T{&{#YOY%jtUP&|aiL+V9< zA3}H$Sv-um2QH!f!-y||OTZsNe3>?XB)pidnhk!;A0dsLGY5twf3(sZ*pM&Lg(#Nhka6#OONOV}h_r&+h;j};e#?hJoa@{f_<3OvT^U3Nt+L%$xd90Bh! zz>}3(6xRNn8GZy>QVh4SmAd--3;C3jpI`eUU@7@DiJ7VQ2z&-V3eVLg|2TBxOEY{2 zu$@5W4TL{|I7Il9hQKA-Ss5N{*= US;X53KaKbl9W9?jxEtU<03GbyrvLx| literal 0 HcmV?d00001 diff --git a/Applications/ScriptPapers/GNUmakefile b/Applications/ScriptPapers/GNUmakefile new file mode 100644 index 0000000..bfb591a --- /dev/null +++ b/Applications/ScriptPapers/GNUmakefile @@ -0,0 +1,62 @@ +# 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 = \ + + +ADDITIONAL_OBJCFLAGS = + +############################################################################ + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/application.make +-include GNUmakefile.postamble diff --git a/Applications/ScriptPapers/NSObject+NibLoading.h b/Applications/ScriptPapers/NSObject+NibLoading.h new file mode 100644 index 0000000..b943988 --- /dev/null +++ b/Applications/ScriptPapers/NSObject+NibLoading.h @@ -0,0 +1,31 @@ +/** NSObject+NibLoading + + Copyright (c) 2002 Stefan Urbanek + + Written by: Stefan Urbanek + Date: 2002 Oct 10 + + 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 NSObject(AFNibLoading) +- (BOOL)loadMyNibNamed:(NSString *)aName; +@end + diff --git a/Applications/ScriptPapers/NSObject+NibLoading.m b/Applications/ScriptPapers/NSObject+NibLoading.m new file mode 100644 index 0000000..4a8f96e --- /dev/null +++ b/Applications/ScriptPapers/NSObject+NibLoading.m @@ -0,0 +1,58 @@ +/** NSObject+NibLoading + + Copyright (c) 2002 Stefan Urbanek + + Written by: Stefan Urbanek + Date: 2002 Oct 10 + + 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 "NSObject+NibLoading.h" + +#import + +@class AFSimulation; + +@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 + diff --git a/Applications/ScriptPapers/NSTextView+additions.h b/Applications/ScriptPapers/NSTextView+additions.h new file mode 100644 index 0000000..429f6f4 --- /dev/null +++ b/Applications/ScriptPapers/NSTextView+additions.h @@ -0,0 +1,31 @@ +/** 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 diff --git a/Applications/ScriptPapers/NSTextView+additions.m b/Applications/ScriptPapers/NSTextView+additions.m new file mode 100644 index 0000000..22fe031 --- /dev/null +++ b/Applications/ScriptPapers/NSTextView+additions.m @@ -0,0 +1,40 @@ +/** 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 diff --git a/Applications/ScriptPapers/ScriptPaper.h b/Applications/ScriptPapers/ScriptPaper.h new file mode 100644 index 0000000..f676608 --- /dev/null +++ b/Applications/ScriptPapers/ScriptPaper.h @@ -0,0 +1,35 @@ +/** 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 diff --git a/Applications/ScriptPapers/ScriptPaper.m b/Applications/ScriptPapers/ScriptPaper.m new file mode 100644 index 0000000..38d2af6 --- /dev/null +++ b/Applications/ScriptPapers/ScriptPaper.m @@ -0,0 +1,109 @@ +/** 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 diff --git a/Applications/ScriptPapers/ScriptPaperController.h b/Applications/ScriptPapers/ScriptPaperController.h new file mode 100644 index 0000000..f9d3696 --- /dev/null +++ b/Applications/ScriptPapers/ScriptPaperController.h @@ -0,0 +1,38 @@ +/** 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 + diff --git a/Applications/ScriptPapers/ScriptPaperController.m b/Applications/ScriptPapers/ScriptPaperController.m new file mode 100644 index 0000000..1215c3d --- /dev/null +++ b/Applications/ScriptPapers/ScriptPaperController.m @@ -0,0 +1,103 @@ +/** 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 diff --git a/Applications/ScriptPapers/ScriptPapersInfo.plist b/Applications/ScriptPapers/ScriptPapersInfo.plist new file mode 100644 index 0000000..0dfdeb4 --- /dev/null +++ b/Applications/ScriptPapers/ScriptPapersInfo.plist @@ -0,0 +1,20 @@ +{ + 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"; + + NSTypes = ( + { + NSUnixExtensions = ("spaper"); + NSName = "spaper"; + NSHumanReadableName = "Script Paper"; + NSMIMETypes = ("application/spaper"); + NSIcon = spaper; + NSRole = Editor; + NSDocumentClass = ScriptPaper; + } + ); +} diff --git a/Applications/ScriptPapers/main.m b/Applications/ScriptPapers/main.m new file mode 100644 index 0000000..7d5bdbc --- /dev/null +++ b/Applications/ScriptPapers/main.m @@ -0,0 +1,37 @@ +/** 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); +} diff --git a/Applications/ScriptPapers/run b/Applications/ScriptPapers/run new file mode 100755 index 0000000..049a917 --- /dev/null +++ b/Applications/ScriptPapers/run @@ -0,0 +1 @@ +make debug=yes && openapp ScriptPapers.debug diff --git a/ChangeLog b/ChangeLog index 495678b..1d9f8ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ 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 diff --git a/Documentation/Reference/STEnvironment.gsdoc b/Documentation/Reference/STEnvironment.gsdoc index c5215c2..3f1c9f9 100644 --- a/Documentation/Reference/STEnvironment.gsdoc +++ b/Documentation/Reference/STEnvironment.gsdoc @@ -84,6 +84,13 @@ bundle if it is not already loaded. + + initDefault + + Initialises scripting environment using default + description. + + initWithDescription: aDescription diff --git a/Documentation/Reference/STEnvironment.html b/Documentation/Reference/STEnvironment.html index 9fedc92..f05dc2b 100644 --- a/Documentation/Reference/STEnvironment.html +++ b/Documentation/Reference/STEnvironment.html @@ -45,6 +45,7 @@
  • -createsUnknownObjects
  • -fullScriptingEnabled
  • -includeBundle:
  • +
  • -initDefault
  • -initWithDescription:
  • -initWithDescriptionName:
  • -knownObjectNames
  • @@ -134,6 +135,16 @@ bundle


    +

    initDefault

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

    + + Initialises scripting environment using default + description. + +

    +

    initWithDescription:

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

    diff --git a/Documentation/Reference/StepTalk.igsdoc b/Documentation/Reference/StepTalk.igsdoc index 450e1a1..07f6062 100644 --- a/Documentation/Reference/StepTalk.igsdoc +++ b/Documentation/Reference/StepTalk.igsdoc @@ -155,6 +155,9 @@ "-includeBundle:" = { STEnvironment = STEnvironment; }; + "-initDefault" = { + STEnvironment = STEnvironment; + }; "-initWithBundle:" = { STBundleInfo = STBundleInfo; }; @@ -489,6 +492,7 @@ "-createsUnknownObjects" = STEnvironment; "-fullScriptingEnabled" = STEnvironment; "-includeBundle:" = STEnvironment; + "-initDefault" = STEnvironment; "-initWithDescription:" = STEnvironment; "-initWithDescriptionName:" = STEnvironment; "-knownObjectNames" = STEnvironment; diff --git a/Source/Headers/StepTalk/STEnvironment.h b/Source/Headers/StepTalk/STEnvironment.h index 0cb125d..378b58c 100644 --- a/Source/Headers/StepTalk/STEnvironment.h +++ b/Source/Headers/StepTalk/STEnvironment.h @@ -60,6 +60,7 @@ + environmentWithDescriptionName:(NSString *)descName; + environmentWithDescription:(STEnvironmentDescription *)aDescription; +- initDefault; - initWithDescriptionName:(NSString *)descName; - initWithDescription:(STEnvironmentDescription *)aDescription; diff --git a/Source/STEnvironment.m b/Source/STEnvironment.m index 9a4a165..5008dc6 100644 --- a/Source/STEnvironment.m +++ b/Source/STEnvironment.m @@ -83,6 +83,19 @@ return AUTORELEASE([[self alloc] initWithDescription:aDescription]); } +/** + Initialises scripting environment using default description. + + + */ +- initDefault +{ + NSString *name; + + name = [STEnvironmentDescription defaultEnvironmentDescriptionName]; + + return [self initWithDescriptionName:name]; +} /** Initialises scripting environment using description with name descName.