Skip to content

Commit 233e941

Browse files
committed
Added example editor implementation
1 parent f0d0679 commit 233e941

16 files changed

+4387
-1
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ build
33
*.pbxuser
44
*.perspectivev3
55
QuickCursor.xcodeproj/project.xcworkspace/xcuserdata/
6-
QuickCursor.xcodeproj/xcuserdata/
6+
QuickCursor.xcodeproj/xcuserdata/
7+
QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/project.xcworkspace/xcuserdata/
8+
QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/xcuserdata/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
88558975159C94250021FF4A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88558974159C94250021FF4A /* Cocoa.framework */; };
11+
8855897F159C94250021FF4A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8855897D159C94250021FF4A /* InfoPlist.strings */; };
12+
88558981159C94250021FF4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558980159C94250021FF4A /* main.m */; };
13+
88558988159C94250021FF4A /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558987159C94250021FF4A /* Document.m */; };
14+
8855898B159C94250021FF4A /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88558989159C94250021FF4A /* Document.xib */; };
15+
8855898E159C94250021FF4A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8855898C159C94250021FF4A /* MainMenu.xib */; };
16+
88558997159C97AA0021FF4A /* DocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558996159C97AA0021FF4A /* DocumentController.m */; };
17+
8855899A159C9DDE0021FF4A /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 88558999159C9DDE0021FF4A /* ApplicationDelegate.m */; };
18+
/* End PBXBuildFile section */
19+
20+
/* Begin PBXFileReference section */
21+
88558970159C94250021FF4A /* QuickCursorEditorExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickCursorEditorExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
22+
88558974159C94250021FF4A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
23+
88558977159C94250021FF4A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
24+
88558978159C94250021FF4A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
25+
88558979159C94250021FF4A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
26+
8855897C159C94250021FF4A /* QuickCursorEditorExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "QuickCursorEditorExample-Info.plist"; sourceTree = "<group>"; };
27+
8855897E159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
28+
88558980159C94250021FF4A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29+
88558982159C94250021FF4A /* QuickCursorEditorExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QuickCursorEditorExample-Prefix.pch"; sourceTree = "<group>"; };
30+
88558986159C94250021FF4A /* Document.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Document.h; sourceTree = "<group>"; };
31+
88558987159C94250021FF4A /* Document.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Document.m; sourceTree = "<group>"; };
32+
8855898A159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Document.xib; sourceTree = "<group>"; };
33+
8855898D159C94250021FF4A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
34+
88558994159C958B0021FF4A /* ODBEditorSuite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ODBEditorSuite.h; sourceTree = "<group>"; };
35+
88558995159C97AA0021FF4A /* DocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentController.h; sourceTree = "<group>"; };
36+
88558996159C97AA0021FF4A /* DocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocumentController.m; sourceTree = "<group>"; };
37+
88558998159C9DDE0021FF4A /* ApplicationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationDelegate.h; sourceTree = "<group>"; };
38+
88558999159C9DDE0021FF4A /* ApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplicationDelegate.m; sourceTree = "<group>"; };
39+
/* End PBXFileReference section */
40+
41+
/* Begin PBXFrameworksBuildPhase section */
42+
8855896D159C94250021FF4A /* Frameworks */ = {
43+
isa = PBXFrameworksBuildPhase;
44+
buildActionMask = 2147483647;
45+
files = (
46+
88558975159C94250021FF4A /* Cocoa.framework in Frameworks */,
47+
);
48+
runOnlyForDeploymentPostprocessing = 0;
49+
};
50+
/* End PBXFrameworksBuildPhase section */
51+
52+
/* Begin PBXGroup section */
53+
88558965159C94250021FF4A = {
54+
isa = PBXGroup;
55+
children = (
56+
8855897A159C94250021FF4A /* QuickCursorEditorExample */,
57+
88558973159C94250021FF4A /* Frameworks */,
58+
88558971159C94250021FF4A /* Products */,
59+
);
60+
sourceTree = "<group>";
61+
};
62+
88558971159C94250021FF4A /* Products */ = {
63+
isa = PBXGroup;
64+
children = (
65+
88558970159C94250021FF4A /* QuickCursorEditorExample.app */,
66+
);
67+
name = Products;
68+
sourceTree = "<group>";
69+
};
70+
88558973159C94250021FF4A /* Frameworks */ = {
71+
isa = PBXGroup;
72+
children = (
73+
88558974159C94250021FF4A /* Cocoa.framework */,
74+
88558976159C94250021FF4A /* Other Frameworks */,
75+
);
76+
name = Frameworks;
77+
sourceTree = "<group>";
78+
};
79+
88558976159C94250021FF4A /* Other Frameworks */ = {
80+
isa = PBXGroup;
81+
children = (
82+
88558977159C94250021FF4A /* AppKit.framework */,
83+
88558978159C94250021FF4A /* CoreData.framework */,
84+
88558979159C94250021FF4A /* Foundation.framework */,
85+
);
86+
name = "Other Frameworks";
87+
sourceTree = "<group>";
88+
};
89+
8855897A159C94250021FF4A /* QuickCursorEditorExample */ = {
90+
isa = PBXGroup;
91+
children = (
92+
88558986159C94250021FF4A /* Document.h */,
93+
88558987159C94250021FF4A /* Document.m */,
94+
88558995159C97AA0021FF4A /* DocumentController.h */,
95+
88558996159C97AA0021FF4A /* DocumentController.m */,
96+
88558998159C9DDE0021FF4A /* ApplicationDelegate.h */,
97+
88558999159C9DDE0021FF4A /* ApplicationDelegate.m */,
98+
88558989159C94250021FF4A /* Document.xib */,
99+
8855898C159C94250021FF4A /* MainMenu.xib */,
100+
8855897B159C94250021FF4A /* Supporting Files */,
101+
);
102+
path = QuickCursorEditorExample;
103+
sourceTree = "<group>";
104+
};
105+
8855897B159C94250021FF4A /* Supporting Files */ = {
106+
isa = PBXGroup;
107+
children = (
108+
8855897C159C94250021FF4A /* QuickCursorEditorExample-Info.plist */,
109+
8855897D159C94250021FF4A /* InfoPlist.strings */,
110+
88558980159C94250021FF4A /* main.m */,
111+
88558994159C958B0021FF4A /* ODBEditorSuite.h */,
112+
88558982159C94250021FF4A /* QuickCursorEditorExample-Prefix.pch */,
113+
);
114+
name = "Supporting Files";
115+
sourceTree = "<group>";
116+
};
117+
/* End PBXGroup section */
118+
119+
/* Begin PBXNativeTarget section */
120+
8855896F159C94250021FF4A /* QuickCursorEditorExample */ = {
121+
isa = PBXNativeTarget;
122+
buildConfigurationList = 88558991159C94250021FF4A /* Build configuration list for PBXNativeTarget "QuickCursorEditorExample" */;
123+
buildPhases = (
124+
8855896C159C94250021FF4A /* Sources */,
125+
8855896D159C94250021FF4A /* Frameworks */,
126+
8855896E159C94250021FF4A /* Resources */,
127+
);
128+
buildRules = (
129+
);
130+
dependencies = (
131+
);
132+
name = QuickCursorEditorExample;
133+
productName = QuickCursorEditorExample;
134+
productReference = 88558970159C94250021FF4A /* QuickCursorEditorExample.app */;
135+
productType = "com.apple.product-type.application";
136+
};
137+
/* End PBXNativeTarget section */
138+
139+
/* Begin PBXProject section */
140+
88558967159C94250021FF4A /* Project object */ = {
141+
isa = PBXProject;
142+
attributes = {
143+
LastUpgradeCheck = 0430;
144+
};
145+
buildConfigurationList = 8855896A159C94250021FF4A /* Build configuration list for PBXProject "QuickCursorEditorExample" */;
146+
compatibilityVersion = "Xcode 3.2";
147+
developmentRegion = English;
148+
hasScannedForEncodings = 0;
149+
knownRegions = (
150+
en,
151+
);
152+
mainGroup = 88558965159C94250021FF4A;
153+
productRefGroup = 88558971159C94250021FF4A /* Products */;
154+
projectDirPath = "";
155+
projectRoot = "";
156+
targets = (
157+
8855896F159C94250021FF4A /* QuickCursorEditorExample */,
158+
);
159+
};
160+
/* End PBXProject section */
161+
162+
/* Begin PBXResourcesBuildPhase section */
163+
8855896E159C94250021FF4A /* Resources */ = {
164+
isa = PBXResourcesBuildPhase;
165+
buildActionMask = 2147483647;
166+
files = (
167+
8855897F159C94250021FF4A /* InfoPlist.strings in Resources */,
168+
8855898B159C94250021FF4A /* Document.xib in Resources */,
169+
8855898E159C94250021FF4A /* MainMenu.xib in Resources */,
170+
);
171+
runOnlyForDeploymentPostprocessing = 0;
172+
};
173+
/* End PBXResourcesBuildPhase section */
174+
175+
/* Begin PBXSourcesBuildPhase section */
176+
8855896C159C94250021FF4A /* Sources */ = {
177+
isa = PBXSourcesBuildPhase;
178+
buildActionMask = 2147483647;
179+
files = (
180+
88558981159C94250021FF4A /* main.m in Sources */,
181+
88558988159C94250021FF4A /* Document.m in Sources */,
182+
88558997159C97AA0021FF4A /* DocumentController.m in Sources */,
183+
8855899A159C9DDE0021FF4A /* ApplicationDelegate.m in Sources */,
184+
);
185+
runOnlyForDeploymentPostprocessing = 0;
186+
};
187+
/* End PBXSourcesBuildPhase section */
188+
189+
/* Begin PBXVariantGroup section */
190+
8855897D159C94250021FF4A /* InfoPlist.strings */ = {
191+
isa = PBXVariantGroup;
192+
children = (
193+
8855897E159C94250021FF4A /* en */,
194+
);
195+
name = InfoPlist.strings;
196+
sourceTree = "<group>";
197+
};
198+
88558989159C94250021FF4A /* Document.xib */ = {
199+
isa = PBXVariantGroup;
200+
children = (
201+
8855898A159C94250021FF4A /* en */,
202+
);
203+
name = Document.xib;
204+
sourceTree = "<group>";
205+
};
206+
8855898C159C94250021FF4A /* MainMenu.xib */ = {
207+
isa = PBXVariantGroup;
208+
children = (
209+
8855898D159C94250021FF4A /* en */,
210+
);
211+
name = MainMenu.xib;
212+
sourceTree = "<group>";
213+
};
214+
/* End PBXVariantGroup section */
215+
216+
/* Begin XCBuildConfiguration section */
217+
8855898F159C94250021FF4A /* Debug */ = {
218+
isa = XCBuildConfiguration;
219+
buildSettings = {
220+
ALWAYS_SEARCH_USER_PATHS = NO;
221+
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
222+
COPY_PHASE_STRIP = NO;
223+
GCC_C_LANGUAGE_STANDARD = gnu99;
224+
GCC_DYNAMIC_NO_PIC = NO;
225+
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
226+
GCC_OPTIMIZATION_LEVEL = 0;
227+
GCC_PREPROCESSOR_DEFINITIONS = (
228+
"DEBUG=1",
229+
"$(inherited)",
230+
);
231+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
232+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
233+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
234+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
235+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
236+
GCC_WARN_UNUSED_VARIABLE = YES;
237+
MACOSX_DEPLOYMENT_TARGET = 10.7;
238+
ONLY_ACTIVE_ARCH = YES;
239+
SDKROOT = macosx;
240+
};
241+
name = Debug;
242+
};
243+
88558990159C94250021FF4A /* Release */ = {
244+
isa = XCBuildConfiguration;
245+
buildSettings = {
246+
ALWAYS_SEARCH_USER_PATHS = NO;
247+
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
248+
COPY_PHASE_STRIP = YES;
249+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
250+
GCC_C_LANGUAGE_STANDARD = gnu99;
251+
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
252+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
253+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
254+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
255+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
256+
GCC_WARN_UNUSED_VARIABLE = YES;
257+
MACOSX_DEPLOYMENT_TARGET = 10.7;
258+
SDKROOT = macosx;
259+
};
260+
name = Release;
261+
};
262+
88558992159C94250021FF4A /* Debug */ = {
263+
isa = XCBuildConfiguration;
264+
buildSettings = {
265+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
266+
GCC_PREFIX_HEADER = "QuickCursorEditorExample/QuickCursorEditorExample-Prefix.pch";
267+
INFOPLIST_FILE = "QuickCursorEditorExample/QuickCursorEditorExample-Info.plist";
268+
PRODUCT_NAME = "$(TARGET_NAME)";
269+
WRAPPER_EXTENSION = app;
270+
};
271+
name = Debug;
272+
};
273+
88558993159C94250021FF4A /* Release */ = {
274+
isa = XCBuildConfiguration;
275+
buildSettings = {
276+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
277+
GCC_PREFIX_HEADER = "QuickCursorEditorExample/QuickCursorEditorExample-Prefix.pch";
278+
INFOPLIST_FILE = "QuickCursorEditorExample/QuickCursorEditorExample-Info.plist";
279+
PRODUCT_NAME = "$(TARGET_NAME)";
280+
WRAPPER_EXTENSION = app;
281+
};
282+
name = Release;
283+
};
284+
/* End XCBuildConfiguration section */
285+
286+
/* Begin XCConfigurationList section */
287+
8855896A159C94250021FF4A /* Build configuration list for PBXProject "QuickCursorEditorExample" */ = {
288+
isa = XCConfigurationList;
289+
buildConfigurations = (
290+
8855898F159C94250021FF4A /* Debug */,
291+
88558990159C94250021FF4A /* Release */,
292+
);
293+
defaultConfigurationIsVisible = 0;
294+
defaultConfigurationName = Release;
295+
};
296+
88558991159C94250021FF4A /* Build configuration list for PBXNativeTarget "QuickCursorEditorExample" */ = {
297+
isa = XCConfigurationList;
298+
buildConfigurations = (
299+
88558992159C94250021FF4A /* Debug */,
300+
88558993159C94250021FF4A /* Release */,
301+
);
302+
defaultConfigurationIsVisible = 0;
303+
};
304+
/* End XCConfigurationList section */
305+
};
306+
rootObject = 88558967159C94250021FF4A /* Project object */;
307+
}

QuickCursorEditorExample/QuickCursorEditorExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ApplicationDelegate.h
3+
// QuickCursorEditorExample
4+
//
5+
// Created by Jesse Grosjean on 6/28/12.
6+
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
@interface ApplicationDelegate : NSObject
12+
13+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// ApplicationDelegate.m
3+
// QuickCursorEditorExample
4+
//
5+
// Created by Jesse Grosjean on 6/28/12.
6+
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import "ApplicationDelegate.h"
10+
#import "DocumentController.h"
11+
12+
13+
@implementation ApplicationDelegate
14+
15+
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
16+
[DocumentController sharedDocumentController];
17+
}
18+
19+
static NSUInteger openUntitledFileIfNotCancledCount = 0;
20+
21+
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender {
22+
openUntitledFileIfNotCancledCount = 0;
23+
[self performSelector:@selector(openUntitledFileIfNotCancled) withObject:nil afterDelay:0]; // Delay for ODB Editor case
24+
return NO;
25+
}
26+
27+
- (void)openUntitledFileIfNotCancled {
28+
if (openUntitledFileIfNotCancledCount < 2) {
29+
// Big ugly hack... otherwise on startup (in QuickCursor case) we end up opening an empy document.
30+
// So instead wait a bit (2 cycles of performSelector) for ODB to cancel us... if no cancel then open untitled document.
31+
[self performSelector:@selector(openUntitledFileIfNotCancled) withObject:nil afterDelay:0];
32+
openUntitledFileIfNotCancledCount++;
33+
return;
34+
}
35+
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL];
36+
}
37+
38+
@end

0 commit comments

Comments
 (0)