├── README ├── .gitignore ├── InfoPlist.strings ├── Localizable.strings ├── Smultron-Manual.pdf ├── Localizable3.strings ├── Other ├── ODBEditorSuite.h ├── SMLDataModel2.xcdatamodel │ ├── layout │ └── elements ├── SMLDataModel3.xcdatamodel │ ├── layout │ └── elements ├── Credits.rtf └── DefaultCommands.plist ├── Graphics ├── SMLMainIcon.icns ├── SMLCommandsIcon.icns ├── SMLDefaultIcon.png ├── SMLDocumentIcon.icns ├── SMLProjectIcon.icns ├── SMLSnippetsIcon.icns ├── SMLDefaultUnsavedIcon.png ├── Tab Bar │ ├── SMLTabBarClose.pdf │ ├── SMLTabBarOverflow.pdf │ ├── SMLTabBarClosePressed.pdf │ ├── SMLTabBarCloseRollover.pdf │ └── SMLTabBarOverflowPressed.pdf ├── Toolbar Icons │ ├── SMLCloseIcon.pdf │ ├── SMLInfoIcon.pdf │ ├── SMLNewIcon.pdf │ ├── SMLOpenIcon.pdf │ ├── SMLRunIcon.pdf │ ├── SMLSaveIcon.pdf │ ├── SMLPreviewIcon.pdf │ ├── SMLFunctionIcon.pdf │ ├── SMLAdvancedFindIcon.pdf │ └── SMLNewCollectionIcon.pdf └── Preferences Icons │ ├── SMLOpenSaveIcon.pdf │ └── SMLAppearanceIcon.pdf ├── sv.lproj ├── Localizable.strings └── Localizable3.strings ├── Smultron.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── vijaykiran.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── Smultron.xcscheme ├── Classes ├── main.m ├── SMLTableView.h ├── SMLProjectWindow.h ├── SMLSearchField.h ├── SMLAdvancedFindPanel.h ├── SMLFontTransformer.h ├── SMLGutterTextView.h ├── SMLSingleDocumentPanel.h ├── SMLCommandManagedObject.h ├── SMLDocumentManagedObject.h ├── SMLEncodingManagedObject.h ├── SMLSnippetManagedObject.h ├── SMLSplitView.h ├── SMLCommandCollectionManagedObject.h ├── SMLPrintTextView.h ├── SMLSnippetCollectionManagedObject.h ├── SMLSyntaxDefinitionManagedObject.h ├── SMLGradientBackgroundView.h ├── SMLServicesController.h ├── SMLProject+TableViewDelegate.h ├── SMLApplicationMenuController.h ├── SMLHelpMenuController.h ├── SMLSingleDocumentWindowDelegate.h ├── SMLFullScreenWindow.h ├── NSString+Textron.h ├── SMLApplication.h ├── SMLSingleDocumentPanel.m ├── SMLDocumentsListCell.h ├── NSImage+Textron.h ├── SMLApplicationMenuController.m ├── SMLDocumentsMenuController.h ├── SMLPrintViewController.h ├── SMLDummyView.h ├── SMLEditMenuController.h ├── SMLPreviewController.h ├── SMLDragAndDropController.h ├── SMLAuthenticationController.h ├── SMLProject+DocumentViewsController.h ├── SMLFontTransformer.m ├── SMLLayoutManager.h ├── SMLProjectWindow.m ├── SMLAdvancedFindPanel.m ├── NSToolbarItem+Textron.h ├── SMLTextPerformer.h ├── SMLTextView.h ├── SMLShortcutsController.h ├── SMLProjectsController.h ├── SMLMainController.h ├── SMLProject+ToolbarController.h ├── SMLCommandCollectionManagedObject.m ├── SMLSnippetCollectionManagedObject.m ├── SMLFileMenuController.h ├── SMLBasicPerformer.h ├── SMLGradientBackgroundView.m ├── SMLViewMenuController.h ├── SMLCommandManagedObject.m ├── SMLSearchField.m ├── SMLSnippetManagedObject.m ├── SMLOpenSavePerformer.h ├── SMLApplicationDelegate.h ├── SMLLineNumbers.h ├── SMLEncodingManagedObject.m ├── SMLInfoController.h ├── SMLSplitView.m ├── SMLTextMenuController.h ├── SMLSnippetsController.h ├── SMLSyntaxDefinitionManagedObject.m ├── SMLToolsMenuController.h ├── SMLDocumentManagedObject.m ├── SMLPreferencesController.h ├── SMLAdvancedFindController.h ├── SMLFullScreenWindow.m ├── SMLInterfacePerformer.h ├── SMLCommandsController.h ├── SMLExtraInterfaceController.h ├── SMLSingleDocumentWindowDelegate.m ├── SMLVariousPerformer.h ├── SMLPrintViewController.m ├── NSToolbarItem+Textron.m └── SMLGutterTextView.m ├── PSMTabBar ├── PSMOverflowPopUpButton.h ├── PSMUnifiedTabStyle.h ├── PSMRolloverButton.h ├── PSMTabStyle.h ├── PSMRolloverButton.m ├── PSMOverflowPopUpButton.m ├── PSMTabDragAssistant.h └── PSMTabBarCell.h ├── Syntax Definitions ├── none.plist ├── standard.plist ├── sgml.plist ├── latex.plist ├── xml.plist ├── plist.plist ├── pdf.plist ├── shell.plist ├── torquescript.plist ├── supercollider.plist ├── eiffel.plist ├── batch.plist ├── scala.plist ├── erl.plist ├── c.plist ├── objectivecaml.plist ├── java.plist ├── sml.plist ├── javafx.plist ├── dylan.plist └── vb.plist ├── Command Line Utility ├── smultron.1 └── smultron_main.m └── ICU ├── LICENSE.txt ├── icu ├── LICENSE.html └── unicode │ └── parseerr.h ├── NSStringICUAdditions.h └── NSStringICUAdditions.m /README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/InfoPlist.strings -------------------------------------------------------------------------------- /Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Localizable.strings -------------------------------------------------------------------------------- /Smultron-Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Smultron-Manual.pdf -------------------------------------------------------------------------------- /Localizable3.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Localizable3.strings -------------------------------------------------------------------------------- /Other/ODBEditorSuite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Other/ODBEditorSuite.h -------------------------------------------------------------------------------- /Graphics/SMLMainIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLMainIcon.icns -------------------------------------------------------------------------------- /Graphics/SMLCommandsIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLCommandsIcon.icns -------------------------------------------------------------------------------- /Graphics/SMLDefaultIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLDefaultIcon.png -------------------------------------------------------------------------------- /Graphics/SMLDocumentIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLDocumentIcon.icns -------------------------------------------------------------------------------- /Graphics/SMLProjectIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLProjectIcon.icns -------------------------------------------------------------------------------- /Graphics/SMLSnippetsIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLSnippetsIcon.icns -------------------------------------------------------------------------------- /sv.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/sv.lproj/Localizable.strings -------------------------------------------------------------------------------- /sv.lproj/Localizable3.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/sv.lproj/Localizable3.strings -------------------------------------------------------------------------------- /Graphics/SMLDefaultUnsavedIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/SMLDefaultUnsavedIcon.png -------------------------------------------------------------------------------- /Graphics/Tab Bar/SMLTabBarClose.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Tab Bar/SMLTabBarClose.pdf -------------------------------------------------------------------------------- /Graphics/Tab Bar/SMLTabBarOverflow.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Tab Bar/SMLTabBarOverflow.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLCloseIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLCloseIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLInfoIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLInfoIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLNewIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLNewIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLOpenIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLOpenIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLRunIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLRunIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLSaveIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLSaveIcon.pdf -------------------------------------------------------------------------------- /Other/SMLDataModel2.xcdatamodel/layout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Other/SMLDataModel2.xcdatamodel/layout -------------------------------------------------------------------------------- /Other/SMLDataModel3.xcdatamodel/layout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Other/SMLDataModel3.xcdatamodel/layout -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLPreviewIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLPreviewIcon.pdf -------------------------------------------------------------------------------- /Other/SMLDataModel2.xcdatamodel/elements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Other/SMLDataModel2.xcdatamodel/elements -------------------------------------------------------------------------------- /Other/SMLDataModel3.xcdatamodel/elements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Other/SMLDataModel3.xcdatamodel/elements -------------------------------------------------------------------------------- /Graphics/Tab Bar/SMLTabBarClosePressed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Tab Bar/SMLTabBarClosePressed.pdf -------------------------------------------------------------------------------- /Graphics/Tab Bar/SMLTabBarCloseRollover.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Tab Bar/SMLTabBarCloseRollover.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLFunctionIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLFunctionIcon.pdf -------------------------------------------------------------------------------- /Graphics/Preferences Icons/SMLOpenSaveIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Preferences Icons/SMLOpenSaveIcon.pdf -------------------------------------------------------------------------------- /Graphics/Tab Bar/SMLTabBarOverflowPressed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Tab Bar/SMLTabBarOverflowPressed.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLAdvancedFindIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLAdvancedFindIcon.pdf -------------------------------------------------------------------------------- /Graphics/Preferences Icons/SMLAppearanceIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Preferences Icons/SMLAppearanceIcon.pdf -------------------------------------------------------------------------------- /Graphics/Toolbar Icons/SMLNewCollectionIcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vijaykiran/smultron/HEAD/Graphics/Toolbar Icons/SMLNewCollectionIcon.pdf -------------------------------------------------------------------------------- /Smultron.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Classes/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Textron 4 | // 5 | // Created by Peter Borg on 2007-02-02. 6 | // 7 | 8 | #import 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | return NSApplicationMain(argc, (const char **) argv); 13 | } 14 | -------------------------------------------------------------------------------- /PSMTabBar/PSMOverflowPopUpButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMOverflowPopUpButton.h 3 | // PSMTabBarControl 4 | // 5 | // Created by John Pannell on 11/4/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PSMOverflowPopUpButton : NSPopUpButton { 13 | NSImage *_PSMTabBarOverflowPopUpImage; 14 | NSImage *_PSMTabBarOverflowDownPopUpImage; 15 | BOOL _down; 16 | } 17 | 18 | // archiving 19 | - (void)encodeWithCoder:(NSCoder *)aCoder; 20 | - (id)initWithCoder:(NSCoder *)aDecoder; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /PSMTabBar/PSMUnifiedTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMUnifiedTabStyle.h 3 | // -------------------- 4 | // 5 | // Created by Keith Blount on 30/04/2006. 6 | // Copyright 2006 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PSMTabStyle.h" 11 | 12 | @interface PSMUnifiedTabStyle : NSObject 13 | { 14 | NSImage *unifiedCloseButton; 15 | NSImage *unifiedCloseButtonDown; 16 | NSImage *unifiedCloseButtonOver; 17 | NSImage *_addTabButtonImage; 18 | NSImage *_addTabButtonPressedImage; 19 | NSImage *_addTabButtonRolloverImage; 20 | 21 | float leftMargin; 22 | } 23 | - (void)setLeftMarginForTabBarControl:(float)margin; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Smultron.xcodeproj/xcuserdata/vijaykiran.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Smultron.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | smultron.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | Smultron.app 21 | 22 | smultron 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Smultron.xcodeproj/xcuserdata/vijaykiran.xcuserdatad/xcschemes/Smultron.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 11 | 12 | 14 | 15 | /> 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /PSMTabBar/PSMRolloverButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMOverflowPopUpButton.h 3 | // NetScrape 4 | // 5 | // Created by John Pannell on 8/4/04. 6 | // Copyright 2004 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PSMRolloverButton : NSButton 12 | { 13 | NSImage *_rolloverImage; 14 | NSImage *_usualImage; 15 | NSTrackingRectTag _myTrackingRectTag; 16 | } 17 | 18 | // the regular image 19 | - (void)setUsualImage:(NSImage *)newImage; 20 | - (NSImage *)usualImage; 21 | 22 | // the rollover image 23 | - (void)setRolloverImage:(NSImage *)newImage; 24 | - (NSImage *)rolloverImage; 25 | 26 | // tracking rect for mouse events 27 | - (void)addTrackingRect; 28 | - (void)removeTrackingRect; 29 | @end -------------------------------------------------------------------------------- /Classes/SMLTableView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLTableView : NSTableView { 18 | 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/SMLProjectWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLProjectWindow : NSWindow { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLSearchField.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSearchField : NSSearchField { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLAdvancedFindPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLAdvancedFindPanel : NSPanel { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLFontTransformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLFontTransformer : NSObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLGutterTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLGutterTextView : NSTextView { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLSingleDocumentPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSingleDocumentPanel : NSPanel { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLCommandManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLCommandManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLDocumentManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLDocumentManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLEncodingManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLEncodingManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLSnippetManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSnippetManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLSplitView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSplitView : NSSplitView { 19 | 20 | NSGradient *dividerGradient; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/SMLCommandCollectionManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLCommandCollectionManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLPrintTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLPrintTextView : NSTextView { 19 | 20 | 21 | } 22 | 23 | - (void)setupView; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/SMLSnippetCollectionManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSnippetCollectionManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLSyntaxDefinitionManagedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSyntaxDefinitionManagedObject : NSManagedObject { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLGradientBackgroundView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLGradientBackgroundView : NSView { 18 | 19 | NSGradient *gradient; 20 | CGFloat scaleFactor; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/SMLServicesController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLServicesController : NSObject { 19 | 20 | } 21 | 22 | + (SMLServicesController *)sharedInstance; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/SMLProject+TableViewDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | #import "SMLProject.h" 17 | 18 | @interface SMLProject (TableViewDelegate) 19 | 20 | 21 | - (void)performInsertFirstDocument:(id)document; 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/SMLApplicationMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLApplicationMenuController : NSObject 18 | { 19 | 20 | } 21 | 22 | - (IBAction)showPreferencesWindowAction:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/SMLHelpMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLHelpMenuController : NSObject 18 | { 19 | } 20 | 21 | - (IBAction)installCommandLineUtilityAction:(id)sender; 22 | 23 | - (IBAction)TextronHelp:(id)sender; 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/SMLSingleDocumentWindowDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLSingleDocumentWindowDelegate : NSObject { 19 | 20 | } 21 | 22 | + (SMLSingleDocumentWindowDelegate *)sharedInstance; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/SMLFullScreenWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLFullScreenWindow : NSWindow { 19 | NSTimer *fullScreenTimer; 20 | 21 | } 22 | 23 | - (void)enterFullScreen; 24 | - (void)returnFromFullScreen; 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/NSString+Textron.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface NSString (NSStringTextron) 19 | 20 | + (NSString *)dateStringForDate:(NSCalendarDate *)date formatIndex:(NSInteger)index; 21 | 22 | - (NSArray *)divideCommandIntoArray; 23 | 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/SMLApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLApplication : NSApplication { 19 | unichar key; 20 | NSInteger keyCode; 21 | NSUInteger flags; 22 | NSWindow *eventWindow; 23 | id textViewClass; 24 | NSString *character; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/SMLSingleDocumentPanel.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSingleDocumentPanel.h" 18 | 19 | @implementation SMLSingleDocumentPanel 20 | 21 | // A dummy class to be able to recognize a frontmost single document window in -[SMLProjectsController currentSMLDocument] 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/SMLDocumentsListCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLDocumentsListCell : NSTextFieldCell { 18 | 19 | NSImage *image; 20 | 21 | CGFloat heightAndWidth; 22 | } 23 | 24 | @property (copy) NSImage *image; 25 | 26 | @property (assign, readwrite) CGFloat heightAndWidth; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/NSImage+Textron.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface NSImage (NSImageTextron) 19 | 20 | + (NSArray *)iconsForPath:(NSString *)path; 21 | 22 | + (NSArray *)quickLookIconForPath:(NSString *)path; 23 | 24 | + (CIImage *)unsavedFilterForCIImage:(CIImage *)ciImage; 25 | 26 | //+ (NSBitmapImageRep *)unsavedIconBitmapRep:(NSBitmapImageRep *)bitmapImageRep; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/SMLApplicationMenuController.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLApplicationMenuController.h" 18 | #import "SMLPreferencesController.h" 19 | 20 | @implementation SMLApplicationMenuController 21 | 22 | 23 | - (IBAction)showPreferencesWindowAction:(id)sender 24 | { 25 | [[SMLPreferencesController sharedInstance] showPreferencesWindow]; 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/SMLDocumentsMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLDocumentsMenuController : NSObject 18 | { 19 | IBOutlet NSMenu *documentsMenu; 20 | } 21 | 22 | + (SMLDocumentsMenuController *)sharedInstance; 23 | 24 | - (IBAction)nextDocumentAction:(id)sender; 25 | - (IBAction)previousDocumentAction:(id)sender; 26 | 27 | - (void)buildDocumentsMenu; 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/SMLPrintViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLPrintViewController : NSViewController 19 | { 20 | IBOutlet NSView *printAccessoryView; 21 | 22 | BOOL dummyValue; 23 | } 24 | 25 | @property BOOL dummyValue; 26 | 27 | - (IBAction)setPrintFontAction:(id)sender; 28 | 29 | - (BOOL)dummyValue; 30 | - (void)setDummyValue:(BOOL)flag; 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/SMLDummyView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLDummyView : NSView { 19 | 20 | NSImage *TextronImage; 21 | NSMutableDictionary *attributes; 22 | NSMutableDictionary *whiteAttributes; 23 | 24 | NSAttributedString *attributedString; 25 | NSAttributedString *whiteAttributedString; 26 | NSSize attributedStringSize; 27 | NSColor *backgroundColour; 28 | 29 | NSGradient *gradient; 30 | 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/SMLEditMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLEditMenuController : NSObject { 19 | 20 | } 21 | 22 | //- (IBAction)selectAction:(id)sender; 23 | - (IBAction)advancedFindReplaceAction:(id)sender; 24 | - (IBAction)liveFindAction:(id)sender; 25 | 26 | //- (IBAction)deleteLineAction:(id)sender; 27 | //- (IBAction)deleteToBeginningOfLineAction:(id)sender; 28 | //- (IBAction)deleteToEndOfLineAction:(id)sender; 29 | 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/SMLPreviewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLPreviewController : NSObject { 18 | 19 | IBOutlet NSWindow *previewWindow; 20 | IBOutlet WebView *webView; 21 | 22 | NSPoint scrollPoint; 23 | } 24 | 25 | @property (readonly) IBOutlet NSWindow *previewWindow; 26 | 27 | 28 | + (SMLPreviewController *)sharedInstance; 29 | 30 | - (void)showPreviewWindow; 31 | 32 | - (void)reload; 33 | 34 | - (IBAction)reloadAction:(id)sender; 35 | 36 | - (void)liveUpdate; 37 | @end 38 | -------------------------------------------------------------------------------- /Classes/SMLDragAndDropController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLDragAndDropController : NSObject { 19 | 20 | NSString *movedDocumentType; 21 | NSString *movedSnippetType; 22 | NSString *movedCommandType; 23 | 24 | } 25 | 26 | + (SMLDragAndDropController *)sharedInstance; 27 | 28 | - (void)moveObjects:(NSArray *)objects inArrayController:(NSArrayController *)arrayController fromIndexes:(NSIndexSet *)rowIndexes toIndex:(NSInteger)insertIndex; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/SMLAuthenticationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLAuthenticationController : NSObject { 19 | 20 | } 21 | 22 | + (SMLAuthenticationController *)sharedInstance; 23 | 24 | - (void)performAuthenticatedOpenOfPath:(NSString *)path withEncoding:(NSStringEncoding)encoding; 25 | - (void)performAuthenticatedSaveOfDocument:(id)document data:(NSData *)data path:(NSString *)path fromSaveAs:(BOOL)fromSaveAs aCopy:(BOOL)aCopy; 26 | 27 | - (void)installCommandLineUtility; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/SMLProject+DocumentViewsController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | #import "SMLProject.h" 17 | 18 | @interface SMLProject (DocumentViewsController) 19 | 20 | - (void)setDefaultViews; 21 | 22 | - (IBAction)viewSizeSliderAction:(id)sender; 23 | 24 | - (void)insertView:(SMLView)view; 25 | - (void)animateSizeSlider; 26 | - (void)reloadData; 27 | - (void)updateTabBar; 28 | - (void)selectSameDocumentInTabBarAsInDocumentsList; 29 | - (void)updateDocumentOrderFromCells:(NSMutableArray *)cells; 30 | 31 | - (void)resizeViewSizeSlider; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/SMLFontTransformer.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLFontTransformer.h" 18 | 19 | @implementation SMLFontTransformer 20 | 21 | + (Class)transformedValueClass 22 | { 23 | return [NSString class]; 24 | } 25 | 26 | 27 | + (BOOL)allowsReverseTransformation 28 | { 29 | return NO; 30 | } 31 | 32 | 33 | - (id)transformedValue:(id)value 34 | { 35 | NSFont *font = [NSUnarchiver unarchiveObjectWithData:value]; 36 | 37 | return [NSString stringWithFormat:@"%@ - %.0fpt", [font fontName], [font pointSize]]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/SMLLayoutManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLLayoutManager : NSLayoutManager { 18 | 19 | NSDictionary *attributes; 20 | NSString *tabCharacter; 21 | NSString *newLineCharacter; 22 | 23 | NSString *completeString; 24 | NSInteger lengthToRedraw; 25 | NSInteger index; 26 | unichar characterToCheck; 27 | NSPoint pointToDrawAt; 28 | NSRect glyphFragment; 29 | 30 | BOOL showInvisibleCharacters; 31 | } 32 | 33 | -(void)setShowInvisibleCharacters:(BOOL)flag; 34 | 35 | @property BOOL showInvisibleCharacters; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Classes/SMLProjectWindow.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLProjectWindow.h" 18 | 19 | @implementation SMLProjectWindow 20 | 21 | - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation 22 | { 23 | self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; 24 | 25 | if (self) { 26 | [self setContentBorderThickness:22.0 forEdge:NSMinYEdge]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/SMLAdvancedFindPanel.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLAdvancedFindPanel.h" 18 | 19 | @implementation SMLAdvancedFindPanel 20 | 21 | - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation 22 | { 23 | self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; 24 | 25 | if (self) { 26 | [self setContentBorderThickness:22.0 forEdge:NSMinYEdge]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | @end -------------------------------------------------------------------------------- /Classes/NSToolbarItem+Textron.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface NSToolbarItem (NSToolbarItemTextron) 19 | 20 | + (NSToolbarItem *)createToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name image:(NSImage *)image action:(SEL)selector tag:(NSInteger)tag target:(id)target; 21 | 22 | + (NSToolbarItem *)createPreferencesToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name image:(NSImage *)image action:(SEL)selector target:(id)target; 23 | 24 | + (NSToolbarItem *)createSeachFieldToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name view:(NSView *)view; 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/SMLTextPerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLTextPerformer : NSObject { 19 | 20 | NSString *darkSideLineEnding; 21 | NSString *macLineEnding; 22 | NSString *unixLineEnding; 23 | 24 | NSString *newLineSymbolString; 25 | } 26 | 27 | + (SMLTextPerformer *)sharedInstance; 28 | 29 | - (NSString *)convertLineEndings:(NSString *)stringToConvert inDocument:(id)document; 30 | 31 | - (NSStringEncoding)guessEncodingFromData:(NSData *)textData; 32 | 33 | - (NSString *)replaceAllNewLineCharactersWithSymbolInString:(NSString *)theTextString; 34 | 35 | - (NSString *)removeAllLineEndingsInString:(NSString *)string; 36 | 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Syntax Definitions/none.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Classes/SMLTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLTextView; 18 | 19 | @interface SMLTextView : NSTextView { 20 | NSInteger lineHeight; 21 | NSPoint startPoint; 22 | NSPoint startOrigin; 23 | CGFloat pageGuideX; 24 | NSColor *pageGuideColour; 25 | 26 | BOOL showPageGuide; 27 | 28 | NSCursor *colouredIBeamCursor; 29 | 30 | BOOL inCompleteMethod; 31 | } 32 | 33 | @property (assign) NSCursor *colouredIBeamCursor; 34 | @property (assign) BOOL inCompleteMethod; 35 | 36 | - (void)setDefaults; 37 | 38 | - (NSInteger)lineHeight; 39 | 40 | - (void)setTabWidth; 41 | 42 | - (void)setPageGuideValues; 43 | 44 | - (void)updateIBeamCursor; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Syntax Definitions/standard.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Syntax Definitions/sgml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Classes/SMLShortcutsController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLShortcutsController : NSObject { 19 | 20 | } 21 | 22 | + (SMLShortcutsController *)sharedInstance; 23 | 24 | - (void)registerSnippetShortcutWithEvent:(NSEvent *)event; 25 | - (void)unregisterSelectedSnippetShortcut; 26 | 27 | - (void)registerCommandShortcutWithEvent:(NSEvent *)event; 28 | - (void)unregisterSelectedCommandShortcut; 29 | 30 | - (NSString *)menuItemKeyStringFromEvent:(NSEvent *)event; 31 | - (NSString *)plainKeyStringFromEvent:(NSEvent *)event; 32 | - (NSString *)plainModifierStringFromEvent:(NSEvent *)event; 33 | - (NSUInteger)carbonModifierFromCocoaModifier:(NSUInteger)cocoaModifier; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/SMLProjectsController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLTextView; 18 | @class SMLProject; 19 | 20 | @interface SMLProjectsController : NSDocumentController 21 | { 22 | SMLProject *currentProject; 23 | } 24 | 25 | @property (assign) SMLProject *currentProject; 26 | 27 | - (id)currentSMLDocument; 28 | - (SMLTextView *)currentTextView; 29 | - (NSString *)currentText; 30 | - (void)selectDocumentFromTheDock:(id)sender; 31 | 32 | - (void)putInRecentWithPath:(NSString *)path; 33 | 34 | - (IBAction)openProjectAction:(id)sender; 35 | - (void)performOpenProjectWithPath:(NSString *)path; 36 | - (void)insertDocumentsFromProjectArray:(NSArray *)array; 37 | 38 | - (void)selectDocument:(id)document; 39 | @end 40 | -------------------------------------------------------------------------------- /Other/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110 2 | {\fonttbl\f0\fnil\fcharset0 Futura-Medium;\f1\fnil\fcharset0 LucidaGrande;\f2\fnil\fcharset0 Futura-CondensedExtraBold; 3 | } 4 | {\colortbl;\red255\green255\blue255;\red0\green12\blue234;} 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural 6 | 7 | \f0\fs28 \cf0 \ 8 | Created, designed and programmed by\ 9 | Peter Borg{\field{\*\fldinst{HYPERLINK "http://sourceforge.net/donate/index.php?group_id=110857"}}{\fldrslt 10 | \f1\b\fs24 \cf2 \uc0\u8232 }} 11 | \f2\b\fs24 \ 12 | \pard\tx2267\tx2366\tx2813\tx2834\tx2860\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural 13 | 14 | \f0\b0 \cf0 Find the lastest version at: 15 | \f1\b \uc0\u8232 {\field{\*\fldinst{HYPERLINK "http://tuppis.com/smultron"}}{\fldrslt 16 | \f0\b0 \cf2 \ul \ulc2 http://smultron.sourceforge.net}}{\field{\*\fldinst{HYPERLINK "http://www8.ocn.ne.jp/%7esonoisa/OgreKit/index.html"}}{\fldrslt \cf2 \uc0\u8232 }} 17 | \f2 \ 18 | 19 | \f0\b0\fs26 Help: 20 | \f1\b\fs24 \uc0\u8232 21 | \f0\b0 With tabs from {\field{\*\fldinst{HYPERLINK "http://www.positivespinmedia.com/dev/PSMTabBarControl.html"}}{\fldrslt \cf2 \ul Positive Spin Media}}\cf2 \ul \ 22 | \cf0 \ulnone With regular expressions from {\field{\*\fldinst{HYPERLINK "http://www-306.ibm.com/software/globalization/icu/index.jsp"}}{\fldrslt IBM}} & {\field{\*\fldinst{HYPERLINK "http://aarone.org/cocoaicu/"}}{\fldrslt CocoaICU}}} -------------------------------------------------------------------------------- /Command Line Utility/smultron.1: -------------------------------------------------------------------------------- 1 | .TH Textron 1 LOCAL 2 | 3 | .SH NAME 4 | Textron - A command-line utility for Textron 5 | 6 | .SH SYNOPSIS 7 | .B Textron [file] ... 8 | 9 | .SH DESCRIPTION 10 | 11 | With Textron you can start the application Textron by just writing Textron with no options. If you write something after Textron it considers that to be the path to the file or, if you write more than one path, the paths to the files. You can use the standard wildcards e.g. * and ~ for your home folder. If you don't specify a full path it adds the current working directory to what you write. If it can't find any of the specified files, it first creates them and then opens them. (Note that if you use a wildcard and it can't match a file to that it creates a file including the wildcard character as a character in the path, e.g. if you write Textron ~/Desktop/*.jsp and there aren't any .jsp-files on the desktop it creates a file called *.jsp on the desktop.) 12 | 13 | .SH EXAMPLES 14 | 15 | Textron - opens the application 16 | 17 | Textron foo - opens foo from the current directory in Textron 18 | 19 | Textron ~/foo - opens foo from your home folder in Textron 20 | 21 | Textron ~/Desktop/fooDoesNotExist - creates the file fooDoesNotExist on your desktop and opens it in Textron 22 | 23 | Textron ~/Desktop/*.php /etc/*.conf - opens all the files that end with .php on the desktop and all files that ends with .conf in the /etc folder 24 | 25 | .SH AUTHOR 26 | 27 | Peter Borg (pgw3@mac.com), 2004-2008 -------------------------------------------------------------------------------- /Classes/SMLMainController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | 16 | #import 17 | 18 | @interface SMLMainController : NSObject 19 | { 20 | NSTimer *checkForUpdateTimer; 21 | NSTimer *hideNoUpdateAvailableTextFieldTimer; 22 | 23 | BOOL isInFullScreenMode; 24 | BOOL singleDocumentWindowWasOpenBeforeEnteringFullScreen; 25 | 26 | NSOperationQueue *operationQueue; 27 | } 28 | 29 | @property BOOL isInFullScreenMode; 30 | @property BOOL singleDocumentWindowWasOpenBeforeEnteringFullScreen; 31 | 32 | @property (readonly) NSOperationQueue *operationQueue; 33 | 34 | + (SMLMainController *)sharedInstance; 35 | 36 | - (void)checkForUpdate; 37 | - (void)checkForUpdateInSeparateThread; 38 | - (void)updateInterfaceOnMainThreadAfterCheckForUpdateFoundNewUpdate:(id)sender; 39 | - (void)hideNoUpdateAvailableTextField; 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/SMLProject+ToolbarController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | #import "SMLProject.h" 17 | 18 | @interface SMLProject (ToolbarController) 19 | 20 | - (IBAction)liveFindToolbarItemAction:(id)sender; 21 | 22 | - (IBAction)functionToolbarItemAction:(id)sender; 23 | 24 | - (void)prepareForLiveFind; 25 | - (void)removeLiveFindSession; 26 | 27 | - (NSSearchField *)liveFindSearchField; 28 | - (NSToolbarItem *)liveFindToolbarItem; 29 | - (NSToolbarItem *)functionToolbarItem; 30 | 31 | - (void)updateLabelsInToolbar; 32 | - (void)removeFunctionMenuFormRepresentation; 33 | - (void)reinsertFunctionMenuFormRepresentation; 34 | 35 | - (NSButton *)functionButton; 36 | 37 | //- (void)updateSplitWindowToolbarItem; 38 | //- (void)updateLineWrapToolbarItem; 39 | 40 | - (void)extraToolbarValidation; 41 | @end 42 | -------------------------------------------------------------------------------- /Classes/SMLCommandCollectionManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLCommandCollectionManagedObject.h" 18 | #import "SMLApplicationDelegate.h" 19 | #import "SMLToolsMenuController.h" 20 | #import "SMLBasicPerformer.h" 21 | 22 | @implementation SMLCommandCollectionManagedObject 23 | 24 | - (void)awakeFromInsert 25 | { 26 | [super awakeFromInsert]; 27 | 28 | [self setValue:[SMLBasic createUUID] forKey:@"uuid"]; 29 | } 30 | 31 | 32 | - (void)didChangeValueForKey:(NSString *)key 33 | { 34 | [super didChangeValueForKey:key]; 35 | 36 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 37 | return; 38 | } 39 | 40 | if (![key isEqualToString:@"uuid"]) { 41 | [[SMLToolsMenuController sharedInstance] buildRunCommandMenu]; 42 | } 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/SMLSnippetCollectionManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSnippetCollectionManagedObject.h" 18 | #import "SMLApplicationDelegate.h" 19 | #import "SMLToolsMenuController.h" 20 | #import "SMLBasicPerformer.h" 21 | 22 | @implementation SMLSnippetCollectionManagedObject 23 | 24 | - (void)awakeFromInsert 25 | { 26 | [super awakeFromInsert]; 27 | 28 | [self setValue:[SMLBasic createUUID] forKey:@"uuid"]; 29 | } 30 | 31 | 32 | - (void)didChangeValueForKey:(NSString *)key 33 | { 34 | [super didChangeValueForKey:key]; 35 | 36 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 37 | return; 38 | } 39 | 40 | if (![key isEqualToString:@"uuid"]) { 41 | [[SMLToolsMenuController sharedInstance] buildInsertSnippetMenu]; 42 | } 43 | } 44 | 45 | 46 | @end 47 | 48 | -------------------------------------------------------------------------------- /Syntax Definitions/latex.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | { 7 | endCommand 8 | } 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | \ 15 | endVariable 16 | {}()[],?.;/:+=><~ 17 | firstString 18 | $ 19 | secondString 20 | 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | \\((sub)*section|part|chapter|paragraph){[^}]*} 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | \begin{document} 44 | \end{document} 45 | 46 | autocompleteWords 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Classes/SMLFileMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | 16 | #import 17 | 18 | @interface SMLFileMenuController : NSObject 19 | { 20 | NSOpenPanel *openPanel; 21 | } 22 | 23 | + (SMLFileMenuController *)sharedInstance; 24 | 25 | - (IBAction)newAction:(id)sender; 26 | - (IBAction)newProjectAction:(id)sender; 27 | - (IBAction)openAction:(id)sender; 28 | 29 | - (IBAction)saveAction:(id)sender; 30 | - (IBAction)saveAsAction:(id)sender; 31 | - (IBAction)saveACopyAsAction:(id)sender; 32 | - (IBAction)revertAction:(id)sender; 33 | - (void)performRevertOfDocument:(id)document; 34 | 35 | - (IBAction)closeAction:(id)sender; 36 | 37 | - (IBAction)saveAllAction:(id)sender; 38 | - (void)saveAsInSaveAllForDocument:(id)document; 39 | 40 | - (void)printAction:(id)sender; 41 | 42 | - (IBAction)revealInFinderAction:(id)sender; 43 | 44 | - (IBAction)saveDocumentsAsProjectAction:(id)sender; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Classes/SMLBasicPerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLBasicPerformer : NSObject { 19 | 20 | NSNumberFormatter *thousandFormatter; 21 | NSMutableDictionary *fetchRequests; 22 | } 23 | 24 | + (SMLBasicPerformer *)sharedInstance; 25 | 26 | - (void)insertFetchRequests; 27 | - (NSArray *)fetchAll:(NSString *)key; 28 | - (NSFetchRequest *)fetchRequest:(NSString *)key; 29 | 30 | - (id)createNewObjectForEntity:(NSString *)entity; 31 | - (void)removeAllObjectsForEntity:(NSString *)entity; 32 | - (NSURL *)uriFromObject:(id)object; 33 | - (id)objectFromURI:(NSURL *)uri; 34 | - (void)removeAllItemsFromMenu:(NSMenu *)menu; 35 | - (NSString *)createUUID; 36 | - (void)insertSortOrderNumbersForArrayController:(NSArrayController *)arrayController; 37 | - (NSString *)genererateTemporaryPath; 38 | - (NSString *)thousandFormatedStringFromNumber:(NSNumber *)number; 39 | - (NSString *)resolveAliasInPath:(NSString *)path; 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Syntax Definitions/xml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | <? 11 | endInstruction 12 | ?> 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | CDATA 44 | EMPTY 45 | INCLUDE 46 | IGNORE 47 | NDATA 48 | #IMPLIED 49 | #PCDATA 50 | #REQUIRED 51 | 52 | autocompleteWords 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ICU/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005-2006, Aaron Evans 2 | * All rights reserved. 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are met: 5 | * 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright 9 | * notice, this list of conditions and the following disclaimer in the 10 | * documentation and/or other materials provided with the distribution. 11 | * * Neither the name of Aaron Evans, nor the names of its contributors may 12 | * be used to endorse or promote products derived from this software 13 | * without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE COYPRIGHT HOLDERS AND CONTRIBUTORS AND 19 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Syntax Definitions/plist.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | <? 11 | endInstruction 12 | ?> 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | key 47 | string 48 | real 49 | integer 50 | date 51 | true 52 | false 53 | data 54 | array 55 | dict 56 | 57 | 58 | -------------------------------------------------------------------------------- /Classes/SMLGradientBackgroundView.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLGradientBackgroundView.h" 18 | 19 | @implementation SMLGradientBackgroundView 20 | 21 | - (id)initWithFrame:(NSRect)frame 22 | { 23 | if (self = [super initWithFrame:frame]) { 24 | 25 | gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0] endingColor:[NSColor colorWithDeviceRed:0.914 green:0.914 blue:0.914 alpha:1.0]]; 26 | 27 | scaleFactor = [[NSScreen mainScreen] userSpaceScaleFactor]; 28 | } 29 | return self; 30 | } 31 | 32 | 33 | - (void)drawRect:(NSRect)rect 34 | { 35 | NSRect gradientRect = [self bounds]; 36 | 37 | NSDrawGroove(gradientRect, gradientRect); 38 | [gradient drawInRect:NSMakeRect(gradientRect.origin.x * scaleFactor, gradientRect.origin.y * scaleFactor, gradientRect.size.width * scaleFactor, gradientRect.size.height - 1.0 * scaleFactor) angle:90]; 39 | } 40 | 41 | 42 | - (BOOL)isOpaque { 43 | return YES; 44 | } 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Classes/SMLViewMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLViewMenuController : NSObject 18 | { 19 | 20 | 21 | } 22 | 23 | + (SMLViewMenuController *)sharedInstance; 24 | 25 | - (IBAction)splitWindowAction:(id)sender; 26 | - (void)performCollapse; 27 | - (IBAction)lineWrapTextAction:(id)sender; 28 | - (IBAction)showSyntaxColoursAction:(id)sender; 29 | - (IBAction)showLineNumbersAction:(id)sender; 30 | - (IBAction)showStatusBarAction:(id)sender; 31 | - (void)performHideStatusBar; 32 | - (IBAction)showInvisibleCharactersAction:(id)sender; 33 | - (IBAction)viewDocumentInSeparateWindowAction:(id)sender; 34 | - (IBAction)viewDocumentInFullScreenAction:(id)sender; 35 | 36 | - (IBAction)showTabBarAction:(id)sender; 37 | - (void)performHideTabBar; 38 | 39 | - (IBAction)showDocumentsViewAction:(id)sender; 40 | - (void)performCollapseDocumentsView; 41 | 42 | - (IBAction)documentsViewAction:(id)sender; 43 | 44 | - (IBAction)emptyDummyAction:(id)sender; 45 | 46 | - (IBAction)showSizeSliderAction:(id)sender; 47 | @end 48 | 49 | -------------------------------------------------------------------------------- /Syntax Definitions/pdf.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | / 15 | endVariable 16 | ()><[]{}/% 17 | firstString 18 | 19 | secondString 20 | 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | endobj 44 | endstream 45 | f 46 | false 47 | n 48 | null 49 | obj 50 | R 51 | startxref 52 | stream 53 | trailer 54 | true 55 | xref 56 | 57 | autocompleteWords 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Classes/SMLCommandManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLCommandManagedObject.h" 18 | #import "SMLBasicPerformer.h" 19 | #import "SMLApplicationDelegate.h" 20 | #import "SMLToolsMenuController.h" 21 | 22 | @implementation SMLCommandManagedObject 23 | 24 | 25 | - (void)awakeFromInsert 26 | { 27 | [super awakeFromInsert]; 28 | 29 | [self setValue:[SMLBasic createUUID] forKey:@"uuid"]; 30 | } 31 | 32 | - (void)didChangeValueForKey:(NSString *)key 33 | { 34 | [super didChangeValueForKey:key]; 35 | 36 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 37 | return; 38 | } 39 | 40 | if (![key isEqualToString:@"uuid"]) { 41 | [[SMLToolsMenuController sharedInstance] buildRunCommandMenu]; 42 | } 43 | } 44 | 45 | 46 | - (NSComparisonResult)localizedCaseInsensitiveCompare:(id)object 47 | { 48 | NSComparisonResult result = NSOrderedSame; 49 | 50 | if ([object isKindOfClass:[self class]]) { 51 | result = [[object valueForKey:@"name"] localizedCaseInsensitiveCompare:[self valueForKey:@"name"]]; 52 | } 53 | 54 | return result; 55 | } 56 | @end 57 | -------------------------------------------------------------------------------- /PSMTabBar/PSMTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMTabStyle.h 3 | // PSMTabBarControl 4 | // 5 | // Created by John Pannell on 2/17/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | /* 10 | Protocol to be observed by all style delegate objects. These objects handle the drawing responsibilities for PSMTabBarCell; once the control has been assigned a style, the background and cells draw consistent with that style. Design pattern and implementation by David Smith, Seth Willits, and Chris Forsythe, all touch up and errors by John P. :-) 11 | */ 12 | 13 | #import "PSMTabBarCell.h" 14 | #import "PSMTabBarControl.h" 15 | 16 | @protocol PSMTabStyle 17 | 18 | // identity 19 | - (NSString *)name; 20 | 21 | // control specific parameters 22 | - (float)leftMarginForTabBarControl; 23 | - (float)rightMarginForTabBarControl; 24 | 25 | // add tab button 26 | - (NSImage *)addTabButtonImage; 27 | - (NSImage *)addTabButtonPressedImage; 28 | - (NSImage *)addTabButtonRolloverImage; 29 | 30 | // cell specific parameters 31 | - (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell; 32 | - (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell; 33 | - (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell; 34 | - (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell; 35 | - (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell; 36 | - (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell; 37 | 38 | // cell values 39 | - (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell; 40 | - (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell; 41 | 42 | // drawing 43 | - (void)drawTabCell:(PSMTabBarCell *)cell; 44 | - (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect; 45 | 46 | @end 47 | 48 | @interface PSMTabBarControl (StyleAccessors) 49 | 50 | - (NSMutableArray *)cells; 51 | 52 | @end -------------------------------------------------------------------------------- /Classes/SMLSearchField.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSearchField.h" 18 | #import "SMLProjectsController.h" 19 | #import "SMLProject.h" 20 | 21 | 22 | @implementation SMLSearchField 23 | 24 | - (BOOL)performKeyEquivalent:(NSEvent *)anEvent 25 | { 26 | NSUInteger flags = [anEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; 27 | unsigned short keyCode = [anEvent keyCode]; 28 | 29 | if (flags == 1048576 && keyCode == 5) { // Command-G 30 | NSToolbarItem *dummyToolbarItem = [[NSToolbarItem alloc] init]; 31 | [dummyToolbarItem setTag:NSFindPanelActionNext]; 32 | [[SMLCurrentProject lastTextViewInFocus] performFindPanelAction:dummyToolbarItem]; 33 | 34 | return YES; 35 | } else if (flags == 1179648 && keyCode == 5) { // Command-Shift-G 36 | NSToolbarItem *dummyToolbarItem = [[NSToolbarItem alloc] init]; 37 | [dummyToolbarItem setTag:NSFindPanelActionPrevious]; 38 | [[SMLCurrentProject lastTextViewInFocus] performFindPanelAction:dummyToolbarItem]; 39 | 40 | return YES; 41 | } else { 42 | [super performKeyEquivalent:anEvent]; 43 | 44 | return NO; 45 | } 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /Classes/SMLSnippetManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSnippetManagedObject.h" 18 | #import "SMLApplicationDelegate.h" 19 | #import "SMLToolsMenuController.h" 20 | #import "SMLBasicPerformer.h" 21 | 22 | @implementation SMLSnippetManagedObject 23 | 24 | - (void)awakeFromInsert 25 | { 26 | [super awakeFromInsert]; 27 | 28 | [self setValue:[SMLBasic createUUID] forKey:@"uuid"]; 29 | } 30 | 31 | 32 | - (void)didChangeValueForKey:(NSString *)key 33 | { 34 | [super didChangeValueForKey:key]; 35 | 36 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 37 | return; 38 | } 39 | 40 | if (![key isEqualToString:@"uuid"]) { 41 | [[SMLToolsMenuController sharedInstance] buildInsertSnippetMenu]; 42 | } 43 | 44 | } 45 | 46 | 47 | - (NSComparisonResult)localizedCaseInsensitiveCompare:(id)object 48 | { 49 | NSComparisonResult result = NSOrderedSame; 50 | 51 | if ([object isKindOfClass:[self class]]) { 52 | result = [[object valueForKey:@"name"] localizedCaseInsensitiveCompare:[self valueForKey:@"name"]]; 53 | } 54 | 55 | return result; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/SMLOpenSavePerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLOpenSavePerformer : NSObject { 19 | 20 | } 21 | 22 | + (SMLOpenSavePerformer *)sharedInstance; 23 | 24 | - (void)openAllTheseFiles:(NSArray *)arrayOfFiles; 25 | - (void)shouldOpen:(NSString *)path withEncoding:(NSStringEncoding)chosenEncoding; 26 | - (void)shouldOpenPartTwo:(NSString *)path withEncoding:(NSStringEncoding)chosenEncoding data:(NSData *)textData; 27 | - (void)performOpenWithPath:(NSString *)path contents:(NSString *)textString encoding:(NSStringEncoding)encoding; 28 | 29 | - (void)performSaveOfDocument:(id)document fromSaveAs:(BOOL)fromSaveAs; 30 | - (void)performSaveOfDocument:(id)document path:(NSString *)path fromSaveAs:(BOOL)fromSaveAs aCopy:(BOOL)aCopy; 31 | - (void)performDataSaveWith:(NSData *)data path:(NSString *)path; 32 | - (void)updateAfterSaveForDocument:(id)document path:(NSString *)path; 33 | 34 | - (NSDictionary *)getExtraMetaDataFromPath:(NSString *)path; 35 | - (void)resetExtraMetaData:(NSDictionary *)dictionary path:(NSString *)path; 36 | 37 | - (BOOL)isPathVisible:(NSString *)path; 38 | - (BOOL)isPartOfSVN:(NSString *)path; 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/SMLApplicationDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLApplicationDelegate : NSObject 18 | { 19 | NSPersistentStoreCoordinator *persistentStoreCoordinator; 20 | NSManagedObjectModel *managedObjectModel; 21 | NSManagedObjectContext *managedObjectContext; 22 | 23 | BOOL shouldCreateEmptyDocument; 24 | BOOL hasFinishedLaunching; 25 | BOOL isTerminatingApplication; 26 | 27 | NSMutableArray *filesToOpenArray; 28 | NSAppleEventDescriptor *appleEventDescriptor; 29 | 30 | } 31 | 32 | @property (readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; 33 | @property (readonly) NSManagedObjectModel *managedObjectModel; 34 | @property (readonly) NSManagedObjectContext *managedObjectContext; 35 | 36 | @property (readonly) BOOL shouldCreateEmptyDocument, hasFinishedLaunching, isTerminatingApplication; 37 | 38 | @property (readonly) NSMutableArray *filesToOpenArray; 39 | @property (assign) NSAppleEventDescriptor *appleEventDescriptor; 40 | 41 | 42 | + (SMLApplicationDelegate *)sharedInstance; 43 | 44 | - (IBAction)saveAction:sender; 45 | 46 | - (void)importFromVersion2; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Classes/SMLLineNumbers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLTextView; 18 | 19 | @interface SMLLineNumbers : NSObject { 20 | 21 | id document; 22 | NSPoint zeroPoint; 23 | NSDictionary *attributes; 24 | 25 | SMLTextView *textView; 26 | NSScrollView *scrollView; 27 | NSScrollView *gutterScrollView; 28 | NSLayoutManager *layoutManager; 29 | NSRect visibleRect; 30 | NSRange visibleRange; 31 | NSString *textString; 32 | NSString *searchString; 33 | 34 | NSInteger index; 35 | NSInteger lineNumber; 36 | 37 | NSInteger indexNonWrap; 38 | NSInteger maxRangeVisibleRange; 39 | NSInteger numberOfGlyphsInTextString; 40 | BOOL oneMoreTime; 41 | unichar lastGlyph; 42 | 43 | NSRange range; 44 | NSInteger widthOfStringInGutter; 45 | NSInteger gutterWidth; 46 | NSRect currentViewBounds; 47 | NSInteger gutterY; 48 | 49 | NSInteger currentLineHeight; 50 | 51 | CGFloat addToScrollPoint; 52 | } 53 | 54 | - (id)initWithDocument:(id)theDocument; 55 | 56 | - (void)updateLineNumbersCheckWidth:(BOOL)checkWidth recolour:(BOOL)recolour; 57 | - (void)updateLineNumbersForClipView:(NSClipView *)clipView checkWidth:(BOOL)checkWidth recolour:(BOOL)recolour; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Syntax Definitions/shell.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | ` 7 | endCommand 8 | ´ 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | $ 15 | endVariable 16 | (){}=;:[] 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | # 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(function)?\s?\w*(\(\))?\s?\n?\s*\{ 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | if 44 | then 45 | elif 46 | else 47 | fi 48 | case 49 | in 50 | ;; 51 | esac 52 | while 53 | for 54 | do 55 | done 56 | continue 57 | local 58 | return 59 | 60 | autocompleteWords 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Classes/SMLEncodingManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLEncodingManagedObject.h" 18 | #import "SMLApplicationDelegate.h" 19 | #import "SMLTextMenuController.h" 20 | #import "SMLPreferencesController.h" 21 | 22 | @implementation SMLEncodingManagedObject 23 | 24 | 25 | - (void)didChangeValueForKey:(NSString *)key 26 | { 27 | [super didChangeValueForKey:key]; 28 | 29 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 30 | return; 31 | } 32 | 33 | NSMutableArray *activeEncodings = [NSMutableArray arrayWithArray:[SMLDefaults valueForKey:@"ActiveEncodings"]]; 34 | if ([[self valueForKey:@"active"] boolValue] == YES) { 35 | [activeEncodings addObject:[self valueForKey:@"encoding"]]; 36 | } else { 37 | [activeEncodings removeObject:[self valueForKey:@"encoding"]]; 38 | } 39 | [SMLDefaults setValue:activeEncodings forKey:@"ActiveEncodings"]; 40 | 41 | [[SMLTextMenuController sharedInstance] buildEncodingsMenus]; 42 | NSUInteger selectedTag = [[[[SMLPreferencesController sharedInstance] encodingsPopUp] selectedItem] tag]; 43 | [[SMLPreferencesController sharedInstance] buildEncodingsMenu]; 44 | [[[SMLPreferencesController sharedInstance] encodingsPopUp] selectItemWithTag:selectedTag]; 45 | } 46 | 47 | 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/SMLInfoController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | 16 | #import 17 | 18 | 19 | @interface SMLInfoController : NSObject 20 | { 21 | IBOutlet NSTextField *createdTextField; 22 | IBOutlet NSTextField *creatorTextField; 23 | IBOutlet NSTextField *encodingTextField; 24 | IBOutlet NSTextField *functionTextField; 25 | IBOutlet NSTextField *groupTextField; 26 | IBOutlet NSImageView *iconImageView; 27 | IBOutlet NSWindow *infoWindow; 28 | IBOutlet NSTextField *lengthTextField; 29 | IBOutlet NSTextField *linesTextField; 30 | IBOutlet NSTextField *modifiedTextField; 31 | IBOutlet NSTextField *ownerTextField; 32 | IBOutlet NSTextField *permissionsTextField; 33 | IBOutlet NSTextField *positionTextField; 34 | IBOutlet NSTextField *selectionTextField; 35 | IBOutlet NSTextField *fileSizeTextField; 36 | IBOutlet NSTextField *syntaxTextField; 37 | IBOutlet NSTextField *titleTextField; 38 | IBOutlet NSTextField *typeTextField; 39 | IBOutlet NSTextField *whereTextField; 40 | IBOutlet NSTextField *wordsTextField; 41 | } 42 | 43 | @property (readonly) IBOutlet NSWindow *infoWindow; 44 | 45 | + (SMLInfoController *)sharedInstance; 46 | 47 | - (void)openInfoWindow; 48 | - (void)refreshInfo; 49 | 50 | - (NSString *)stringFromPermissions:(unsigned long)permissions; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/SMLSplitView.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSplitView.h" 18 | #import "SMLProjectsController.h" 19 | #import "SMLproject.h" 20 | 21 | @implementation SMLSplitView 22 | 23 | - (void)awakeFromNib 24 | { 25 | dividerGradient = [[NSGradient alloc] initWithColorsAndLocations:[NSColor colorWithDeviceWhite:0.80 alpha:1.0], 0.0, [NSColor colorWithDeviceWhite:0.84 alpha:1.0], 0.2, [NSColor colorWithDeviceWhite:0.90 alpha:1.0], 0.50, [NSColor colorWithDeviceWhite:0.84 alpha:1.0], 0.8, [NSColor colorWithDeviceWhite:0.74 alpha:1.0], 1.0, nil]; 26 | } 27 | 28 | 29 | - (void)drawDividerInRect:(NSRect)aRect 30 | { 31 | if ([self isVertical]) { 32 | [dividerGradient drawInRect:aRect angle:0]; 33 | } else { 34 | [dividerGradient drawInRect:aRect angle:90]; 35 | } 36 | 37 | [super drawDividerInRect:aRect]; 38 | } 39 | 40 | 41 | - (CGFloat)dividerThickness 42 | { 43 | if ([[self autosaveName] isEqualToString:@"ProjectSplitView"]) { 44 | return 1.0; 45 | } else if ([[self autosaveName] isEqualToString:@"ContentSplitView"] && ([self isSubviewCollapsed:[SMLCurrentProject secondContentView]] || ![NSApp isActive])) { 46 | return 0.0; 47 | } else if ([[self autosaveName] isEqualToString:@"ContentSplitView"]) { 48 | return 7.0; 49 | } else { 50 | return 5.0; 51 | } 52 | } 53 | 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Syntax Definitions/torquescript.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autocompleteWords 6 | 7 | beginCommand 8 | 9 | beginFirstMultiLineComment 10 | /* 11 | beginInstruction 12 | 13 | beginSecondMultiLineComment 14 | 15 | beginVariable 16 | $% 17 | endCommand 18 | 19 | endFirstMultiLineComment 20 | */ 21 | endInstruction 22 | 23 | endSecondMultiLineComment 24 | 25 | endVariable 26 | ./*+-()=; 27 | firstSingleLineComment 28 | // 29 | firstString 30 | " 31 | functionDefinition 32 | ^\s*\w*function\s+.* 33 | keywords 34 | 35 | break 36 | case 37 | continue 38 | datablock 39 | default 40 | else 41 | function 42 | if 43 | for 44 | new 45 | or 46 | package 47 | return 48 | switch 49 | switch$ 50 | while 51 | yes 52 | no 53 | on 54 | off 55 | true 56 | false 57 | 58 | keywordsCaseSensitive 59 | 60 | recolourKeywordIfAlreadyColoured 61 | 62 | removeFromFunction 63 | function 64 | secondSingleLineComment 65 | 66 | secondString 67 | ' 68 | 69 | 70 | -------------------------------------------------------------------------------- /Syntax Definitions/supercollider.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | | 11 | endInstruction 12 | | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | ar 45 | arg 46 | case 47 | classvar 48 | collect 49 | do 50 | dup 51 | false 52 | if 53 | inf 54 | kr 55 | new 56 | nil 57 | or 58 | protect 59 | switch 60 | this 61 | true 62 | super 63 | try 64 | var 65 | while 66 | 67 | autocompleteWords 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Classes/SMLTextMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLTextMenuController : NSObject 18 | { 19 | //NSArray *availableEncodingsArray; 20 | 21 | IBOutlet NSMenu *textEncodingMenu; 22 | IBOutlet NSMenu *reloadTextWithEncodingMenu; 23 | IBOutlet NSMenu *syntaxDefinitionMenu; 24 | } 25 | 26 | + (SMLTextMenuController *)sharedInstance; 27 | 28 | - (void)buildEncodingsMenus; 29 | - (void)buildSyntaxDefinitionsMenu; 30 | 31 | - (void)changeEncodingAction:(id)sender; 32 | 33 | - (IBAction)removeNeedlessWhitespaceAction:(id)sender; 34 | - (IBAction)detabAction:(id)sender; 35 | - (IBAction)entabAction:(id)sender; 36 | - (void)performEntab; 37 | - (void)performDetab; 38 | - (IBAction)shiftLeftAction:(id)sender; 39 | - (IBAction)shiftRightAction:(id)sender; 40 | - (IBAction)toLowercaseAction:(id)sender; 41 | - (IBAction)toUppercaseAction:(id)sender; 42 | - (IBAction)capitaliseAction:(id)sender; 43 | - (IBAction)goToLineAction:(id)sender; 44 | - (void)performGoToLine:(NSInteger)lineToGoTo; 45 | - (IBAction)closeTagAction:(id)sender; 46 | - (IBAction)commentOrUncommentAction:(id)sender; 47 | - (IBAction)emptyDummyAction:(id)sender; 48 | - (IBAction)removeLineEndingsAction:(id)sender; 49 | - (IBAction)changeLineEndingsAction:(id)sender; 50 | - (IBAction)interchangeAdjacentCharactersAction:(id)sender; 51 | - (IBAction)prepareForXMLAction:(id)sender; 52 | 53 | - (IBAction)changeSyntaxDefinitionAction:(id)sender; 54 | @end 55 | -------------------------------------------------------------------------------- /PSMTabBar/PSMRolloverButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSMOverflowPopUpButton.m 3 | // NetScrape 4 | // 5 | // Created by John Pannell on 8/4/04. 6 | // Copyright 2004 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import "PSMRolloverButton.h" 10 | 11 | @implementation PSMRolloverButton 12 | 13 | // the regular image 14 | - (void)setUsualImage:(NSImage *)newImage 15 | { 16 | _usualImage = newImage; 17 | [self setImage:_usualImage]; 18 | } 19 | 20 | - (NSImage *)usualImage 21 | { 22 | return _usualImage; 23 | } 24 | 25 | - (void)setRolloverImage:(NSImage *)newImage 26 | { 27 | _rolloverImage = newImage; 28 | } 29 | 30 | - (NSImage *)rolloverImage 31 | { 32 | return _rolloverImage; 33 | } 34 | 35 | - (void)addTrackingRect 36 | { 37 | // assign a tracking rect to watch for mouse enter/exit 38 | _myTrackingRectTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; 39 | } 40 | 41 | - (void)removeTrackingRect 42 | { 43 | [self removeTrackingRect:_myTrackingRectTag]; 44 | } 45 | 46 | // override for rollover effect 47 | - (void)mouseEntered:(NSEvent *)theEvent; 48 | { 49 | // set rollover image 50 | [self setImage:_rolloverImage]; 51 | [self setNeedsDisplay]; 52 | [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact 53 | } 54 | 55 | - (void)mouseExited:(NSEvent *)theEvent; 56 | { 57 | // restore usual image 58 | [self setImage:_usualImage]; 59 | [self setNeedsDisplay]; 60 | [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact 61 | } 62 | 63 | - (void)mouseDown:(NSEvent *)theEvent 64 | { 65 | // eliminates drawing artifact 66 | [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:[self superview] argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; 67 | [super mouseDown:theEvent]; 68 | } 69 | 70 | - (void)resetCursorRects 71 | { 72 | // called when the button rect has been changed 73 | [self removeTrackingRect]; 74 | [self addTrackingRect]; 75 | [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact 76 | } 77 | 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Command Line Utility/smultron_main.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | #import 17 | 18 | int main (int argc, const char * argv[]) { 19 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 20 | 21 | NSFileManager *fileManager = [NSFileManager defaultManager]; 22 | NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; 23 | if (!argv[1]) { // There is no argument 24 | if (![workspace launchApplication:@"Textron.app"]) { 25 | NSLog(@"Can't open Textron"); 26 | } 27 | } else { // We should open files 28 | short i = 1; 29 | NSString *path; 30 | while (argv[i]) { 31 | path = [[NSString alloc] initWithUTF8String:argv[i]]; 32 | if (![fileManager fileExistsAtPath:path]) { // Check if file exists, otherwise create it 33 | NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; 34 | NSNumber *creatorCode = [NSNumber numberWithUnsignedLong:'SMUL']; 35 | NSNumber *typeCode = [NSNumber numberWithUnsignedLong:'SMLd']; 36 | [attributes setObject:creatorCode forKey:@"NSFileHFSCreatorCode"]; 37 | [attributes setObject:typeCode forKey:@"NSFileHFSTypeCode"]; 38 | [fileManager createFileAtPath:path contents:nil attributes:attributes]; 39 | } 40 | 41 | if (![workspace openFile:path withApplication:@"Textron.app"]) { // Open file 42 | NSLog(@"Couldn't open %@ with Textron", path); 43 | } 44 | i++; 45 | } 46 | } 47 | 48 | [pool drain]; 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /Classes/SMLSnippetsController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLSnippetsController : NSObject 18 | { 19 | IBOutlet NSArrayController *snippetCollectionsArrayController; 20 | IBOutlet NSTableView *snippetCollectionsTableView; 21 | IBOutlet NSArrayController *snippetsArrayController; 22 | IBOutlet NSTableView *snippetsTableView; 23 | IBOutlet NSWindow *snippetsWindow; 24 | IBOutlet NSTextView *snippetsTextView; 25 | IBOutlet NSView *snippetsFilterView; 26 | } 27 | 28 | @property (readonly) IBOutlet NSTextView *snippetsTextView; 29 | @property (readonly) IBOutlet NSWindow *snippetsWindow; 30 | @property (readonly) IBOutlet NSArrayController *snippetCollectionsArrayController; 31 | @property (readonly) IBOutlet NSTableView *snippetCollectionsTableView; 32 | @property (readonly) IBOutlet NSArrayController *snippetsArrayController; 33 | @property (readonly) IBOutlet NSTableView *snippetsTableView; 34 | 35 | + (SMLSnippetsController *)sharedInstance; 36 | 37 | - (void)openSnippetsWindow; 38 | 39 | - (IBAction)newCollectionAction:(id)sender; 40 | - (IBAction)newSnippetAction:(id)sender; 41 | 42 | - (id)performInsertNewSnippet; 43 | 44 | - (void)insertSnippet:(id)snippet; 45 | 46 | - (void)performDeleteCollection; 47 | 48 | - (void)importSnippets; 49 | - (void)performSnippetsImportWithPath:(NSString *)path; 50 | - (void)exportSnippets; 51 | 52 | - (NSManagedObjectContext *)managedObjectContext; 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ICU/icu/LICENSE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICU License - ICU 1.8.1 and later 6 | 7 | 8 | 9 |

ICU License - ICU 1.8.1 and later

10 | 11 |

COPYRIGHT AND PERMISSION NOTICE

12 | 13 |

14 | Copyright (c) 1995-2006 International Business Machines Corporation and others 15 |

16 |

17 | All rights reserved. 18 |

19 |

20 | Permission is hereby granted, free of charge, to any person obtaining a copy 21 | of this software and associated documentation files (the "Software"), 22 | to deal in the Software without restriction, including without limitation 23 | the rights to use, copy, modify, merge, publish, distribute, and/or sell 24 | copies of the Software, and to permit persons 25 | to whom the Software is furnished to do so, provided that the above 26 | copyright notice(s) and this permission notice appear in all copies 27 | of the Software and that both the above copyright notice(s) and this 28 | permission notice appear in supporting documentation. 29 |

30 |

31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 32 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 33 | PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL 34 | THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, 35 | OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 36 | RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 37 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE 38 | USE OR PERFORMANCE OF THIS SOFTWARE. 39 |

40 |

41 | Except as contained in this notice, the name of a copyright holder shall not be 42 | used in advertising or otherwise to promote the sale, use or other dealings in 43 | this Software without prior written authorization of the copyright holder. 44 |

45 | 46 |
47 |

48 | All trademarks and registered trademarks mentioned herein are the property of their respective owners. 49 |

50 | 51 | 52 | -------------------------------------------------------------------------------- /Classes/SMLSyntaxDefinitionManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSyntaxDefinitionManagedObject.h" 18 | #import "SMLApplicationDelegate.h" 19 | #import "SMLVariousPerformer.h" 20 | 21 | @implementation SMLSyntaxDefinitionManagedObject 22 | 23 | - (void)didChangeValueForKey:(NSString *)key 24 | { 25 | [super didChangeValueForKey:key]; 26 | 27 | if ([[SMLApplicationDelegate sharedInstance] hasFinishedLaunching] == NO) { 28 | return; 29 | } 30 | 31 | if ([SMLVarious isChangingSyntaxDefinitionsProgrammatically] == YES) { 32 | return; 33 | } 34 | 35 | NSDictionary *changedObject = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[self valueForKey:@"name"], [self valueForKey:@"extensions"], nil] forKeys:[NSArray arrayWithObjects:@"name", @"extensions", nil]]; 36 | if ([SMLDefaults valueForKey:@"ChangedSyntaxDefinitions"]) { 37 | NSMutableArray *changedSyntaxDefinitionsArray = [NSMutableArray arrayWithArray:[SMLDefaults valueForKey:@"ChangedSyntaxDefinitions"]]; 38 | NSArray *array = [NSArray arrayWithArray:changedSyntaxDefinitionsArray]; 39 | for (id item in array) { 40 | if ([[item valueForKey:@"name"] isEqualToString:[self valueForKey:@"name"]]) { 41 | [changedSyntaxDefinitionsArray removeObject:item]; 42 | } 43 | } 44 | [changedSyntaxDefinitionsArray addObject:changedObject]; 45 | [SMLDefaults setValue:changedSyntaxDefinitionsArray forKey:@"ChangedSyntaxDefinitions"]; 46 | } else { 47 | [SMLDefaults setValue:[NSArray arrayWithObject:changedObject] forKey:@"ChangedSyntaxDefinitions"]; 48 | } 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /Classes/SMLToolsMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLToolsMenuController : NSObject 18 | { 19 | IBOutlet NSMenu *runCommandMenu; 20 | IBOutlet NSMenu *insertSnippetMenu; 21 | IBOutlet NSMenu *functionsMenu; 22 | 23 | NSTextView *textViewToInsertColourInto; 24 | } 25 | 26 | + (SMLToolsMenuController *)sharedInstance; 27 | 28 | - (IBAction)createSnippetFromSelectionAction:(id)sender; 29 | - (IBAction)insertColourAction:(id)sender; 30 | - (IBAction)previewAction:(id)sender; 31 | - (IBAction)reloadPreviewAction:(id)sender; 32 | - (IBAction)showCommandsWindowAction:(id)sender; 33 | - (IBAction)runTextAction:(id)sender; 34 | - (IBAction)showSnippetsWindowAction:(id)sender; 35 | - (IBAction)previousFunctionAction:(id)sender; 36 | - (IBAction)nextFunctionAction:(id)sender; 37 | 38 | - (void)buildInsertSnippetMenu; 39 | - (void)buildRunCommandMenu; 40 | 41 | - (IBAction)emptyDummyAction:(id)sender; 42 | 43 | - (IBAction)getInfoAction:(id)sender; 44 | - (IBAction)refreshInfoAction:(id)sender; 45 | 46 | - (IBAction)importSnippetsAction:(id)sender; 47 | - (IBAction)exportSnippetsAction:(id)sender; 48 | 49 | - (IBAction)importCommandsAction:(id)sender; 50 | - (IBAction)exportCommandsAction:(id)sender; 51 | 52 | - (IBAction)showCommandResultWindowAction:(id)sender; 53 | - (IBAction)runSelectionInlineAction:(id)sender; 54 | 55 | - (IBAction)runCommandAction:(id)sender; 56 | - (IBAction)newCommandAction:(id)sender; 57 | - (IBAction)newCommandCollectionAction:(id)sender; 58 | 59 | - (IBAction)newSnippetAction:(id)sender; 60 | - (IBAction)newSnippetCollectionAction:(id)sender; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Classes/SMLDocumentManagedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLDocumentManagedObject.h" 18 | 19 | @implementation SMLDocumentManagedObject 20 | 21 | - (void)awakeFromInsert 22 | { 23 | [super awakeFromInsert]; 24 | 25 | // NSImage *defaultDocumentIcon = [SMLInterface documentIcon]; 26 | // [defaultDocumentIcon setDataRetained:NO]; 27 | // [defaultDocumentIcon setScalesWhenResized:YES]; 28 | // 29 | // NSImage *defaultUnsavedDocumentIcon = [[NSImage alloc] initWithData:[[SMLVarious unsavedIconFromImage:defaultDocumentIcon] TIFFRepresentation]]; 30 | // [defaultUnsavedDocumentIcon setDataRetained:NO]; 31 | // [defaultUnsavedDocumentIcon setScalesWhenResized:YES]; 32 | // 33 | // [self setValue:defaultDocumentIcon forKey:@"icon"]; 34 | // [self setValue:defaultUnsavedDocumentIcon forKey:@"unsavedIcon"]; 35 | 36 | [self setValue:[NSNumber numberWithBool:[[SMLDefaults valueForKey:@"SyntaxColourNewDocuments"] boolValue]] forKey:@"isSyntaxColoured"]; 37 | [self setValue:[NSNumber numberWithBool:[[SMLDefaults valueForKey:@"LineWrapNewDocuments"] boolValue]] forKey:@"isLineWrapped"]; 38 | [self setValue:[NSNumber numberWithBool:[[SMLDefaults valueForKey:@"ShowInvisibleCharacters"] boolValue]] forKey:@"showInvisibleCharacters"]; 39 | [self setValue:[NSNumber numberWithBool:[[SMLDefaults valueForKey:@"ShowLineNumberGutter"] boolValue]] forKey:@"showLineNumberGutter"]; 40 | [self setValue:[NSNumber numberWithInteger:[[SMLDefaults valueForKey:@"GutterWidth"] integerValue]] forKey:@"gutterWidth"]; 41 | [self setValue:[NSNumber numberWithInteger:[[SMLDefaults valueForKey:@"EncodingsPopUp"] integerValue]] forKey:@"encoding"]; 42 | } 43 | 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Syntax Definitions/eiffel.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | -- 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | indexing 44 | class 45 | inherit 46 | creation 47 | feature 48 | rename 49 | redefine 50 | undefine 51 | select 52 | export 53 | local 54 | deferred 55 | do 56 | is 57 | once 58 | alias 59 | external 60 | rescue 61 | debug 62 | if 63 | inspect 64 | from 65 | else 66 | elseif 67 | when 68 | until 69 | loop 70 | then 71 | obsolete 72 | end 73 | check 74 | ensure 75 | require 76 | variant 77 | invariant 78 | create 79 | 80 | autocompleteWords 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /ICU/NSStringICUAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSStringICUAdditions.h 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/19/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ICUPattern; 11 | 12 | @interface NSString (NSStringICUAdditions) 13 | 14 | /*! 15 | @method nativeUTF16Encoding 16 | @abstract The native UTF16 encoding on the given machine. 17 | @discussion The native UTF16 encoding on the given machine. 18 | */ 19 | +(NSStringEncoding)nativeUTF16Encoding; 20 | 21 | 22 | 23 | /*! 24 | @method UTF16String 25 | @abstract Returns a UTF16 encoded string in the native encoding. 26 | @discussion This string has a retain policy equivalent to UTF8String. In 27 | other words, if you want to keep this string around beyond the given autorelease 28 | context, you need to copy the returned string. 29 | */ 30 | -(void *)UTF16String; 31 | 32 | 33 | /*! 34 | @method copyUTF16String 35 | @abstract returns a copy 36 | @discussion Returns a UTF16 encoded string in the native encoding. The returned 37 | buffer must eventually be freed. 38 | */ 39 | -(void *)copyUTF16String; 40 | 41 | /*! 42 | @method findPattern: 43 | @abstract Finds the given expression and and groups. 44 | @discussion Returns the match and any grouped matches in the returned 45 | array. The first element of the array is the entire match and subsequent 46 | elements are the groups in the order the matches occur. 47 | */ 48 | -(NSArray *)findPattern:(NSString *)aRegex; 49 | 50 | /*! 51 | @method componentsSeparatedByPattern: 52 | @abstract Returns the components separated by the given pattern. 53 | @discussion Break a string into components where components separated 54 | by occurrences of the given pattern. 55 | */ 56 | -(NSArray *)componentsSeparatedByPattern:(NSString *)aRegex; 57 | 58 | /*! 59 | @method replaceOccurrencesOfPattern:withString: 60 | @abstract Replace occurrences of the pattern with the replacement text. 61 | @discussion Replace occurrences of the pattern with the replacement text. 62 | The replacement text may contain backrerferences. 63 | */ 64 | -(NSString *)replaceOccurrencesOfPattern:(NSString *)aPattern withString:(NSString *)replacementText; 65 | 66 | /*! 67 | @method matchesPattern: 68 | @abstract Returns YES if the string matches the entire pattern. 69 | @discussion Returns YES if the string matches the entire pattern. 70 | */ 71 | -(BOOL)matchesPattern:(NSString *)aRegex; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Classes/SMLPreferencesController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @interface SMLPreferencesController : NSObject 18 | { 19 | NSToolbar *preferencesToolbar; 20 | 21 | IBOutlet NSWindow *preferencesWindow; 22 | IBOutlet NSView *generalView; 23 | IBOutlet NSView *appearanceView; 24 | IBOutlet NSView *openSaveView; 25 | IBOutlet NSView *advancedView; 26 | IBOutlet NSArrayController *syntaxDefinitionsArrayController; 27 | 28 | IBOutlet NSTextField *noUpdateAvailableTextField; 29 | IBOutlet NSPopUpButton *encodingsPopUp; 30 | IBOutlet NSPopUpButton *syntaxColouringPopUp; 31 | IBOutlet NSPopUpButton *lastSavedFormatPopUp; 32 | 33 | IBOutlet NSArrayController *encodingsArrayController; 34 | 35 | IBOutlet NSTableView *syntaxDefinitionsTableView; 36 | IBOutlet NSTableView *encodingsTableView; 37 | 38 | BOOL hasPreparedAdvancedInterface; 39 | 40 | NSView *currentView; 41 | } 42 | 43 | @property (readonly) IBOutlet NSArrayController *encodingsArrayController; 44 | @property (readonly) IBOutlet NSArrayController *syntaxDefinitionsArrayController; 45 | @property (readonly) IBOutlet NSPopUpButton *encodingsPopUp; 46 | @property (readonly) IBOutlet NSWindow *preferencesWindow; 47 | 48 | 49 | + (SMLPreferencesController *)sharedInstance; 50 | 51 | - (void)setDefaults; 52 | 53 | - (void)showPreferencesWindow; 54 | 55 | - (NSRect)getRectForView:(NSView *)view; 56 | - (CGFloat)toolbarHeight; 57 | 58 | - (IBAction)setFontAction:(id)sender; 59 | - (IBAction)checkNowAction:(id)sender; 60 | 61 | - (NSTextField *)noUpdateAvailableTextField; 62 | 63 | - (IBAction)revertToStandardSettingsAction:(id)sender; 64 | - (void)buildEncodingsMenu; 65 | 66 | - (IBAction)openSetFolderAction:(id)sender; 67 | - (IBAction)saveAsSetFolderAction:(id)sender; 68 | 69 | 70 | 71 | - (NSManagedObjectContext *)managedObjectContext; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Classes/SMLAdvancedFindController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLAdvancedFindController : NSObject 19 | { 20 | IBOutlet NSWindow *advancedFindWindow; 21 | IBOutlet NSSearchField *findSearchField; 22 | IBOutlet NSSearchField *replaceSearchField; 23 | IBOutlet NSTextField *findResultTextField; 24 | IBOutlet NSOutlineView *findResultsOutlineView; 25 | IBOutlet NSView *resultDocumentContentView; 26 | IBOutlet NSTreeController *findResultsTreeController; 27 | 28 | IBOutlet NSSplitView *advancedFindSplitView; 29 | 30 | IBOutlet NSButton *currentDocumentScope; 31 | IBOutlet NSButton *currentProjectScope; 32 | IBOutlet NSButton *allDocumentsScope; 33 | 34 | id currentlyDisplayedDocumentInAdvancedFind; 35 | } 36 | 37 | @property (assign) id currentlyDisplayedDocumentInAdvancedFind; 38 | @property (readonly) IBOutlet NSWindow *advancedFindWindow; 39 | @property (readonly) IBOutlet NSOutlineView *findResultsOutlineView; 40 | 41 | + (SMLAdvancedFindController *)sharedInstance; 42 | 43 | - (IBAction)findAction:(id)sender; 44 | - (IBAction)replaceAction:(id)sender; 45 | 46 | - (void)performNumberOfReplaces:(NSInteger)numberOfReplaces; 47 | 48 | - (void)showAdvancedFindWindow; 49 | 50 | - (NSEnumerator *)scopeEnumerator; 51 | 52 | - (void)removeCurrentlyDisplayedDocumentInAdvancedFind; 53 | 54 | - (NSView *)resultDocumentContentView; 55 | 56 | - (NSManagedObjectContext *)managedObjectContext; 57 | 58 | - (NSMutableDictionary *)preparedResultDictionaryFromString:(NSString *)completeString searchStringLength:(NSInteger)searchStringLength range:(NSRange)foundRange lineNumber:(NSInteger)lineNumber document:(id)document; 59 | 60 | - (void)alertThatThisIsNotAValidRegularExpression:(NSString *)string; 61 | 62 | - (void)searchScopeChanged:(id)sender; 63 | 64 | - (IBAction)showRegularExpressionsHelpPanelAction:(id)sender; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Classes/SMLFullScreenWindow.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | 16 | #import "SMLStandardHeader.h" 17 | 18 | #import "SMLFullScreenWindow.h" 19 | #import "SMLInterfacePerformer.h" 20 | 21 | @implementation SMLFullScreenWindow 22 | 23 | - (BOOL)canBecomeKeyWindow 24 | { 25 | return YES; 26 | } 27 | 28 | 29 | - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag 30 | { 31 | if (self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag]) { 32 | [self setAlphaValue:0]; 33 | [self setOpaque:NO]; 34 | [self setHasShadow:NO]; 35 | [self setBackgroundColor:[NSColor blackColor]]; 36 | 37 | return self; 38 | } 39 | 40 | return nil; 41 | } 42 | 43 | 44 | - (void)enterFullScreen 45 | { 46 | SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); 47 | fullScreenTimer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self selector:@selector(fadeIn) userInfo:nil repeats:YES]; 48 | } 49 | 50 | 51 | - (void)fadeIn 52 | { 53 | if ([self alphaValue] < 1.0) { 54 | [self setAlphaValue:([self alphaValue] + 0.05)]; 55 | } else { 56 | if (fullScreenTimer != nil) { 57 | [fullScreenTimer invalidate]; 58 | fullScreenTimer = nil; 59 | } 60 | 61 | [SMLInterface insertDocumentIntoFullScreenWindow]; 62 | } 63 | } 64 | 65 | 66 | - (void)returnFromFullScreen 67 | { 68 | fullScreenTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fadeOut) userInfo:nil repeats:YES]; 69 | 70 | } 71 | 72 | 73 | - (void)fadeOut 74 | { 75 | if ([self alphaValue] > 0) { 76 | [self setAlphaValue:([self alphaValue] - 0.05)]; 77 | } else { 78 | if (fullScreenTimer != nil) { 79 | [fullScreenTimer invalidate]; 80 | fullScreenTimer = nil; 81 | } 82 | 83 | [SMLInterface returnFromFullScreen]; 84 | } 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Syntax Definitions/batch.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | @ 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | % 15 | endVariable 16 | \.\=\\\" 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | :: 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keyWordsCaseSensitive 38 | 39 | recolourKeyWordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | assoc 44 | call 45 | cd 46 | chdir 47 | cls 48 | cmd 49 | color 50 | copy 51 | date 52 | defined 53 | del 54 | dir 55 | dpath 56 | echo 57 | else 58 | endlocal 59 | erase 60 | errorlevel 61 | exit 62 | exist 63 | for 64 | ftype 65 | goto 66 | if 67 | md 68 | mkdir 69 | move 70 | not 71 | path 72 | pause 73 | popd 74 | prompt 75 | pushd 76 | rd 77 | rem 78 | rename 79 | ren 80 | rmdir 81 | set 82 | setlocal 83 | shift 84 | start 85 | time 86 | title 87 | type 88 | ver 89 | 90 | autocompleteWords 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Syntax Definitions/scala.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | def 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstract 44 | case 45 | catch 46 | class 47 | def 48 | do 49 | else 50 | extends 51 | false 52 | final 53 | finally 54 | for 55 | if 56 | implicit 57 | import 58 | match 59 | new 60 | null 61 | object 62 | override 63 | package 64 | private 65 | protected 66 | requires 67 | return 68 | sealed 69 | super 70 | this 71 | throw 72 | trait 73 | try 74 | true 75 | type 76 | val 77 | var 78 | while 79 | with 80 | yield 81 | 82 | autocompleteWords 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Classes/SMLInterfacePerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLFullScreenWindow; 18 | 19 | @interface SMLInterfacePerformer : NSObject { 20 | 21 | NSString *statusBarBetweenString; 22 | NSString *statusBarLastSavedString; 23 | NSString *statusBarSelectionLengthString; 24 | NSString *statusBarLineString; 25 | NSString *statusBarColumnString; 26 | NSString *statusBarSyntaxDefinitionString; 27 | NSString *statusBarEncodingString; 28 | 29 | SMLFullScreenWindow *fullScreenWindow; 30 | id fullScreenDocument; 31 | NSMenu *savedMainMenu; 32 | NSRect fullScreenRect; 33 | 34 | NSImage *defaultIcon; 35 | NSImage *defaultUnsavedIcon; 36 | } 37 | 38 | @property (readonly) SMLFullScreenWindow *fullScreenWindow; 39 | @property (readonly) id fullScreenDocument; 40 | 41 | @property (retain) NSImage *defaultIcon; 42 | @property (retain) NSImage *defaultUnsavedIcon; 43 | 44 | 45 | + (SMLInterfacePerformer *)sharedInstance; 46 | 47 | - (void)goToFunctionOnLine:(id)sender; 48 | - (void)createFirstViewForDocument:(id)document; 49 | - (void)insertDocumentIntoSecondContentView:(id)document; 50 | - (void)insertDocumentIntoThirdContentView:(id)document orderFront:(BOOL)orderFront; 51 | - (void)insertDocumentIntoFourthContentView:(id)document; 52 | 53 | - (void)updateStatusBar; 54 | - (void)clearStatusBar; 55 | 56 | - (NSString *)whichDirectoryForOpen; 57 | - (NSString *)whichDirectoryForSave; 58 | 59 | - (void)removeAllSubviewsFromView:(NSView *)view; 60 | - (void)enterFullScreenForDocument:(id)document; 61 | - (void)insertDocumentIntoFullScreenWindow; 62 | - (void)returnFromFullScreen; 63 | 64 | - (void)insertAllFunctionsIntoMenu:(NSMenu *)menu; 65 | - (NSArray *)allFunctions; 66 | - (NSInteger)currentLineNumber; 67 | - (NSInteger)currentFunctionIndexForFunctions:(NSArray *)functions; 68 | 69 | - (void)removeAllTabBarObjectsForTabView:(NSTabView *)tabView; 70 | 71 | - (void)changeViewWithAnimationForWindow:(NSWindow *)window oldView:(NSView *)oldView newView:(NSView *)newView newRect:(NSRect)newRect; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Classes/SMLCommandsController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLTableView; 18 | 19 | @interface SMLCommandsController : NSObject { 20 | 21 | IBOutlet NSArrayController *commandCollectionsArrayController; 22 | IBOutlet NSTableView *commandCollectionsTableView; 23 | IBOutlet NSArrayController *commandsArrayController; 24 | IBOutlet NSTableView *commandsTableView; 25 | IBOutlet NSWindow *commandsWindow; 26 | IBOutlet NSTextView *commandsTextView; 27 | IBOutlet NSView *commandsFilterView; 28 | 29 | BOOL currentCommandShouldBeInsertedInline; 30 | BOOL isCommandRunning; 31 | NSTimer *checkIfTemporaryFilesCanBeDeletedTimer; 32 | NSMutableArray *temporaryFilesArray; 33 | 34 | } 35 | 36 | @property (readonly) IBOutlet NSTextView *commandsTextView; 37 | @property (readonly) IBOutlet NSWindow *commandsWindow; 38 | @property (readonly) IBOutlet NSArrayController *commandCollectionsArrayController; 39 | @property (readonly) IBOutlet NSTableView *commandCollectionsTableView; 40 | @property (readonly) IBOutlet NSArrayController *commandsArrayController; 41 | @property (readonly) IBOutlet NSTableView *commandsTableView; 42 | 43 | + (SMLCommandsController *)sharedInstance; 44 | 45 | - (void)openCommandsWindow; 46 | 47 | - (IBAction)newCollectionAction:(id)sender; 48 | - (IBAction)newCommandAction:(id)sender; 49 | 50 | - (id)performInsertNewCommand; 51 | 52 | - (void)performDeleteCollection; 53 | 54 | - (void)importCommands; 55 | - (void)performCommandsImportWithPath:(NSString *)path; 56 | - (void)exportCommands; 57 | 58 | - (NSManagedObjectContext *)managedObjectContext; 59 | 60 | 61 | - (IBAction)runAction:(id)sender; 62 | 63 | - (IBAction)insertPathAction:(id)sender; 64 | - (IBAction)insertDirectoryAction:(id)sender; 65 | 66 | - (NSString *)commandToRunFromString:(NSString *)string; 67 | 68 | - (void)runCommand:(id)command; 69 | 70 | - (BOOL)currentCommandShouldBeInsertedInline; 71 | 72 | - (void)setCommandRunning:(BOOL)flag; 73 | 74 | - (void)clearAnyTemporaryFiles; 75 | 76 | 77 | 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Classes/SMLExtraInterfaceController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface SMLExtraInterfaceController : NSObject { 19 | 20 | IBOutlet NSTextField *spacesTextFieldEntabWindow; 21 | IBOutlet NSTextField *spacesTextFieldDetabWindow; 22 | IBOutlet NSTextField *lineTextFieldGoToLineWindow; 23 | IBOutlet NSWindow *entabWindow; 24 | IBOutlet NSWindow *detabWindow; 25 | IBOutlet NSWindow *goToLineWindow; 26 | 27 | IBOutlet NSView *openPanelAccessoryView; 28 | IBOutlet NSPopUpButton *openPanelEncodingsPopUp; 29 | //IBOutlet NSView *printAccessoryView; 30 | 31 | IBOutlet NSWindow *commandResultWindow; 32 | IBOutlet NSTextView *commandResultTextView; 33 | 34 | IBOutlet NSWindow *newProjectWindow; 35 | IBOutlet NSPanel *regularExpressionsHelpPanel; 36 | } 37 | 38 | 39 | @property (readonly) IBOutlet NSView *openPanelAccessoryView; 40 | @property (readonly) IBOutlet NSPopUpButton *openPanelEncodingsPopUp; 41 | //@property (readonly) IBOutlet NSView *printAccessoryView; 42 | @property (readonly) IBOutlet NSWindow *commandResultWindow; 43 | @property (readonly) IBOutlet NSTextView *commandResultTextView; 44 | @property (readonly) IBOutlet NSWindow *newProjectWindow; 45 | 46 | + (SMLExtraInterfaceController *)sharedInstance; 47 | 48 | - (void)displayEntab; 49 | - (void)displayDetab; 50 | - (IBAction)entabButtonEntabWindowAction:(id)sender; 51 | - (IBAction)detabButtonDetabWindowAction:(id)sender; 52 | - (IBAction)cancelButtonEntabDetabGoToLineWindowsAction:(id)sender; 53 | - (void)displayGoToLine; 54 | - (IBAction)goButtonGoToLineWindowAction:(id)sender; 55 | 56 | //- (IBAction)setPrintFontAction:(id)sender; 57 | 58 | - (NSPopUpButton *)openPanelEncodingsPopUp; 59 | - (NSView *)openPanelAccessoryView; 60 | //- (NSView *)printAccessoryView; 61 | - (NSWindow *)commandResultWindow; 62 | -(NSTextView *)commandResultTextView; 63 | - (NSWindow *)newProjectWindow; 64 | 65 | - (void)showCommandResultWindow; 66 | 67 | 68 | - (IBAction)createNewProjectAction:(id)sender; 69 | 70 | - (void)showRegularExpressionsHelpPanel; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Syntax Definitions/erl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | % 25 | beginFirstMultiLineComment 26 | % 27 | endFirstMultiLineComment 28 | % 29 | beginSecondMultiLineComment 30 | % 31 | endSecondMultiLineComment 32 | % 33 | functionDefinition 34 | ^[a-z]+.*\(.*\)\s*-> 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | module 44 | include 45 | compile 46 | author 47 | vsn 48 | behavior 49 | behaviour 50 | define 51 | record 52 | after 53 | and 54 | andalso 55 | band 56 | begin 57 | bnot 58 | bor 59 | bsi 60 | bsr 61 | case 62 | catch 63 | cond 64 | div 65 | end 66 | fun 67 | if 68 | let 69 | not 70 | of 71 | or 72 | orelse 73 | query 74 | receive 75 | rem 76 | try 77 | when 78 | xor 79 | 80 | autocompleteWords 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Classes/SMLSingleDocumentWindowDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLSingleDocumentWindowDelegate.h" 18 | #import "SMLBasicPerformer.h" 19 | #import "SMLSyntaxColouring.h" 20 | #import "SMLLineNumbers.h" 21 | 22 | @implementation SMLSingleDocumentWindowDelegate 23 | 24 | static id sharedInstance = nil; 25 | 26 | + (SMLSingleDocumentWindowDelegate *)sharedInstance 27 | { 28 | if (sharedInstance == nil) { 29 | sharedInstance = [[self alloc] init]; 30 | } 31 | 32 | return sharedInstance; 33 | } 34 | 35 | 36 | - (id)init 37 | { 38 | if (sharedInstance == nil) { 39 | sharedInstance = [super init]; 40 | } 41 | return sharedInstance; 42 | } 43 | 44 | 45 | - (void)windowDidResize:(NSNotification *)aNotification 46 | { 47 | NSWindow *window = [aNotification object]; 48 | NSArray *array = [SMLBasic fetchAll:@"Document"]; 49 | id document; 50 | for (document in array) { 51 | if ([document valueForKey:@"singleDocumentWindow"] == window) { 52 | break; 53 | } 54 | } 55 | 56 | if (document == nil) { 57 | return; 58 | } 59 | 60 | array = [[window contentView] subviews]; 61 | for (id view in array) { 62 | if (view == [document valueForKey:@"thirdTextScrollView"]) { 63 | [[document valueForKey:@"lineNumbers"] updateLineNumbersForClipView:[view contentView] checkWidth:NO recolour:YES]; 64 | } 65 | } 66 | 67 | [SMLDefaults setValue:NSStringFromRect([window frame]) forKey:@"SingleDocumentWindow"]; 68 | } 69 | 70 | 71 | - (BOOL)windowShouldClose:(id)sender 72 | { 73 | NSArray *array = [SMLBasic fetchAll:@"Document"]; 74 | for (id item in array) { 75 | if ([item valueForKey:@"singleDocumentWindow"] == sender) { 76 | [item setValue:nil forKey:@"singleDocumentWindow"]; 77 | [item setValue:nil forKey:@"singleDocumentWindow"]; 78 | [item setValue:nil forKey:@"thirdTextView"]; 79 | [[item valueForKey:@"syntaxColouring"] setThirdLayoutManager:nil]; 80 | break; 81 | } 82 | } 83 | 84 | [SMLDefaults setValue:NSStringFromRect([sender frame]) forKey:@"SingleDocumentWindow"]; 85 | 86 | return YES; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /Syntax Definitions/c.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | char 44 | double 45 | enum 46 | float 47 | int 48 | long 49 | short 50 | signed 51 | struct 52 | typedef 53 | union 54 | unsigned 55 | void 56 | auto 57 | const 58 | extern 59 | register 60 | static 61 | volatile 62 | break 63 | case 64 | continue 65 | default 66 | do 67 | else 68 | for 69 | goto 70 | if 71 | return 72 | sizeof 73 | switch 74 | while 75 | asm 76 | asmlinkage 77 | far 78 | huge 79 | inline 80 | near 81 | pascal 82 | true 83 | false 84 | NULL 85 | #include 86 | #define 87 | #warning 88 | #error 89 | #ifdef 90 | #ifndef 91 | #endif 92 | #else 93 | 94 | autocompleteWords 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /ICU/NSStringICUAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSStringICUAdditions.m 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/19/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import "NSStringICUAdditions.h" 10 | #import "ICUPattern.h" 11 | #import "ICUMatcher.h" 12 | 13 | struct URegularExpression; 14 | /** 15 | * Structure represeting a compiled regular rexpression, plus the results 16 | * of a match operation. 17 | * @draft ICU 3.0 18 | */ 19 | typedef struct URegularExpression URegularExpression; 20 | 21 | #define U_HIDE_DRAFT_API 1 22 | #define U_DISABLE_RENAMING 1 23 | #import 24 | 25 | @interface NSString (NSStringICUPrivateAdditions) 26 | 27 | @end 28 | 29 | @implementation NSString (NSStringICUAdditions) 30 | 31 | -(NSString *)replaceOccurrencesOfPattern:(NSString *)aPattern withString:(NSString *)replacementText { 32 | ICUPattern *p = [ICUPattern patternWithString:aPattern]; 33 | ICUMatcher *m = [ICUMatcher matcherWithPattern:p overString:self]; 34 | return [m replaceAllWithString:replacementText]; 35 | } 36 | 37 | -(BOOL)matchesPattern:(NSString *)aRegex { 38 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 39 | ICUMatcher *m = [ICUMatcher matcherWithPattern:p overString:self]; 40 | return [m matches]; 41 | } 42 | 43 | -(NSArray *)findPattern:(NSString *)aRegex { 44 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 45 | ICUMatcher *matcher = [ICUMatcher matcherWithPattern:p overString:self]; 46 | NSMutableArray *foundGroups = [NSMutableArray array]; 47 | 48 | [matcher findFromIndex:0]; 49 | int i; 50 | for(i=0;i<=[matcher numberOfGroups];i++) 51 | [foundGroups addObject:[matcher groupAtIndex:i]]; 52 | 53 | return [NSArray arrayWithArray:foundGroups]; 54 | } 55 | 56 | -(NSArray *)componentsSeparatedByPattern:(NSString *)aRegex { 57 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 58 | return [p componentsSplitFromString:self]; 59 | } 60 | 61 | 62 | +(NSStringEncoding)nativeUTF16Encoding { 63 | CFStringEncoding stringEncoding; 64 | #if __BIG_ENDIAN__ 65 | stringEncoding = kCFStringEncodingUTF16BE; 66 | #elif __LITTLE_ENDIAN__ 67 | stringEncoding = kCFStringEncodingUTF16LE; 68 | #endif 69 | 70 | return CFStringConvertEncodingToNSStringEncoding(stringEncoding); 71 | } 72 | 73 | -(void *)UTF16String { 74 | UChar *ret = (UChar *)[self cStringUsingEncoding:[NSString nativeUTF16Encoding]]; 75 | 76 | // for some reason, the null-terminator doesn't always show up at the right place and this 77 | // causes extra characters to be created in the unicode string. We remove them here by force. 78 | unsigned int len = [self length]; 79 | ret[len] = '\0'; 80 | return ret; 81 | } 82 | 83 | -(void *)copyUTF16String { 84 | unsigned int length = [self length]; 85 | UChar *utf16String = malloc((length+1)*sizeof(UChar)); 86 | [self getCharacters: utf16String]; 87 | utf16String[length] = 0; 88 | return utf16String; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Classes/SMLVariousPerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | @class SMLFullScreenWindow; 18 | @class SMLPrintTextView; 19 | 20 | @interface SMLVariousPerformer : NSObject { 21 | 22 | NSInteger untitledNumber; 23 | 24 | NSString *separatorString; 25 | 26 | NSTimer *checkIfAnotherApplicationHasChangedDocumentsTimer; 27 | 28 | BOOL isChangingSyntaxDefinitionsProgrammatically; 29 | NSTask *asynchronousTask; 30 | NSMutableString *asynchronousTaskResult; 31 | } 32 | 33 | + (SMLVariousPerformer *)sharedInstance; 34 | 35 | - (void)updateCheckIfAnotherApplicationHasChangedDocumentsTimer; 36 | 37 | - (void)insertTextEncodings; 38 | - (void)insertSyntaxDefinitions; 39 | - (void)insertDefaultSnippets; 40 | 41 | - (void)insertDefaultCommands; 42 | - (void)standardAlertSheetWithTitle:(NSString *)title message:(NSString *)message window:(NSWindow *)window; 43 | - (void)stopModalLoop; 44 | - (void)sendModifiedEventToExternalDocument:(id)document path:(NSString *)path; 45 | - (void)sendClosedEventToExternalDocument:(id)document; 46 | 47 | - (NSInteger)alertWithMessage:(NSString *)message informativeText:(NSString *)informativeText defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton; 48 | 49 | - (void)checkIfDocumentsHaveBeenUpdatedByAnotherApplication; 50 | - (void)sheetDidFinish:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; 51 | - (NSString *)performCommand:(NSString *)command; 52 | - (void)performCommandAsynchronously:(NSString *)command; 53 | - (void)asynchronousTaskCompleted; 54 | 55 | - (BOOL)isChangingSyntaxDefinitionsProgrammatically; 56 | 57 | - (void)setUnsavedAsLastSavedDateForDocument:(id)document; 58 | - (void)setLastSavedDateForDocument:(id)document date:(NSDate *)lastSavedDate; 59 | - (void)hasChangedDocument:(id)document; 60 | 61 | - (void)setNameAndPathForDocument:(id)document path:(NSString *)path; 62 | 63 | 64 | - (void)fixSortOrderNumbersForArrayController:(NSArrayController *)arrayController overIndex:(NSInteger)index; 65 | - (void)resetSortOrderNumbersForArrayController:(NSArrayController *)arrayController; 66 | 67 | 68 | - (void)insertIconsInBackground:(id)array; 69 | 70 | //- (SMLPrintTextView *)printView; 71 | @end 72 | -------------------------------------------------------------------------------- /PSMTabBar/PSMOverflowPopUpButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSMOverflowPopUpButton.m 3 | // PSMTabBarControl 4 | // 5 | // Created by John Pannell on 11/4/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import "PSMOverflowPopUpButton.h" 10 | #import "PSMTabBarControl.h" 11 | 12 | @implementation PSMOverflowPopUpButton 13 | 14 | - (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag 15 | { 16 | self=[super initWithFrame:frameRect pullsDown:YES]; 17 | if (self) { 18 | [self setBezelStyle:NSRegularSquareBezelStyle]; 19 | [self setBordered:NO]; 20 | [self setTitle:@""]; 21 | [self setPreferredEdge:NSMaxXEdge]; 22 | 23 | _PSMTabBarOverflowPopUpImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"SMLTabBarOverflow" ofType:@"pdf" inDirectory:@"Tab Bar"]]; 24 | _PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"SMLTabBarOverflowPressed" ofType:@"pdf" inDirectory:@"Tab Bar"]]; 25 | } 26 | return self; 27 | } 28 | 29 | 30 | 31 | - (void)drawRect:(NSRect)rect 32 | { 33 | if(_PSMTabBarOverflowPopUpImage == nil){ 34 | [super drawRect:rect]; 35 | return; 36 | } 37 | 38 | NSImage *image = (_down) ? _PSMTabBarOverflowDownPopUpImage : _PSMTabBarOverflowPopUpImage; 39 | NSSize imageSize = [image size]; 40 | rect.origin.x = NSMidX(rect) - (imageSize.width * 0.5); 41 | rect.origin.y = NSMidY(rect) - (imageSize.height * 0.5); 42 | if([self isFlipped]) { 43 | rect.origin.y += imageSize.height; 44 | } 45 | [image compositeToPoint:rect.origin operation:NSCompositeSourceOver]; 46 | } 47 | 48 | - (void)mouseDown:(NSEvent *)event 49 | { 50 | _down = YES; 51 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]]; 52 | [self setNeedsDisplay:YES]; 53 | [super mouseDown:event]; 54 | } 55 | 56 | - (void)notificationReceived:(NSNotification *)notification 57 | { 58 | _down = NO; 59 | [self setNeedsDisplay:YES]; 60 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 61 | } 62 | 63 | #pragma mark - 64 | #pragma mark Archiving 65 | 66 | - (void)encodeWithCoder:(NSCoder *)aCoder { 67 | [super encodeWithCoder:aCoder]; 68 | if ([aCoder allowsKeyedCoding]) { 69 | [aCoder encodeObject:_PSMTabBarOverflowPopUpImage forKey:@"PSMTabBarOverflowPopUpImage"]; 70 | [aCoder encodeObject:_PSMTabBarOverflowDownPopUpImage forKey:@"PSMTabBarOverflowDownPopUpImage"]; 71 | } 72 | } 73 | 74 | - (id)initWithCoder:(NSCoder *)aDecoder { 75 | self = [super initWithCoder:aDecoder]; 76 | if (self) { 77 | if ([aDecoder allowsKeyedCoding]) { 78 | _PSMTabBarOverflowPopUpImage = [aDecoder decodeObjectForKey:@"PSMTabBarOverflowPopUpImage"]; 79 | _PSMTabBarOverflowDownPopUpImage = [aDecoder decodeObjectForKey:@"PSMTabBarOverflowDownPopUpImage"]; 80 | } 81 | } 82 | return self; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Syntax Definitions/objectivecaml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | (* 27 | endFirstMultiLineComment 28 | *) 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | as 45 | assert 46 | asr 47 | begin 48 | class 49 | constraint 50 | do 51 | done 52 | downto 53 | else 54 | end 55 | exception 56 | external 57 | false 58 | for 59 | fun 60 | function 61 | functor 62 | if 63 | in 64 | include 65 | inherit 66 | initializer 67 | land 68 | lazy 69 | let 70 | lor 71 | lsl 72 | lsr 73 | lxor 74 | match 75 | method 76 | mod 77 | module 78 | mutable 79 | new 80 | object 81 | of 82 | open 83 | or 84 | private 85 | rec 86 | sig 87 | struct 88 | then 89 | to 90 | true 91 | try 92 | type 93 | val 94 | virtual 95 | when 96 | while 97 | with 98 | 99 | autocompleteWords 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Syntax Definitions/java.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstract 44 | break 45 | case 46 | catch 47 | continue 48 | default 49 | do 50 | else 51 | extends 52 | final 53 | finally 54 | for 55 | if 56 | implements 57 | instanceof 58 | native 59 | new 60 | private 61 | protected 62 | public 63 | return 64 | static 65 | switch 66 | synchronized 67 | throw 68 | throws 69 | transient 70 | try 71 | volatile 72 | while 73 | package 74 | import 75 | boolean 76 | byte 77 | char 78 | class 79 | double 80 | float 81 | int 82 | interface 83 | long 84 | short 85 | void 86 | assert 87 | strictfp 88 | false 89 | null 90 | super 91 | this 92 | true 93 | goto 94 | const 95 | enum 96 | 97 | autocompleteWords 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Syntax Definitions/sml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | (* 27 | endFirstMultiLineComment 28 | *) 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstype 44 | and 45 | andalso 46 | as 47 | case 48 | do 49 | datatype 50 | else 51 | end 52 | eqtype 53 | exception 54 | false 55 | fn 56 | fun 57 | functor 58 | handle 59 | if 60 | in 61 | include 62 | infix 63 | infixr 64 | let 65 | local 66 | nonfix 67 | of 68 | op 69 | open 70 | orelse 71 | raise 72 | rec 73 | sharing 74 | sig 75 | signature 76 | struct 77 | structure 78 | then 79 | true 80 | type 81 | val 82 | where 83 | with 84 | withtype 85 | while 86 | unit 87 | int 88 | real 89 | char 90 | string 91 | substring 92 | word 93 | ref 94 | array 95 | vector 96 | bool 97 | list 98 | option 99 | order 100 | 101 | autocompleteWords 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Syntax Definitions/javafx.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | after 44 | as 45 | attribute 46 | before 47 | bind 48 | Boolean 49 | break 50 | catch 51 | class 52 | continue 53 | delete 54 | do 55 | else 56 | extends 57 | finally 58 | first 59 | for 60 | foreach 61 | format 62 | from 63 | function 64 | import 65 | if 66 | in 67 | indexof 68 | insert 69 | instanceof 70 | Integer 71 | into 72 | inverse 73 | last 74 | later 75 | lazy 76 | new 77 | Number 78 | on 79 | operation 80 | return 81 | reverse 82 | select 83 | sizeof 84 | String 85 | then 86 | this 87 | throw 88 | trigger 89 | try 90 | var 91 | where 92 | while 93 | 94 | autocompleteWords 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /PSMTabBar/PSMTabDragAssistant.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMTabDragAssistant.h 3 | // PSMTabBarControl 4 | // 5 | // Created by John Pannell on 4/10/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | /* 10 | This class is a sigleton that manages the details of a tab drag and drop. The details were beginning to overwhelm me when keeping all of this in the control and cells :-) 11 | */ 12 | 13 | #import 14 | #import "PSMTabBarControl.h" 15 | @class PSMTabBarCell; 16 | @class PSMTabDragWindow; 17 | 18 | #define kPSMTabDragAnimationSteps 8 19 | #define PI 3.1417 20 | 21 | @interface PSMTabDragAssistant : NSObject { 22 | PSMTabBarControl *_sourceTabBar; 23 | PSMTabBarControl *_destinationTabBar; 24 | NSMutableSet *_participatingTabBars; 25 | PSMTabBarCell *_draggedCell; 26 | int _draggedCellIndex; // for snap back 27 | BOOL _isDragging; 28 | 29 | // Animation 30 | NSTimer *_animationTimer; 31 | NSMutableArray *_sineCurveWidths; 32 | NSPoint _currentMouseLoc; 33 | PSMTabBarCell *_targetCell; 34 | } 35 | 36 | // Creation/destruction 37 | + (PSMTabDragAssistant *)sharedDragAssistant; 38 | 39 | // Accessors 40 | - (PSMTabBarControl *)sourceTabBar; 41 | - (void)setSourceTabBar:(PSMTabBarControl *)tabBar; 42 | - (PSMTabBarControl *)destinationTabBar; 43 | - (void)setDestinationTabBar:(PSMTabBarControl *)tabBar; 44 | - (PSMTabBarCell *)draggedCell; 45 | - (void)setDraggedCell:(PSMTabBarCell *)cell; 46 | - (int)draggedCellIndex; 47 | - (void)setDraggedCellIndex:(int)value; 48 | - (BOOL)isDragging; 49 | - (void)setIsDragging:(BOOL)value; 50 | - (NSPoint)currentMouseLoc; 51 | - (void)setCurrentMouseLoc:(NSPoint)point; 52 | - (PSMTabBarCell *)targetCell; 53 | - (void)setTargetCell:(PSMTabBarCell *)cell; 54 | 55 | // Functionality 56 | - (void)startDraggingCell:(PSMTabBarCell *)cell fromTabBar:(PSMTabBarControl *)control withMouseDownEvent:(NSEvent *)event; 57 | - (void)draggingEnteredTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; 58 | - (void)draggingUpdatedInTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; 59 | - (void)draggingExitedTabBar:(PSMTabBarControl *)control; 60 | - (void)performDragOperation; 61 | - (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation; 62 | - (void)finishDrag; 63 | 64 | // Animation 65 | - (void)animateDrag:(NSTimer *)timer; 66 | - (void)calculateDragAnimationForTabBar:(PSMTabBarControl *)control; 67 | 68 | // Placeholder 69 | - (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control withDraggedCell:(PSMTabBarCell *)cell; 70 | - (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control; 71 | - (void)removeAllPlaceholdersFromTabBar:(PSMTabBarControl *)control; 72 | 73 | @end 74 | 75 | @interface PSMTabBarControl (DragAccessors) 76 | 77 | - (id)style; 78 | - (NSMutableArray *)cells; 79 | - (void)setControlView:(id)view; 80 | - (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; 81 | - (PSMTabBarCell *)lastVisibleTab; 82 | - (int)numberOfVisibleTabs; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Other/DefaultCommands.plist: -------------------------------------------------------------------------------- 1 | { 2 | List = ( 3 | { 4 | name = "Current path"; 5 | text = "/bin/ls -AlFkhe %%p"; 6 | }, 7 | { 8 | name = "Current directory"; 9 | text = "/bin/ls -AlFkhe %%d"; 10 | }, 11 | { 12 | name = "Home directory"; 13 | text = "/bin/ls -AlFkhe ~"; 14 | }, 15 | { 16 | name = Desktop; 17 | text = "/bin/ls -AlFkhe ~/Desktop"; 18 | }, 19 | { 20 | name = "Spotlight path"; 21 | text = "/usr/bin/mdls %%p"; 22 | }, 23 | ); 24 | Convert = ( 25 | { 26 | name = "Document to HTML"; 27 | text = "/usr/bin/textutil -convert html -stdout -inputencoding 5 -encoding 5 %%p"; 28 | inline = YES; 29 | }, 30 | { 31 | name = "Document to plain text"; 32 | text = "/usr/bin/textutil -convert txt -stdout -inputencoding 5 -encoding 5 %%p"; 33 | inline = YES; 34 | }, 35 | { 36 | name = "Selection to HTML entities"; 37 | text = "#!/usr/bin/php\n"; 38 | inline = YES; 39 | interpreter = "/usr/bin/php"; 40 | }, 41 | { 42 | name = "Selection from HTML entities to normal characters"; 43 | text = "#!/usr/bin/php\n"; 44 | inline = YES; 45 | }, 46 | { 47 | name = "From binary plist to XML"; 48 | text = "#!/bin/sh\n\ntempFile=/tmp/TextronTempFile.`/bin/date +%H%M%S`.$$\n\n/usr/bin/plutil -convert xml1 -o $tempFile %%p\n/bin/cat $tempFile\n/bin/rm -f $tempFile"; 49 | }, 50 | { 51 | name = "From XML plist to binary"; 52 | text = "#!/bin/sh\n\ntempFile=/tmp/TextronTempFile.`/bin/date +%H%M%S`.$$\n\n/usr/bin/plutil -convert binary1 -o $tempFile %%p\n/bin/cat $tempFile\n/bin/rm -f $tempFile"; 53 | }, 54 | ); 55 | Validate = ( 56 | { 57 | name = HTML; 58 | text = "/usr/bin/tidy -errors %%p"; 59 | }, 60 | { 61 | name = "HTML accessibility"; 62 | text = "/usr/bin/tidy -access 3 %%p"; 63 | }, 64 | { 65 | name = plist; 66 | text = "/usr/bin/plutil %%p"; 67 | }, 68 | { 69 | name = XML; 70 | text = "/usr/bin/xmllint -noout %%p"; 71 | }, 72 | ); 73 | Other = ( 74 | { 75 | name = "Run path"; 76 | text = "/bin/sh %%p"; 77 | }, 78 | { 79 | name = "Show last log items"; 80 | text = "/usr/bin/tail /var/log/system.log"; 81 | }, 82 | { 83 | name = "Insert current date"; 84 | text = "/bin/date '+%Y-%m-%d %H:%M'"; 85 | inline = YES; 86 | }, 87 | { 88 | name = "Sort selected lines ascending"; 89 | text = "#!/bin/sh\n\n/usr/bin/sort -f %%s"; 90 | inline = YES; 91 | }, 92 | { 93 | name = "Sort selected lines descending"; 94 | text = "#!/bin/sh\n\n/usr/bin/sort -fr %%s"; 95 | inline = YES; 96 | }, 97 | { 98 | name = "Remove duplicate lines"; 99 | text = "#!/bin/sh\n\n/usr/bin/uniq -u %%s"; 100 | inline = YES; 101 | }, 102 | { 103 | name = "Compile Java"; 104 | text = "/usr/bin/javac %%p"; 105 | }, 106 | { 107 | name = "Make executable"; 108 | text = "/bin/chmod u+x %%p"; 109 | }, 110 | ); 111 | } -------------------------------------------------------------------------------- /Classes/SMLPrintViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLPrintViewController.h" 16 | 17 | #import "SMLStandardHeader.h" 18 | 19 | 20 | @implementation SMLPrintViewController 21 | 22 | @synthesize dummyValue; 23 | 24 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 25 | { 26 | return [super initWithNibName:@"SMLPrintAccessoryView" bundle:nibBundleOrNil]; 27 | } 28 | 29 | 30 | - (void)awakeFromNib 31 | { 32 | [self setView:printAccessoryView]; 33 | 34 | NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController]; 35 | 36 | [defaultsController addObserver:self forKeyPath:@"values.PrintHeader" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"]; 37 | [defaultsController addObserver:self forKeyPath:@"values.PrintSyntaxColours" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"]; 38 | [defaultsController addObserver:self forKeyPath:@"values.OnlyPrintSelection" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"]; 39 | [defaultsController addObserver:self forKeyPath:@"values.MarginsMin" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"]; 40 | [defaultsController addObserver:self forKeyPath:@"values.PrintFont" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"]; 41 | 42 | [self performSelector:@selector(hackToMakeDisplayUpdateDirectly) withObject:nil afterDelay:0.0]; 43 | } 44 | 45 | 46 | - (void)hackToMakeDisplayUpdateDirectly 47 | { 48 | [self setDummyValue:!dummyValue]; 49 | } 50 | 51 | 52 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 53 | { 54 | if ([(NSString *)context isEqualToString:@"PrinterSettingsChanged"]) { 55 | [self setDummyValue:!dummyValue]; 56 | 57 | } else { 58 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 59 | } 60 | 61 | } 62 | 63 | 64 | - (NSSet *)keyPathsForValuesAffectingPreview 65 | { 66 | return [NSSet setWithObject:@"dummyValue"]; 67 | } 68 | 69 | 70 | - (NSArray *)localizedSummaryItems 71 | { 72 | return [NSArray arrayWithObject:[NSDictionary dictionary]]; 73 | } 74 | 75 | 76 | - (IBAction)setPrintFontAction:(id)sender 77 | { 78 | NSFontManager *fontManager = [NSFontManager sharedFontManager]; 79 | [fontManager setSelectedFont:[NSUnarchiver unarchiveObjectWithData:[SMLDefaults valueForKey:@"PrintFont"]] isMultiple:NO]; 80 | [fontManager orderFrontFontPanel:nil]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/NSToolbarItem+Textron.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "NSToolbarItem+Textron.h" 16 | 17 | 18 | @implementation NSToolbarItem (NSToolbarItemTextron) 19 | 20 | 21 | + (NSToolbarItem *)createToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name image:(NSImage *)image action:(SEL)selector tag:(NSInteger)tag target:(id)target 22 | { 23 | NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; 24 | 25 | // [toolbarItem setLabel:name]; 26 | // [toolbarItem setPaletteLabel:name]; 27 | // [toolbarItem setToolTip:name]; 28 | // [toolbarItem setTag:tag]; 29 | // 30 | // [toolbarItem setImage:image]; 31 | // [toolbarItem setTarget:target]; 32 | // [toolbarItem setAction:selector]; 33 | 34 | NSRect toolbarItemRect = NSMakeRect(0.0, 0.0, 28.0, 27.0); 35 | 36 | NSView *view = [[NSView alloc] initWithFrame:toolbarItemRect]; 37 | NSButton *button = [[NSButton alloc] initWithFrame:toolbarItemRect]; 38 | [button setBezelStyle:NSTexturedRoundedBezelStyle]; 39 | [button setTitle:@""]; 40 | [button setImage:image]; 41 | [button setTarget:target]; 42 | [button setAction:selector]; 43 | [[button cell] setImageScaling:NSImageScaleProportionallyDown]; 44 | [button setImagePosition:NSImageOnly]; 45 | 46 | [toolbarItem setLabel:name]; 47 | [toolbarItem setPaletteLabel:name]; 48 | [toolbarItem setToolTip:name]; 49 | 50 | [view addSubview:button]; 51 | 52 | [toolbarItem setTag:tag]; 53 | [toolbarItem setView:view]; 54 | 55 | return toolbarItem; 56 | } 57 | 58 | 59 | + (NSToolbarItem *)createPreferencesToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name image:(NSImage *)image action:(SEL)selector target:(id)target 60 | { 61 | NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; 62 | 63 | [toolbarItem setLabel:name]; 64 | [toolbarItem setPaletteLabel:name]; 65 | [toolbarItem setToolTip:name]; 66 | 67 | [toolbarItem setImage:image]; 68 | [toolbarItem setTarget:target]; 69 | [toolbarItem setAction:selector]; 70 | 71 | return toolbarItem; 72 | } 73 | 74 | 75 | + (NSToolbarItem *)createSeachFieldToolbarItemWithIdentifier:(NSString *)itemIdentifier name:(NSString *)name view:(NSView *)view 76 | { 77 | NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; 78 | [toolbarItem setLabel:name]; 79 | [toolbarItem setToolTip:name]; 80 | [toolbarItem setPaletteLabel:name]; 81 | [toolbarItem setView:view]; 82 | [toolbarItem setMinSize:NSMakeSize(70, 32)]; 83 | [toolbarItem setMaxSize:NSMakeSize(200, 32)]; 84 | 85 | return toolbarItem; 86 | } 87 | @end 88 | -------------------------------------------------------------------------------- /Syntax Definitions/dylan.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | < 15 | endVariable 16 | > 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | afterwards 44 | above 45 | abstract 46 | below 47 | begin 48 | block 49 | by 50 | case 51 | class 52 | cleanup 53 | concrete 54 | constant 55 | create 56 | define 57 | domain 58 | else 59 | elseif 60 | end 61 | exception 62 | exclude 63 | export 64 | finally 65 | for 66 | from 67 | function 68 | functional 69 | generic 70 | handler 71 | if 72 | import 73 | in 74 | inherited 75 | inline 76 | instance 77 | interface 78 | library 79 | let 80 | local 81 | macro 82 | method 83 | open 84 | otherwise 85 | primary 86 | rename 87 | sealed 88 | select 89 | sideways 90 | signal 91 | singleton 92 | slot 93 | subclass 94 | then 95 | to 96 | unless 97 | until 98 | use 99 | variable 100 | virtual 101 | when 102 | while 103 | 104 | autocompleteWords 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Syntax Definitions/vb.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | ' 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*\w*(function|sub)\s+.* 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | if 44 | then 45 | else 46 | elseif 47 | select 48 | case 49 | for 50 | to 51 | step 52 | next 53 | each 54 | in 55 | do 56 | while 57 | until 58 | loop 59 | wend 60 | exit 61 | end 62 | function 63 | sub 64 | class 65 | property 66 | get 67 | let 68 | set 69 | byval 70 | byref 71 | const 72 | dim 73 | redim 74 | preserve 75 | as 76 | set 77 | with 78 | new 79 | public 80 | default 81 | private 82 | rem 83 | call 84 | execute 85 | eval 86 | on 87 | error 88 | goto 89 | resume 90 | option 91 | explicit 92 | erase 93 | randomize 94 | is 95 | mod 96 | and 97 | or 98 | not 99 | xor 100 | imp 101 | false 102 | true 103 | empty 104 | nothing 105 | null 106 | 107 | autocompleteWords 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ICU/icu/unicode/parseerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | ********************************************************************** 3 | * Copyright (C) 1999-2004, International Business Machines 4 | * Corporation and others. All Rights Reserved. 5 | ********************************************************************** 6 | * Date Name Description 7 | * 03/14/00 aliu Creation. 8 | * 06/27/00 aliu Change from C++ class to C struct 9 | ********************************************************************** 10 | */ 11 | #ifndef PARSEERR_H 12 | #define PARSEERR_H 13 | 14 | #include "unicode/utypes.h" 15 | 16 | 17 | /** 18 | * The capacity of the context strings in UParseError. 19 | * @stable ICU 2.0 20 | */ 21 | enum { U_PARSE_CONTEXT_LEN = 16 }; 22 | 23 | /** 24 | * A UParseError struct is used to returned detailed information about 25 | * parsing errors. It is used by ICU parsing engines that parse long 26 | * rules, patterns, or programs, where the text being parsed is long 27 | * enough that more information than a UErrorCode is needed to 28 | * localize the error. 29 | * 30 | *

The line, offset, and context fields are optional; parsing 31 | * engines may choose not to use to use them. 32 | * 33 | *

The preContext and postContext strings include some part of the 34 | * context surrounding the error. If the source text is "let for=7" 35 | * and "for" is the error (e.g., because it is a reserved word), then 36 | * some examples of what a parser might produce are the following: 37 | * 38 | *

39 |  * preContext   postContext
40 |  * ""           ""            The parser does not support context
41 |  * "let "       "=7"          Pre- and post-context only
42 |  * "let "       "for=7"       Pre- and post-context and error text
43 |  * ""           "for"         Error text only
44 |  * 
45 | * 46 | *

Examples of engines which use UParseError (or may use it in the 47 | * future) are Transliterator, RuleBasedBreakIterator, and 48 | * RegexPattern. 49 | * 50 | * @stable ICU 2.0 51 | */ 52 | typedef struct UParseError { 53 | 54 | /** 55 | * The line on which the error occured. If the parser uses this 56 | * field, it sets it to the line number of the source text line on 57 | * which the error appears, which will be be a value >= 1. If the 58 | * parse does not support line numbers, the value will be <= 0. 59 | * @stable ICU 2.0 60 | */ 61 | int32_t line; 62 | 63 | /** 64 | * The character offset to the error. If the line field is >= 1, 65 | * then this is the offset from the start of the line. Otherwise, 66 | * this is the offset from the start of the text. If the parser 67 | * does not support this field, it will have a value < 0. 68 | * @stable ICU 2.0 69 | */ 70 | int32_t offset; 71 | 72 | /** 73 | * Textual context before the error. Null-terminated. The empty 74 | * string if not supported by parser. 75 | * @stable ICU 2.0 76 | */ 77 | UChar preContext[U_PARSE_CONTEXT_LEN]; 78 | 79 | /** 80 | * The error itself and/or textual context after the error. 81 | * Null-terminated. The empty string if not supported by parser. 82 | * @stable ICU 2.0 83 | */ 84 | UChar postContext[U_PARSE_CONTEXT_LEN]; 85 | 86 | } UParseError; 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Classes/SMLGutterTextView.m: -------------------------------------------------------------------------------- 1 | /* 2 | Textron 3 | Based on Smultron Written by Peter Borg, pgw3@mac.com 4 | Find the latest version at http://vijaykiran.com/textron 5 | 6 | Copyright 2004-2009 Peter Borg 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "SMLStandardHeader.h" 16 | 17 | #import "SMLGutterTextView.h" 18 | 19 | @implementation SMLGutterTextView 20 | 21 | - (id)initWithFrame:(NSRect)frame 22 | { 23 | if (self = [super initWithFrame:frame]) { 24 | 25 | [self setContinuousSpellCheckingEnabled:NO]; 26 | [self setAllowsUndo:NO]; 27 | [self setAllowsDocumentBackgroundColorChange:NO]; 28 | [self setRichText:NO]; 29 | [self setUsesFindPanel:NO]; 30 | [self setUsesFontPanel:NO]; 31 | [self setAlignment:NSRightTextAlignment]; 32 | [self setEditable:NO]; 33 | [self setSelectable:NO]; 34 | [[self textContainer] setContainerSize:NSMakeSize([[SMLDefaults valueForKey:@"GutterWidth"] integerValue], FLT_MAX)]; 35 | [self setVerticallyResizable:YES]; 36 | [self setHorizontallyResizable:YES]; 37 | [self setAutoresizingMask:NSViewHeightSizable]; 38 | 39 | [self setFont:[NSUnarchiver unarchiveObjectWithData:[SMLDefaults valueForKey:@"TextFont"]]]; 40 | [self setTextColor:[NSColor textColor]];//[NSUnarchiver unarchiveObjectWithData:[SMLDefaults valueForKey:@"TextColourWell"]]]; 41 | [self setInsertionPointColor:[NSColor textColor]];//[NSUnarchiver unarchiveObjectWithData:[SMLDefaults valueForKey:@"TextColourWell"]]]; 42 | [self setBackgroundColor:[NSColor colorWithCalibratedWhite:0.94 alpha:1.0]]; 43 | 44 | NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController]; 45 | [defaultsController addObserver:self forKeyPath:@"values.TextFont" options:NSKeyValueObservingOptionNew context:@"TextFontChanged"]; 46 | } 47 | return self; 48 | } 49 | 50 | 51 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 52 | { 53 | if ([(NSString *)context isEqualToString:@"TextFontChanged"]) { 54 | [self setFont:[NSUnarchiver unarchiveObjectWithData:[SMLDefaults valueForKey:@"TextFont"]]]; 55 | } else { 56 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 57 | } 58 | } 59 | 60 | 61 | - (void)drawRect:(NSRect)rect 62 | { 63 | [super drawRect:rect]; 64 | 65 | NSRect bounds = [self bounds]; 66 | if ([self needsToDrawRect:NSMakeRect(bounds.size.width - 1, 0, 1, bounds.size.height)] == YES) { 67 | [[NSColor lightGrayColor] set]; 68 | NSBezierPath *dottedLine = [NSBezierPath bezierPathWithRect:NSMakeRect(bounds.size.width, 0, 0, bounds.size.height)]; 69 | CGFloat dash[2]; 70 | dash[0] = 1.0; 71 | dash[1] = 2.0; 72 | [dottedLine setLineDash:dash count:2 phase:1.0]; 73 | [dottedLine stroke]; 74 | } 75 | 76 | } 77 | 78 | 79 | - (BOOL)isOpaque 80 | { 81 | return YES; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /PSMTabBar/PSMTabBarCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSMTabBarCell.h 3 | // PSMTabBarControl 4 | // 5 | // Created by John Pannell on 10/13/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PSMTabBarControl.h" 11 | 12 | @class PSMTabBarControl; 13 | 14 | 15 | @interface PSMTabBarCell : NSActionCell { 16 | // sizing 17 | NSRect _frame; 18 | NSSize _stringSize; 19 | int _currentStep; 20 | BOOL _isPlaceholder; 21 | 22 | // state 23 | int _tabState; 24 | NSTrackingRectTag _closeButtonTrackingTag; // left side tracking, if dragging 25 | NSTrackingRectTag _cellTrackingTag; // right side tracking, if dragging 26 | BOOL _closeButtonOver; 27 | BOOL _closeButtonPressed; 28 | NSProgressIndicator *_indicator; 29 | BOOL _isInOverflowMenu; 30 | BOOL _hasCloseButton; 31 | BOOL _isCloseButtonSuppressed; 32 | BOOL _hasIcon; 33 | int _count; 34 | } 35 | 36 | // creation/destruction 37 | - (id)initWithControlView:(PSMTabBarControl *)controlView; 38 | - (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView; 39 | 40 | // accessors 41 | - (id)controlView; 42 | - (void)setControlView:(id)view; 43 | - (NSTrackingRectTag)closeButtonTrackingTag; 44 | - (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag; 45 | - (NSTrackingRectTag)cellTrackingTag; 46 | - (void)setCellTrackingTag:(NSTrackingRectTag)tag; 47 | - (float)width; 48 | - (NSRect)frame; 49 | - (void)setFrame:(NSRect)rect; 50 | - (void)setStringValue:(NSString *)aString; 51 | - (NSSize)stringSize; 52 | - (NSAttributedString *)attributedStringValue; 53 | - (int)tabState; 54 | - (void)setTabState:(int)state; 55 | - (NSProgressIndicator *)indicator; 56 | - (BOOL)isInOverflowMenu; 57 | - (void)setIsInOverflowMenu:(BOOL)value; 58 | - (BOOL)closeButtonPressed; 59 | - (void)setCloseButtonPressed:(BOOL)value; 60 | - (BOOL)closeButtonOver; 61 | - (void)setCloseButtonOver:(BOOL)value; 62 | - (BOOL)hasCloseButton; 63 | - (void)setHasCloseButton:(BOOL)set; 64 | - (void)setCloseButtonSuppressed:(BOOL)suppress; 65 | - (BOOL)isCloseButtonSuppressed; 66 | - (BOOL)hasIcon; 67 | - (void)setHasIcon:(BOOL)value; 68 | - (int)count; 69 | - (void)setCount:(int)value; 70 | - (BOOL)isPlaceholder; 71 | - (void)setIsPlaceholder:(BOOL)value; 72 | - (int)currentStep; 73 | - (void)setCurrentStep:(int)value; 74 | 75 | // component attributes 76 | - (NSRect)indicatorRectForFrame:(NSRect)cellFrame; 77 | - (NSRect)closeButtonRectForFrame:(NSRect)cellFrame; 78 | - (float)minimumWidthOfCell; 79 | - (float)desiredWidthOfCell; 80 | 81 | // drawing 82 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 83 | 84 | // tracking the mouse 85 | - (void)mouseEntered:(NSEvent *)theEvent; 86 | - (void)mouseExited:(NSEvent *)theEvent; 87 | 88 | // drag support 89 | - (NSImage*)dragImageForRect:(NSRect)cellFrame; 90 | 91 | // archiving 92 | - (void)encodeWithCoder:(NSCoder *)aCoder; 93 | - (id)initWithCoder:(NSCoder *)aDecoder; 94 | 95 | @end 96 | 97 | @interface PSMTabBarControl (CellAccessors) 98 | 99 | - (id)style; 100 | 101 | @end 102 | --------------------------------------------------------------------------------