mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-12-30 08:30:46 +00:00
Remove abandoned template editor to make way for the new one.
This commit is contained in:
parent
7f491cbb39
commit
af1db3f963
@ -1,33 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface Element : NSObject
|
||||
{
|
||||
NSString *type;
|
||||
NSString *label;
|
||||
union // for resource arrays only, ignored for TMPL arrays
|
||||
{
|
||||
NSString *string;
|
||||
NSNumber *number;
|
||||
NSData *data;
|
||||
BOOL boolean;
|
||||
} elementData;
|
||||
}
|
||||
|
||||
- (id)initWithType:(NSString *)typeValue andLabel:(NSString *)labelValue;
|
||||
+ (id)elementOfType:(NSString *)typeValue withLabel:(NSString *)labelValue;
|
||||
|
||||
- (NSString *)label;
|
||||
- (NSString *)type;
|
||||
- (unsigned long)typeAsLong;
|
||||
- (NSString *)string;
|
||||
- (void)setString:(NSString *)string;
|
||||
- (NSNumber *)number;
|
||||
- (void)setNumber:(NSNumber *)number;
|
||||
- (long)numberAsLong;
|
||||
- (void)setNumberWithLong:(long)number;
|
||||
- (NSData *)data;
|
||||
- (void)setData:(NSData *)data;
|
||||
- (BOOL)boolean;
|
||||
- (void)setBoolean:(BOOL)boolean;
|
||||
|
||||
@end
|
@ -1,113 +0,0 @@
|
||||
#import "Element.h"
|
||||
|
||||
@implementation Element
|
||||
|
||||
- (id)initWithType:(NSString *)typeValue andLabel:(NSString *)labelValue
|
||||
{
|
||||
// sets values directly for speed reasons (less messaging overhead)
|
||||
self = [super init];
|
||||
type = [typeValue copy];
|
||||
label = [labelValue copy];
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (id)elementOfType:(NSString *)typeValue withLabel:(NSString *)labelValue
|
||||
{
|
||||
Element *element = [[Element allocWithZone:[self zone]] initWithType:typeValue andLabel:labelValue];
|
||||
return [element autorelease];
|
||||
}
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
Element *element = [[Element alloc] initWithType:type andLabel:label];
|
||||
// bug: copy other stuff here
|
||||
return element;
|
||||
}
|
||||
|
||||
/* ACCESSORS */
|
||||
|
||||
- (NSString *)label
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
- (NSString *)type
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
- (unsigned long)typeAsLong
|
||||
{
|
||||
return *(unsigned long *)[type cString];
|
||||
}
|
||||
/*
|
||||
- (NSMutableArray *)subelements;
|
||||
{
|
||||
long myType = [self typeAsLong];
|
||||
if( myType == 'LSTB' || myType == 'LSTC' )
|
||||
{
|
||||
if( subelements == nil )
|
||||
subelements = [[NSMutableArray alloc] init];
|
||||
}
|
||||
else subelements = nil;
|
||||
return subelements;
|
||||
}
|
||||
*/
|
||||
/* DATA ACCESSORS */
|
||||
|
||||
- (NSString *)string
|
||||
{
|
||||
return elementData.string;
|
||||
}
|
||||
|
||||
- (void)setString:(NSString *)string
|
||||
{
|
||||
elementData.string = [string retain];
|
||||
}
|
||||
|
||||
- (NSNumber *)number
|
||||
{
|
||||
return elementData.number;
|
||||
}
|
||||
|
||||
- (void)setNumber:(NSNumber *)number
|
||||
{
|
||||
elementData.number = [number retain];
|
||||
}
|
||||
|
||||
- (long)numberAsLong
|
||||
{
|
||||
return [elementData.number longValue];
|
||||
}
|
||||
|
||||
- (void)setNumberWithLong:(long)number
|
||||
{
|
||||
elementData.number = [[NSNumber numberWithLong:number] retain];
|
||||
}
|
||||
|
||||
- (NSData *)data
|
||||
{
|
||||
return elementData.data;
|
||||
}
|
||||
|
||||
- (void)setData:(NSData *)data
|
||||
{
|
||||
elementData.data = [data retain];
|
||||
}
|
||||
|
||||
- (BOOL)boolean
|
||||
{
|
||||
return elementData.boolean;
|
||||
}
|
||||
|
||||
- (void)setBoolean:(BOOL)boolean
|
||||
{
|
||||
elementData.boolean = boolean;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"{ %@, %@ }", type, label];
|
||||
}
|
||||
|
||||
@end
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
CLASS = TemplateWindowController;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {containerView = NSView; };
|
||||
SUPERCLASS = NSWindowController;
|
||||
}
|
||||
);
|
||||
IBVersion = 1;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>276 97 356 240 0 0 1024 746 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>22</key>
|
||||
<string>114 377 480 236 0 0 1024 746 </string>
|
||||
<key>45</key>
|
||||
<string>163 366 480 162 0 0 1024 746 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>283.0</string>
|
||||
<key>IBLockedObjects</key>
|
||||
<array>
|
||||
<integer>20</integer>
|
||||
<integer>19</integer>
|
||||
</array>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<<<<<<< info.nib
|
||||
<string>6F21</string>
|
||||
=======
|
||||
<string>6G30</string>
|
||||
>>>>>>> 1.2
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
@ -1,34 +0,0 @@
|
||||
<?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>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Template Editor</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>© Nicholas Shanks 2002</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.nickshanks.resknife.template</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>ResKnife Template Editor</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>ResK</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.0.1d1</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>TemplateWindow</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>TemplateWindowController</string>
|
||||
<key>RKEditedType</key>
|
||||
<string>Template Editor</string>
|
||||
</dict>
|
||||
</plist>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>SupportedTypes</key>
|
||||
<array>
|
||||
<string>all</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@ -1,27 +0,0 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "ResKnifePluginProtocol.h"
|
||||
#import "ResKnifeResourceProtocol.h"
|
||||
|
||||
@interface TemplateWindowController : NSWindowController <ResKnifePluginProtocol, ResKnifeTemplatePluginProtocol>
|
||||
{
|
||||
IBOutlet NSView *containerView;
|
||||
|
||||
NSMutableArray *tmpl;
|
||||
NSMutableArray *res;
|
||||
id <ResKnifeResourceProtocol> resource;
|
||||
}
|
||||
|
||||
// normal methods
|
||||
- (void)readTemplate:(id <ResKnifeResourceProtocol>)tmpl;
|
||||
- (void)parseData;
|
||||
- (void)createUI;
|
||||
- (void)enumerateElements:(NSMutableArray *)elements;
|
||||
- (void)resourceDataDidChange:(NSNotification *)notification;
|
||||
- (void)refreshData:(NSData *)data;
|
||||
|
||||
// accessors
|
||||
- (id)resource;
|
||||
- (NSData *)data;
|
||||
|
||||
@end
|
@ -1,365 +0,0 @@
|
||||
#import "TemplateWindowController.h"
|
||||
#import "Element.h"
|
||||
#import <stdarg.h>
|
||||
|
||||
@implementation TemplateWindowController
|
||||
|
||||
- (id)initWithResource:(id)newResource
|
||||
{
|
||||
return [self initWithResources:newResource, nil];
|
||||
}
|
||||
|
||||
- (id)initWithResources:(id)newResource, ...
|
||||
{
|
||||
id currentResource;
|
||||
va_list resourceList;
|
||||
va_start( resourceList, newResource );
|
||||
|
||||
// one instance of your principal class will be created for every resource set the user wants to edit (similar to Windows apps)
|
||||
self = [self initWithWindowNibName:@"TemplateWindow"];
|
||||
if( !self )
|
||||
{
|
||||
va_end( resourceList );
|
||||
return self;
|
||||
}
|
||||
|
||||
resource = [newResource retain];
|
||||
tmpl = [[NSMutableArray alloc] init];
|
||||
res = [[NSMutableArray alloc] init];
|
||||
|
||||
[self readTemplate:va_arg( resourceList, id )]; // reads (but doesn't retain) the template for this resource (TMPL resource with name equal to the passed resource's type)
|
||||
while( currentResource = va_arg( resourceList, id ) )
|
||||
NSLog( @"too many params passed to -initWithResources: %@", [currentResource description] );
|
||||
va_end( resourceList );
|
||||
|
||||
// load the window from the nib
|
||||
[self window];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[(id)resource autorelease];
|
||||
[tmpl autorelease];
|
||||
[res autorelease];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
[super windowDidLoad];
|
||||
|
||||
// set the window's title
|
||||
if( ![[resource name] isEqualToString:@""] )
|
||||
[[self window] setTitle:[resource name]];
|
||||
|
||||
// parse data using pre-scanned template and create the fields as needed
|
||||
[self readData];
|
||||
[self createUI];
|
||||
|
||||
// insert the resources' data into the text fields
|
||||
[self refreshData:[resource data]];
|
||||
|
||||
// we don't want this notification until we have a window! (Only register for notifications on the resource we're editing)
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resourceDataDidChange:) name:ResourceDataDidChangeNotification object:resource];
|
||||
|
||||
// finally, show the window
|
||||
[self showWindow:self];
|
||||
}
|
||||
|
||||
- (void)readTemplate:(id <ResKnifeResourceProtocol>)tmplResource
|
||||
{
|
||||
if( !tmplResource ) NSLog( @"resource template was invalid" );
|
||||
else
|
||||
{
|
||||
NSString *label, *type;
|
||||
char *currentByte = (char *) [[tmplResource data] bytes];
|
||||
unsigned long size = [[tmplResource data] length], position = 0;
|
||||
while( position < size )
|
||||
{
|
||||
// save where pointer will be AFTER having loaded this element
|
||||
position += *currentByte +5;
|
||||
|
||||
// obtain label and type
|
||||
label = [NSString stringWithCString:currentByte +1 length:*currentByte];
|
||||
currentByte += *currentByte +1;
|
||||
type = [NSString stringWithCString:currentByte length:4];
|
||||
currentByte += 4;
|
||||
|
||||
// add element to array
|
||||
[tmpl addObject:[Element elementOfType:type withLabel:label]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)readData
|
||||
{
|
||||
// tmpl == array of Elements describing the template for this resource
|
||||
// res == array of either Elements or Arrays containing the resource data
|
||||
|
||||
// this function creates the res instance variable, filling it with data from the resource if there's data available.
|
||||
|
||||
unsigned long position = 0; // position (byte offset) in resource I'm currently reading from
|
||||
char *data = (char *) [[resource data] bytes]; // address of initial byte of resource in memory
|
||||
|
||||
unsigned long templateCounter = 0; // index into template array of the current template element
|
||||
Element *currentTemplateElement; // current template element
|
||||
NSMutableArray *targetStack = [NSMutableArray arrayWithObject:res]; // stack of arrays (target for addition of new elements)
|
||||
NSMutableArray *loopStack = [NSMutableArray array]; // stack for 'LSTB' and 'LSTC' elements
|
||||
NSMutableArray *loopCountStack = [NSMutableArray array]; // stack for counting how many times to loop
|
||||
|
||||
// when templateCounter >= [tmpl count], loop is only exited if targetStack has more than one target (this handles empty templates)
|
||||
while( templateCounter < [tmpl count] || [targetStack count] > 1 )
|
||||
{
|
||||
currentTemplateElement = [tmpl objectAtIndex:templateCounter];
|
||||
NSLog( @"template = %@", currentTemplateElement );
|
||||
/* unsigned long type = [currentTemplateElement typeAsLong];
|
||||
switch( type )
|
||||
{
|
||||
case 'BCNT':
|
||||
case 'BZCT':
|
||||
[resourceElement setNumberWithLong:*(unsigned char *)(data + position)];
|
||||
lim = *(unsigned char *)(data + position) + (type == 'BZCT'? 1:0);
|
||||
position += 1;
|
||||
break;
|
||||
case 'OCNT':
|
||||
case 'ZCNT':
|
||||
[resourceElement setNumberWithLong:*(unsigned short *)(data + position)];
|
||||
lim = *(unsigned short *)(data + position) + (type == 'ZCNT'? 1:0);
|
||||
position += 2;
|
||||
break;
|
||||
case 'LCNT':
|
||||
case 'LZCT':
|
||||
[resourceElement setNumberWithLong:*(unsigned long *)(data + position)];
|
||||
lim = *(unsigned long *)(data + position) + (type == 'LZCT'? 1:0);
|
||||
position += 4;
|
||||
break;
|
||||
|
||||
case 'LSTB':
|
||||
case 'LSTC':
|
||||
[(NSMutableArray *)[targetStack lastObject] addObject:[NSMutableArray array]];
|
||||
[loopStack addObject:currentTemplateElement]; // append the template loop start object to the array
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
// [(NSMutableArray *)[targetStack lastObject] addItem:[self createElementForTemplate:currentTemplateElement
|
||||
}
|
||||
*/
|
||||
templateCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)parseData
|
||||
{
|
||||
unsigned long position = 0;
|
||||
char *data = (char *) [[resource data] bytes];
|
||||
|
||||
// used for nesting of elements, 'target' is current object to append to, targetStack is a FILO stack of mutable array pointers, loopStack is a stack of element indicies to the start of loops, so I can go back to the head of a loop when iterating it
|
||||
NSMutableArray *target = res;
|
||||
NSMutableArray *targetStack = [NSMutableArray arrayWithObject:res];
|
||||
NSMutableArray *loopStack = [NSMutableArray array];
|
||||
|
||||
// n = current item in TMPL to read, c = loop counter, when exiting loop, go back 'c' items in the template, lim is how many times to loop, obtained from a loop count
|
||||
unsigned long n = 0, c = 0, lim = 0;
|
||||
|
||||
// creates an array of elements containing the data in whatever format the template dictates
|
||||
// array can then simply be manipulated one element at a time, or flattened to save
|
||||
Element *currentTemplateElement, *resourceElement;
|
||||
// NSEnumerator *enumerator = [tmpl objectEnumerator];
|
||||
// while( currentTemplateElement = [enumerator nextObject] )
|
||||
while( position < [[resource size] unsignedLongValue] )
|
||||
{
|
||||
unsigned long type;
|
||||
|
||||
currentTemplateElement = [tmpl objectAtIndex:n];
|
||||
n++, c++;
|
||||
type = [currentTemplateElement typeAsLong];
|
||||
resourceElement = [[currentTemplateElement copy] autorelease];
|
||||
NSLog( @"tmpl element = %@; position = %d", currentTemplateElement, position );
|
||||
switch( type )
|
||||
{
|
||||
/* Alignment */
|
||||
case 'AWRD':
|
||||
position += position % 2;
|
||||
break;
|
||||
case 'ALNG':
|
||||
position += position % 4;
|
||||
break;
|
||||
|
||||
/* Fillers */
|
||||
case 'FBYT':
|
||||
position += 1;
|
||||
break;
|
||||
case 'FWRD':
|
||||
position += 2;
|
||||
break;
|
||||
case 'FLNG':
|
||||
position += 4;
|
||||
break;
|
||||
|
||||
/* Decimal */
|
||||
case 'DBYT':
|
||||
[resourceElement setNumberWithLong:*(char *)(data + position)];
|
||||
position += 1;
|
||||
break;
|
||||
case 'DWRD':
|
||||
[resourceElement setNumberWithLong:*(short *)(data + position)];
|
||||
position += 2;
|
||||
break;
|
||||
case 'DLNG':
|
||||
[resourceElement setNumberWithLong:*(long *)(data + position)];
|
||||
position += 4;
|
||||
break;
|
||||
|
||||
/* Hex */
|
||||
case 'HBYT':
|
||||
[resourceElement setData:[NSData dataWithBytes:(void *)(data + position) length:1]];
|
||||
position += 1;
|
||||
break;
|
||||
case 'HWRD':
|
||||
[resourceElement setData:[NSData dataWithBytes:(void *)(data + position) length:2]];
|
||||
position += 2;
|
||||
break;
|
||||
case 'HLNG':
|
||||
[resourceElement setData:[NSData dataWithBytes:(void *)(data + position) length:4]];
|
||||
position += 4;
|
||||
break;
|
||||
case 'HEXD':
|
||||
// bug: doesn't check HEXD is the last element
|
||||
[resourceElement setData:[NSData dataWithBytes:(void *)(data + position) length:([[resource size] intValue] - position)]];
|
||||
position = [[resource size] intValue];
|
||||
break;
|
||||
|
||||
/* Strings */
|
||||
case 'CHAR':
|
||||
[resourceElement setString:[[NSString alloc] initWithData:[NSData dataWithBytes:(void *)(data + position) length:1] encoding:NSMacOSRomanStringEncoding]];
|
||||
position += 1;
|
||||
break;
|
||||
case 'TNAM':
|
||||
[resourceElement setString:[[NSString alloc] initWithData:[NSData dataWithBytes:(void *)(data + position) length:4] encoding:NSMacOSRomanStringEncoding]];
|
||||
position += 4;
|
||||
break;
|
||||
case 'PSTR':
|
||||
[resourceElement setString:[[NSString alloc] initWithData:[NSData dataWithBytes:(void *)(data + position + 1) length:*(unsigned char *)(data + position)] encoding:NSMacOSRomanStringEncoding]];
|
||||
position += *(unsigned char *)(data + position) + 1;
|
||||
break;
|
||||
|
||||
/* List Counts */
|
||||
case 'BCNT':
|
||||
case 'BZCT':
|
||||
// bug: how big are these various count fields?
|
||||
[resourceElement setNumberWithLong:*(unsigned char *)(data + position)];
|
||||
lim = *(unsigned char *)(data + position) + (type == 'BZCT'? 1:0);
|
||||
position += 1;
|
||||
break;
|
||||
case 'OCNT':
|
||||
case 'ZCNT':
|
||||
// bug: how big are these various count fields?
|
||||
[resourceElement setNumberWithLong:*(unsigned short *)(data + position)];
|
||||
lim = *(unsigned short *)(data + position) + (type == 'ZCNT'? 1:0);
|
||||
position += 2;
|
||||
break;
|
||||
case 'LCNT':
|
||||
case 'LZCT':
|
||||
// bug: how big are these various count fields?
|
||||
[resourceElement setNumberWithLong:*(unsigned long *)(data + position)];
|
||||
lim = *(unsigned long *)(data + position) + (type == 'LZCT'? 1:0);
|
||||
position += 4;
|
||||
break;
|
||||
|
||||
/* List beginning and end */
|
||||
case 'LSTB':
|
||||
case 'LSTC':
|
||||
[target addObject:resourceElement]; // add list item to current target array
|
||||
// target = [resourceElement subelements]; // change current array to list's sub-elements
|
||||
[targetStack addObject:target]; // append sub-element array to target stack so it can be popped off afterwards
|
||||
resourceElement = nil; // don't add item to it's own sub-elements later!
|
||||
break;
|
||||
case 'LSTE':
|
||||
// bug: if there is a LSTE without a preceeding LSTB or LSTC this will crash
|
||||
[targetStack removeLastObject]; // pop off current target from stack
|
||||
target = [targetStack lastObject]; // set current target to whatever was second from top on the stack
|
||||
resourceElement = nil; // list end items are not needed in a resource array
|
||||
if( n < lim ) n -= c;
|
||||
c = 0;
|
||||
break;
|
||||
|
||||
/* Cxxx, Hxxx or P0xx */
|
||||
default:
|
||||
// bug: should look for Cxxx, Hxxx or P0xx and complain if it's something else (an unknown type)!!
|
||||
{/* long lengthStr = (type & 0x00FFFFFF) << 8;
|
||||
unsigned long length = strtoul( (char *) &lengthStr, nil, 10 );
|
||||
*/ char *lengthStr = (type & 0x00FFFFFF) & (3 << 24);
|
||||
unsigned long length;
|
||||
StringToNum(lengthStr, &length);
|
||||
NSLog( @"error, '%@' is unsupported, skipping %d bytes", [resourceElement type], length );
|
||||
resourceElement = nil; // relies on element being previously autoreleased to avoid a leak
|
||||
position += length;
|
||||
} break;
|
||||
} // end template element type switch
|
||||
|
||||
if( resourceElement )
|
||||
{
|
||||
NSLog( @"adding %@", resourceElement );
|
||||
[target addObject:resourceElement];
|
||||
}
|
||||
} // end while position < size
|
||||
|
||||
NSLog( [target description] );
|
||||
}
|
||||
|
||||
- (void)createUI
|
||||
{
|
||||
// iterate through res (the resource element array) creating fields
|
||||
[self enumerateElements:res];
|
||||
}
|
||||
|
||||
- (void)enumerateElements:(NSMutableArray *)elements
|
||||
{
|
||||
// iterate through the array of resource elements, creating fields
|
||||
Element *currentResourceElement;
|
||||
NSEnumerator *enumerator = [elements objectEnumerator];
|
||||
NSLog( @"elements in resource array = %d", [elements count] );
|
||||
while( currentResourceElement = [enumerator nextObject] )
|
||||
{
|
||||
// if element is a container (subelements != nil), iterate inside it first
|
||||
/* if( [currentResourceElement subelements] )
|
||||
{
|
||||
// bug: need to indent view right
|
||||
[self enumerateElements:[currentResourceElement subelements]];
|
||||
// bug: need to remove indentation
|
||||
}
|
||||
else // element is normal
|
||||
*/ {
|
||||
/* NSFormCell *newField = [[NSFormCell alloc] initTextCell:[currentResourceElement label]];
|
||||
[fieldsMatrix addRowWithCells:[NSArray arrayWithObject:[newField autorelease]]]; */
|
||||
NSLog( [currentResourceElement description] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resourceDataDidChange:(NSNotification *)notification
|
||||
{
|
||||
// ensure it's our resource which got changed (should always be true, we don't register for notifications on other resource objects)
|
||||
if( [notification object] == (id)resource )
|
||||
[self refreshData:[resource data]];
|
||||
}
|
||||
|
||||
- (void)refreshData:(NSData *)data;
|
||||
{
|
||||
// put data from resource into correct fields
|
||||
}
|
||||
|
||||
- (id)resource
|
||||
{
|
||||
return resource;
|
||||
}
|
||||
|
||||
- (NSData *)data
|
||||
{
|
||||
return [resource data];
|
||||
}
|
||||
|
||||
@end
|
@ -94,13 +94,6 @@
|
||||
E1B2A44E0E41103800A72928 /* FindSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E6221021B6A0801A80001 /* FindSheetController.m */; };
|
||||
E1B2A44F0E41103800A72928 /* Notifications.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C9ECCE027F474A01A8010C /* Notifications.m */; };
|
||||
E1B2A4510E41103800A72928 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B5884B0156D40B01000001 /* Cocoa.framework */; };
|
||||
E1B2A45A0E41103800A72928 /* TemplateWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = F535443E0226752901A80001 /* TemplateWindowController.h */; };
|
||||
E1B2A45B0E41103800A72928 /* Element.h in Headers */ = {isa = PBXBuildFile; fileRef = F535444D0226B5F501A80001 /* Element.h */; };
|
||||
E1B2A45D0E41103800A72928 /* TemplateWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5D0CBD302278F8B01A80001 /* TemplateWindow.nib */; };
|
||||
E1B2A45F0E41103800A72928 /* TemplateWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = F535443F0226752901A80001 /* TemplateWindowController.m */; };
|
||||
E1B2A4600E41103800A72928 /* Element.m in Sources */ = {isa = PBXBuildFile; fileRef = F535444E0226B5F501A80001 /* Element.m */; };
|
||||
E1B2A4610E41103800A72928 /* Notifications.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C9ECCE027F474A01A8010C /* Notifications.m */; };
|
||||
E1B2A4630E41103800A72928 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B5884B0156D40B01000001 /* Cocoa.framework */; };
|
||||
E1B2A47A0E41103800A72928 /* NovaTools.nib in Resources */ = {isa = PBXBuildFile; fileRef = F58F6BA9025BDBA701A8010C /* NovaTools.nib */; };
|
||||
E1B2A47B0E41103800A72928 /* boom.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5EDC612025BFB7301A8010C /* boom.nib */; };
|
||||
E1B2A47C0E41103800A72928 /* char.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5EDC615025BFB7C01A8010C /* char.nib */; };
|
||||
@ -411,8 +404,6 @@
|
||||
E1B2A43C0E41103800A72928 /* ResKnife Cocoa.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ResKnife Cocoa.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E1B2A4560E41103800A72928 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
E1B2A4570E41103800A72928 /* Hexadecimal Editor.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Hexadecimal Editor.plugin"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E1B2A4680E41103800A72928 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
E1B2A4690E41103800A72928 /* Template Editor.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Template Editor.plugin"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E1B2A4930E41103800A72928 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
E1B2A4940E41103800A72928 /* NovaTools.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NovaTools.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E1B2A4C30E41103800A72928 /* Info-ResKnife_Carbon__Upgraded_.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-ResKnife_Carbon__Upgraded_.plist"; sourceTree = "<group>"; };
|
||||
@ -464,11 +455,6 @@
|
||||
F50DFE6C036C258301A8010A /* Templar.rsrc */ = {isa = PBXFileReference; lastKnownFileType = archive.rsrc; path = Templar.rsrc; sourceTree = "<group>"; };
|
||||
F50DFE6D036C258301A8010A /* TemplateWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TemplateWindow.cpp; sourceTree = "<group>"; };
|
||||
F50DFE6E036C258301A8010A /* TemplateWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TemplateWindow.h; sourceTree = "<group>"; };
|
||||
F535443E0226752901A80001 /* TemplateWindowController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TemplateWindowController.h; sourceTree = "<group>"; };
|
||||
F535443F0226752901A80001 /* TemplateWindowController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = TemplateWindowController.m; sourceTree = "<group>"; };
|
||||
F53544430226778D01A80001 /* TemplateWindow.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = TemplateWindow.nib; path = English.lproj/TemplateWindow.nib; sourceTree = "<group>"; };
|
||||
F535444D0226B5F501A80001 /* Element.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Element.h; sourceTree = "<group>"; };
|
||||
F535444E0226B5F501A80001 /* Element.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Element.m; sourceTree = "<group>"; };
|
||||
F543AFDB027B2A5001A8010C /* DataSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataSource.h; sourceTree = "<group>"; };
|
||||
F543AFDC027B2A5001A8010C /* DataSource.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DataSource.m; sourceTree = "<group>"; };
|
||||
F543AFF0027C716E01A8010C /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = "English.lproj/Resource Types.strings"; sourceTree = "<group>"; };
|
||||
@ -665,14 +651,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4620E41103800A72928 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E1B2A4630E41103800A72928 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A48C0E41103800A72928 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -894,20 +872,6 @@
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F5354435022673C101A80001 /* Template Editor (Abandoned) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F535443E0226752901A80001 /* TemplateWindowController.h */,
|
||||
F535443F0226752901A80001 /* TemplateWindowController.m */,
|
||||
F535444D0226B5F501A80001 /* Element.h */,
|
||||
F535444E0226B5F501A80001 /* Element.m */,
|
||||
E1B2A4680E41103800A72928 /* Info.plist */,
|
||||
F5D0CBD302278F8B01A80001 /* TemplateWindow.nib */,
|
||||
);
|
||||
name = "Template Editor (Abandoned)";
|
||||
path = "Template Editor";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F5594EE9021F3E2301A80001 /* Categories */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -934,7 +898,6 @@
|
||||
3D3B99B704DC167D0056861E /* Bitmap Editor */,
|
||||
E1B2A7340E41218F00A72928 /* Font Editor */,
|
||||
F5DF1C0F0254C78801A80001 /* NovaTools */,
|
||||
F5354435022673C101A80001 /* Template Editor (Abandoned) */,
|
||||
);
|
||||
path = "Plug-Ins";
|
||||
sourceTree = "<group>";
|
||||
@ -973,7 +936,6 @@
|
||||
children = (
|
||||
E1B2A43C0E41103800A72928 /* ResKnife Cocoa.app */,
|
||||
E1B2A4570E41103800A72928 /* Hexadecimal Editor.plugin */,
|
||||
E1B2A4690E41103800A72928 /* Template Editor.plugin */,
|
||||
E1B2A4940E41103800A72928 /* NovaTools.plugin */,
|
||||
E1B2A4C40E41103900A72928 /* ResKnife Carbon.app */,
|
||||
E1B2A4F00E41103900A72928 /* libResKnife.dylib.a */,
|
||||
@ -1343,15 +1305,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4590E41103800A72928 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E1B2A45A0E41103800A72928 /* TemplateWindowController.h in Headers */,
|
||||
E1B2A45B0E41103800A72928 /* Element.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4960E41103800A72928 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -1497,26 +1450,6 @@
|
||||
productReference = E1B2A4570E41103800A72928 /* Hexadecimal Editor.plugin */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
E1B2A4580E41103800A72928 /* Nick's Template Editor (Abandoned) */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E1B2A4650E41103800A72928 /* Build configuration list for PBXNativeTarget "Nick's Template Editor (Abandoned)" */;
|
||||
buildPhases = (
|
||||
E1B2A4590E41103800A72928 /* Headers */,
|
||||
E1B2A45C0E41103800A72928 /* Resources */,
|
||||
E1B2A45E0E41103800A72928 /* Sources */,
|
||||
E1B2A4620E41103800A72928 /* Frameworks */,
|
||||
E1B2A4640E41103800A72928 /* Rez */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Nick's Template Editor (Abandoned)";
|
||||
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
|
||||
productName = "Template Editor Cocoa";
|
||||
productReference = E1B2A4690E41103800A72928 /* Template Editor.plugin */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
E1B2A46A0E41103800A72928 /* NovaTools */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E1B2A4900E41103800A72928 /* Build configuration list for PBXNativeTarget "NovaTools" */;
|
||||
@ -1735,7 +1668,6 @@
|
||||
E1B2A5080E41103900A72928 /* Template Editor Carbon */,
|
||||
E1B2A5190E41103900A72928 /* PICT Editor */,
|
||||
E1B2A52A0E41103900A72928 /* Uli's Template Editor (Abandoned) */,
|
||||
E1B2A4580E41103800A72928 /* Nick's Template Editor (Abandoned) */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@ -1779,14 +1711,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A45C0E41103800A72928 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E1B2A45D0E41103800A72928 /* TemplateWindow.nib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4790E41103800A72928 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -1883,13 +1807,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4640E41103800A72928 /* Rez */ = {
|
||||
isa = PBXRezBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4BD0E41103800A72928 /* Rez */ = {
|
||||
isa = PBXRezBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -1984,16 +1901,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A45E0E41103800A72928 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E1B2A45F0E41103800A72928 /* TemplateWindowController.m in Sources */,
|
||||
E1B2A4600E41103800A72928 /* Element.m in Sources */,
|
||||
E1B2A4610E41103800A72928 /* Notifications.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E1B2A4810E41103800A72928 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -2328,14 +2235,6 @@
|
||||
path = Cocoa;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
F5D0CBD302278F8B01A80001 /* TemplateWindow.nib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F53544430226778D01A80001 /* TemplateWindow.nib */,
|
||||
);
|
||||
name = TemplateWindow.nib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F5EDC612025BFB7301A8010C /* boom.nib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
@ -2499,58 +2398,6 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E1B2A4660E41103800A72928 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREFIX_HEADER = "Prefix Files/C99 Prefix.h";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = "Cocoa/Plug-Ins/Template Editor/Info.plist";
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_REZFLAGS = "";
|
||||
PRODUCT_NAME = "Template Editor";
|
||||
SECTORDER_FLAGS = "";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
WRAPPER_EXTENSION = plugin;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E1B2A4670E41103800A72928 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_PREFIX_HEADER = "Prefix Files/C99 Prefix.h";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = "Cocoa/Plug-Ins/Template Editor/Info.plist";
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_REZFLAGS = "";
|
||||
PRODUCT_NAME = "Template Editor";
|
||||
SECTORDER_FLAGS = "";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wmost",
|
||||
"-Wno-four-char-constants",
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
WRAPPER_EXTENSION = plugin;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E1B2A4910E41103800A72928 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@ -3090,15 +2937,6 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
E1B2A4650E41103800A72928 /* Build configuration list for PBXNativeTarget "Nick's Template Editor (Abandoned)" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E1B2A4660E41103800A72928 /* Debug */,
|
||||
E1B2A4670E41103800A72928 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
E1B2A4900E41103800A72928 /* Build configuration list for PBXNativeTarget "NovaTools" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
Loading…
Reference in New Issue
Block a user