Skip to content
Browse files

Added example editor implementation

  • Loading branch information...
1 parent f0d0679 commit 233e941a0550d0d83304b2aff92974fe5845e247 @jessegrosjean jessegrosjean committed
View
4 .gitignore
@@ -3,4 +3,6 @@ build
*.pbxuser
*.perspectivev3
QuickCursor.xcodeproj/project.xcworkspace/xcuserdata/
-QuickCursor.xcodeproj/xcuserdata/
+QuickCursor.xcodeproj/xcuserdata/
+QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/project.xcworkspace/xcuserdata/
+QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/xcuserdata/
View
307 QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/project.pbxproj
@@ -0,0 +1,307 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 88558975159C94250021FF4A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88558974159C94250021FF4A /* Cocoa.framework */; };
+ 8855897F159C94250021FF4A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8855897D159C94250021FF4A /* InfoPlist.strings */; };
+ 88558981159C94250021FF4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558980159C94250021FF4A /* main.m */; };
+ 88558988159C94250021FF4A /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558987159C94250021FF4A /* Document.m */; };
+ 8855898B159C94250021FF4A /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88558989159C94250021FF4A /* Document.xib */; };
+ 8855898E159C94250021FF4A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8855898C159C94250021FF4A /* MainMenu.xib */; };
+ 88558997159C97AA0021FF4A /* DocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558996159C97AA0021FF4A /* DocumentController.m */; };
+ 8855899A159C9DDE0021FF4A /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558999159C9DDE0021FF4A /* ApplicationDelegate.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 88558970159C94250021FF4A /* QuickCursorEditorExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickCursorEditorExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 88558974159C94250021FF4A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 88558977159C94250021FF4A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 88558978159C94250021FF4A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 88558979159C94250021FF4A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 8855897C159C94250021FF4A /* QuickCursorEditorExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "QuickCursorEditorExample-Info.plist"; sourceTree = "<group>"; };
+ 8855897E159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 88558980159C94250021FF4A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 88558982159C94250021FF4A /* QuickCursorEditorExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QuickCursorEditorExample-Prefix.pch"; sourceTree = "<group>"; };
+ 88558986159C94250021FF4A /* Document.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Document.h; sourceTree = "<group>"; };
+ 88558987159C94250021FF4A /* Document.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Document.m; sourceTree = "<group>"; };
+ 8855898A159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Document.xib; sourceTree = "<group>"; };
+ 8855898D159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 88558994159C958B0021FF4A /* ODBEditorSuite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ODBEditorSuite.h; sourceTree = "<group>"; };
+ 88558995159C97AA0021FF4A /* DocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentController.h; sourceTree = "<group>"; };
+ 88558996159C97AA0021FF4A /* DocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocumentController.m; sourceTree = "<group>"; };
+ 88558998159C9DDE0021FF4A /* ApplicationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationDelegate.h; sourceTree = "<group>"; };
+ 88558999159C9DDE0021FF4A /* ApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplicationDelegate.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8855896D159C94250021FF4A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 88558975159C94250021FF4A /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 88558965159C94250021FF4A = {
+ isa = PBXGroup;
+ children = (
+ 8855897A159C94250021FF4A /* QuickCursorEditorExample */,
+ 88558973159C94250021FF4A /* Frameworks */,
+ 88558971159C94250021FF4A /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 88558971159C94250021FF4A /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 88558970159C94250021FF4A /* QuickCursorEditorExample.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 88558973159C94250021FF4A /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 88558974159C94250021FF4A /* Cocoa.framework */,
+ 88558976159C94250021FF4A /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 88558976159C94250021FF4A /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 88558977159C94250021FF4A /* AppKit.framework */,
+ 88558978159C94250021FF4A /* CoreData.framework */,
+ 88558979159C94250021FF4A /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 8855897A159C94250021FF4A /* QuickCursorEditorExample */ = {
+ isa = PBXGroup;
+ children = (
+ 88558986159C94250021FF4A /* Document.h */,
+ 88558987159C94250021FF4A /* Document.m */,
+ 88558995159C97AA0021FF4A /* DocumentController.h */,
+ 88558996159C97AA0021FF4A /* DocumentController.m */,
+ 88558998159C9DDE0021FF4A /* ApplicationDelegate.h */,
+ 88558999159C9DDE0021FF4A /* ApplicationDelegate.m */,
+ 88558989159C94250021FF4A /* Document.xib */,
+ 8855898C159C94250021FF4A /* MainMenu.xib */,
+ 8855897B159C94250021FF4A /* Supporting Files */,
+ );
+ path = QuickCursorEditorExample;
+ sourceTree = "<group>";
+ };
+ 8855897B159C94250021FF4A /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 8855897C159C94250021FF4A /* QuickCursorEditorExample-Info.plist */,
+ 8855897D159C94250021FF4A /* InfoPlist.strings */,
+ 88558980159C94250021FF4A /* main.m */,
+ 88558994159C958B0021FF4A /* ODBEditorSuite.h */,
+ 88558982159C94250021FF4A /* QuickCursorEditorExample-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8855896F159C94250021FF4A /* QuickCursorEditorExample */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 88558991159C94250021FF4A /* Build configuration list for PBXNativeTarget "QuickCursorEditorExample" */;
+ buildPhases = (
+ 8855896C159C94250021FF4A /* Sources */,
+ 8855896D159C94250021FF4A /* Frameworks */,
+ 8855896E159C94250021FF4A /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = QuickCursorEditorExample;
+ productName = QuickCursorEditorExample;
+ productReference = 88558970159C94250021FF4A /* QuickCursorEditorExample.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 88558967159C94250021FF4A /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ };
+ buildConfigurationList = 8855896A159C94250021FF4A /* Build configuration list for PBXProject "QuickCursorEditorExample" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 88558965159C94250021FF4A;
+ productRefGroup = 88558971159C94250021FF4A /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8855896F159C94250021FF4A /* QuickCursorEditorExample */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8855896E159C94250021FF4A /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8855897F159C94250021FF4A /* InfoPlist.strings in Resources */,
+ 8855898B159C94250021FF4A /* Document.xib in Resources */,
+ 8855898E159C94250021FF4A /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8855896C159C94250021FF4A /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 88558981159C94250021FF4A /* main.m in Sources */,
+ 88558988159C94250021FF4A /* Document.m in Sources */,
+ 88558997159C97AA0021FF4A /* DocumentController.m in Sources */,
+ 8855899A159C9DDE0021FF4A /* ApplicationDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 8855897D159C94250021FF4A /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8855897E159C94250021FF4A /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 88558989159C94250021FF4A /* Document.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8855898A159C94250021FF4A /* en */,
+ );
+ name = Document.xib;
+ sourceTree = "<group>";
+ };
+ 8855898C159C94250021FF4A /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8855898D159C94250021FF4A /* en */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 8855898F159C94250021FF4A /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 88558990159C94250021FF4A /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 88558992159C94250021FF4A /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "QuickCursorEditorExample/QuickCursorEditorExample-Prefix.pch";
+ INFOPLIST_FILE = "QuickCursorEditorExample/QuickCursorEditorExample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 88558993159C94250021FF4A /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "QuickCursorEditorExample/QuickCursorEditorExample-Prefix.pch";
+ INFOPLIST_FILE = "QuickCursorEditorExample/QuickCursorEditorExample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8855896A159C94250021FF4A /* Build configuration list for PBXProject "QuickCursorEditorExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8855898F159C94250021FF4A /* Debug */,
+ 88558990159C94250021FF4A /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 88558991159C94250021FF4A /* Build configuration list for PBXNativeTarget "QuickCursorEditorExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 88558992159C94250021FF4A /* Debug */,
+ 88558993159C94250021FF4A /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 88558967159C94250021FF4A /* Project object */;
+}
View
7 ...orExample/QuickCursorEditorExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:QuickCursorEditorExample.xcodeproj">
+ </FileRef>
+</Workspace>
View
13 QuickCursorEditorExample/QuickCursorEditorExample/ApplicationDelegate.h
@@ -0,0 +1,13 @@
+//
+// ApplicationDelegate.h
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface ApplicationDelegate : NSObject
+
+@end
View
38 QuickCursorEditorExample/QuickCursorEditorExample/ApplicationDelegate.m
@@ -0,0 +1,38 @@
+//
+// ApplicationDelegate.m
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "ApplicationDelegate.h"
+#import "DocumentController.h"
+
+
+@implementation ApplicationDelegate
+
+- (void)applicationWillFinishLaunching:(NSNotification *)notification {
+ [DocumentController sharedDocumentController];
+}
+
+static NSUInteger openUntitledFileIfNotCancledCount = 0;
+
+- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender {
+ openUntitledFileIfNotCancledCount = 0;
+ [self performSelector:@selector(openUntitledFileIfNotCancled) withObject:nil afterDelay:0]; // Delay for ODB Editor case
+ return NO;
+}
+
+- (void)openUntitledFileIfNotCancled {
+ if (openUntitledFileIfNotCancledCount < 2) {
+ // Big ugly hack... otherwise on startup (in QuickCursor case) we end up opening an empy document.
+ // So instead wait a bit (2 cycles of performSelector) for ODB to cancel us... if no cancel then open untitled document.
+ [self performSelector:@selector(openUntitledFileIfNotCancled) withObject:nil afterDelay:0];
+ openUntitledFileIfNotCancledCount++;
+ return;
+ }
+ [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL];
+}
+
+@end
View
21 QuickCursorEditorExample/QuickCursorEditorExample/Document.h
@@ -0,0 +1,21 @@
+//
+// Document.h
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface Document : NSDocument {
+ NSString *loadingText;
+ BOOL fromExternal;
+ NSString *externalDisplayName;
+ NSAppleEventDescriptor *externalSender;
+ NSAppleEventDescriptor *externalToken;
+}
+
+@property (nonatomic, assign) IBOutlet NSTextView *textView;
+
+@end
View
134 QuickCursorEditorExample/QuickCursorEditorExample/Document.m
@@ -0,0 +1,134 @@
+//
+// Document.m
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "Document.h"
+#import "ODBEditorSuite.h"
+
+
+@implementation Document
+
+- (id)init {
+ self = [super init];
+ if (self) {
+ }
+ return self;
+}
+
+- (void)close {
+ if (fromExternal == YES) {
+ [self sendClosedEventToExternalDocument];
+ }
+ [super close];
+}
+
+- (void)dealloc {
+ [externalDisplayName release];
+ [externalSender release];
+ [externalToken release];
+ [loadingText release];
+ [super dealloc];
+}
+
+- (NSString *)windowNibName {
+ return @"Document";
+}
+
+- (void)awakeFromNib {
+ if (loadingText) {
+ NSTextStorage *textStorage = [textView textStorage];
+ [textStorage replaceCharactersInRange:NSMakeRange(0, [textStorage length]) withString:loadingText];
+ [loadingText release];
+ loadingText = nil;
+ }
+}
+
+@synthesize textView;
+
++ (BOOL)autosavesInPlace {
+ return YES;
+}
+
+- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError {
+ NSString *text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
+ if (text) {
+ if (textView) {
+ NSTextStorage *textStorage = [textView textStorage];
+ [textStorage replaceCharactersInRange:NSMakeRange(0, [textStorage length]) withString:text];
+ } else {
+ [loadingText autorelease];
+ loadingText = [text retain];
+ }
+ return YES;
+ } else {
+ return NO;
+ }
+}
+
+- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)outError {
+ NSString *textContent = [self.textView.textStorage string];
+
+ if ([textContent writeToURL:absoluteURL atomically:YES encoding:NSUTF8StringEncoding error:outError]) {
+ if (saveOperation != NSAutosaveOperation && saveOperation != NSSaveToOperation) {
+ if (fromExternal) {
+ [self sendModifiedEventToExternalWithDocument:saveOperation == NSSaveAsOperation];
+ }
+ }
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void)sendModifiedEventToExternalWithDocument:(BOOL)fromSaveAs {
+ NSURL *url = [self fileURL];
+ NSData *data = [[url absoluteString] dataUsingEncoding:NSUTF8StringEncoding];
+ OSType signature = [externalSender typeCodeValue];
+ NSAppleEventDescriptor *descriptor = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplSignature bytes:&signature length:sizeof(OSType)];
+ NSAppleEventDescriptor *event = [NSAppleEventDescriptor appleEventWithEventClass:kODBEditorSuite eventID:kAEModifiedFile targetDescriptor:descriptor returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
+ [event setParamDescriptor:[NSAppleEventDescriptor descriptorWithDescriptorType:typeFileURL data:data] forKeyword:keyDirectObject];
+
+ if (externalToken) {
+ [event setParamDescriptor:externalToken forKeyword:keySenderToken];
+ }
+ if (fromSaveAs) {
+ [descriptor setParamDescriptor:[NSAppleEventDescriptor descriptorWithDescriptorType:typeFileURL data:data] forKeyword:keyNewLocation];
+ fromExternal = NO;
+ }
+
+ AppleEvent *eventPointer = (AEDesc *)[event aeDesc];
+
+ if (eventPointer) {
+ OSStatus errorStatus = AESendMessage(eventPointer, NULL, kAENoReply, kAEDefaultTimeout);
+ if (errorStatus != noErr) {
+ NSBeep();
+ }
+ }
+}
+
+- (void)sendClosedEventToExternalDocument {
+ NSURL *url = [self fileURL];
+ NSData *data = [[url absoluteString] dataUsingEncoding:NSUTF8StringEncoding];
+ OSType signature = [externalSender typeCodeValue];
+ NSAppleEventDescriptor *descriptor = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplSignature bytes:&signature length:sizeof(OSType)];
+ NSAppleEventDescriptor *event = [NSAppleEventDescriptor appleEventWithEventClass:kODBEditorSuite eventID:kAEClosedFile targetDescriptor:descriptor returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
+ [event setParamDescriptor:[NSAppleEventDescriptor descriptorWithDescriptorType:typeFileURL data:data] forKeyword:keyDirectObject];
+ if (externalToken) {
+ [event setParamDescriptor:externalToken forKeyword:keySenderToken];
+ }
+
+ AppleEvent *eventPointer = (AEDesc *)[event aeDesc];
+
+ if (eventPointer) {
+ OSStatus errorStatus = AESendMessage(eventPointer, NULL, kAENoReply, kAEDefaultTimeout);
+ if (errorStatus != noErr) {
+ NSBeep();
+ }
+ }
+}
+
+@end
View
13 QuickCursorEditorExample/QuickCursorEditorExample/DocumentController.h
@@ -0,0 +1,13 @@
+//
+// DocumentController.h
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface DocumentController : NSDocumentController
+
+@end
View
85 QuickCursorEditorExample/QuickCursorEditorExample/DocumentController.m
@@ -0,0 +1,85 @@
+//
+// DocumentController.m
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "DocumentController.h"
+#import "ODBEditorSuite.h"
+#import "Document.h"
+
+@interface Document (DocumentControllerPrivate)
+- (void)setExternalDisplayName:(NSString *)aString externalSender:(NSAppleEventDescriptor *)aSender externalToken:(NSAppleEventDescriptor *)aToken;
+@end
+
+@implementation Document (DocumentControllerPrivate)
+
+- (void)setExternalDisplayName:(NSString *)aString externalSender:(NSAppleEventDescriptor *)aSender externalToken:(NSAppleEventDescriptor *)aToken {
+ fromExternal = YES;
+ externalDisplayName = [aString retain];
+ externalSender = [aSender retain];
+ externalToken = [aToken retain];
+}
+
+@end
+
+@implementation DocumentController
+
+- (void)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler {
+ NSAppleEventDescriptor *currentAppleEvent = [[[[NSAppleEventManager sharedAppleEventManager] currentAppleEvent] copy] autorelease];
+ NSAppleEventDescriptor *externalSender = nil;
+ NSAppleEventDescriptor *externalToken = nil;
+ NSString *externalDisplayName = nil;
+ __block BOOL fromExternal = NO;
+
+ if ([currentAppleEvent paramDescriptorForKeyword:keyFileSender]) {
+ fromExternal = YES;
+ }
+
+ NSAppleEventDescriptor *keyAEPropDataDescriptor = nil;
+ BOOL isKeyAEPropData = NO;
+
+ if (!fromExternal && [currentAppleEvent paramDescriptorForKeyword:keyAEPropData]) {
+ keyAEPropDataDescriptor = [currentAppleEvent paramDescriptorForKeyword:keyAEPropData];
+ isKeyAEPropData = YES;
+
+ if ([keyAEPropDataDescriptor paramDescriptorForKeyword:keyFileSender]) {
+ fromExternal = YES;
+ }
+ }
+
+ if (fromExternal) {
+ if (!isKeyAEPropData) {
+ externalDisplayName = [[currentAppleEvent paramDescriptorForKeyword:keyFileCustomPath] stringValue];
+ } else {
+ externalDisplayName = [[keyAEPropDataDescriptor paramDescriptorForKeyword:keyFileCustomPath] stringValue];
+ }
+
+ if (!isKeyAEPropData) {
+ externalSender = [currentAppleEvent paramDescriptorForKeyword:keyFileSender];
+ } else {
+ externalSender = [keyAEPropDataDescriptor paramDescriptorForKeyword:keyFileSender];
+ }
+
+ if (!isKeyAEPropData) {
+ externalToken = [currentAppleEvent paramDescriptorForKeyword:keyFileSenderToken];
+ } else {
+ externalToken = [currentAppleEvent paramDescriptorForKeyword:keyFileSenderToken];
+ }
+ }
+
+ if (fromExternal) {
+ [NSObject cancelPreviousPerformRequestsWithTarget:[NSApp delegate] selector:@selector(openUntitledFileIfNotCancled) object:nil];
+ }
+
+ [super openDocumentWithContentsOfURL:url display:displayDocument completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error) {
+ if (fromExternal) {
+ [(id)document setExternalDisplayName:externalDisplayName externalSender:externalSender externalToken:externalToken];
+ }
+ completionHandler(document, documentWasAlreadyOpen, error);
+ }];
+}
+
+@end
View
34 QuickCursorEditorExample/QuickCursorEditorExample/ODBEditorSuite.h
@@ -0,0 +1,34 @@
+//
+// ODB Editor Suite constants
+//
+//
+// Copyright ©2000, Bare Bones Software, Inc.
+//
+
+// For full information and documentation, see
+// <http://www.barebones.com/developer/>
+
+// optional paramters to 'aevt'/'odoc'
+#define keyFileSender 'FSnd'
+#define keyFileSenderToken 'FTok'
+#define keyFileCustomPath 'Burl'
+
+// suite code for ODB editor suite events
+//
+// WARNING: although the suite code is coincidentally the same
+// as BBEdit's application signature, you must not change this,
+// or else you'll break the suite. If you do that, ninjas will
+// come to your house and kick your ass.
+//
+//
+
+#define kODBEditorSuite 'R*ch'
+
+// ODB editor suite events, sent by the editor to the server.
+
+#define kAEModifiedFile 'FMod'
+#define keyNewLocation 'New?'
+#define kAEClosedFile 'FCls'
+
+// optional paramter to kAEModifiedFile/kAEClosedFile
+#define keySenderToken 'Tokn'
View
71 QuickCursorEditorExample/QuickCursorEditorExample/QuickCursorEditorExample-Info.plist
@@ -0,0 +1,71 @@
+<?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>txt</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>Document</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>*</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>com.hogbaysoftware.catch-all</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>Document</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.hogbaysoftware.${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>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012 __MyCompanyName__. All rights reserved.</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
View
7 QuickCursorEditorExample/QuickCursorEditorExample/QuickCursorEditorExample-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'QuickCursorEditorExample' target in the 'QuickCursorEditorExample' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
View
480 QuickCursorEditorExample/QuickCursorEditorExample/en.lproj/Document.xib
@@ -0,0 +1,480 @@
+<?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">11E53</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.47</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">2182</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>NSView</string>
+ <string>NSScrollView</string>
+ <string>NSWindowTemplate</string>
+ <string>NSTextView</string>
+ <string>IBNSLayoutConstraint</string>
+ <string>NSScroller</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">Document</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="NSScrollView" id="256026768">
+ <reference key="NSNextResponder" ref="568628114"/>
+ <int key="NSvFlags">256</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSClipView" id="660955037">
+ <reference key="NSNextResponder" ref="256026768"/>
+ <int key="NSvFlags">2304</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSTextView" id="296109087">
+ <reference key="NSNextResponder" ref="660955037"/>
+ <int key="NSvFlags">2322</int>
+ <set class="NSMutableSet" key="NSDragTypes">
+ <string>Apple HTML pasteboard type</string>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>Apple URL pasteboard type</string>
+ <string>CorePasteboardFlavorType 0x6D6F6F76</string>
+ <string>NSColor pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NSStringPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT RTFD pasteboard type</string>
+ <string>NeXT Rich Text Format v1.0 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ <string>NeXT font pasteboard type</string>
+ <string>NeXT ruler pasteboard type</string>
+ <string>WebURLsWithTitlesPboardType</string>
+ <string>public.url</string>
+ </set>
+ <string key="NSFrameSize">{492, 14}</string>
+ <reference key="NSSuperview" ref="660955037"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="411015717"/>
+ <string key="NSReuseIdentifierKey">_NS:13</string>
+ <object class="NSTextContainer" key="NSTextContainer" id="447747972">
+ <object class="NSLayoutManager" key="NSLayoutManager">
+ <object class="NSTextStorage" key="NSTextStorage">
+ <object class="NSMutableString" key="NSString">
+ <characters key="NS.bytes"/>
+ </object>
+ <nil key="NSDelegate"/>
+ </object>
+ <array class="NSMutableArray" key="NSTextContainers">
+ <reference ref="447747972"/>
+ </array>
+ <int key="NSLMFlags">134</int>
+ <nil key="NSDelegate"/>
+ </object>
+ <reference key="NSTextView" ref="296109087"/>
+ <double key="NSWidth">492</double>
+ <int key="NSTCFlags">1</int>
+ </object>
+ <object class="NSTextViewSharedData" key="NSSharedData">
+ <int key="NSFlags">67121123</int>
+ <int key="NSTextCheckingTypes">0</int>
+ <nil key="NSMarkedAttributes"/>
+ <object class="NSColor" key="NSBackgroundColor" id="1057383002">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <dictionary key="NSSelectedAttributes">
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextColor</string>
+ <object class="NSColor" key="NSColor" id="438758467">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </dictionary>
+ <reference key="NSInsertionColor" ref="438758467"/>
+ <dictionary key="NSLinkAttributes">
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDEAA</bytes>
+ </object>
+ <object class="NSCursor" key="NSCursor">
+ <string key="NSHotSpot">{8, -8}</string>
+ <int key="NSCursorType">13</int>
+ </object>
+ <integer value="1" key="NSUnderline"/>
+ </dictionary>
+ <nil key="NSDefaultParagraphStyle"/>
+ <nil key="NSTextFinder"/>
+ <int key="NSPreferredTextFinderStyle">1</int>
+ </object>
+ <int key="NSTVFlags">6</int>
+ <string key="NSMaxSize">{492, 10000000}</string>
+ <string key="NSMinize">{222, 14}</string>
+ <nil key="NSDelegate"/>
+ </object>
+ </array>
+ <string key="NSFrame">{{1, 1}, {492, 413}}</string>
+ <reference key="NSSuperview" ref="256026768"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="296109087"/>
+ <string key="NSReuseIdentifierKey">_NS:11</string>
+ <reference key="NSDocView" ref="296109087"/>
+ <reference key="NSBGColor" ref="1057383002"/>
+ <object class="NSCursor" key="NSCursor">
+ <string key="NSHotSpot">{4, 5}</string>
+ <object class="NSImage" key="NSImage">
+ <int key="NSImageFlags">79691776</int>
+ <array key="NSReps">
+ <array>
+ <integer value="5"/>
+ <object class="NSURL">
+ <nil key="NS.base"/>
+ <string key="NS.relative">file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff</string>
+ </object>
+ </array>
+ </array>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwAA</bytes>
+ </object>
+ </object>
+ </object>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="605540347">
+ <reference key="NSNextResponder" ref="256026768"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{493, 1}, {15, 413}}</string>
+ <reference key="NSSuperview" ref="256026768"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:84</string>
+ <reference key="NSTarget" ref="256026768"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.85256409645080566</double>
+ </object>
+ <object class="NSScroller" id="411015717">
+ <reference key="NSNextResponder" ref="256026768"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{-100, -100}, {87, 18}}</string>
+ <reference key="NSSuperview" ref="256026768"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="660955037"/>
+ <string key="NSReuseIdentifierKey">_NS:33</string>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="256026768"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.94565218687057495</double>
+ </object>
+ </array>
+ <string key="NSFrame">{{-1, -1}, {509, 415}}</string>
+ <reference key="NSSuperview" ref="568628114"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="660955037"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <int key="NSsFlags">133138</int>
+ <reference key="NSVScroller" ref="605540347"/>
+ <reference key="NSHScroller" ref="411015717"/>
+ <reference key="NSContentView" ref="660955037"/>
+ </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">textView</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="296109087"/>
+ </object>
+ <int key="connectionID">100042</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">
+ <object class="IBNSLayoutConstraint" id="543527408">
+ <reference key="firstItem" ref="256026768"/>
+ <int key="firstAttribute">5</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="568628114"/>
+ <int key="secondAttribute">5</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">-1</double>
+ </object>
+ <float key="priority">1000</float>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ <reference key="containingView" ref="568628114"/>
+ </object>
+ <object class="IBNSLayoutConstraint" id="745667397">
+ <reference key="firstItem" ref="568628114"/>
+ <int key="firstAttribute">6</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="256026768"/>
+ <int key="secondAttribute">6</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">-1</double>
+ </object>
+ <float key="priority">1000</float>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ <reference key="containingView" ref="568628114"/>
+ </object>
+ <object class="IBNSLayoutConstraint" id="966764544">
+ <reference key="firstItem" ref="568628114"/>
+ <int key="firstAttribute">4</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="256026768"/>
+ <int key="secondAttribute">4</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">-1</double>
+ </object>
+ <float key="priority">1000</float>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ <reference key="containingView" ref="568628114"/>
+ </object>
+ <object class="IBNSLayoutConstraint" id="313343617">
+ <reference key="firstItem" ref="256026768"/>
+ <int key="firstAttribute">3</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="568628114"/>
+ <int key="secondAttribute">3</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">-1</double>
+ </object>
+ <float key="priority">1000</float>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ <reference key="containingView" ref="568628114"/>
+ </object>
+ <reference ref="256026768"/>
+ </array>
+ <reference key="parent" ref="275939982"/>
+ </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">100027</int>
+ <reference key="object" ref="256026768"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="296109087"/>
+ <reference ref="411015717"/>
+ <reference ref="605540347"/>
+ </array>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100028</int>
+ <reference key="object" ref="296109087"/>
+ <reference key="parent" ref="256026768"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100029</int>
+ <reference key="object" ref="411015717"/>
+ <reference key="parent" ref="256026768"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100030</int>
+ <reference key="object" ref="605540347"/>
+ <reference key="parent" ref="256026768"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100036</int>
+ <reference key="object" ref="543527408"/>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100039</int>
+ <reference key="object" ref="745667397"/>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100040</int>
+ <reference key="object" ref="966764544"/>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100041</int>
+ <reference key="object" ref="313343617"/>
+ <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>
+ <boolean value="NO" key="100027.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
+ <string key="100027.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100028.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <boolean value="NO" key="100028.usesInspectorBar"/>
+ <string key="100029.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100030.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100036.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100039.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100040.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100041.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="543527408"/>
+ <reference ref="745667397"/>
+ <reference ref="966764544"/>
+ <reference ref="313343617"/>
+ </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">100042</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">Document</string>
+ <string key="superclassName">NSDocument</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">textView</string>
+ <string key="NS.object.0">NSTextView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">textView</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">textView</string>
+ <string key="candidateClassName">NSTextView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/Document.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSLayoutConstraint</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/NSLayoutConstraint.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <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>
View
2 QuickCursorEditorExample/QuickCursorEditorExample/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
3,158 QuickCursorEditorExample/QuickCursorEditorExample/en.lproj/MainMenu.xib
3,158 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
14 QuickCursorEditorExample/QuickCursorEditorExample/main.m
@@ -0,0 +1,14 @@
+//
+// main.m
+// QuickCursorEditorExample
+//
+// Created by Jesse Grosjean on 6/28/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **)argv);
+}

0 comments on commit 233e941

Please sign in to comment.
Something went wrong with that request. Please try again.