Permalink
Browse files

Added example editor implementation

  • Loading branch information...
jessegrosjean committed Jun 28, 2012
1 parent f0d0679 commit 233e941a0550d0d83304b2aff92974fe5845e247
View
@@ -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/
@@ -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 */;
+}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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
@@ -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
Oops, something went wrong.

0 comments on commit 233e941

Please sign in to comment.