Update NovaTools.

This commit is contained in:
Nicholas Shanks 2002-04-27 18:17:47 +00:00
parent de68e099da
commit 141fe2dc56
36 changed files with 3208 additions and 259 deletions

View File

@ -0,0 +1,11 @@
#import <Carbon/Carbon.h>
#import <AppKit/AppKit.h>
@interface NSEvent (ModifierKeys)
+ (BOOL) isControlKeyDown;
+ (BOOL) isOptionKeyDown;
+ (BOOL) isCommandKeyDown;
+ (BOOL) isShiftKeyDown;
@end

View File

@ -0,0 +1,25 @@
#import "NSEvent-ModifierKeys.h"
@implementation NSEvent (ModifierKeys)
+ (BOOL) isControlKeyDown
{
return (GetCurrentKeyModifiers() & controlKey) != 0;
}
+ (BOOL) isOptionKeyDown
{
return (GetCurrentKeyModifiers() & optionKey) != 0;
}
+ (BOOL) isCommandKeyDown
{
return (GetCurrentKeyModifiers() & cmdKey) != 0;
}
+ (BOOL) isShiftKeyDown
{
return (GetCurrentKeyModifiers() & shiftKey) != 0;
}
@end

View File

@ -2,6 +2,7 @@
@interface ApplicationDelegate : NSObject
{
NSMutableDictionary *icons;
}
- (IBAction)showAbout:(id)sender;
@ -12,6 +13,8 @@
- (IBAction)showPrefs:(id)sender;
- (void)initUserDefaults;
- (NSDictionary *)icons;
@end
@interface NSSavePanel (PackageBrowser)

View File

@ -22,8 +22,19 @@
int launchCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"LaunchCount"];
[[NSUserDefaults standardUserDefaults] setInteger:launchCount + 1 forKey:@"LaunchCount"];
// save a number of icons
icons = [[NSMutableDictionary alloc] init];
[icons setObject:[[NSWorkspace sharedWorkspace] iconForFileType:@"PICT"] forKey:@"PICT"];
[icons setObject:[[NSWorkspace sharedWorkspace] iconForFileType:@"icns"] forKey:@"icns"];
[self initUserDefaults];
}
}
- (void)dealloc
{
[icons release];
[super dealloc];
}
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
@ -113,6 +124,11 @@
[defaults synchronize];
}
- (NSDictionary *)icons
{
return icons;
}
@end
@implementation NSSavePanel (PackageBrowser)

View File

@ -77,8 +77,8 @@
[[filePropertyForm cellAtIndex:1] setStringValue:[currentDocument type]];
// [[filePropertyForm cellAtIndex:2] setObjectValue:[NSNumber numberWithUnsignedLongLong:dataLogicalSize]];
// [[filePropertyForm cellAtIndex:3] setObjectValue:[NSNumber numberWithUnsignedLongLong:rsrcLogicalSize]];
[[filePropertyForm cellAtIndex:2] setStringValue:[NSString stringWithUnsignedLongLong:dataLogicalSize]];
[[filePropertyForm cellAtIndex:3] setStringValue:[NSString stringWithUnsignedLongLong:rsrcLogicalSize]];
[[filePropertyForm cellAtIndex:2] setStringValue:[[NSNumber numberWithUnsignedLongLong:dataLogicalSize] description]];
[[filePropertyForm cellAtIndex:3] setStringValue:[[NSNumber numberWithUnsignedLongLong:rsrcLogicalSize] description]];
[placeholderView setContentView:documentView];
}
}
@ -127,12 +127,9 @@
+ (id)sharedInfoWindowController
{
static InfoWindowController *sharedInfoWindowController = nil;
if( !sharedInfoWindowController )
{
sharedInfoWindowController = [[InfoWindowController allocWithZone:[self zone]] init];
}
return sharedInfoWindowController;
}
@end
@end

View File

@ -1,6 +1,7 @@
#import "OutlineViewDelegate.h"
#import "ResourceNameCell.h"
#import "Resource.h"
#import "ApplicationDelegate.h"
@implementation OutlineViewDelegate
@ -16,6 +17,7 @@
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
int row = [outlineView rowForItem:item];
NSString *identifier = [tableColumn identifier];
if( [identifier isEqualToString:@"name"] ) [cell setFormatter:nameFormatter];
else if( [identifier isEqualToString:@"size"] ) [cell setFormatter:sizeFormatter];
@ -25,8 +27,12 @@
if( [identifier isEqualToString:@"name"] )
{
// [(ResourceNameCell *)cell setImage:[NSImage imageNamed:@"Resource file"]];
[(ResourceNameCell *)cell setImage:[[NSWorkspace sharedWorkspace] iconForFileType:[(Resource *)item type]]];
// [(ResourceNameCell *)cell setImage:[[NSWorkspace sharedWorkspace] iconForFileType:[(Resource *)item type]]];
[(ResourceNameCell *)cell setImage:[[(ApplicationDelegate *)[NSApp delegate] icons] valueForKey:[(Resource *)item type]]];
}
if( row % 2 == 0 ) [cell setBackgroundColor:[NSColor whiteColor]];
else [cell setBackgroundColor:[NSColor colorWithCalibratedRed:0.93 green:0.95 blue:1.0 alpha:1.0]];
}
@end

View File

@ -18,6 +18,7 @@
- (void)setupToolbar:(NSWindowController *)windowController;
- (IBAction)showCreateResourceSheet:(id)sender;
- (IBAction)showSelectTemplateSheet:(id)sender;
- (IBAction)openResources:(id)sender;
- (IBAction)openResourcesInTemplate:(id)sender;
- (IBAction)openResourcesAsHex:(id)sender;

View File

@ -96,6 +96,8 @@ NSString *DocumentInfoDidChangeNotification = @"DocumentInfoDidChangeNotificat
// resource menu
else if( [item action] == @selector(openResources:) ) return selectedRows > 0;
else if( [item action] == @selector(openResourcesInTemplate:) ) return selectedRows > 0;
else if( [item action] == @selector(openResourcesWithOtherTemplate:) ) return selectedRows > 0;
else if( [item action] == @selector(openResourcesAsHex:) ) return selectedRows > 0;
else if( [item action] == @selector(playSound:) ) return selectedRows == 1 && [[resource type] isEqualToString:@"snd "];
else if( [item action] == @selector(revertResourceToSaved:) ) return selectedRows == 1 && [resource isDirty];
@ -137,7 +139,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
{
NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
if( [itemIdentifier isEqual:RKCreateItemIdentifier] )
if( [itemIdentifier isEqualToString:RKCreateItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Create", nil)];
[item setPaletteLabel:NSLocalizedString(@"Create", nil)];
@ -147,7 +149,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
[item setAction:@selector(showCreateResourceSheet:)];
return item;
}
else if( [itemIdentifier isEqual:RKDeleteItemIdentifier] )
else if( [itemIdentifier isEqualToString:RKDeleteItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Delete", nil)];
[item setPaletteLabel:NSLocalizedString(@"Delete", nil)];
@ -157,27 +159,27 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
[item setAction:@selector(clear:)];
return item;
}
else if( [itemIdentifier isEqual:RKEditItemIdentifier] )
else if( [itemIdentifier isEqualToString:RKEditItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Edit", nil)];
[item setPaletteLabel:NSLocalizedString(@"Edit", nil)];
[item setToolTip:NSLocalizedString(@"Edit Resource In Default Editor", nil)];
[item setImage:[NSImage imageNamed:@"Edit"]];
[item setTarget:self];
[item setAction:@selector(openResource:)];
[item setAction:@selector(openResources:)];
return item;
}
else if( [itemIdentifier isEqual:RKEditHexItemIdentifier] )
else if( [itemIdentifier isEqualToString:RKEditHexItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Edit Hex", nil)];
[item setPaletteLabel:NSLocalizedString(@"Edit Hex", nil)];
[item setToolTip:NSLocalizedString(@"Edit Resource As Hexadecimal", nil)];
[item setImage:[NSImage imageNamed:@"Edit Hex"]];
[item setTarget:self];
[item setAction:@selector(openResourceAsHex:)];
[item setAction:@selector(openResourcesAsHex:)];
return item;
}
else if( [itemIdentifier isEqual:RKSaveItemIdentifier] )
else if( [itemIdentifier isEqualToString:RKSaveItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Save", nil)];
[item setPaletteLabel:NSLocalizedString(@"Save", nil)];
@ -187,7 +189,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
[item setAction:@selector(saveDocument:)];
return item;
}
else if( [itemIdentifier isEqual:RKShowInfoItemIdentifier] )
else if( [itemIdentifier isEqualToString:RKShowInfoItemIdentifier] )
{
[item setLabel:NSLocalizedString(@"Show Info", nil)];
[item setPaletteLabel:NSLocalizedString(@"Show Info", nil)];
@ -236,6 +238,13 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
[sheetController showCreateResourceSheet:self];
}
- (IBAction)showSelectTemplateSheet:(id)sender
{
// bug: ResourceDocument allocs a sheet controller, but it's never disposed of
// SelectTemplateSheetController *sheetController = [[CreateResourceSheetController alloc] initWithWindowNibName:@"SelectTemplateSheet"];
// [sheetController showSelectTemplateSheet:self];
}
- (IBAction)openResources:(id)sender
{
Resource *resource;
@ -271,13 +280,15 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
NSBundle *editor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"NovaTools.plugin"]];
// open the resources, passing in the template to use
if( editor /* && [[editor principalClass] respondsToSelector:@selector(initWithResource:)] */ )
if( editor /*&& [[editor principalClass] respondsToSelector:@selector(initWithResource:)]*/ )
{
// bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self autorelease] when it's last window is closed?
[(id <ResKnifePluginProtocol>)[[editor principalClass] alloc] initWithResource:resource];
id plug = [(id <ResKnifePluginProtocol>)[[editor principalClass] alloc] initWithResource:resource];
if( plug ) return;
}
// if no editor exists, or the editor is broken, open using template
else [self openResource:resource usingTemplate:[resource type]];
[self openResource:resource usingTemplate:[resource type]];
}
- (void)openResource:(Resource *)resource usingTemplate:(NSString *)templateName
@ -292,10 +303,12 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
if( tmpl && [[templateEditor principalClass] respondsToSelector:@selector(initWithResources:)] )
{
// bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self autorelease] when it's last window is closed?
[(id <ResKnifePluginProtocol>)[[templateEditor principalClass] alloc] initWithResources:resource, tmpl, nil];
id plug = [(id <ResKnifePluginProtocol>)[[templateEditor principalClass] alloc] initWithResources:resource, tmpl, nil];
if( plug ) return;
}
// if no template exists, or template editor is broken, open as hex
else [self openResourceAsHex:resource];
[self openResourceAsHex:resource];
}
- (void)openResourceAsHex:(Resource *)resource

View File

@ -43,10 +43,11 @@
- (void)setImage:(NSImage *)newImage
{
// save image and set to 16x16 pixels
[image autorelease];
id old = image;
image = [newImage retain];
[image setScalesWhenResized:YES];
[image setSize:NSMakeSize(16,16)];
[old autorelease];
}
- (NSRect)imageFrameForCellFrame:(NSRect)cellFrame

View File

@ -16,7 +16,6 @@
openResources = id;
openResourcesAsHex = id;
openResourcesInTemplate = id;
openResourcesWithOtherTemplate = id;
playSound = id;
revertResourceToSaved = id;
scrollToSelection = id;
@ -25,6 +24,7 @@
showFind = id;
showInfo = id;
showPrefs = id;
showSelectTemplateSheet = id;
};
CLASS = FirstResponder;
LANGUAGE = ObjC;

View File

@ -7,15 +7,11 @@
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>-25 387 347 44 0 0 1024 746 </string>
<string>59 443 347 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q45</string>
<string>5Q110</string>
</dict>
</plist>

Binary file not shown.

View File

@ -161,8 +161,8 @@ NSString *ResourceDidChangeNotification = @"ResourceDidChangeNotification";
[[ascii textStorage] addAttributes:dictionary range:NSMakeRange(0, [[ascii textStorage] length])];
// restore selections (this is the dumbest way to do it, but it'll do for now)
[hex setSelectedRange:hexSelection];
[ascii setSelectedRange:asciiSelection];
[hex setSelectedRange:NSIntersectionRange(hexSelection, [hex selectedRange])];
[ascii setSelectedRange:NSIntersectionRange(asciiSelection, [ascii selectedRange])];
// restore delegates
[hex setDelegate:oldDelegate];
@ -184,4 +184,4 @@ NSString *ResourceDidChangeNotification = @"ResourceDidChangeNotification";
return bytesPerRow;
}
@end
@end

File diff suppressed because one or more lines are too long

View File

@ -7,4 +7,7 @@
{
id <ResKnifeResourceProtocol> resource;
}
- (IBAction)toggleResID:(id)sender;
@end

View File

@ -9,45 +9,16 @@
- (id)initWithResource:(id)newResource
{
NSString *asciiType = NSLocalizedStringFromTable( [resource type], @"Resource Types", nil );
resource = [newResource retain];
NSLog( @"%s", [[resource type] lossyCString] );
NSLog( [[[resource type] dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] description] );
if( [asciiType isEqualToString:@"boom"] )
{
id oldSelf = self;
self = [[BoomWindowController alloc] initWithResource:newResource];
[oldSelf release];
}
if( [asciiType isEqualToString:@"char"] )
{
id oldSelf = self;
self = [[CharWindowController alloc] initWithResource:newResource];
[oldSelf release];
}
if( [asciiType isEqualToString:@"colr"] )
{
id oldSelf = self;
self = [[ColrWindowController alloc] initWithResource:newResource];
[oldSelf release];
}
if( [asciiType isEqualToString:@"cron"] )
{
id oldSelf = self;
self = [[CronWindowController alloc] initWithResource:newResource];
[oldSelf release];
}
if( [asciiType isEqualToString:@"desc"] )
{
id oldSelf = self;
self = [[DescWindowController alloc] initWithResource:newResource];
[oldSelf release];
}
id oldSelf = self;
NSData *classData = [[(id <ResKnifeResourceProtocol>)newResource type] dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *className = [[[NSString stringWithCString:[classData bytes] length:[classData length]] capitalizedString] stringByAppendingString:@"WindowController"];
if( [className isEqualToString:@"Yea(R)WindowController"] ) className = @"YearWindowController";
self = [[NSClassFromString(className) alloc] initWithResource:newResource];
[oldSelf release];
if( !self ) return nil;
// do global stuff here
resource = [newResource retain];
return self;
}
@ -57,4 +28,25 @@
return nil;
}
- (void)windowDidLoad
{
[super windowDidLoad];
// insert the resources' data into the text fields
// [self refreshData:[resource data]];
// we don't want this notification until we have a window!
// bug: only registers for notifications on the resource we're editing, need dependant resources too (pass nil for object?)
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resourceDataDidChange:) name:ResourceDataDidChangeNotification object:resource];
// finally, show the window
[self showWindow:self];
}
- (IBAction)toggleResID:(id)sender
{
// toggles between resource IDs and index numbers
NSLog( @"%@", [resource type] );
}
@end

View File

@ -5,12 +5,12 @@
- (id)initWithResource:(id)newResource
{
self = [self initWithWindowNibName:@"boom"];
if( !self ) return self;
if( !self ) return nil;
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
if( ![[resource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"Explosion: %@", [resource name]]];
if( [newResource name] && ![[newResource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"%@: %@", [[self window] title], [newResource name]]];
return self;
}

View File

@ -6,6 +6,10 @@
<string>220 152 356 240 0 0 1152 848 </string>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>5Q110</string>
</dict>

Binary file not shown.

View File

@ -1,7 +1,32 @@
#import <Cocoa/Cocoa.h>
#import "NovaWindowController.h"
#define prefixField [timeForm cellAtIndex:0]
#define suffixField [timeForm cellAtIndex:1]
@interface CharWindowController : NovaWindowController
{
IBOutlet NSTextField *dayField;
IBOutlet NSTextField *monthField;
IBOutlet NSTextField *yearField;
IBOutlet NSStepper *dayStepper;
IBOutlet NSStepper *monthStepper;
IBOutlet NSStepper *yearStepper;
IBOutlet NSForm *timeForm;
// Initial Goodies
NSDecimalNumber *ship;
NSDecimalNumber *cash;
NSDecimalNumber *kills;
// Beginning Of Time
NSCalendarDate *date;
NSString *prefix;
NSString *suffix;
}
- (void)update;
- (IBAction)stepDate:(id)sender;
- (IBAction)editDate:(id)sender;
@end

View File

@ -2,4 +2,58 @@
@implementation CharWindowController
- (id)initWithResource:(id)newResource
{
self = [self initWithWindowNibName:@"char"];
if( !self ) return nil;
// load data from resource
ship = [[NSDecimalNumber alloc] initWithShort:128];
cash = [[NSDecimalNumber alloc] initWithLong:10000];
kills = [[NSDecimalNumber alloc] initWithUnsignedLong:0];
date = [[NSCalendarDate date] retain];
prefix = [[NSString alloc] init];
suffix = [[NSString alloc] init];
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
if( [newResource name] && ![[newResource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"%@: %@", [[self window] title], [newResource name]]];
[self update];
return self;
}
- (void)update
{
// update some stuff in the catchall box
// update Beginning Of Time
[dayField setIntValue:[date dayOfMonth]];
[monthField setIntValue:[date monthOfYear]];
[yearField setIntValue:[date yearOfCommonEra]];
[dayStepper setIntValue:[date dayOfMonth]];
[monthStepper setIntValue:[date monthOfYear]];
[yearStepper setIntValue:[date yearOfCommonEra]];
[prefixField setStringValue:prefix];
[suffixField setStringValue:suffix];
}
- (IBAction)stepDate:(id)sender
{
id old = date;
date = [[NSCalendarDate alloc] initWithYear:[yearStepper intValue] month:[monthStepper intValue] day:[dayStepper intValue] hour:0 minute:0 second:0 timeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[old release];
[self update];
}
- (IBAction)editDate:(id)sender
{
id old = date;
date = [[NSCalendarDate alloc] initWithYear:[yearField intValue] month:[monthField intValue] day:[dayField intValue] hour:0 minute:0 second:0 timeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[old release];
[self update];
}
@end

View File

@ -1,8 +1,18 @@
{
IBClasses = (
{
ACTIONS = {editDate = id; stepDate = id; };
CLASS = CharWindowController;
LANGUAGE = ObjC;
OUTLETS = {
dayField = NSTextField;
dayStepper = NSStepper;
monthField = NSTextField;
monthStepper = NSStepper;
timeForm = NSForm;
yearField = NSTextField;
yearStepper = NSStepper;
};
SUPERCLASS = NovaWindowController;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },

View File

@ -5,7 +5,7 @@
<key>IBDocumentLocation</key>
<string>30 118 356 240 0 0 1152 848 </string>
<key>IBFramework Version</key>
<string>248.0</string>
<string>263.2</string>
<key>IBGroupedObjects</key>
<dict>
<key>2</key>
@ -21,6 +21,6 @@
<key>IBLastGroupID</key>
<string>3</string>
<key>IBSystem Version</key>
<string>5Q110</string>
<string>5Q125</string>
</dict>
</plist>

Binary file not shown.

View File

@ -2,4 +2,16 @@
@implementation ColrWindowController
- (id)initWithResource:(id)newResource
{
self = [self initWithWindowNibName:@"colr"];
if( !self ) return nil;
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
if( [newResource name] && ![[newResource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"%@: %@", [[self window] title], [newResource name]]];
return self;
}
@end

View File

@ -2,4 +2,19 @@
@implementation CronWindowController
- (id)initWithResource:(id)newResource
{
self = [self initWithWindowNibName:@"cron"];
if( !self ) return nil;
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
if( [newResource name] && ![[newResource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"%@: %@", [[self window] title], [newResource name]]];
return self;
}
// date format for start and end:
// %e/%1m/%Y == 1/1/2000
@end

View File

@ -7,7 +7,7 @@
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {incrementDate = id; synchroniseDates = id; };
ACTIONS = {toggleResID = id; };
CLASS = NovaWindowController;
LANGUAGE = ObjC;
SUPERCLASS = NSWindowController;

Binary file not shown.

View File

@ -0,0 +1,8 @@
#import <Cocoa/Cocoa.h>
@interface DescSplitViewDelegate : NSObject
{
}
@end

View File

@ -0,0 +1,40 @@
#import "DescSplitViewDelegate.h"
@implementation DescSplitViewDelegate
/*
- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize
{
}
*/
- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedCoord ofSubviewAt:(int)offset
{
return proposedCoord < 20.0? 20.0 : proposedCoord;
}
/*
- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedCoord ofSubviewAt:(int)offset
{
}
- (void)splitViewWillResizeSubviews:(NSNotification *)notification
{
}
- (void)splitViewDidResizeSubviews:(NSNotification *)notification
{
}
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview
{
return YES;
}
- (float)splitView:(NSSplitView *)splitView constrainSplitPosition:(float)proposedPosition ofSubviewAt:(int)index
{
}
*/
@end

View File

@ -2,4 +2,16 @@
@implementation DescWindowController
- (id)initWithResource:(id)newResource
{
self = [self initWithWindowNibName:@"desc"];
if( !self ) return nil;
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
if( [newResource name] && ![[newResource name] isEqualToString:@""] )
[[self window] setTitle:[NSString stringWithFormat:@"%@: %@", [[self window] title], [newResource name]]];
return self;
}
@end

View File

@ -1,12 +1,15 @@
{
IBClasses = (
{CLASS = DescSplitViewDelegate; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = DescWindowController;
LANGUAGE = ObjC;
SUPERCLASS = NovaWindowController;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = NSObject; LANGUAGE = ObjC; },
{
ACTIONS = {toggleResID = id; };
CLASS = NovaWindowController;
LANGUAGE = ObjC;
SUPERCLASS = NSWindowController;

View File

@ -3,10 +3,10 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>58 289 356 240 0 0 1152 848 </string>
<string>75 569 356 240 0 0 1152 848 </string>
<key>IBFramework Version</key>
<string>248.0</string>
<string>263.2</string>
<key>IBSystem Version</key>
<string>5Q110</string>
<string>5Q125</string>
</dict>
</plist>

Binary file not shown.

View File

@ -1,20 +1,16 @@
// !$*UTF8*$!
{
F51C71F50269B2C501A8010C = {
fileReference = F5B588320156D40B01000001;
F51C71FA0269F15501A8010C = {
fileReference = F5EF83A8020C08E601A80001;
isa = PBXFileBreakpoint;
lineNumber = 120;
lineNumber = 136;
state = 1;
};
F5354437022674B401A80001 = {
activeExec = 0;
customExecs = {
};
};
F57CEE0E0189C95101A8010B = {
activeExec = 0;
customExecs = {
};
};
F5ACB4180221B22401A80001 = {
isa = PBXSymbolicBreakpoint;
@ -23,112 +19,33 @@
};
F5B5880F0156D2A601000001 = {
activeBuildStyle = F5EBF6B801573EC201000001;
activeExecutable = F5B588190156D30301000001;
activeTarget = F5B588130156D30301000001;
addToTargets = (
F5DF1C090254C6BA01A80001,
);
breakpoints = (
F5ACB4180221B22401A80001,
F51C71F50269B2C501A8010C,
F51C71FA0269F15501A8010C,
);
executables = (
F5B588190156D30301000001,
F5B5887B0156D5CB01000001,
);
perUserDictionary = {
PBXWorkspaceConfiguration = {
ContentSize = "{996, 578}";
LeftSlideOut = {
ActiveTab = 0;
Frame = "{{0, 23}, {996, 555}}";
Split0 = {
ActiveTab = 1;
Frame = "{{325, 0}, {671, 555}}";
Split0 = {
Frame = "{{0, 110}, {671, 445}}";
};
SplitCount = 1;
Tab0 = {
Debugger = {
ActiveTab = 0;
Frame = "{{0, 0}, {671, 289}}";
Split0 = {
Frame = "{{0, 131}, {671, 158}}";
Split0 = {
Frame = "{{0, 0}, {311, 158}}";
};
Split1 = {
Frame = "{{320, 0}, {351, 158}}";
};
SplitCount = 2;
};
SplitCount = 1;
Tab0 = {
Frame = "{{0, 0}, {671, 107}}";
};
Tab1 = {
Frame = "{{0, 0}, {745, 146}}";
};
TabCount = 2;
};
Frame = "{{0, 0}, {671, 289}}";
LauncherConfigVersion = 4;
};
Tab1 = {
Frame = "{{0, 0}, {671, 86}}";
LauncherConfigVersion = 3;
Runner = {
Frame = "{{0, 0}, {671, 86}}";
};
};
Tab2 = {
BuildMessageFrame = "{{0, 0}, {673, 134}}";
BuildTranscriptFrame = "{{0, 143}, {673, 85}}";
Frame = "{{0, 0}, {671, 226}}";
};
Tab3 = {
Frame = "{{0, 0}, {805, 281}}";
};
TabCount = 4;
};
SplitCount = 1;
Tab0 = {
Frame = "{{0, 0}, {301, 555}}";
};
Tab1 = {
ClassesFrame = "{{0, 0}, {211, 350}}";
Frame = "{{0, 0}, {209, 580}}";
MembersFrame = "{{0, 359}, {211, 221}}";
OptionsSetName = "Hierarchy, all classes";
};
Tab2 = {
Frame = "{{0, 0}, {200, 580}}";
};
Tab3 = {
Frame = "{{0, 0}, {200, 770}}";
Split0 = {
Frame = "{{0, 0}, {200, 374}}";
};
Split1 = {
Frame = "{{0, 383}, {200, 387}}";
};
SplitCount = 2;
};
Tab4 = {
Frame = "{{0, 0}, {250, 806}}";
};
TabCount = 5;
};
};
PBXPerProjectTemplateStateSaveDate = 41601555;
PBXWorkspaceStateSaveDate = 41601555;
};
projectwideBuildSettings = {
};
wantsIndex = 1;
wantsSCM = 1;
};
F5B588130156D30301000001 = {
activeExec = 0;
customExecs = {
};
targetExecs = {
macosx = (
F5B588190156D30301000001,
);
};
executables = (
F5B588190156D30301000001,
);
};
F5B588190156D30301000001 = {
activeArgIndex = 2147483647;
@ -140,6 +57,7 @@
environmentEntries = (
);
isa = PBXExecutable;
name = "ResKnife Cocoa";
shlibInfoDictList = (
);
sourceDirectories = (
@ -147,13 +65,9 @@
};
F5B588750156D5CB01000001 = {
activeExec = 0;
customExecs = {
};
targetExecs = {
macosx = (
F5B5887B0156D5CB01000001,
);
};
executables = (
F5B5887B0156D5CB01000001,
);
};
F5B5887B0156D5CB01000001 = {
activeArgIndex = 2147483647;
@ -165,6 +79,7 @@
environmentEntries = (
);
isa = PBXExecutable;
name = "ResKnife Carbon";
shlibInfoDictList = (
);
sourceDirectories = (
@ -172,22 +87,14 @@
};
F5B588D20156D78201000001 = {
activeExec = 0;
customExecs = {
};
};
F5B588EE0156DAF301000001 = {
activeExec = 0;
customExecs = {
};
};
F5B5890B0156DC2201000001 = {
activeExec = 0;
customExecs = {
};
};
F5DF1C090254C6BA01A80001 = {
activeExec = 0;
customExecs = {
};
};
}

View File

@ -3,8 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 34;
objectVersion = 38;
objects = {
F51C71F60269C7E701A8010C = {
fileRef = F54E622B021D192201A80001;
isa = PBXBuildFile;
settings = {
};
};
F51FB38E0256057F01A80001 = {
children = (
F58F6BA9025BDBA701A8010C,
@ -13,7 +19,6 @@
F5EDC618025BFB8601A8010C,
F5EDC61B025BFB8E01A8010C,
F5EDC61E025BFBB501A8010C,
F55F7F8B025BF4BA01A8010C,
);
isa = PBXGroup;
name = Resources;
@ -115,7 +120,6 @@
F535444F0226B5F501A80001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5354439022674B401A80001 = {
buildActionMask = 2147483647;
@ -124,7 +128,6 @@
F5D0CBD402278F8B01A80001,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F535443A022674B401A80001 = {
buildActionMask = 2147483647;
@ -133,7 +136,6 @@
F53544500226B5F501A80001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F535443B022674B401A80001 = {
buildActionMask = 2147483647;
@ -141,14 +143,12 @@
F53544460226907801A80001,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F535443C022674B401A80001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F535443D0226752901A80001 = {
isa = PBXFileReference;
@ -245,6 +245,39 @@
settings = {
};
};
F543B8790274842E01A8010C = {
isa = PBXFileReference;
name = ShipDataSource.m;
path = NovaTools/ship/ShipDataSource.m;
refType = 2;
};
F543B87A0274842E01A8010C = {
isa = PBXFileReference;
name = ShipDataSource.h;
path = NovaTools/ship/ShipDataSource.h;
refType = 2;
};
F543B87B0274842E01A8010C = {
fileRef = F543B8790274842E01A8010C;
isa = PBXBuildFile;
settings = {
};
};
F543B87C0274842E01A8010C = {
fileRef = F543B87A0274842E01A8010C;
isa = PBXBuildFile;
settings = {
};
};
F543B87D0274845501A8010C = {
children = (
F543B87A0274842E01A8010C,
F543B8790274842E01A8010C,
);
isa = PBXGroup;
name = "Data Sources";
refType = 4;
};
F54E6220021B6A0801A80001 = {
isa = PBXFileReference;
path = FindSheetController.h;
@ -329,28 +362,6 @@
path = Categories;
refType = 4;
};
F55F7F8B025BF4BA01A8010C = {
children = (
F55F7F8C025BF4BA01A8010C,
);
isa = PBXVariantGroup;
name = "Resource Types.strings";
path = "";
refType = 4;
};
F55F7F8C025BF4BA01A8010C = {
fileEncoding = 10;
isa = PBXFileReference;
name = English;
path = "English.lproj/Resource Types.strings";
refType = 4;
};
F55F7F8D025BF4BA01A8010C = {
fileRef = F55F7F8B025BF4BA01A8010C;
isa = PBXBuildFile;
settings = {
};
};
F5730B930159528A01000001 = {
isa = PBXFileReference;
path = defaults.plist;
@ -466,7 +477,6 @@
F58F6BB0025BE22201A8010C,
);
isa = PBXCopyFilesBuildPhase;
name = "Copy Files";
};
F57CEE0B0189C95101A8010B = {
children = (
@ -553,7 +563,6 @@
F54E6224021B6A0901A80001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F57CEE100189C95101A8010B = {
buildActionMask = 2147483647;
@ -563,7 +572,6 @@
F54E6225021B6A0901A80001,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F57CEE110189C95101A8010B = {
buildActionMask = 2147483647;
@ -574,7 +582,6 @@
F54E6226021B6A0901A80001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F57CEE120189C95101A8010B = {
buildActionMask = 2147483647;
@ -582,14 +589,45 @@
F5502C3301C5586301C57124,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F57CEE130189C95101A8010B = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F58A183F0278353501A8010C = {
children = (
F58A18410278355D01A8010C,
F58A18400278355D01A8010C,
);
isa = PBXGroup;
name = "Aux Support";
refType = 4;
};
F58A18400278355D01A8010C = {
isa = PBXFileReference;
name = DescSplitViewDelegate.m;
path = desc/DescSplitViewDelegate.m;
refType = 4;
};
F58A18410278355D01A8010C = {
isa = PBXFileReference;
name = DescSplitViewDelegate.h;
path = desc/DescSplitViewDelegate.h;
refType = 4;
};
F58A18420278355D01A8010C = {
fileRef = F58A18400278355D01A8010C;
isa = PBXBuildFile;
settings = {
};
};
F58A18430278355D01A8010C = {
fileRef = F58A18410278355D01A8010C;
isa = PBXBuildFile;
settings = {
};
};
F58F6B7E025BC3A501A8010C = {
isa = PBXFileReference;
@ -976,7 +1014,6 @@
F5DF1BFD0254AD8801A80001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5B588150156D30301000001 = {
buildActionMask = 2147483647;
@ -998,9 +1035,9 @@
F577A8FF0211E4D401A80001,
F577A8F50211D05E01A80001,
F577A8F90211DC1E01A80001,
F51C71F60269C7E701A8010C,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5B588160156D30301000001 = {
buildActionMask = 2147483647;
@ -1022,7 +1059,6 @@
F5DF1C070254AD8801A80001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5B588170156D30301000001 = {
buildActionMask = 2147483647;
@ -1031,14 +1067,12 @@
F5B588730156D40B01000001,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5B588180156D30301000001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5B5881A0156D40B01000001 = {
children = (
@ -1590,7 +1624,7 @@
F5B5887A0156D5CB01000001,
);
buildSettings = {
LIBRARY_SEARCH_PATHS = /Volumes/DeskStar/nicholas/Projects/ResKnife/Carbon;
LIBRARY_SEARCH_PATHS = Carbon;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
@ -1696,7 +1730,6 @@
F5B588B90156D6D901000001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5B588770156D5CB01000001 = {
buildActionMask = 2147483647;
@ -1704,7 +1737,6 @@
F5B588BC0156D6D901000001,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5B588780156D5CB01000001 = {
buildActionMask = 2147483647;
@ -1726,7 +1758,6 @@
F5B588CB0156D6D901000001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5B588790156D5CB01000001 = {
buildActionMask = 2147483647;
@ -1734,7 +1765,6 @@
F53B5F3201C984F301A8010C,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5B5887A0156D5CB01000001 = {
buildActionMask = 2147483647;
@ -1743,7 +1773,6 @@
F5B588D00156D6D901000001,
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5B5887C0156D6D901000001 = {
children = (
@ -2298,14 +2327,12 @@
F535442F0225D46C01A80001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5B588D40156D78201000001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5B588D50156D78201000001 = {
buildActionMask = 2147483647;
@ -2316,7 +2343,6 @@
F5B588EB0156D9D401000001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5B588D60156D78201000001 = {
buildActionMask = 2147483647;
@ -2324,14 +2350,12 @@
F5B588EC0156DA1601000001,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5B588D70156D78201000001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5B588D80156D9D401000001 = {
children = (
@ -2531,14 +2555,12 @@
F53544320226550001A80001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5B588F00156DAF301000001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5B588F10156DAF301000001 = {
buildActionMask = 2147483647;
@ -2547,7 +2569,6 @@
F5B589080156DC2201000001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5B588F20156DAF301000001 = {
buildActionMask = 2147483647;
@ -2555,7 +2576,6 @@
F5B589090156DC2201000001,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5B588F30156DAF301000001 = {
buildActionMask = 2147483647;
@ -2563,7 +2583,6 @@
F5B5890A0156DC2201000001,
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5B588F40156DC2201000001 = {
children = (
@ -2771,7 +2790,6 @@
F5B5890F0156DC2201000001,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5B5890D0156DC2201000001 = {
fileRef = F5B588FF0156DC2201000001;
@ -2796,7 +2814,6 @@
files = (
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5B589110156DC2201000001 = {
buildActionMask = 2147483647;
@ -2805,7 +2822,6 @@
F5B589130156DC2201000001,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5B589120156DC2201000001 = {
fileRef = F5B589000156DC2201000001;
@ -2825,7 +2841,6 @@
F5B589150156DC2201000001,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5B589150156DC2201000001 = {
fileRef = F5B5884A0156D40B01000001;
@ -2838,7 +2853,6 @@
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5CDEBAB01FC893201A80001 = {
isa = PBXFileReference;
@ -3137,15 +3151,15 @@
F58F6B94025BD97701A8010C,
F58F6BAC025BE14801A8010C,
F58F6BAD025BE14801A8010C,
F543B87C0274842E01A8010C,
F58A18430278355D01A8010C,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F5DF1C0B0254C6BA01A80001 = {
buildActionMask = 2147483647;
files = (
F58F6BAB025BDBA801A8010C,
F55F7F8D025BF4BA01A8010C,
F5EDC614025BFB7301A8010C,
F5EDC617025BFB7C01A8010C,
F5EDC61A025BFB8601A8010C,
@ -3153,7 +3167,6 @@
F5EDC620025BFBB501A8010C,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F5DF1C0C0254C6BA01A80001 = {
buildActionMask = 2147483647;
@ -3164,9 +3177,10 @@
F58F6B8D025BC7C001A8010C,
F58F6B91025BCF5901A8010C,
F58F6B95025BD97801A8010C,
F543B87B0274842E01A8010C,
F58A18420278355D01A8010C,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F5DF1C0D0254C6BA01A80001 = {
buildActionMask = 2147483647;
@ -3174,14 +3188,12 @@
F58F6BAE025BE1E001A8010C,
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F5DF1C0E0254C6BA01A80001 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F5DF1C0F0254C78801A80001 = {
children = (
@ -3197,6 +3209,8 @@
F58F6B8F025BCF5901A8010C,
F58F6B93025BD97701A8010C,
F58F6B92025BD97701A8010C,
F543B87D0274845501A8010C,
F58A183F0278353501A8010C,
F51FB38E0256057F01A80001,
);
isa = PBXGroup;