Permalink
Browse files

Added RKSupportResourceRegistry that opens a couple of files in

~/Library/Application Support/ResKnife/Support Resources/
(the equivalent folder in /Library)
A
ResKnife.app/Contents/Resources/SupportResources/


git-svn-id: https://resknife.svn.sourceforge.net/svnroot/resknife/trunk/ResKnife@102 25122d23-1bc7-42f3-9251-2040de679093
  • Loading branch information...
1 parent dc9e28c commit cf47844b7e713284d093d94899a8ce105d3bd623 witness committed Aug 20, 2003
@@ -8,6 +8,8 @@
#import "ResourceDataSource.h"
#import "ResknifePluginProtocol.h"
+#import "RKSupportResourceRegistry.h"
+
@implementation ApplicationDelegate
@@ -22,7 +24,8 @@ - (void)applicationWillFinishLaunching:(NSNotification *)notification
{
// instanciate my own subclass of NSDocumentController so I can override the open dialog
RKDocumentController *docController = [[RKDocumentController alloc] init];
- #pragma unused( docController )
+
+ [RKSupportResourceRegistry scanForSupportResources: [NSDocumentController sharedDocumentController]];
}
- (void)awakeFromNib
@@ -0,0 +1,20 @@
+//
+// RKSupportResourceRegistry.h
+// ResKnife
+//
+// Created by Uli Kusterer on Mon Aug 18 2003.
+// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import <AppKit/AppKit.h>
+
+
+@interface RKSupportResourceRegistry : NSObject
+{
+
+}
+
++(void) scanForSupportResources: (NSDocumentController*)c;
+
+
+@end
@@ -0,0 +1,45 @@
+//
+// RKSupportResourceRegistry.m
+// ResKnife
+//
+// Created by Uli Kusterer on Mon Aug 18 2003.
+// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import "RKSupportResourceRegistry.h"
+
+
+@implementation RKSupportResourceRegistry
+
++(void) scanForSupportResources: (NSDocumentController*)c
+{
+ // TODO: Instead of hard-coding sysPath we should use some FindFolder-like API!
+ NSString *appSupport = @"Library/Application Support/ResKnife/Support Resources/";
+ NSString *appPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Support Resources"];
+ NSString *userPath = [NSHomeDirectory() stringByAppendingPathComponent:appSupport];
+ NSString *sysPath = [@"/" stringByAppendingPathComponent:appSupport];
+ NSArray *paths = [NSArray arrayWithObjects:appPath, userPath, sysPath, nil];
+ NSEnumerator *pathEnum = [paths objectEnumerator];
+ NSString *path;
+
+ while( path = [pathEnum nextObject] )
+ {
+ NSEnumerator *e = [[[NSFileManager defaultManager] directoryContentsAtPath:path] objectEnumerator];
+ NSString *name;
+
+ NSLog(@"Looking for resources in %@", path);
+
+ while( name = [e nextObject] )
+ {
+ name = [path stringByAppendingPathComponent:name];
+ NSLog(@"Examining %@", name);
+ if( [[name pathExtension] isEqualToString:@"rsrc"] )
+ {
+ [c openDocumentWithContentsOfFile:name display:YES];
+ //[[[[[c openDocumentWithContentsOfFile:name display:YES] windowControllers] objectAtIndex:0] window] orderOut: self];
+ }
+ }
+ }
+}
+
+@end
@@ -673,6 +673,7 @@ -(BOOL) readFromFile: (NSString*)fileName ofType: (NSString*)fileKind
if( !fork ) DisposePtr( (Ptr) resourceForkName ); // only delete if we're not saving it to "fork" instance var.
if( fileRefNum ) FSClose( fileRefNum );
DisposePtr( (Ptr) fileRef );
+
return succeeded;
}
@@ -839,6 +839,30 @@
settings = {
};
};
+ 3D53A9FD04F171DC006651FA = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = RKSupportResourceRegistry.h;
+ refType = 4;
+ };
+ 3D53A9FE04F171DC006651FA = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = RKSupportResourceRegistry.m;
+ refType = 4;
+ };
+ 3D53A9FF04F171DC006651FA = {
+ fileRef = 3D53A9FD04F171DC006651FA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 3D53AA0004F171DC006651FA = {
+ fileRef = 3D53A9FE04F171DC006651FA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
//3D0
//3D1
//3D2
@@ -2823,6 +2847,7 @@
F59481AF03D0776C01A8010A,
F59481B303D077DC01A8010A,
3D35755E04DAEB6200B8225B,
+ 3D53A9FF04F171DC006651FA,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -2880,6 +2905,7 @@
F59481B403D077DC01A8010A,
3D35755B04DAEB4300B8225B,
3D35755F04DAEB6200B8225B,
+ 3D53AA0004F171DC006651FA,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -2940,6 +2966,8 @@
F5B5882E0156D40B01000001,
3D35755C04DAEB6200B8225B,
3D35755D04DAEB6200B8225B,
+ 3D53A9FD04F171DC006651FA,
+ 3D53A9FE04F171DC006651FA,
F5B5882F0156D40B01000001,
F5B588300156D40B01000001,
F5B588310156D40B01000001,
@@ -54,7 +54,7 @@
3DFEB4D504E67CC7009449E8 = {
fileReference = F5B5881E0156D40B01000001;
isa = PBXFileBreakpoint;
- lineNumber = 115;
+ lineNumber = 118;
state = 1;
};
F50DFE1E036C255E01A8010A = {
@@ -74,7 +74,7 @@
activeExecutable = 3D97EA9B0476C2A600BE8AD5;
activeTarget = F5B588130156D30301000001;
addToTargets = (
- 3D0B38BC04DEF48D005AED5E,
+ F5B588130156D30301000001,
);
breakpoints = (
3DFEB4D304E672EA009449E8,
@@ -85,7 +85,7 @@
3D97EA9C0476C2A600BE8AD5,
);
perUserDictionary = {
- PBXPerProjectTemplateStateSaveDate = 82928627;
+ PBXPerProjectTemplateStateSaveDate = 83076143;
"PBXTemplateGeometry-F5314676015831810DCA290F" = {
ContentSize = "{685, 434}";
LeftSlideOut = {
@@ -342,16 +342,16 @@
ToolbarVisible = YES;
WindowLocation = "{371, 372}";
};
- "PBXTemplateGeometry-F5CA7EC8015C06940DCA290F" = {
- ContentSize = "{705, 569}";
+ "PBXTemplateGeometry-F5CA7ECB015C094F0DCA290F" = {
+ ContentSize = "{668, 621}";
LeftSlideOut = {
Collapsed = NO;
- Frame = "{{0, 0}, {705, 569}}";
+ Frame = "{{0, 0}, {668, 621}}";
Split0 = {
Collapsed = NO;
- Frame = "{{0, 0}, {705, 569}}";
+ Frame = "{{0, 0}, {668, 621}}";
Split0 = {
- Frame = "{{0, 0}, {705, 569}}";
+ Frame = "{{0, 0}, {668, 621}}";
};
SplitCount = 1;
Tab0 = {
@@ -360,11 +360,11 @@
Tab1 = {
Debugger = {
Collapsed = NO;
- Frame = "{{0, 0}, {522, 208}}";
+ Frame = "{{0, 0}, {664, 208}}";
Split0 = {
- Frame = "{{0, 24}, {522, 184}}";
+ Frame = "{{0, 24}, {664, 184}}";
Split0 = {
- Frame = "{{0, 0}, {254, 184}}";
+ Frame = "{{0, 0}, {325, 184}}";
};
Split1 = {
DebugVariablesTableConfiguration = (
@@ -373,9 +373,9 @@
Value,
85,
Summary,
- 62.123,
+ 96.123,
);
- Frame = "{{263, 0}, {259, 184}}";
+ Frame = "{{334, 0}, {330, 184}}";
};
SplitCount = 2;
};
@@ -389,14 +389,14 @@
TabCount = 2;
TabsVisible = YES;
};
- Frame = "{{0, 0}, {522, 208}}";
+ Frame = "{{0, 0}, {664, 208}}";
LauncherConfigVersion = 7;
};
Tab2 = {
- Frame = "{{0, 0}, {807, 536}}";
+ Frame = "{{0, 0}, {664, 50}}";
LauncherConfigVersion = 3;
Runner = {
- Frame = "{{0, 0}, {807, 536}}";
+ Frame = "{{0, 0}, {664, 50}}";
};
};
Tab3 = {
@@ -413,12 +413,12 @@
};
SplitCount = 1;
Tab0 = {
- Frame = "{{0, 0}, {300, 533}}";
+ Frame = "{{0, 0}, {313, 531}}";
GroupTreeTableConfiguration = (
TargetStatusColumn,
18,
MainColumn,
- 267,
+ 280,
);
};
Tab1 = {
@@ -442,7 +442,7 @@
Frame = "{{0, 0}, {200, 100}}";
};
Tab3 = {
- Frame = "{{0, 0}, {222, 536}}";
+ Frame = "{{0, 0}, {200, 557}}";
TargetTableConfiguration = (
ActiveObject,
16,
@@ -457,40 +457,44 @@
enabledColumn,
31,
);
- Frame = "{{0, 0}, {250, 528}}";
+ Frame = "{{0, 0}, {250, 100}}";
};
TabCount = 5;
TabsVisible = NO;
};
NavBarShownByDefault = YES;
StatusViewVisible = NO;
- Template = F5CA7EC8015C06940DCA290F;
- ToolbarVisible = YES;
- WindowLocation = "{233, 115}";
+ Template = F5CA7ECB015C094F0DCA290F;
+ ToolbarVisible = NO;
+ WindowLocation = "{334, 103}";
};
- "PBXTemplateGeometry-F5CA7ECB015C094F0DCA290F" = {
- ContentSize = "{668, 621}";
+ "PBXTemplateGeometry-F5CA7ECC015C09990DCA290F" = {
+ ContentSize = "{773, 558}";
LeftSlideOut = {
Collapsed = NO;
- Frame = "{{0, 0}, {668, 621}}";
+ Frame = "{{0, 23}, {773, 535}}";
Split0 = {
+ ActiveTab = 0;
+ ActiveTabName = PBXDebugSessionModule;
Collapsed = NO;
- Frame = "{{0, 0}, {668, 621}}";
+ Frame = "{{24, 0}, {749, 535}}";
Split0 = {
- Frame = "{{0, 0}, {668, 621}}";
+ Frame = "{{0, 214}, {749, 321}}";
};
SplitCount = 1;
Tab0 = {
- Frame = "{{0, 0}, {484, 208}}";
+ Frame = "{{0, 0}, {749, 267}}";
};
Tab1 = {
Debugger = {
+ ActiveTab = 0;
+ ActiveTabName = PBXDebugCLIModule;
Collapsed = NO;
- Frame = "{{0, 0}, {664, 208}}";
+ Frame = "{{0, 0}, {749, 208}}";
Split0 = {
- Frame = "{{0, 24}, {664, 184}}";
+ Frame = "{{0, 74}, {749, 134}}";
Split0 = {
- Frame = "{{0, 0}, {325, 184}}";
+ Frame = "{{0, 0}, {367, 134}}";
};
Split1 = {
DebugVariablesTableConfiguration = (
@@ -499,9 +503,9 @@
Value,
85,
Summary,
- 96.123,
+ 139.123,
);
- Frame = "{{334, 0}, {330, 184}}";
+ Frame = "{{376, 0}, {373, 134}}";
};
SplitCount = 2;
};
@@ -510,12 +514,12 @@
Frame = "{{0, 0}, {100, 50}}";
};
Tab1 = {
- Frame = "{{0, 0}, {100, 50}}";
+ Frame = "{{0, 0}, {749, 50}}";
};
TabCount = 2;
TabsVisible = YES;
};
- Frame = "{{0, 0}, {664, 208}}";
+ Frame = "{{0, 0}, {749, 208}}";
LauncherConfigVersion = 7;
};
Tab2 = {
@@ -586,13 +590,13 @@
Frame = "{{0, 0}, {250, 100}}";
};
TabCount = 5;
- TabsVisible = NO;
+ TabsVisible = YES;
};
NavBarShownByDefault = YES;
- StatusViewVisible = NO;
- Template = F5CA7ECB015C094F0DCA290F;
- ToolbarVisible = NO;
- WindowLocation = "{334, 103}";
+ StatusViewVisible = YES;
+ Template = F5CA7ECC015C09990DCA290F;
+ ToolbarVisible = YES;
+ WindowLocation = "{204, 80}";
};
PBXWorkspaceContents = (
{
@@ -764,7 +768,7 @@
WindowLocation = "{143, 10}";
},
);
- PBXWorkspaceStateSaveDate = 82928627;
+ PBXWorkspaceStateSaveDate = 83076143;
};
projectwideBuildSettings = {
};

0 comments on commit cf47844

Please sign in to comment.