Permalink
Browse files

Add HeaderDoc script and some comments for testing it.

  • Loading branch information...
1 parent f51eb3d commit 068b1e26d23e196dfa24de2dcb6bd367be6fc87b @uliwitness committed Apr 9, 2012
Showing with 212 additions and 14 deletions.
  1. +2 −0 .gitignore
  2. +113 −0 HeaderDocTOCTemplate.html
  3. +23 −7 WILDDocument.h
  4. +45 −7 WILDDocument.m
  5. +5 −0 build_docs.command
  6. +24 −0 headerDoc2html.config
View
@@ -1 +1,3 @@
svn_version.h
+
+docs/
View
@@ -0,0 +1,113 @@
+<html>
+<head>
+<title>$$framework@@</title>
+<!-- A big scary CSS block -->
+ <style type="text/css"><!--
+#pagehead {
+ font-weight: bold ;
+ font-size: 32px ;
+ text-align: center ;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+}
+td {
+ font-size: 80% ;
+}
+a:link {
+ text-decoration: none;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ color: #0000ff;
+}
+a:visited {
+ text-decoration: none;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ color: #0000ff;
+}
+a:visited:hover {
+ text-decoration: underline;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ color: #ff6600;
+}
+a:active {
+ text-decoration: none;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ color: #ff6600;
+}
+a:hover {
+ text-decoration: underline;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ color: #ff6600;
+}
+h1 {
+ font-size: 150% ;
+ text-align: center ;
+}
+h4 {
+ text-decoration: none;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+ font-weight: bold;
+}
+body {
+ text-decoration: none;
+ font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+}
+address {
+ font-size: 12px ;
+}
+.address_image {
+ float: left ;
+}
+-->
+</style>
+<!-- End big scary CSS block -->
+
+</head>
+<body bgcolor="#ffffff">
+
+<!-- start of header -->
+<!--#include virtual="/path/to/header.html"-->
+<!-- end of header -->
+
+$$frameworkdiscussion@@
+
+<h2><a name="summary">API Summary</a></h2>
+<h3>Headers</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$headerlist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<h3>Functions</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$functionlist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<h3>Types</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$typelist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<h3>Macros</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$macrolist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<h3>Classes</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$classlist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0" @@
+</table>
+
+<h3>Protocols</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$protocollist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<h3>Data</h3>
+<table border="0" cellpadding="0" cellspacing="0" width="90%">
+ $$datalist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0"@@
+</table>
+
+<!-- start of footer -->
+<hr/>
+ (C) Copyright 2010 by Uli Kusterer, all rights reserved.
+<!-- end of footer -->
+</body>
+</html>
View
@@ -16,21 +16,37 @@
@class WILDCard;
+/*!
+ @class WILDDocument A document referencing the Stacksmith file on disk, containing one or more stacks, plus any information global to the file. A document may have a "main" stack that gets opened at startup.
+ @var mErrorsAndWarnings Errors and warnings when opening old documents, or stacks imported from HyperCard.
+ @var mFontIDTable Font ID --> name mappings. Needed to read imported HyperCard stacks.
+ @var mTextStyles STBL-extracted text/style info. Needed to read imported HyperCard stacks. Array of WILDStyleEntry objects
+ @var mMediaList Pictures, movies, sounds etc. contained in this stack. Array of WILDMediaEntry objects.
+ @var mStacks Array of WILDStack objects.
+ @var mCreatedByVersion Version string of the version of Stacksmith (or HyperCard) that created this stack, includes the host app's name.
+ @var mLastCompactedVersion Version string of the last version of Stacksmith (or HyperCard) that compacted this stack, includes the host app's name. (currently only initialized and set, but Stacksmith doesn't compact stacks)
+ @var mFirstEditedVersion Version string of the first version of Stacksmith (or HyperCard) that edited this stack, includes the host app's name. (Initialized by Stacksmith for new files, maintained for imported stacks, but otherwise unused)
+ @var mLastEditedVersion Version string of the most recent version of Stacksmith (or HyperCard) that edited this stack, includes the host app's name.
+ @var mContextGroup The context group needed for the Leonie interpreter to compile and run scripts. This holds global variables etc.
+ @var mMediaIDSeed ID number for next new icon etc. (unless already taken, then we'll add to it until we hit a free one)
+ @var mStackIDSeed ID number for next new stack in document (unless already taken, then we'll add to it until we hit a free one).
+*/
+
@interface WILDDocument : NSDocument
{
- NSMutableArray * mErrorsAndWarnings; // Errors and warnings when opening old documents, or stacks imported from HyperCard.
- NSMutableDictionary * mFontIDTable; // Font ID --> name mappings
- NSMutableDictionary * mTextStyles; // STBL-extracted text/style info.
- NSMutableArray * mMediaList; // Media.
- NSMutableArray * mStacks; // List of stacks in this document.
+ NSMutableArray * mErrorsAndWarnings;
+ NSMutableDictionary * mFontIDTable;
+ NSMutableDictionary * mTextStyles;
+ NSMutableArray * mMediaList;
+ NSMutableArray * mStacks;
NSString * mCreatedByVersion;
NSString * mLastCompactedVersion;
NSString * mFirstEditedVersion;
NSString * mLastEditedVersion;
struct LEOContextGroup* mContextGroup;
- WILDObjectID mMediaIDSeed; // ID number for next new icon etc. (unless already taken, then we'll add to it until we hit a free one).
- WILDObjectID mStackIDSeed; // ID number for next new stack in document (unless already taken, then we'll add to it until we hit a free one).
+ WILDObjectID mMediaIDSeed;
+ WILDObjectID mStackIDSeed;
}
-(void) addFont: (NSString*)fontName withID: (WILDObjectID)fontID;
View
@@ -28,9 +28,19 @@
#import "UKHelperMacros.h"
+/*!
+ @class WILDDocument
+*/
+
@implementation WILDDocument
-- (id)init
+/*!
+ @method init
+ @abstract Default constructor, used both for loading stacks from disk and for creating a completely new stack on creation.
+ @seealso -readFromURL:ofType:error:
+*/
+
+- (id)init;
{
self = [super init];
if( self )
@@ -79,7 +89,12 @@ -(void) dealloc
}
--(void) makeWindowControllers
+/*!
+ @method makeWindowControllers
+ @abstract Add a window controller for each stack's window.
+*/
+
+-(void) makeWindowControllers;
{
for( WILDStack* currStack in mStacks )
{
@@ -110,7 +125,12 @@ -(void) makeWindowControllers
//}
--(void) fileHandle: (NSFileHandle*)fh ofImporterDidReadLine: (NSString*)currLine
+/*!
+ @method fileHandle:ofImporterDidReadLine:
+ @abstract Called to parse each line output by stackimport when importing a HyperCard stack. Fills our errors/warnings list and updates progress display.
+*/
+
+-(void) fileHandle: (NSFileHandle*)fh ofImporterDidReadLine: (NSString*)currLine;
{
if( !currLine )
{
@@ -139,7 +159,13 @@ -(void) fileHandle: (NSFileHandle*)fh ofImporterDidReadLine: (NSString*)currLine
}
-- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)outError
+/*!
+ @method writeToURL:ofType:forSaveOperation:originalContentsURL:error:
+ @abstract Write any changes to this document back out to disk.
+ @seealso -readFromURL:ofType:error:
+*/
+
+- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)outError;
{
if( ![[NSFileManager defaultManager] fileExistsAtPath: [absoluteURL path]] )
{
@@ -194,9 +220,14 @@ - (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOpera
}
--(void) loadStandardResourceTableReturningError: (NSError**)outError
+/*!
+ @method loadStandardResourceTableReturningError:
+ @abstract Load built-in standard media table so others can access it: (ICONs, PICTs, CURSs and SNDs)
+ @param outError If en error occurs, this will return an error object.
+*/
+
+-(void) loadStandardResourceTableReturningError: (NSError**)outError;
{
- // Load built-in standard picture table so others can access it: (ICONs, PICTs, CURSs and SNDs)
NSXMLDocument * stdDoc = [[[NSXMLDocument alloc] initWithContentsOfURL: [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource: @"resources" ofType: @"xml"]]
options: 0 error: outError] autorelease];
NSXMLElement * stdStackfileElement = [stdDoc rootElement];
@@ -214,7 +245,14 @@ -(void) loadStandardResourceTableReturningError: (NSError**)outError
}
-- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
+/*!
+ @method readFromURL:ofType:error:
+ @abstract Load data from a stack XML file into this stack object.
+ @seealso -init
+ @seealso -writeToURL:ofType:forSaveOperation:originalContentsURL:error:
+*/
+
+- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError;
{
NSURL* tocURL = absoluteURL;
BOOL isDir = NO;
View
@@ -0,0 +1,5 @@
+#!/bin/bash
+cd `dirname "$0"`
+rm -rf docs
+/Applications/Xcode.app/Contents/Developer/usr/bin/headerdoc2html -o docs .
+/Applications/Xcode.app/Contents/Developer/usr/bin/gatherheaderdoc docs
View
@@ -0,0 +1,24 @@
+# Configuration file for HeaderDoc
+# Original file: $Revision: 1.5.4.1.2.20 $ From Apple Computer
+# Modified by: Uli Kusterer
+###########################################################
+copyrightOwner => (c) 2010 Uli Kusterer, all rights reserved.
+defaultFrameName => index.html
+masterTOCName => masterTOC.html
+apiUIDPrefix => leo_ref
+TOCTemplateFile => ./HeaderDocTOCTemplate.html
+ignorePrefixes =>
+htmlHeader =>
+dateFormat => %Y-%m-%d
+textStyle =>
+commentStyle => background:#ffffff; color:#ff0000
+preprocessorStyle => background:#ffffff; color:#236e25
+funcNameStyle => background:#ffffff; color:#0000dd;
+stringStyle => background: #ffffff; color:#666666;
+charStyle => background: #ffffff; color:#666666;
+numberStyle => background: #ffffff; color:#000000;
+keywordStyle => background:#ffffff; color:#0000ff;
+typeStyle => background:#ffffff; color:#0000ff;
+paramStyle => background:#ffffff; color:#000000;
+varStyle => background:#ffffff; color:#000000;
+templateStyle => background:#ffffff; color:#761550;

0 comments on commit 068b1e2

Please sign in to comment.