Archive Project
This commit is contained in:
BIN
Brainfuck.icns
Executable file
BIN
Brainfuck.icns
Executable file
Binary file not shown.
33
Brainfuck.xcodeproj/project.pbxproj
Normal file → Executable file
33
Brainfuck.xcodeproj/project.pbxproj
Normal file → Executable file
@@ -14,6 +14,12 @@
|
||||
3B9F1F34174A865C00529CDD /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B9F1F33174A865C00529CDD /* Document.m */; };
|
||||
3B9F1F37174A865C00529CDD /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3B9F1F35174A865C00529CDD /* Document.xib */; };
|
||||
3B9F1F3A174A865D00529CDD /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3B9F1F38174A865C00529CDD /* MainMenu.xib */; };
|
||||
3B9F1F42174A8BAB00529CDD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B9F1F41174A8BAB00529CDD /* AppDelegate.m */; };
|
||||
3B9F1F45174A8BF000529CDD /* Interpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B9F1F44174A8BF000529CDD /* Interpreter.m */; };
|
||||
3B9F1F7D174AAB2500529CDD /* Lexer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B9F1F7C174AAB2500529CDD /* Lexer.m */; };
|
||||
3B9F1F8C174AC80A00529CDD /* Default.brainfuck in Resources */ = {isa = PBXBuildFile; fileRef = 3B9F1F8B174AC80A00529CDD /* Default.brainfuck */; };
|
||||
3BB9D879174ADA4F004D176D /* Brainfuck.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3BB9D878174ADA4F004D176D /* Brainfuck.icns */; };
|
||||
3BB9D87B174AE68D004D176D /* BrainfuckDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3BB9D87A174AE68D004D176D /* BrainfuckDocument.icns */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -31,6 +37,16 @@
|
||||
3B9F1F33174A865C00529CDD /* Document.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Document.m; sourceTree = "<group>"; };
|
||||
3B9F1F36174A865C00529CDD /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Document.xib; sourceTree = "<group>"; };
|
||||
3B9F1F39174A865D00529CDD /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
3B9F1F40174A8BAB00529CDD /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
3B9F1F41174A8BAB00529CDD /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
3B9F1F43174A8BF000529CDD /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = "<group>"; };
|
||||
3B9F1F44174A8BF000529CDD /* Interpreter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Interpreter.m; sourceTree = "<group>"; };
|
||||
3B9F1F7B174AAB2500529CDD /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = "<group>"; };
|
||||
3B9F1F7C174AAB2500529CDD /* Lexer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Lexer.m; sourceTree = "<group>"; };
|
||||
3B9F1F8A174AB86300529CDD /* Printer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Printer.h; sourceTree = "<group>"; };
|
||||
3B9F1F8B174AC80A00529CDD /* Default.brainfuck */ = {isa = PBXFileReference; fileEncoding = 7; lastKnownFileType = text; path = Default.brainfuck; sourceTree = "<group>"; };
|
||||
3BB9D878174ADA4F004D176D /* Brainfuck.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Brainfuck.icns; sourceTree = "<group>"; };
|
||||
3BB9D87A174AE68D004D176D /* BrainfuckDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = BrainfuckDocument.icns; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -48,6 +64,8 @@
|
||||
3B9F1F14174A865C00529CDD = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3BB9D87A174AE68D004D176D /* BrainfuckDocument.icns */,
|
||||
3BB9D878174ADA4F004D176D /* Brainfuck.icns */,
|
||||
3B9F1F26174A865C00529CDD /* Brainfuck */,
|
||||
3B9F1F1F174A865C00529CDD /* Frameworks */,
|
||||
3B9F1F1E174A865C00529CDD /* Products */,
|
||||
@@ -84,10 +102,18 @@
|
||||
3B9F1F26174A865C00529CDD /* Brainfuck */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B9F1F40174A8BAB00529CDD /* AppDelegate.h */,
|
||||
3B9F1F41174A8BAB00529CDD /* AppDelegate.m */,
|
||||
3B9F1F7B174AAB2500529CDD /* Lexer.h */,
|
||||
3B9F1F7C174AAB2500529CDD /* Lexer.m */,
|
||||
3B9F1F43174A8BF000529CDD /* Interpreter.h */,
|
||||
3B9F1F44174A8BF000529CDD /* Interpreter.m */,
|
||||
3B9F1F8A174AB86300529CDD /* Printer.h */,
|
||||
3B9F1F32174A865C00529CDD /* Document.h */,
|
||||
3B9F1F33174A865C00529CDD /* Document.m */,
|
||||
3B9F1F35174A865C00529CDD /* Document.xib */,
|
||||
3B9F1F38174A865C00529CDD /* MainMenu.xib */,
|
||||
3B9F1F8B174AC80A00529CDD /* Default.brainfuck */,
|
||||
3B9F1F27174A865C00529CDD /* Supporting Files */,
|
||||
);
|
||||
path = Brainfuck;
|
||||
@@ -160,6 +186,9 @@
|
||||
3B9F1F31174A865C00529CDD /* Credits.rtf in Resources */,
|
||||
3B9F1F37174A865C00529CDD /* Document.xib in Resources */,
|
||||
3B9F1F3A174A865D00529CDD /* MainMenu.xib in Resources */,
|
||||
3B9F1F8C174AC80A00529CDD /* Default.brainfuck in Resources */,
|
||||
3BB9D879174ADA4F004D176D /* Brainfuck.icns in Resources */,
|
||||
3BB9D87B174AE68D004D176D /* BrainfuckDocument.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -172,6 +201,9 @@
|
||||
files = (
|
||||
3B9F1F2D174A865C00529CDD /* main.m in Sources */,
|
||||
3B9F1F34174A865C00529CDD /* Document.m in Sources */,
|
||||
3B9F1F42174A8BAB00529CDD /* AppDelegate.m in Sources */,
|
||||
3B9F1F45174A8BF000529CDD /* Interpreter.m in Sources */,
|
||||
3B9F1F7D174AAB2500529CDD /* Lexer.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -315,6 +347,7 @@
|
||||
3B9F1F3F174A865D00529CDD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
7
Brainfuck.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
7
Brainfuck.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Brainfuck.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
BIN
Brainfuck.xcodeproj/project.xcworkspace/xcuserdata/kim.xcuserdatad/UserInterfaceState.xcuserstate
generated
Executable file
BIN
Brainfuck.xcodeproj/project.xcworkspace/xcuserdata/kim.xcuserdatad/UserInterfaceState.xcuserstate
generated
Executable file
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
|
||||
<true/>
|
||||
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "1.0">
|
||||
</Bucket>
|
||||
86
Brainfuck.xcodeproj/xcuserdata/kim.xcuserdatad/xcschemes/Brainfuck.xcscheme
Executable file
86
Brainfuck.xcodeproj/xcuserdata/kim.xcuserdatad/xcschemes/Brainfuck.xcscheme
Executable file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0460"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F1C174A865C00529CDD"
|
||||
BuildableName = "Brainfuck.app"
|
||||
BlueprintName = "Brainfuck"
|
||||
ReferencedContainer = "container:Brainfuck.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F1C174A865C00529CDD"
|
||||
BuildableName = "Brainfuck.app"
|
||||
BlueprintName = "Brainfuck"
|
||||
ReferencedContainer = "container:Brainfuck.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F1C174A865C00529CDD"
|
||||
BuildableName = "Brainfuck.app"
|
||||
BlueprintName = "Brainfuck"
|
||||
ReferencedContainer = "container:Brainfuck.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F1C174A865C00529CDD"
|
||||
BuildableName = "Brainfuck.app"
|
||||
BlueprintName = "Brainfuck"
|
||||
ReferencedContainer = "container:Brainfuck.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Brainfuck.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>3B9F1F1C174A865C00529CDD</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
17
Brainfuck/AppDelegate.h
Executable file
17
Brainfuck/AppDelegate.h
Executable file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CodeSnippet;
|
||||
|
||||
@interface AppDelegate : NSObject<NSApplicationDelegate, NSWindowDelegate>
|
||||
|
||||
- (IBAction)colorChanged:(id)sender;
|
||||
|
||||
@end
|
||||
49
Brainfuck/AppDelegate.m
Executable file
49
Brainfuck/AppDelegate.m
Executable file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#define Color(r,g,b) [NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedRed:r green:g blue:b alpha:1.0]]
|
||||
#define WhiteColor(white) [NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedWhite:white alpha:1.0]]
|
||||
#define DefaultColor(color) [NSArchiver archivedDataWithRootObject:[NSColor color]]
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
#pragma mark - Application delegate
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
NSMutableDictionary *defaults = [NSMutableDictionary dictionaryWithCapacity:9];
|
||||
[defaults setObject:WhiteColor(0.333333) forKey:@"default"];
|
||||
[defaults setObject:Color(11/255.0, 86/255.0, 2/255.0) forKey:@"\\+"];
|
||||
[defaults setObject:Color(11/255.0, 86/255.0, 2/255.0) forKey:@"\\-"];
|
||||
[defaults setObject:Color(0.0, 0.0, 83/255.0) forKey:@"\\<"];
|
||||
[defaults setObject:Color(0.0, 0.0, 83/255.0) forKey:@"\\>"];
|
||||
[defaults setObject:Color(82/255.0, 0.0, 2/255.0) forKey:@"\\["];
|
||||
[defaults setObject:Color(82/255.0, 0.0, 2/255.0) forKey:@"\\]"];
|
||||
[defaults setObject:DefaultColor(blackColor) forKey:@"\\."];
|
||||
[defaults setObject:DefaultColor(blackColor) forKey:@"\\,"];
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
|
||||
}
|
||||
|
||||
- (IBAction)colorChanged:(id)sender {
|
||||
for (id obj in [[NSDocumentController sharedDocumentController] documents]) {
|
||||
if ([obj respondsToSelector:@selector(updateColors)]) {
|
||||
[obj performSelector:@selector(updateColors)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Window delegate
|
||||
|
||||
- (void)windowDidResignMain:(NSNotification *)notification
|
||||
{
|
||||
[self colorChanged:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
44
Brainfuck/Brainfuck-Info.plist
Normal file → Executable file
44
Brainfuck/Brainfuck-Info.plist
Normal file → Executable file
@@ -12,23 +12,33 @@
|
||||
<string>brainfuck</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string></string>
|
||||
<string>BrainfuckDocument.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DocumentType</string>
|
||||
<string>Brainfuck Document</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>????</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>tk.brainfuck</string>
|
||||
</array>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>Document</string>
|
||||
<key>NSExportableTypes</key>
|
||||
<array>
|
||||
<string>tk.brainfuck</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<string>Brainfuck</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>tk.brainfuck.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
@@ -53,5 +63,33 @@
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.plain-text</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Brainfuck Document</string>
|
||||
<key>UTTypeIconFile</key>
|
||||
<string>BrainfuckDocument</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>tk.brainfuck</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>com.apple.ostype</key>
|
||||
<array>
|
||||
<string>????</string>
|
||||
</array>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>brainfuck</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array/>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
0
Brainfuck/Brainfuck-Prefix.pch
Normal file → Executable file
0
Brainfuck/Brainfuck-Prefix.pch
Normal file → Executable file
18
Brainfuck/Default.brainfuck
Executable file
18
Brainfuck/Default.brainfuck
Executable file
@@ -0,0 +1,18 @@
|
||||
++++++++++
|
||||
[
|
||||
>+++++++>++++++++++>+++>+<<<<-
|
||||
]
|
||||
>++.
|
||||
>+.
|
||||
+++++++.
|
||||
.
|
||||
+++.
|
||||
>++.
|
||||
<<+++++++++++++++.
|
||||
>.
|
||||
+++.
|
||||
------.
|
||||
--------.
|
||||
>+.
|
||||
>.
|
||||
+++.
|
||||
13
Brainfuck/Document.h
Normal file → Executable file
13
Brainfuck/Document.h
Normal file → Executable file
@@ -8,6 +8,17 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface Document : NSDocument
|
||||
#import "Printer.h"
|
||||
|
||||
@interface Document : NSDocument<NSWindowDelegate, NSSplitViewDelegate, NSTextStorageDelegate, NSTextViewDelegate, Printer>
|
||||
|
||||
@property (unsafe_unretained) IBOutlet NSTextView *editorView;
|
||||
@property (weak) IBOutlet NSTextField *inputView;
|
||||
@property (unsafe_unretained) IBOutlet NSTextView *outputView;
|
||||
|
||||
@property (copy) NSString *text;
|
||||
|
||||
- (IBAction)executeScript:(id)sender;
|
||||
- (void)updateColors;
|
||||
|
||||
@end
|
||||
|
||||
127
Brainfuck/Document.m
Normal file → Executable file
127
Brainfuck/Document.m
Normal file → Executable file
@@ -8,7 +8,20 @@
|
||||
|
||||
#import "Document.h"
|
||||
|
||||
@implementation Document
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import "Interpreter.h"
|
||||
|
||||
@implementation Document {
|
||||
NSString *changedCharacters;
|
||||
NSInteger insertLocation;
|
||||
}
|
||||
|
||||
@synthesize editorView;
|
||||
@synthesize inputView;
|
||||
@synthesize outputView;
|
||||
|
||||
@synthesize text;
|
||||
|
||||
- (id)init
|
||||
{
|
||||
@@ -21,15 +34,18 @@
|
||||
|
||||
- (NSString *)windowNibName
|
||||
{
|
||||
// Override returning the nib file name of the document
|
||||
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
|
||||
return @"Document";
|
||||
}
|
||||
|
||||
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
|
||||
{
|
||||
[super windowControllerDidLoadNib:aController];
|
||||
// Add any code here that needs to be executed once the windowController has loaded the document's window.
|
||||
editorView.textStorage.delegate = self;
|
||||
if (!self.text) {
|
||||
NSString *defaultFilePath = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"Default.brainfuck"];
|
||||
self.text = [NSString stringWithContentsOfFile:defaultFilePath encoding:NSASCIIStringEncoding error:nil];
|
||||
}
|
||||
[self updateColors];
|
||||
}
|
||||
|
||||
+ (BOOL)autosavesInPlace
|
||||
@@ -39,21 +55,104 @@
|
||||
|
||||
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
|
||||
{
|
||||
// Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.
|
||||
// You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
|
||||
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
|
||||
@throw exception;
|
||||
return nil;
|
||||
return [self.text dataUsingEncoding:NSASCIIStringEncoding];
|
||||
}
|
||||
|
||||
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
|
||||
{
|
||||
// Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.
|
||||
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
// If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.
|
||||
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
|
||||
@throw exception;
|
||||
self.text = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings error:(NSError *__autoreleasing *)outError
|
||||
{
|
||||
NSPrintOperation *op = [NSPrintOperation printOperationWithView:self.editorView];
|
||||
[self updateColors];
|
||||
return op;
|
||||
}
|
||||
|
||||
- (IBAction)executeScript:(id)sender
|
||||
{
|
||||
self.outputView.string = @"";
|
||||
Interpreter *interpreter = [Interpreter interpreter];
|
||||
interpreter.printer = self;
|
||||
[interpreter execute:self.editorView.string withInput:self.inputView.stringValue error:nil];
|
||||
}
|
||||
|
||||
- (void)updateColors
|
||||
{
|
||||
changedCharacters = self.editorView.string;
|
||||
insertLocation = 0;
|
||||
[self addTextStorageAttributes:self.editorView.textStorage];
|
||||
}
|
||||
|
||||
#pragma mark - Window delegate
|
||||
|
||||
- (void)windowDidResignKey:(NSNotification *)notification
|
||||
{
|
||||
[self updateColors];
|
||||
}
|
||||
|
||||
#pragma mark - Text storage delegate
|
||||
|
||||
- (void)textStorageDidProcessEditing:(NSNotification *)notification
|
||||
{
|
||||
[self addTextStorageAttributes:notification.object];
|
||||
}
|
||||
|
||||
- (void)addTextStorageAttributes:(NSTextStorage *)storage
|
||||
{
|
||||
if (!changedCharacters) {
|
||||
return;
|
||||
}
|
||||
NSData *foregroundData;
|
||||
NSColor *foreground;
|
||||
for (NSInteger i = 0; i < changedCharacters.length; ) {
|
||||
NSInteger loc = insertLocation + i;
|
||||
NSInteger len = 1;
|
||||
unichar c = [changedCharacters characterAtIndex:i];
|
||||
while (changedCharacters.length > ++i && [changedCharacters characterAtIndex:i] == c)
|
||||
len++;
|
||||
foregroundData = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"\\%c", c]];
|
||||
if (!foregroundData) {
|
||||
foregroundData = [[NSUserDefaults standardUserDefaults] objectForKey:@"default"];
|
||||
}
|
||||
foreground = [NSUnarchiver unarchiveObjectWithData:foregroundData];
|
||||
[storage addAttribute:NSForegroundColorAttributeName value:foreground range:NSMakeRange(loc, len)];
|
||||
}
|
||||
changedCharacters = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Text view delegate
|
||||
|
||||
- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString
|
||||
{
|
||||
if (replacementString.length == 0) {
|
||||
changedCharacters = nil;
|
||||
} else {
|
||||
changedCharacters = replacementString;
|
||||
insertLocation = affectedCharRange.location;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Printer
|
||||
|
||||
- (void)print:(NSString *)string
|
||||
{
|
||||
self.outputView.string = [self.outputView.string stringByAppendingString:string];
|
||||
}
|
||||
|
||||
#pragma mark - Split view delegate
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return proposedMaximumPosition-50;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
23
Brainfuck/Interpreter.h
Executable file
23
Brainfuck/Interpreter.h
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Interpreter.h
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Printer.h"
|
||||
|
||||
@interface Interpreter : NSObject
|
||||
|
||||
+ (Interpreter *)interpreter;
|
||||
|
||||
- (id)init;
|
||||
|
||||
@property (strong, nonatomic) id<Printer> printer;
|
||||
|
||||
- (void)execute:(NSString *)script withInput:(NSString *)input error:(NSError **)error;
|
||||
|
||||
@end
|
||||
130
Brainfuck/Interpreter.m
Executable file
130
Brainfuck/Interpreter.m
Executable file
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// Interpreter.m
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Interpreter.h"
|
||||
|
||||
#import "Lexer.h"
|
||||
|
||||
@implementation Interpreter {
|
||||
NSMutableArray *a;
|
||||
NSInteger level;
|
||||
NSString *input;
|
||||
NSInteger inPos;
|
||||
}
|
||||
|
||||
@synthesize printer;
|
||||
|
||||
+ (Interpreter *)interpreter
|
||||
{
|
||||
return [[self alloc] init];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)execute:(NSString *)script withInput:(NSString *)i error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
input = i;
|
||||
inPos = 0;
|
||||
Lexer *lexer = [Lexer lexer];
|
||||
NSArray *cmds = [lexer performLexingOnString:script error:error];
|
||||
level = 0;
|
||||
a = [NSMutableArray new];
|
||||
[a addObject:[NSNumber numberWithInt:0]];
|
||||
[self executeCommands:cmds];
|
||||
}
|
||||
|
||||
- (void)executeCommands:(NSArray *)cmds
|
||||
{
|
||||
for (id cmd in cmds) {
|
||||
if ([cmd isKindOfClass:[NSArray class]]) {
|
||||
[self loop:cmd];
|
||||
} else {
|
||||
[self executeCommand:cmd];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)executeCommand:(NSString *)cmd
|
||||
{
|
||||
int c = [cmd characterAtIndex:0];
|
||||
if (c == '+') {
|
||||
[self increment];
|
||||
} else if (c == '-') {
|
||||
[self decrement];
|
||||
} else if (c == '<') {
|
||||
[self previousCell];
|
||||
} else if (c == '>') {
|
||||
[self nextCell];
|
||||
} else if (c == '.') {
|
||||
[self printCellValue];
|
||||
} else if (c == ',') {
|
||||
[self readNextInput];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)increment
|
||||
{
|
||||
NSNumber *number = a[level];
|
||||
number = [NSNumber numberWithInt:number.intValue+1];
|
||||
a[level] = number;
|
||||
}
|
||||
|
||||
- (void)decrement
|
||||
{
|
||||
NSNumber *number = a[level];
|
||||
number = [NSNumber numberWithInt:number.intValue-1];
|
||||
a[level] = number;
|
||||
}
|
||||
|
||||
- (void)nextCell
|
||||
{
|
||||
if (++level == a.count) {
|
||||
[a addObject:[NSNumber numberWithInt:0]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)previousCell
|
||||
{
|
||||
if (--level == -1) {
|
||||
[a insertObject:[NSNumber numberWithInt:0] atIndex:0];
|
||||
level++;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)printCellValue
|
||||
{
|
||||
NSNumber *ascii = a[level];
|
||||
NSString *text = [NSString stringWithFormat:@"%c", ascii.intValue];
|
||||
[self.printer print:text];
|
||||
}
|
||||
|
||||
- (void)readNextInput
|
||||
{
|
||||
int ascii;
|
||||
if (inPos == input.length) {
|
||||
ascii = 0;
|
||||
} else {
|
||||
ascii = [input characterAtIndex:inPos++];
|
||||
}
|
||||
a[level] = [NSNumber numberWithInt:ascii];
|
||||
}
|
||||
|
||||
- (void)loop:(NSArray *)cmds
|
||||
{
|
||||
while (((NSNumber *)a[level]).intValue != 0) {
|
||||
[self executeCommands:cmds];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
19
Brainfuck/Lexer.h
Executable file
19
Brainfuck/Lexer.h
Executable file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Lexer.h
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface Lexer : NSObject
|
||||
|
||||
+ (Lexer *)lexer;
|
||||
|
||||
- (id)init;
|
||||
|
||||
- (NSArray *)performLexingOnString:(NSString *)string error:(NSError **)error;
|
||||
|
||||
@end
|
||||
70
Brainfuck/Lexer.m
Executable file
70
Brainfuck/Lexer.m
Executable file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// Lexer.m
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Lexer.h"
|
||||
|
||||
@implementation Lexer {
|
||||
NSString *script;
|
||||
NSInteger pos;
|
||||
NSInteger loopNestingLevel;
|
||||
NSMutableArray *tokens;
|
||||
}
|
||||
|
||||
+ (Lexer *)lexer
|
||||
{
|
||||
return [[self alloc] init];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)performLexingOnString:(NSString *)s error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
pos = 0;
|
||||
loopNestingLevel = -1;
|
||||
script = s;
|
||||
tokens = [[NSMutableArray alloc] init];
|
||||
[self matchNextTokensInto:tokens error:error];
|
||||
if (error) {
|
||||
return nil;
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
- (void)matchNextTokensInto:(NSMutableArray *)target error:(NSError *__autoreleasing *)error;
|
||||
{
|
||||
while (pos < script.length) {
|
||||
int c = [script characterAtIndex:pos++];
|
||||
NSString *character = [NSString stringWithFormat:@"%c", c];
|
||||
if (c == '-' || c == '+' || c == '<' || c == '>' || c == '.' || c == ',') {
|
||||
[target addObject:character];
|
||||
} else if (c == '[') {
|
||||
loopNestingLevel++;
|
||||
NSMutableArray *subTokens = [NSMutableArray new];
|
||||
[self matchNextTokensInto:subTokens error:error];
|
||||
[target addObject:subTokens];
|
||||
} else if (c == ']') {
|
||||
if (loopNestingLevel-- == -1) {
|
||||
NSError *err = [NSError errorWithDomain:@"Lexer" code:101 userInfo:@{NSLocalizedDescriptionKey: @"] without mathcing ["}];
|
||||
*error = err;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (loopNestingLevel >= 0) {
|
||||
*error = [NSError errorWithDomain:@"Lexer" code:102 userInfo:@{NSLocalizedDescriptionKey: @"unclosed loop"}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
16
Brainfuck/Printer.h
Executable file
16
Brainfuck/Printer.h
Executable file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Printer.h
|
||||
// Brainfuck
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 brainfuck. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol Printer <NSObject>
|
||||
@required
|
||||
|
||||
- (void)print:(NSString *)string;
|
||||
|
||||
@end
|
||||
28
Brainfuck/en.lproj/Credits.rtf
Normal file → Executable file
28
Brainfuck/en.lproj/Credits.rtf
Normal file → Executable file
@@ -1,29 +1,39 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
Kim Wittenburg\
|
||||
\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
{\field{\*\fldinst{HYPERLINK "http://de.wikipedia.org/wiki/Brainfuck"}}{\fldrslt
|
||||
\b \cf0 Brainfuck}}
|
||||
\b :\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
\cf0
|
||||
\b0 Urban M\'fcller (1993)\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
\cf0 \
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
Kim Wittenburg\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
Kim Wittenburg\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
What Documentation?\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
||||
Nobody. I hate everyone.\
|
||||
}
|
||||
1310
Brainfuck/en.lproj/Document.xib
Normal file → Executable file
1310
Brainfuck/en.lproj/Document.xib
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
0
Brainfuck/en.lproj/InfoPlist.strings
Normal file → Executable file
0
Brainfuck/en.lproj/InfoPlist.strings
Normal file → Executable file
3874
Brainfuck/en.lproj/MainMenu.xib
Normal file → Executable file
3874
Brainfuck/en.lproj/MainMenu.xib
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
0
Brainfuck/main.m
Normal file → Executable file
0
Brainfuck/main.m
Normal file → Executable file
BIN
BrainfuckDocument.icns
Executable file
BIN
BrainfuckDocument.icns
Executable file
Binary file not shown.
86
Ook/Ook.xcodeproj/xcuserdata/kim.xcuserdatad/xcschemes/Ook.xcscheme
Executable file
86
Ook/Ook.xcodeproj/xcuserdata/kim.xcuserdatad/xcschemes/Ook.xcscheme
Executable file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0460"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F4E174A8CF000529CDD"
|
||||
BuildableName = "Ook.app"
|
||||
BlueprintName = "Ook"
|
||||
ReferencedContainer = "container:Ook.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F4E174A8CF000529CDD"
|
||||
BuildableName = "Ook.app"
|
||||
BlueprintName = "Ook"
|
||||
ReferencedContainer = "container:Ook.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F4E174A8CF000529CDD"
|
||||
BuildableName = "Ook.app"
|
||||
BlueprintName = "Ook"
|
||||
ReferencedContainer = "container:Ook.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3B9F1F4E174A8CF000529CDD"
|
||||
BuildableName = "Ook.app"
|
||||
BlueprintName = "Ook"
|
||||
ReferencedContainer = "container:Ook.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Ook.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>3B9F1F4E174A8CF000529CDD</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
13
Ook/Ook/OoKDocument.h
Executable file
13
Ook/Ook/OoKDocument.h
Executable file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// OoKDocument.h
|
||||
// Ook
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 ook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface OoKDocument : NSDocument
|
||||
|
||||
@end
|
||||
59
Ook/Ook/OoKDocument.m
Executable file
59
Ook/Ook/OoKDocument.m
Executable file
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// OoKDocument.m
|
||||
// Ook
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 ook. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OoKDocument.h"
|
||||
|
||||
@implementation OoKDocument
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
// Add your subclass-specific initialization here.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)windowNibName
|
||||
{
|
||||
// Override returning the nib file name of the document
|
||||
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
|
||||
return @"OoKDocument";
|
||||
}
|
||||
|
||||
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
|
||||
{
|
||||
[super windowControllerDidLoadNib:aController];
|
||||
// Add any code here that needs to be executed once the windowController has loaded the document's window.
|
||||
}
|
||||
|
||||
+ (BOOL)autosavesInPlace
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
|
||||
{
|
||||
// Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.
|
||||
// You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
|
||||
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
|
||||
@throw exception;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
|
||||
{
|
||||
// Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.
|
||||
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
// If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.
|
||||
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
|
||||
@throw exception;
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
57
Ook/Ook/Ook-Info.plist
Executable file
57
Ook/Ook/Ook-Info.plist
Executable file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ook</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DocumentType</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>????</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>OoKDocument</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>ook.ook.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.developer-tools</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2013 ook. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
7
Ook/Ook/Ook-Prefix.pch
Executable file
7
Ook/Ook/Ook-Prefix.pch
Executable file
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'Ook' target in the 'Ook' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
29
Ook/Ook/en.lproj/Credits.rtf
Executable file
29
Ook/Ook/en.lproj/Credits.rtf
Executable file
@@ -0,0 +1,29 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
\
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
||||
2
Ook/Ook/en.lproj/InfoPlist.strings
Executable file
2
Ook/Ook/en.lproj/InfoPlist.strings
Executable file
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
4562
Ook/Ook/en.lproj/MainMenu.xib
Executable file
4562
Ook/Ook/en.lproj/MainMenu.xib
Executable file
File diff suppressed because it is too large
Load Diff
249
Ook/Ook/en.lproj/OoKDocument.xib
Executable file
249
Ook/Ook/en.lproj/OoKDocument.xib
Executable file
@@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11C42</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.17</string>
|
||||
<string key="IBDocument.HIToolboxVersion">567.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1938</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSView</string>
|
||||
<string>IBNSLayoutConstraint</string>
|
||||
<string>NSCustomObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="580458321">
|
||||
<object class="NSCustomObject" id="512844837">
|
||||
<string key="NSClassName">OoKDocument</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="613418571">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="275939982">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{133, 235}, {507, 413}}</string>
|
||||
<int key="NSWTFlags">1886912512</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<string key="NSViewClass">View</string>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<string key="NSWindowContentMinSize">{94, 86}</string>
|
||||
<object class="NSView" key="NSWindowView" id="568628114">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSTextField" id="433022199">
|
||||
<reference key="NSNextResponder" ref="568628114"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrame">{{119, 195}, {268, 22}}</string>
|
||||
<reference key="NSSuperview" ref="568628114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="566561048">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">138412032</int>
|
||||
<string key="NSContents">Your document contents here</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">18</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="433022199"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{507, 413}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMinSize">{94, 108}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="796877042">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="512844837"/>
|
||||
<reference key="destination" ref="275939982"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="275939982"/>
|
||||
<reference key="destination" ref="512844837"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="580458321"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="512844837"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="613418571"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="275939982"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="568628114"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Window</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="568628114"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="433022199"/>
|
||||
<object class="IBNSLayoutConstraint" id="649349124">
|
||||
<reference key="firstItem" ref="433022199"/>
|
||||
<int key="firstAttribute">9</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="568628114"/>
|
||||
<int key="secondAttribute">9</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<int key="scoringType">5</int>
|
||||
<float key="scoringTypeFloat">22</float>
|
||||
<int key="contentType">2</int>
|
||||
<reference key="containingView" ref="568628114"/>
|
||||
</object>
|
||||
<object class="IBNSLayoutConstraint" id="215213155">
|
||||
<reference key="firstItem" ref="433022199"/>
|
||||
<int key="firstAttribute">10</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="568628114"/>
|
||||
<int key="secondAttribute">10</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<int key="scoringType">5</int>
|
||||
<float key="scoringTypeFloat">22</float>
|
||||
<int key="contentType">2</int>
|
||||
<reference key="containingView" ref="568628114"/>
|
||||
</object>
|
||||
</array>
|
||||
<reference key="parent" ref="275939982"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">20</int>
|
||||
<reference key="object" ref="433022199"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="566561048"/>
|
||||
</array>
|
||||
<reference key="parent" ref="568628114"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100020</int>
|
||||
<reference key="object" ref="566561048"/>
|
||||
<reference key="parent" ref="433022199"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="796877042"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100025</int>
|
||||
<reference key="object" ref="649349124"/>
|
||||
<reference key="parent" ref="568628114"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100026</int>
|
||||
<reference key="object" ref="215213155"/>
|
||||
<reference key="parent" ref="568628114"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100020.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100025.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100026.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="20.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
|
||||
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="5.IBWindowTemplateEditedContentRect">{{133, 170}, {507, 413}}</string>
|
||||
<array class="NSMutableArray" key="6.IBNSViewMetadataConstraints">
|
||||
<reference ref="649349124"/>
|
||||
<reference ref="215213155"/>
|
||||
</array>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">100026</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<bool key="IBDocument.UseAutolayout">YES</bool>
|
||||
</data>
|
||||
</archive>
|
||||
14
Ook/Ook/main.m
Executable file
14
Ook/Ook/main.m
Executable file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// main.m
|
||||
// Ook
|
||||
//
|
||||
// Created by Kim Wittenburg on 20.05.13.
|
||||
// Copyright (c) 2013 ook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
||||
Reference in New Issue
Block a user