Un-gitignore the Uli's Template Editor folder

Note: The stuff in this folder doesn't actually work
This commit is contained in:
Eric Gallager 2012-05-06 13:14:09 -04:00
parent f06637cffe
commit 3306fb2256
56 changed files with 16241 additions and 1 deletions

1
.gitignore vendored
View File

@ -14,4 +14,3 @@ xcuserdata/
-1
Uli's Template Editor/*

118
UKTemplateFieldProtocol.h Normal file
View File

@ -0,0 +1,118 @@
/*
* UKTemplateFieldProtocol.h
* AngelTemplate
*
* Created by Uli Kusterer on 22.10.06.
* Copyright 2006 M. Uli Kusterer. All rights reserved.
*
*/
/* This is the main header for writing plugin template field types for
AngelTemplate. Sorry that it ended up looking a tad convoluted and full.
You may want to skip reading this and just check out the
SamplePluginTemplateField project that you should have received with
AngelTemplate. It will show that it's really ridiculously easy. */
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Foundation/Foundation.h>
// -----------------------------------------------------------------------------
// Data Types:
// -----------------------------------------------------------------------------
@class UKTemplateField;
// -----------------------------------------------------------------------------
// Macros:
// -----------------------------------------------------------------------------
// Use this to call class methods on the template field protocol:
#define UK_TEMPLATEFIELD_CLASS NSClassFromString( @"UKTemplateField" )
// -----------------------------------------------------------------------------
// Protocols:
// -----------------------------------------------------------------------------
/* These are the externally visible methods that you can use on the actual
template field object handed to the plugin's constructor and used for
built-in template fields: */
@protocol UKTemplateFieldProtocol
// Creating/Setting up a template field:
+(void) registerTemplateFieldClass: (Class)cl forType: (NSString*)type; // Call this from your +load method to register your class for each of its types.
+(id) fieldWithSettingsDictionary: (NSDictionary*)dict; // Will look up the correct class for the "type" in the dictionary and give you a new UKTemplateField for that.
-(void) dataChanged: (id)sender; // Action for checkboxes etc. that marks the document dirty.
-(void) updateDocumentGUI; // Cause our table view GUI to reload because we added fields or whatever.
-(void) reportChangeOfUnknownKey: (NSString*)key; // Tells document to report about unknown value change.
-(id) objectForSettingsKey: (NSString*)key; // Tries to inherit unset properties from document (i.e. template-wide setting).
-(BOOL) isBigEndian; // These use objectForSettingsKey.
-(BOOL) isLittleEndian; // These use objectForSettingsKey.
@end
/* These are methods that the template field implements but forwards to your
plugin controller. The plugin controller is expected to override these and
provide its own functionality: */
@protocol UKTemplateFieldOverridableMethods
-(void) readFromData: (NSData*)data offset: (int*)offs; // Must add read amount to offs. Must be prepared for not enough data being present.
-(void) writeToData: (NSMutableData*)data offset: (int*)offs; // Must add written amount to offs.
-(id) plistRepresentation; // Field's value as a property list type.
// You also have to provide -fieldValue or -fieldValueForKey: to provide a value to be displayed by AngelWeb for your field (see below).
@end
/* Optional or almost-optional methods for your plugin object: */
@protocol UKTemplateFieldOptionalMethods
// You must provide exactly *one* of the following two:
// These return plist-type values that our NSOutlineView knows how to display.
-(id) fieldValue; // Override this to show your value. Called by the default implementation of fieldValueForKey: to provide the actual value (as opposed to label etc., which we can pull from the template).
-(id) fieldValueForKey: (NSString*)key; // Value/Label etc. of this field to display in the document's outline view.
// The rest are completely optional:
-(void) loadDefaults; // Called instead of readFromData:offset: when creating a new file.
// The following is needed if you want your field to be editable:
-(void) setFieldValue: (id)newValue forKey: (NSString*)key; // Key is currently always "value". If it's something else, call reportChangeOfUnknownKey:.
-(BOOL) fieldValueIsEditableForKey: (NSString*)key;
-(BOOL) isSelectable;
// These are if you have sub-fields in your field:
-(BOOL) canHaveSubFields; // May have sub fields (but it's maybe empty right now). Defaults to NO.
-(int) countSubFields; // # of subfields. Defaults to 0.
-(UKTemplateField*) subFieldAtIndex: (int)index; // Return the subfield with specified (zero-based) index.
-(void) addNewField: (id)sender; // Action of the "New Field" menu item. You can also implement other selectors like delete:, copy: etc.
-(void) openFieldEditor: (id)sender; // Open the field (editor or preview or whatever). Handy for more complex fields.
@end
/* The following protocol is what your plugin field type should implement at
the least. Note that this includes all of the overridable methods above
as well as fieldValue or fieldValueForKey:. */
@protocol UKTemplateFieldPluginProtocol <UKTemplateFieldOverridableMethods,NSObject>
-(id) initWithTemplateField: (UKTemplateField*)owningField; // Initializer AngelTemplate calls on your class to create a new object. Save away a nonretained pointer to owningTemplate. It's your lifeline to AngelTemplate.
// May also implement UKTemplateFieldOptionalMethods.
@end

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,23 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#pragma mark Named Structures
struct _NSPoint {
float _field1;
float _field2;
};
struct _NSRect {
struct _NSPoint _field1;
struct _NSSize _field2;
};
struct _NSSize {
float _field1;
float _field2;
};

View File

@ -0,0 +1,29 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\
\b Human Interface Design:
\b0 \
Some other people\
\
\b Testing:
\b0 \
Hopefully not nobody\
\
\b Documentation:
\b0 \
Whoever\
\
\b With special thanks to:
\b0 \
Mom\
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
IBClasses = (
{
ACTIONS = {addNewField = id; copyFileAsPList = id; };
CLASS = FirstResponder;
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
},
{CLASS = UKAngelTemplateAppDelegate; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

View File

@ -0,0 +1,21 @@
<?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>86 100 356 240 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>88 342 334 44 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,15 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = MyDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; },
{CLASS = UKScrollDocumentView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
ACTIONS = {copyFileAsPList = id; };
CLASS = UKTemplateDocument;
LANGUAGE = ObjC;
OUTLETS = {fieldList = NSOutlineView; };
SUPERCLASS = NSDocument;
}
);
IBVersion = 1;
}

View File

@ -0,0 +1,16 @@
<?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>83 110 356 240 0 0 1280 1002 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
</dict>
</plist>

View File

@ -0,0 +1,66 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
<string>txt</string>
<string>data</string>
<string>bin</string>
</array>
<key>CFBundleTypeName</key>
<string>Template file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>UKTemplateDocument</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>fileTemplate</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AngelTemplateDoc</string>
<key>CFBundleTypeName</key>
<string>AngelWeb File Template</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>XML</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>AngelTemplate</string>
<key>CFBundleIconFile</key>
<string>AngelTemplate</string>
<key>CFBundleIdentifier</key>
<string>de.zathras.angel-template</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,21 @@
//
// NSObject+Subclasses.h
// AngelTemplate
//
// Created by Uli Kusterer on 18.01.05.
// Copyright 2005 M. Uli Kusterer. All rights reserved.
// Based on a CocoaDev.com posting by Neil A. Van Note.
//
#import <Foundation/Foundation.h>
@interface NSObject (UKSubclasses)
+(NSArray*) subclasses;
+(NSArray*) directSubclasses;
+(NSEnumerator*) subclassEnumerator;
+(NSEnumerator*) directSubclassEnumerator;
@end

View File

@ -0,0 +1,15 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@interface NSObject (UKSubclasses)
+ (id)subclasses;
+ (id)directSubclasses;
+ (id)subclassEnumerator;
+ (id)directSubclassEnumerator;
@end

View File

@ -0,0 +1,12 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSOutlineView.h"
@interface NSOutlineView (UKExpandAllItems)
- (void)expandAllItems;
@end

View File

@ -0,0 +1,15 @@
ANGELTEMPLATE
AngelTemplate is a generic viewer application for binary file types. The basic idea is the same as with ResEdit's and Resorcerer's 'TMPL' resources. Just that this is only for files' data forks and is implemented with property lists and other fancy Mac OS X doodads.
Note that this is a development preview. It is not yet finished, but may already be useful. I'd love to hear your feedback, suggestions etc.
CONTACT ME AT:
Uli Kusterer
http://www.zathras.de
witness (dot) of (dot) teachtext (at) gmx (dot) net
kusterer (at) gmail (dot) com
witness (at) zathras (dot) de
(c) 2006, all rights reserved.

View File

@ -0,0 +1,283 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
3D2915270AEBA10E00AB9DD3 /* SamplePluginTemplateField.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D2915260AEBA10E00AB9DD3 /* SamplePluginTemplateField.m */; };
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
32DBCF630370AF2F00C91783 /* SamplePluginFieldType_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplePluginFieldType_Prefix.pch; sourceTree = "<group>"; };
3D2915250AEBA10E00AB9DD3 /* SamplePluginTemplateField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplePluginTemplateField.h; sourceTree = "<group>"; };
3D2915260AEBA10E00AB9DD3 /* SamplePluginTemplateField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SamplePluginTemplateField.m; sourceTree = "<group>"; };
3D29152C0AEBA13600AB9DD3 /* UKTemplateFieldProtocol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKTemplateFieldProtocol.h; path = ../UKTemplateFieldProtocol.h; sourceTree = SOURCE_ROOT; };
8D5B49B6048680CD000E48DA /* SamplePluginFieldType.pluginTemplateField */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SamplePluginFieldType.pluginTemplateField; sourceTree = BUILT_PRODUCTS_DIR; };
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D5B49B3048680CD000E48DA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
089C166AFE841209C02AAC07 /* SamplePluginFieldType */ = {
isa = PBXGroup;
children = (
08FB77AFFE84173DC02AAC07 /* Classes */,
32C88E010371C26100C91783 /* Other Sources */,
089C167CFE841241C02AAC07 /* Resources */,
089C1671FE841209C02AAC07 /* Frameworks and Libraries */,
19C28FB8FE9D52D311CA2CBB /* Products */,
);
name = SamplePluginFieldType;
sourceTree = "<group>";
};
089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */,
);
name = "Frameworks and Libraries";
sourceTree = "<group>";
};
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D5B49B7048680CD000E48DA /* Info.plist */,
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AFFE84173DC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
3D29152C0AEBA13600AB9DD3 /* UKTemplateFieldProtocol.h */,
3D2915250AEBA10E00AB9DD3 /* SamplePluginTemplateField.h */,
3D2915260AEBA10E00AB9DD3 /* SamplePluginTemplateField.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
089C167FFE841241C02AAC07 /* AppKit.framework */,
D2F7E65807B2D6F200F64583 /* CoreData.framework */,
089C1672FE841209C02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FB8FE9D52D311CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D5B49B6048680CD000E48DA /* SamplePluginFieldType.pluginTemplateField */,
);
name = Products;
sourceTree = "<group>";
};
32C88E010371C26100C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
32DBCF630370AF2F00C91783 /* SamplePluginFieldType_Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D5B49AC048680CD000E48DA /* SamplePluginFieldType */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "SamplePluginFieldType" */;
buildPhases = (
8D5B49AF048680CD000E48DA /* Resources */,
8D5B49B1048680CD000E48DA /* Sources */,
8D5B49B3048680CD000E48DA /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = SamplePluginFieldType;
productInstallPath = "$(HOME)/Library/Bundles";
productName = SamplePluginFieldType;
productReference = 8D5B49B6048680CD000E48DA /* SamplePluginFieldType.pluginTemplateField */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "SamplePluginFieldType" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 089C166AFE841209C02AAC07 /* SamplePluginFieldType */;
projectDirPath = "";
projectRoot = "";
targets = (
8D5B49AC048680CD000E48DA /* SamplePluginFieldType */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D5B49AF048680CD000E48DA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D5B49B1048680CD000E48DA /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3D2915270AEBA10E00AB9DD3 /* SamplePluginTemplateField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C167EFE841241C02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
1DEB913B08733D840010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = SamplePluginFieldType_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
PRODUCT_NAME = SamplePluginFieldType;
WRAPPER_EXTENSION = pluginTemplateField;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB913C08733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = SamplePluginFieldType_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
PRODUCT_NAME = SamplePluginFieldType;
WRAPPER_EXTENSION = pluginTemplateField;
};
name = Release;
};
1DEB913F08733D840010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_OPENMP_SUPPORT = YES;
GCC_VERSION = 4.0;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_PKGINFO_FILE = YES;
GENERATE_PROFILING_CODE = YES;
LD_GENERATE_MAP_FILE = YES;
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
VALIDATE_PRODUCT = YES;
};
name = Debug;
};
1DEB914008733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "SamplePluginFieldType" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB913B08733D840010E9CD /* Debug */,
1DEB913C08733D840010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "SamplePluginFieldType" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB913F08733D840010E9CD /* Debug */,
1DEB914008733D840010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 089C1669FE841209C02AAC07 /* Project object */;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'SamplePluginFieldType' target in the 'SamplePluginFieldType' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -0,0 +1,29 @@
//
// SamplePluginTemplateField.h
// SamplePluginFieldType
//
// Created by Uli Kusterer on 22.10.06.
// Copyright 2006 M. Uli Kusterer. All rights reserved.
//
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Cocoa/Cocoa.h>
#import "UKTemplateFieldProtocol.h"
// -----------------------------------------------------------------------------
// Classes:
// -----------------------------------------------------------------------------
@interface SamplePluginTemplateField : NSObject <UKTemplateFieldPluginProtocol>
{
UKTemplateField* owningField; // Use this object to talk to AngelTemplate.
int ourData; // Whatever data this field read from the file.
}
-(id) initWithTemplateField: (UKTemplateField*)inOwningField;
@end

View File

@ -0,0 +1,123 @@
//
// SamplePluginTemplateField.m
// SamplePluginFieldType
//
// Created by Uli Kusterer on 22.10.06.
// Copyright 2006 M. Uli Kusterer. All rights reserved.
//
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import "SamplePluginTemplateField.h"
@implementation SamplePluginTemplateField
// -----------------------------------------------------------------------------
// load:
// Register our field type(s) with AngelTemplate:
// -----------------------------------------------------------------------------
+(void) load
{
[UK_TEMPLATEFIELD_CLASS registerTemplateFieldClass: [self class] forType: @"Sample"];
}
// -----------------------------------------------------------------------------
// * CONSTRUCTOR:
// -----------------------------------------------------------------------------
-(id) initWithTemplateField: (UKTemplateField*)inOwningField
{
if( (self = [super init]) )
{
// Save away the owning field so we can later ask it for info:
owningField = inOwningField; // Don't retain, it's our owner, so we'd get a retain circle.
}
return self;
}
// -----------------------------------------------------------------------------
// Read from file:
// -----------------------------------------------------------------------------
-(void) readFromData: (NSData*)data offset: (int*)offs
{
if( ([data length] -(*offs)) >= sizeof(ourData) ) // Still have enough data in file for this?
{
[data getBytes: &ourData range: NSMakeRange(*offs,sizeof(ourData))];
if( [owningField isBigEndian] )
ourData = EndianS32_BtoN(ourData);
else
ourData = EndianS32_LtoN(ourData);
}
else
[self loadDefaults]; // Not enough data? Just use default (would be cooler to try to read what data we have and pad the rest with zeroes if that made sense for your data type).
*offs += sizeof(ourData); // Append our size anyway, so AngelTemplate knows we need more data and can tell user.
}
// -----------------------------------------------------------------------------
// Append to file (save):
// -----------------------------------------------------------------------------
-(void) writeToData: (NSMutableData*)data offset: (int*)offs
{
int i = ourData;
if( [owningField isBigEndian] )
i = EndianS32_NtoB(ourData);
else
i = EndianS32_NtoL(ourData);
[data appendBytes: &i length: sizeof(i)];
*offs += sizeof(i);
}
// -----------------------------------------------------------------------------
// Provide our value in a way suitable for display:
// -----------------------------------------------------------------------------
-(id) fieldValue
{
return [NSNumber numberWithInt: ourData];
}
// -----------------------------------------------------------------------------
// Accept changes from the user:
// -----------------------------------------------------------------------------
-(void) setFieldValue: (id)newValue forKey: (NSString*)key
{
if( [key isEqualToString: @"value"] )
ourData = [newValue intValue];
else
[owningField reportChangeOfUnknownKey: key];
}
// -----------------------------------------------------------------------------
// Return our item in some property list representation for Plist-Export:
// -----------------------------------------------------------------------------
-(id) plistRepresentation
{
return [NSNumber numberWithInt: ourData];
}
// -----------------------------------------------------------------------------
// Apply a sensible default value for new files:
// -----------------------------------------------------------------------------
-(void) loadDefaults
{
ourData = 7;
}
@end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
WHAT IS A TEMPLATE?
For AngelTemplate, a Template is a file that describes a (binary) file format.
AngelTemplate uses template files to find out how to best display certain
kinds of binary files to you.
HOW DO I CREATE A TEMPLATE?
A template is basically a property list file. So, just use Property List
Editor to create your template, and when you're finished change its file
name extension from ".plist" to ".fileTemplate" and drop it in your ~/Library/Application Support/AngelTemplate/Templates/ folder.
BASIC STRUCTURE OF A TEMPLATE
A template file's root is a dictionary. It contains a "templateType" key that
must currently always be set to the string "fieldList", and a "templateVersion"
key that must currently always be set to the number "1".
A field list template consists of a list of "fields", which are the individual
pieces of data present in the file. An example of a field would be an integer,
a string, or a boolean. In addition, some fields can contain other fields, for
example the Array field can in turn contain integers, strings etc.
In addition to the keys mentioned above, fieldList Templates of type 1 (the only
type of template at this time) also contain the following keys:
fieldDefaults - A dictionary containing fallback key-value pairs for certain
field types. For example, if a field's value can be stored
as big-endian or little-endian, and you want all fields to
be big-endian, you can specify the "endianness" key with
value "big" in this dictionary instead of for each field,
and thus make the entire file big-endian.
fieldList - An array of dictionaries, where each dictionary contains
key-value pairs describing a certain field. All fields
have at least the following two key-value pairs:
type - A string identifying the type of field. See
below for a list of supported field types.
label - A label to display to the left of this field.
This is a bit of description whose text you
can choose arbitrarily to tell people using
this template what a particular field
contains.
Some field types also understand the following (optional)
key-value pairs:
description - A piece of (longer) descriptional text that
you can choose arbitrarily to provide
additional information about a field.
endianness - This is a string cintaining either "big" or
"little" and decides whether multi-byte data
types like integers and array counters will
be stored with least-significant byte first
(Intel) or last (PowerPC, M68000). If you
do not specify this key, the little-endian
format used on today's Intel-Chip-Based Macs
is used.
defaultValue - This is a value that will be used for new
fields to fill them with an initial value.
You can for example use this to fill in the
newest version number into a data structure.
Depending on what type a field has, the
defaultValue will adopt an appropriate
data type, generally a string or a number.
fieldList - Some fields can contain other fields. For
example, array fields contain a list of
fields that make up one array item. The
fieldList key is used in the array field and
other fields with sub-fields to hold an
Array listing these fields. Such a fieldList
has the exact same format as the fieldList
at the root level of the file.
Generally, if a field type understands the
fieldList field, it is /not/ optional.
setVariable - This is a string used as a variable name in
which this field's value will be stored. You
can then later take the saved value and
specify it to another field to use as its
value. This is e.g. useful with arrays where
the number of elements doesn't immediately
precede the array items.
LIST OF FIELD TYPES
The following field types are currently available in AngelTemplate:
Integer - A 4-byte signed integer.
UnsignedInteger - A 4-byte unsigned integer.
TwoByteInteger - A 2-byte signed integer.
TwoByteUnsignedInteger - A 2-byte unsigned integer.
UnsignedTwoByteInteger - A 2-byte unsigned integer.
Boolean - A 1-byte boolean value that is either 1 or 0
(YES or NO).
Comment - This is a field that only exists in the template. It
does not read or write any data from/to the file,
but rather simply displays its label in the template.
You can use this to group together certain fields
and add descriptions.
CString - A C string is a bunch of characters followed by a zero byte.
You can specify an "encoding" key for this field containing
a string like "MacOSRoman", "UTF8", "ISOLatin1" or "ASCII"
(See NSStringEncoding for other encoding names you can use.
Simply take the xxx part of the "NSxxxStringEncoding"
constants). If no encoding is specified, AngelTemplate will
assume an encoding of "UTF8".
PString - A Pascal String. Pascal Strings start with one byte
indicating their length in bytes, and up to 255 characters
after that.
Like for C strings, you can specify the "encoding" key. Note
that most Pascal strings out there won't be in the default
encoding of UTF8, so you'd better explicitly specify
MacRoman or ISOLatin1.
Array - An array of other fields. The array starts off with a 4-byte
integer containing the number of array elements, followed
by that many array items. Each array item's field layout is
defined by the fieldList contained in the array field.
TwoByteArray - Like Array, but the counter is a two-byte integer instead of
a 4-byte integer.

View File

@ -0,0 +1,8 @@
-> Add "offset" and "size" fields that are tagged so an offset and a size can be
used together for blocks that just "float" in a file.
-> Also allow for offsets that don't have a size associated, where the size is
decided by the data itself, but watch out that we don't show "excess data"
error messages for those.
-> With offsets, we may have to keep track of used ranges and then detect
"holes". But make sure that can be turned off in case a template doesn't
include certain padding data but uses offsets.

View File

@ -0,0 +1,127 @@
<?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>fieldDefaults</key>
<dict>
<key>endianness</key>
<string>big</string>
</dict>
<key>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<integer>77</integer>
<key>description</key>
<string>This is a custom description specified in the template.</string>
<key>label</key>
<string>Number 1</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>88</integer>
<key>label</key>
<string>Number 2</string>
<key>type</key>
<string>TwoByteInteger</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>99</integer>
<key>label</key>
<string>Number 3</string>
<key>type</key>
<string>TwoByteInteger</string>
</dict>
<dict>
<key>label</key>
<string>Now come some more interesting fields:</string>
<key>type</key>
<string>Comment</string>
</dict>
<dict>
<key>defaultValue</key>
<string>Well, what have we here?</string>
<key>encoding</key>
<string>MacOSRoman</string>
<key>label</key>
<string>String 1</string>
<key>type</key>
<string>PString</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>11</integer>
<key>label</key>
<string>Number 4</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<string>A C string.</string>
<key>label</key>
<string>String 2</string>
<key>type</key>
<string>CString</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>22</integer>
<key>label</key>
<string>Number 5</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<true/>
<key>label</key>
<string>Frobnitz the Mxlyptztik</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2</integer>
<key>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<true/>
<key>label</key>
<string>Truify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<false/>
<key>label</key>
<string>Falsify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2048</integer>
<key>label</key>
<string>Number in Array</string>
<key>type</key>
<string>Integer</string>
</dict>
</array>
<key>label</key>
<string>Array 1</string>
<key>type</key>
<string>Array</string>
</dict>
</array>
<key>templateType</key>
<string>fieldList</string>
<key>templateVersion</key>
<integer>1</integer>
</dict>
</plist>

View File

@ -0,0 +1,122 @@
<?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>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<integer>77</integer>
<key>label</key>
<string>Number 1</string>
<key>type</key>
<string>Integer</string>
<key>description</key>
<string>This is a custom description specified in the template.</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>88</integer>
<key>label</key>
<string>Number 2</string>
<key>type</key>
<string>TwoByteInteger</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>99</integer>
<key>label</key>
<string>Number 3</string>
<key>type</key>
<string>TwoByteInteger</string>
</dict>
<dict>
<key>label</key>
<string>Now come some more interesting fields:</string>
<key>type</key>
<string>Comment</string>
</dict>
<dict>
<key>defaultValue</key>
<string>Well, what have we here?</string>
<key>encoding</key>
<string>MacOSRoman</string>
<key>label</key>
<string>String 1</string>
<key>type</key>
<string>PString</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>11</integer>
<key>label</key>
<string>Number 4</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<string>A C string.</string>
<key>label</key>
<string>String 2</string>
<key>type</key>
<string>CString</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>22</integer>
<key>label</key>
<string>Number 5</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<true/>
<key>label</key>
<string>Frobnitz the Mxlyptztik</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2</integer>
<key>label</key>
<string>Array 1</string>
<key>type</key>
<string>Array</string>
<key>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<true/>
<key>label</key>
<string>Truify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<false/>
<key>label</key>
<string>Falsify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2048</integer>
<key>label</key>
<string>Number in Array</string>
<key>type</key>
<string>Integer</string>
</dict>
</array>
</dict>
</array>
<key>templateType</key>
<string>fieldList</string>
<key>templateVersion</key>
<integer>1</integer>
</dict>
</plist>

View File

@ -0,0 +1,23 @@
<?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>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<integer>5</integer>
<key>description</key>
<string>This is a custom description specified in the template.</string>
<key>label</key>
<string>Sample Field Test</string>
<key>type</key>
<string>Sample</string>
</dict>
</array>
<key>templateType</key>
<string>fieldList</string>
<key>templateVersion</key>
<integer>1</integer>
</dict>
</plist>

View File

@ -0,0 +1,30 @@
<?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>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<integer>2</integer>
<key>fieldList</key>
<array>
<dict>
<key>label</key>
<string>String</string>
<key>type</key>
<string>PString</string>
</dict>
</array>
<key>label</key>
<string>Strings</string>
<key>type</key>
<string>Array</string>
</dict>
</array>
<key>templateType</key>
<string>fieldList</string>
<key>templateVersion</key>
<integer>1</integer>
</dict>
</plist>

View File

@ -0,0 +1,58 @@
<?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>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<integer>1</integer>
<key>description</key>
<string>1 means native</string>
<key>label</key>
<string>Byte-Order Marker</string>
<key>type</key>
<string>Integer</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2</integer>
<key>fieldList</key>
<array>
<dict>
<key>defaultValue</key>
<true/>
<key>label</key>
<string>Truify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<false/>
<key>label</key>
<string>Falsify</string>
<key>type</key>
<string>Boolean</string>
</dict>
<dict>
<key>defaultValue</key>
<integer>2048</integer>
<key>label</key>
<string>Number in Array</string>
<key>type</key>
<string>Integer</string>
</dict>
</array>
<key>label</key>
<string>Array 1</string>
<key>type</key>
<string>Array</string>
</dict>
</array>
<key>templateType</key>
<string>fieldList</string>
<key>templateVersion</key>
<integer>1</integer>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@interface UKAngelTemplateAppDelegate : NSObject
{
}
- (void)applicationDidFinishLaunching:(id)arg1;
@end

View File

@ -0,0 +1,33 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@class NSMutableArray, UKArrayTemplateField;
@interface UKArrayItemTemplateField : UKTemplateField
{
NSMutableArray *fields;
UKArrayTemplateField *owningArray;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1 owner:(id)arg2;
- (void)dealloc;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValueForKey:(id)arg1;
- (BOOL)canHaveSubFields;
- (int)countSubFields;
- (id)subFieldAtIndex:(int)arg1;
- (void)addSubField:(id)arg1;
- (BOOL)isSelectable;
- (void)delete:(id)arg1;
- (void)addNewField:(id)arg1;
@end

View File

@ -0,0 +1,35 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@class NSMutableArray;
@interface UKArrayTemplateField : UKTemplateField
{
NSMutableArray *fields;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)dealloc;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)loadDefaults;
- (void)load:(int)arg1 fieldsFromData:(id)arg2 offset:(int *)arg3 afterField:(id)arg4;
- (void)addNewFieldAfterField:(id)arg1;
- (void)deleteField:(id)arg1;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (BOOL)canHaveSubFields;
- (int)countSubFields;
- (id)subFieldAtIndex:(int)arg1;
- (BOOL)fieldValueIsEditableForKey:(id)arg1;
- (BOOL)isSelectable;
- (void)addNewField:(id)arg1;
@end

View File

@ -0,0 +1,23 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@interface UKBooleanTemplateField : UKTemplateField
{
BOOL booleanValue;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
@end

View File

@ -0,0 +1,26 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@class NSString;
@interface UKCStringTemplateField : UKTemplateField
{
NSString *stringValue;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)dealloc;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
@end

View File

@ -0,0 +1,22 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@interface UKCommentTemplateField : UKTemplateField
{
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValueForKey:(id)arg1;
- (BOOL)fieldValueIsEditableForKey:(id)arg1;
@end

View File

@ -0,0 +1,23 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@interface UKIntegerTemplateField : UKTemplateField
{
int intValue;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
@end

View File

@ -0,0 +1,21 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSMutableArray;
@interface UKNibOwner : NSObject
{
NSMutableArray *topLevelObjects;
}
- (id)init;
- (void)dealloc;
- (id)nibFilename;
@end

View File

@ -0,0 +1,26 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@class NSString;
@interface UKPStringTemplateField : UKTemplateField
{
NSString *stringValue;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)dealloc;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
@end

View File

@ -0,0 +1,29 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSMutableArray, NSMutableDictionary;
@interface UKPluginRegistry : NSObject
{
NSMutableArray *plugins;
NSMutableDictionary *pluginPaths;
BOOL instantiate;
}
+ (id)sharedRegistry;
- (id)init;
- (void)dealloc;
- (void)loadPluginsOfType:(id)arg1;
- (void)loadPluginsFromPath:(id)arg1 ofType:(id)arg2;
- (id)loadPluginForPath:(id)arg1;
- (id)loadedPlugins;
- (BOOL)instantiate;
- (void)setInstantiate:(BOOL)arg1;
@end

View File

@ -0,0 +1,30 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@interface UKPluginTemplateField : UKTemplateField
{
id pluginController;
}
- (void)dealloc;
- (void)setPluginController:(id)arg1;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (id)fieldValueForKey:(id)arg1;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
- (void)loadDefaults;
- (BOOL)canHaveSubFields;
- (int)countSubFields;
- (id)subFieldAtIndex:(int)arg1;
- (BOOL)fieldValueIsEditableForKey:(id)arg1;
- (BOOL)isSelectable;
@end

View File

@ -0,0 +1,17 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSView.h"
@interface UKScrollDocumentView : NSView
{
}
- (id)initWithFrame:(struct _NSRect)arg1;
- (BOOL)isFlipped;
@end

View File

@ -0,0 +1,48 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSDocument.h"
@class NSMutableArray, NSMutableData, NSMutableDictionary, NSOutlineView;
@interface UKTemplateDocument : NSDocument
{
NSOutlineView *fieldList;
NSMutableData *fileData;
NSMutableArray *fields;
NSMutableDictionary *fieldDefaults;
NSMutableDictionary *variables;
}
- (id)init;
- (void)dealloc;
- (id)windowNibName;
- (void)windowControllerDidLoadNib:(id)arg1;
- (id)dataRepresentationOfType:(id)arg1;
- (BOOL)readFromFile:(id)arg1 ofType:(id)arg2;
- (id)loadOneFieldFromDictionary:(id)arg1;
- (BOOL)loadFieldsFromDictionary:(id)arg1;
- (void)loadDataForField:(id)arg1 offset:(int *)arg2;
- (void)reloadTemplateFields;
- (void)updateGUI;
- (void)fieldChanged:(id)arg1;
- (void)alertDidEnd:(id)arg1 returnCode:(int)arg2 contextInfo:(void *)arg3;
- (void)copyFileAsPList:(id)arg1;
- (id)outlineView:(id)arg1 child:(int)arg2 ofItem:(id)arg3;
- (BOOL)outlineView:(id)arg1 isItemExpandable:(id)arg2;
- (int)outlineView:(id)arg1 numberOfChildrenOfItem:(id)arg2;
- (id)outlineView:(id)arg1 objectValueForTableColumn:(id)arg2 byItem:(id)arg3;
- (void)outlineView:(id)arg1 setObjectValue:(id)arg2 forTableColumn:(id)arg3 byItem:(id)arg4;
- (BOOL)outlineView:(id)arg1 shouldEditTableColumn:(id)arg2 item:(id)arg3;
- (BOOL)outlineView:(id)arg1 shouldSelectItem:(id)arg2;
- (void)field:(id)arg1 gotUnknownValueKey:(id)arg2;
- (id)objectForSettingsKey:(id)arg1;
- (BOOL)respondsToSelector:(SEL)arg1;
- (void)forwardInvocation:(id)arg1;
- (id)methodSignatureForSelector:(SEL)arg1;
@end

View File

@ -0,0 +1,48 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
#import "UKTemplateFieldOverridableMethods-Protocol.h"
#import "UKTemplateFieldProtocol-Protocol.h"
@class NSDictionary, NSDocument;
@interface UKTemplateField : NSObject <UKTemplateFieldProtocol, UKTemplateFieldOverridableMethods>
{
NSDictionary *settings;
NSDocument *owningDocument;
}
+ (void)registerTemplateFieldClass:(Class)arg1 forType:(id)arg2;
+ (void)registerForDefaultName;
+ (id)fieldWithSettingsDictionary:(id)arg1;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)dealloc;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)loadDefaults;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (void)addToArray:(id)arg1;
- (id)plistRepresentation;
- (void)controlTextDidChange:(id)arg1;
- (void)dataChanged:(id)arg1;
- (void)setOwningDocument:(id)arg1;
- (id)owningDocument;
- (id)fieldValueForKey:(id)arg1;
- (id)fieldValue;
- (BOOL)canHaveSubFields;
- (int)countSubFields;
- (id)subFieldAtIndex:(int)arg1;
- (id)objectForSettingsKey:(id)arg1;
- (BOOL)isBigEndian;
- (BOOL)isLittleEndian;
- (void)updateDocumentGUI;
- (void)reportChangeOfUnknownKey:(id)arg1;
- (BOOL)fieldValueIsEditableForKey:(id)arg1;
- (BOOL)isSelectable;
@end

View File

@ -0,0 +1,12 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
@protocol UKTemplateFieldOverridableMethods
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
@end

View File

@ -0,0 +1,17 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
@protocol UKTemplateFieldProtocol
+ (void)registerTemplateFieldClass:(Class)arg1 forType:(id)arg2;
+ (id)fieldWithSettingsDictionary:(id)arg1;
- (void)dataChanged:(id)arg1;
- (void)updateDocumentGUI;
- (void)reportChangeOfUnknownKey:(id)arg1;
- (id)objectForSettingsKey:(id)arg1;
- (BOOL)isBigEndian;
- (BOOL)isLittleEndian;
@end

View File

@ -0,0 +1,118 @@
/*
* UKTemplateFieldProtocol.h
* AngelTemplate
*
* Created by Uli Kusterer on 22.10.06.
* Copyright 2006 M. Uli Kusterer. All rights reserved.
*
*/
/* This is the main header for writing plugin template field types for
AngelTemplate. Sorry that it ended up looking a tad convoluted and full.
You may want to skip reading this and just check out the
SamplePluginTemplateField project that you should have received with
AngelTemplate. It will show that it's really ridiculously easy. */
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Foundation/Foundation.h>
// -----------------------------------------------------------------------------
// Data Types:
// -----------------------------------------------------------------------------
@class UKTemplateField;
// -----------------------------------------------------------------------------
// Macros:
// -----------------------------------------------------------------------------
// Use this to call class methods on the template field protocol:
#define UK_TEMPLATEFIELD_CLASS NSClassFromString( @"UKTemplateField" )
// -----------------------------------------------------------------------------
// Protocols:
// -----------------------------------------------------------------------------
/* These are the externally visible methods that you can use on the actual
template field object handed to the plugin's constructor and used for
built-in template fields: */
@protocol UKTemplateFieldProtocol
// Creating/Setting up a template field:
+(void) registerTemplateFieldClass: (Class)cl forType: (NSString*)type; // Call this from your +load method to register your class for each of its types.
+(id) fieldWithSettingsDictionary: (NSDictionary*)dict; // Will look up the correct class for the "type" in the dictionary and give you a new UKTemplateField for that.
-(void) dataChanged: (id)sender; // Action for checkboxes etc. that marks the document dirty.
-(void) updateDocumentGUI; // Cause our table view GUI to reload because we added fields or whatever.
-(void) reportChangeOfUnknownKey: (NSString*)key; // Tells document to report about unknown value change.
-(id) objectForSettingsKey: (NSString*)key; // Tries to inherit unset properties from document (i.e. template-wide setting).
-(BOOL) isBigEndian; // These use objectForSettingsKey.
-(BOOL) isLittleEndian; // These use objectForSettingsKey.
@end
/* These are methods that the template field implements but forwards to your
plugin controller. The plugin controller is expected to override these and
provide its own functionality: */
@protocol UKTemplateFieldOverridableMethods
-(void) readFromData: (NSData*)data offset: (int*)offs; // Must add read amount to offs. Must be prepared for not enough data being present.
-(void) writeToData: (NSMutableData*)data offset: (int*)offs; // Must add written amount to offs.
-(id) plistRepresentation; // Field's value as a property list type.
// You also have to provide -fieldValue or -fieldValueForKey: to provide a value to be displayed by AngelWeb for your field (see below).
@end
/* Optional or almost-optional methods for your plugin object: */
@protocol UKTemplateFieldOptionalMethods
// You must provide exactly *one* of the following two:
// These return plist-type values that our NSOutlineView knows how to display.
-(id) fieldValue; // Override this to show your value. Called by the default implementation of fieldValueForKey: to provide the actual value (as opposed to label etc., which we can pull from the template).
-(id) fieldValueForKey: (NSString*)key; // Value/Label etc. of this field to display in the document's outline view.
// The rest are completely optional:
-(void) loadDefaults; // Called instead of readFromData:offset: when creating a new file.
// The following is needed if you want your field to be editable:
-(void) setFieldValue: (id)newValue forKey: (NSString*)key; // Key is currently always "value". If it's something else, call reportChangeOfUnknownKey:.
-(BOOL) fieldValueIsEditableForKey: (NSString*)key;
-(BOOL) isSelectable;
// These are if you have sub-fields in your field:
-(BOOL) canHaveSubFields; // May have sub fields (but it's maybe empty right now). Defaults to NO.
-(int) countSubFields; // # of subfields. Defaults to 0.
-(UKTemplateField*) subFieldAtIndex: (int)index; // Return the subfield with specified (zero-based) index.
-(void) addNewField: (id)sender; // Action of the "New Field" menu item. You can also implement other selectors like delete:, copy: etc.
-(void) openFieldEditor: (id)sender; // Open the field (editor or preview or whatever). Handy for more complex fields.
@end
/* The following protocol is what your plugin field type should implement at
the least. Note that this includes all of the overridable methods above
as well as fieldValue or fieldValueForKey:. */
@protocol UKTemplateFieldPluginProtocol <UKTemplateFieldOverridableMethods,NSObject>
-(id) initWithTemplateField: (UKTemplateField*)owningField; // Initializer AngelTemplate calls on your class to create a new object. Save away a nonretained pointer to owningTemplate. It's your lifeline to AngelTemplate.
// May also implement UKTemplateFieldOptionalMethods.
@end

View File

@ -0,0 +1,15 @@
//
// UKTextUtilities.h
// AngelTemplate
//
// Created by Uli Kusterer on 17.01.05.
// Copyright 2005 M. Uli Kusterer. All rights reserved.
//
#import <Cocoa/Cocoa.h>
// Turns an encoding name (name of one of the NSStringEncoding constants without
// the NS... and ...StringEncoding parts) into an NSStringEncoding value. If
// the string isn't known, returns NSUTF8StringEncoding.
NSStringEncoding StringEncodingFromName( NSString* encName );

View File

@ -0,0 +1,23 @@
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "UKTemplateField.h"
@interface UKUnsignedIntegerTemplateField : UKTemplateField
{
unsigned int intValue;
}
+ (void)load;
- (id)initWithSettingsDictionary:(id)arg1;
- (void)readFromData:(id)arg1 offset:(int *)arg2;
- (void)writeToData:(id)arg1 offset:(int *)arg2;
- (id)plistRepresentation;
- (id)fieldValue;
- (void)setFieldValue:(id)arg1 forKey:(id)arg2;
@end

11795
Uli's Template Editor/main.s Normal file

File diff suppressed because it is too large Load Diff