├── Documentation ├── man │ ├── mpgl.1 │ ├── headerdoc.1 │ ├── hdxml2manxml.1 │ ├── xml2man.1 │ ├── gatherheaderdoc.1 │ └── headerdoc2html.1 ├── headerdoc.pdf ├── WhatsNewInHD8.pdf ├── Resources │ ├── Images │ │ ├── 1dot.gif │ │ ├── dash.gif │ │ ├── pdf.gif │ │ ├── bullet.gif │ │ ├── sm_dash.gif │ │ ├── spacer.gif │ │ ├── download.gif │ │ ├── indexpage.gif │ │ ├── pdf_logo.gif │ │ ├── sm_bullet.gif │ │ ├── e_indexpage.gif │ │ ├── graydiamond.gif │ │ ├── larg_bullet.gif │ │ ├── second_level.gif │ │ ├── vindexpage.gif │ │ ├── rate_page_icon.gif │ │ ├── show_toc_icon.gif │ │ ├── top_level_none.gif │ │ ├── top_level_open.gif │ │ ├── e_indexpage_range.gif │ │ ├── indexpage_range.gif │ │ ├── sm_opentriangle.gif │ │ ├── third_level_open.gif │ │ ├── top_level_closed.gif │ │ ├── vindexpage_range.gif │ │ ├── third_level_closed.gif │ │ └── top_level_closed_gray.gif │ └── JavaScript │ │ └── page.js ├── index.html ├── usage │ ├── chapter_2_section_4.html │ ├── chapter_3_section_4.html │ ├── chapter_2_section_3.html │ └── chapter_2_section_1.html ├── intro │ └── chapter_1_section_1.html ├── tags │ ├── chapter_3_section_7.html │ ├── chapter_2_section_7.html │ └── chapter_3_section_4.html └── gatherheaderdoc │ └── chapter_7_section_1.html ├── testsuite ├── Makefile ├── sources │ ├── copyright.h │ ├── linktest.h │ ├── meta.h │ ├── defun.h │ ├── availability.h │ ├── textblock.h │ ├── kr_c.c │ ├── javalinktest.java │ ├── overload.h │ ├── KernelFramework.hdoc │ ├── nestclass.h │ ├── tdefenum.h │ ├── enumsTest.h │ ├── mixed.h │ ├── bsh_function.bsh │ ├── sh_function.sh │ ├── ksh_function.ksh │ ├── functionTest.h │ ├── postfuncmod.h │ ├── ObjCProtocol.h │ ├── serialtest.java │ ├── operators.h │ ├── operators_spaces.h │ ├── template.h │ ├── fgroup.h │ ├── ObjCOneClass.h │ ├── ObjCTwoClasses.h │ ├── ObjCTwoClassesOneProtocol.h │ └── grouptest.h ├── mktestout.sh ├── diffhtml.sh ├── testHeaderDoc.sh ├── updateVerifiedOutput.sh ├── testLinkResolver.sh └── difftxt.sh ├── ExampleHeaders ├── copyright.h ├── linktest.h ├── meta.h ├── defun.h ├── availability.h ├── textblock.h ├── kr_c.c ├── linktest.java ├── overload.h ├── nestclass.h ├── classInARow.h ├── enumsTest.h ├── nameoverride.h ├── shell_sample │ ├── bsh_function.bsh │ ├── sh_function.sh │ └── ksh_function.ksh ├── functionTest.h ├── postfuncmod.h ├── Objective-C │ ├── CategoryTests │ │ ├── categoriesOnly │ │ │ ├── TrainsMisc.h │ │ │ └── Boats.h │ │ └── categoryWithOwningClass │ │ │ └── Trains.h │ ├── OneProtocol │ │ └── ObjCProtocol.h │ ├── OneClass │ │ └── ObjCOneClass.h │ ├── TwoClasses │ │ └── ObjCTwoClasses.h │ └── TwoClassesOneProtocol │ │ └── ObjCTwoClassesOneProtocol.h ├── template.h ├── fgroup.h ├── operators_spaces.h └── nestComments.h ├── dpkg └── control ├── FrameworkList ├── headerDoc2HTML.config-standard ├── README ├── xmlman ├── hdxml2manxml.mxml ├── Makefile ├── xml2man.mxml ├── example.mxml └── Syntax ├── headerDoc2HTML.config ├── headerDoc2HTML.config-xcodecolors ├── headerDoc2HTML.config-uglycolors ├── headerDoc2HTML.config-uglyblink ├── Modules └── HeaderDoc │ ├── Regen.pm │ ├── Availability.list │ ├── ClassArray.pm │ ├── ObjCProtocol.pm │ ├── DocReference.pm │ ├── ObjCClass.pm │ ├── MinorAPIElement.pm │ └── DBLookup.pm ├── processFramework.sh ├── Makefile └── exampletoctemplate.html /Documentation/man/mpgl.1: -------------------------------------------------------------------------------- 1 | .so man1/xml2man.1 2 | -------------------------------------------------------------------------------- /Documentation/man/headerdoc.1: -------------------------------------------------------------------------------- 1 | .so man1/headerdoc2html.1 2 | -------------------------------------------------------------------------------- /testsuite/Makefile: -------------------------------------------------------------------------------- 1 | 2 | runtests: 3 | ./testHeaderDoc.sh 4 | ./testLinkResolver.sh 5 | 6 | -------------------------------------------------------------------------------- /Documentation/headerdoc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/headerdoc.pdf -------------------------------------------------------------------------------- /Documentation/WhatsNewInHD8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/WhatsNewInHD8.pdf -------------------------------------------------------------------------------- /Documentation/Resources/Images/1dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/1dot.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/dash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/dash.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/pdf.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/bullet.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/sm_dash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/sm_dash.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/spacer.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/download.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/indexpage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/indexpage.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/pdf_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/pdf_logo.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/sm_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/sm_bullet.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/e_indexpage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/e_indexpage.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/graydiamond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/graydiamond.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/larg_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/larg_bullet.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/second_level.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/second_level.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/vindexpage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/vindexpage.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/rate_page_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/rate_page_icon.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/show_toc_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/show_toc_icon.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/top_level_none.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/top_level_none.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/top_level_open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/top_level_open.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/e_indexpage_range.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/e_indexpage_range.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/indexpage_range.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/indexpage_range.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/sm_opentriangle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/sm_opentriangle.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/third_level_open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/third_level_open.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/top_level_closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/top_level_closed.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/vindexpage_range.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/vindexpage_range.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/third_level_closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/third_level_closed.gif -------------------------------------------------------------------------------- /Documentation/Resources/Images/top_level_closed_gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/headerdoc/HEAD/Documentation/Resources/Images/top_level_closed_gray.gif -------------------------------------------------------------------------------- /ExampleHeaders/copyright.h: -------------------------------------------------------------------------------- 1 | /*! @header copytest 2 | @copyright Apple Computer 3 | */ 4 | 5 | /*! @function copyfunc 6 | This is a pointless function 7 | */ 8 | 9 | int copyfunc(int a); 10 | 11 | -------------------------------------------------------------------------------- /testsuite/sources/copyright.h: -------------------------------------------------------------------------------- 1 | /*! @header copytest 2 | @copyright Apple Computer 3 | */ 4 | 5 | /*! @function copyfunc 6 | This is a pointless function 7 | */ 8 | 9 | int copyfunc(int a); 10 | 11 | -------------------------------------------------------------------------------- /testsuite/mktestout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf test_output 4 | mkdir test_output 5 | for i in sources/* ; do 6 | echo "PROCESSING $i" 7 | ../headerDoc2HTML.pl -o test_output $i 8 | ../headerDoc2HTML.pl -X -o test_output $i 9 | done 10 | 11 | -------------------------------------------------------------------------------- /ExampleHeaders/linktest.h: -------------------------------------------------------------------------------- 1 | /*! @header foo.h 2 | @discussion For more information, see the index or {@link //apple_ref/occ//ObjCClassDeux/classTwoMethodFour:bogusOne:bogusTwo classTwoMethodFour documentation} if you'd like. 3 | */ 4 | -------------------------------------------------------------------------------- /testsuite/sources/linktest.h: -------------------------------------------------------------------------------- 1 | /*! @header foo.h 2 | @discussion For more information, see the index or {@link //apple_ref/occ//ObjCClassDeux/classTwoMethodFour:bogusOne:bogusTwo classTwoMethodFour documentation} if you'd like. 3 | */ 4 | -------------------------------------------------------------------------------- /ExampleHeaders/meta.h: -------------------------------------------------------------------------------- 1 | /*! @header copytest 2 | @copyright Apple Computer 3 | @meta http-equiv="refresh" content="1;http://www.apple.com/" 4 | */ 5 | 6 | /*! @function copyfunc 7 | This is a pointless function 8 | */ 9 | 10 | int copyfunc(int a); 11 | 12 | -------------------------------------------------------------------------------- /testsuite/sources/meta.h: -------------------------------------------------------------------------------- 1 | /*! @header copytest 2 | @copyright Apple Computer 3 | @meta http-equiv="refresh" content="1;http://www.apple.com/" 4 | */ 5 | 6 | /*! @function copyfunc 7 | This is a pointless function 8 | */ 9 | 10 | int copyfunc(int a); 11 | 12 | -------------------------------------------------------------------------------- /ExampleHeaders/defun.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*! @function foo 4 | @param a arg1 5 | @param b arg2 6 | */ 7 | 8 | #define foo(a, b) { printf(a, b) } 9 | 10 | /*! @function bar 11 | @param c arg3 12 | @param d arg4 13 | */ 14 | 15 | #define bar(c, d) { \ 16 | printf(c, d) \ 17 | } 18 | 19 | -------------------------------------------------------------------------------- /testsuite/sources/defun.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*! @function foo 4 | @param a arg1 5 | @param b arg2 6 | */ 7 | 8 | #define foo(a, b) { printf(a, b) } 9 | 10 | /*! @function bar 11 | @param c arg3 12 | @param d arg4 13 | */ 14 | 15 | #define bar(c, d) { \ 16 | printf(c, d) \ 17 | } 18 | 19 | -------------------------------------------------------------------------------- /ExampleHeaders/availability.h: -------------------------------------------------------------------------------- 1 | /*! @header foo.h 2 | @availability 10.2 and later 3 | @discussion foo discussion 4 | @cfbundleidentifier com.mycompany.mybundle 5 | */ 6 | 7 | /*! @function bar 8 | @availability 10.3 and later 9 | @updated 2003-07-22 10 | */ 11 | void bar(int a); 12 | 13 | -------------------------------------------------------------------------------- /ExampleHeaders/textblock.h: -------------------------------------------------------------------------------- 1 | /*! @header 2 | @discussion 3 | 4 | This is an example of how to use a textblock element. 5 | 6 |
7 | @textblock
8 | if (a<3) {
9 | printf("a is less than 3.\n");
10 | }
11 | @/textblock
12 |
13 |
14 | For more information, reread this page.
15 | */
16 |
17 |
--------------------------------------------------------------------------------
/testsuite/sources/availability.h:
--------------------------------------------------------------------------------
1 | /*! @header foo.h
2 | @availability 10.2 and later
3 | @discussion foo discussion
4 | @cfbundleidentifier com.mycompany.mybundle
5 | */
6 |
7 | /*! @function bar
8 | @availability 10.3 and later
9 | @updated 2003-07-22
10 | */
11 | void bar(int a);
12 |
13 |
--------------------------------------------------------------------------------
/ExampleHeaders/kr_c.c:
--------------------------------------------------------------------------------
1 |
2 | /*! @function ansifunc
3 | @discussion test of ANSI C and K&R C mixed.
4 | */
5 | void ansifunc(int a, void b);
6 |
7 | /*! @function main
8 | @discussion doesn't do much
9 | */
10 |
11 | main(a, b)
12 | int a;
13 | char *b;
14 | {
15 | int c;
16 |
17 |
18 |
19 |
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/testsuite/sources/textblock.h:
--------------------------------------------------------------------------------
1 | /*! @header
2 | @discussion
3 |
4 | This is an example of how to use a textblock element.
5 |
6 |
7 | @textblock
8 | if (a<3) {
9 | printf("a is less than 3.\n");
10 | }
11 | @/textblock
12 |
13 |
14 | For more information, reread this page.
15 | */
16 |
17 |
--------------------------------------------------------------------------------
/testsuite/sources/kr_c.c:
--------------------------------------------------------------------------------
1 |
2 | /*! @function ansifunc
3 | @discussion test of ANSI C and K&R C mixed.
4 | */
5 | void ansifunc(int a, void b);
6 |
7 | /*! @function main
8 | @discussion doesn't do much
9 | */
10 |
11 | main(a, b)
12 | int a;
13 | char *b;
14 | {
15 | int c;
16 |
17 |
18 |
19 |
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/dpkg/control:
--------------------------------------------------------------------------------
1 | Package: headerdoc
2 | Maintainer: Darwin Developers For more information on xml2man, see
21 |This program was designed to convert Man Page Generation Language (MPGL) XML 17 | files into mdoc-based manual pages. The MPGL is a fairly direct translation 18 | of mdoc to XML.
19 |For more information on hdxml2manxml, see
23 |Returns kIONotANumber if you can't count.
20 |Returns kIOMoron if you REALLY can't count.
21 |This is a text container, really, but generally contains 46 | lines like this:
47 |Here's a list of conformance:
53 |Here's a definition list:
59 |Here are some bugs:
74 |75 |
I think that pretty much covers it.
82 |Paragraph 10 |
indented block 11 | indented literal text or code 12 |unordered (bullet) list 13 |
ordered (numbered) list 14 |
- list item (in a ul/ol) 15 |
Literal text 16 | 17 | 18 | Also allowed are: 19 | 20 |Path name 21 | Function name 22 | Command name 23 | Operating System 24 | Man page cross-reference *** SEE EXAMPLE *** 25 | 26 | 27 | Here's an example: 28 | 29 | 30 | 103 | 104 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | # Makefile for headerdoc 3 | # Wilfredo Sanchez | wsanchez@apple.com 4 | ## 5 | 6 | 7 | bindir = /usr/bin 8 | # docsDir = /Developer/Documentation/DeveloperTools 9 | program1 = headerdoc2html 10 | program2 = gatherheaderdoc 11 | 12 | perl_libdir := $(shell perl -e 'require Config; print "$$Config::Config{'privlib'}\n";') 13 | startperl := $(shell perl -e 'require Config; print "$$Config::Config{'startperl'}\n";') 14 | 15 | all: 16 | echo ${perl_libdir} 17 | cd xmlman ; make all 18 | 19 | clean: 20 | cd xmlman ; make clean 21 | 22 | installsrc: 23 | mkdir -p "$(SRCROOT)" 24 | tar cf - . | (cd "$(SRCROOT)" && tar xpf -) 25 | 26 | installhdrs: 27 | 28 | build: 29 | 30 | clean: 31 | 32 | test: 33 | cd testsuite ; make ; make runtests ; cd .. 34 | 35 | realinstall: 36 | DSTROOT="" make installsub 37 | 38 | install: all 39 | @echo ; \ 40 | export DSTROOT="/tmp/headerdoc/Release" ; \ 41 | \ 42 | echo "WARNING: Make install by default installs in" ; \ 43 | echo "" ; \ 44 | echo " $$DSTROOT" ; \ 45 | echo "" ; \ 46 | echo "This is primarily intended for building packages." ; \ 47 | echo "If you want to actually install over your" ; \ 48 | echo "existing installation, cancel this make and run" ; \ 49 | echo "\"sudo make realinstall\" instead." ; \ 50 | \ 51 | sleep 5 ; \ 52 | make installsub 53 | 54 | installsub: 55 | 56 | @echo "Destination is: \"${DSTROOT}\"" 57 | 58 | umask 022 && install -d $(DSTROOT)$(perl_libdir)/HeaderDoc 59 | install -c -m 444 Modules/HeaderDoc/*.pm $(DSTROOT)$(perl_libdir)/HeaderDoc 60 | install -c -m 444 Modules/HeaderDoc/Availability.list $(DSTROOT)$(perl_libdir)/HeaderDoc 61 | if [ -f "Modules/HeaderDoc/LinkResolver.pm" ] ; then \ 62 | rm -f $(DSTROOT)$(perl_libdir)/HeaderDoc/LinkResolver.pm ; \ 63 | umask 022 && install -d $(DSTROOT)/AppleInternal/Library/Perl/HeaderDoc ; \ 64 | install -c -m 444 Modules/HeaderDoc/LinkResolver.pm $(DSTROOT)/AppleInternal/Library/Perl/HeaderDoc ; \ 65 | fi 66 | umask 022 && install -d $(DSTROOT)$(bindir) 67 | umask 022 && install -d $(DSTROOT)$(perl_libdir)/HeaderDoc/bin 68 | install -c -m 755 xmlman/xml2man $(DSTROOT)$(bindir)/xml2man 69 | install -c -m 755 xmlman/hdxml2manxml $(DSTROOT)$(bindir)/hdxml2manxml 70 | install -c -m 755 xmlman/resolveLinks $(DSTROOT)$(perl_libdir)/HeaderDoc//bin/resolveLinks 71 | install -c -m 755 headerDoc2HTML.pl $(DSTROOT)$(bindir)/$(program1) 72 | perl -i -pe 's|^#!/usr/bin/perl.*$$|$(startperl)|;' $(DSTROOT)$(bindir)/$(program1) 73 | chmod 555 $(DSTROOT)$(bindir)/$(program1) 74 | umask 022 && install -d $(DSTROOT)$(bindir) 75 | install -c -m 755 gatherHeaderDoc.pl $(DSTROOT)$(bindir)/$(program2) 76 | perl -i -pe 's|^#!/usr/bin/perl.*$$|$(startperl)|;' $(DSTROOT)$(bindir)/$(program2) 77 | chmod 555 $(DSTROOT)$(bindir)/$(program2) 78 | # umask 022 && install -d $(DSTROOT)$(docsDir)/HeaderDoc 79 | # install -c -m 444 Documentation/*.html $(DSTROOT)$(docsDir)/HeaderDoc 80 | umask 022 && install -d $(DSTROOT)/usr/share/man/man1 81 | install -c -m 444 Documentation/man/*.1 $(DSTROOT)/usr/share/man/man1 82 | cd xmlman ; make clean ; cd .. 83 | 84 | -------------------------------------------------------------------------------- /testsuite/sources/ObjCOneClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #importAugust 28, 2002 31 |Document title 32 |Darwin 33 |1 34 |35 | 38 | 39 |foo 36 |this is a description bar 37 |this is also a description 40 | 45 | 46 |a 41 |attributes This is the atts flag d 42 |date This is the date flag x 43 |This is the -x flag filename 44 |This is the filename 47 | 50 | 51 |Returns kIONotANumber if you can't count.
48 |Returns kIOMoron if you REALLY can't count.
49 |52 | TEXT 53 | 54 | 55 |56 | 59 | 60 |/path/to/filename 57 |This is a waste of time /path/to/another/filename 58 |This is also a waste of time 61 | TEXT 62 | 63 | 64 |65 | TEXT 66 | 67 | 68 |69 | TEXT 70 | 71 | 72 |73 | 78 | 79 |This is a text container, really, but generally contains 74 | lines like this:
75 |foo 76 |1 ,bar 77 |3 80 | 86 | 87 |Here's a list of conformance:
81 |82 |
85 |- Single UNIX Specification
83 |- POSIX
84 |88 | This program should be history.... 89 | 90 | 91 |92 | 102 |Here are some bugs:
93 |94 |
95 |
99 | 100 |- Bug one....
96 |- Bug two....
97 |- Bug three....
98 |I think that pretty much covers it.
101 |13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassOne 45 | @abstract NSBox provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassOne : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | 80 | /*! 81 | @method classOneMethodTwo 82 | @abstract Returns a constant representing the title position. 83 | */ 84 | - (NSTitlePosition)classOneMethodTwo; 85 | 86 | /*! 87 | @method dateWithString:calendarFormat: 88 | @abstract Creates and returns a calendar date initialized with the date 89 | specified in the string description. 90 | @discussion Test method three in class one. 91 | @param description A string specifying the date. 92 | @param format Conversion specifiers similar to those used in strftime(). 93 | @result Returns the newly initialized date object or nil on error. 94 | */ 95 | + (id)dateWithString:(NSString *)description calendarFormat:(NSString *)format; 96 | 97 | 98 | @end 99 | 100 | -------------------------------------------------------------------------------- /ExampleHeaders/Objective-C/OneClass/ObjCOneClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassOne 45 | @abstract NSBox provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassOne : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | 80 | /*! 81 | @method classOneMethodTwo 82 | @abstract Returns a constant representing the title position. 83 | */ 84 | - (NSTitlePosition)classOneMethodTwo; 85 | 86 | /*! 87 | @method dateWithString:calendarFormat: 88 | @abstract Creates and returns a calendar date initialized with the date 89 | specified in the string description. 90 | @discussion Test method three in class one. 91 | @param description A string specifying the date. 92 | @param format Conversion specifiers similar to those used in strftime(). 93 | @result Returns the newly initialized date object or nil on error. 94 | */ 95 | + (id)dateWithString:(NSString *)description calendarFormat:(NSString *)format; 96 | 97 | 98 | @end 99 | 100 | -------------------------------------------------------------------------------- /exampletoctemplate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is my favorite title line 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |18 | 19 | 20 | 21 | 22 | 23 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/ClassArray.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: ClassArray 4 | # Synopsis: Holds info about a class line array 5 | # 6 | # Author: David Gatwood (dgatwood@apple.com) 7 | # Last Updated: $Date: 2004/03/10 19:12:16 $ 8 | # 9 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 10 | # 11 | # @APPLE_LICENSE_HEADER_START@ 12 | # 13 | # This file contains Original Code and/or Modifications of Original Code 14 | # as defined in and that are subject to the Apple Public Source License 15 | # Version 2.0 (the 'License'). You may not use this file except in 16 | # compliance with the License. Please obtain a copy of the License at 17 | # http://www.opensource.apple.com/apsl/ and read it before using this 18 | # file. 19 | # 20 | # The Original Code and all software distributed under the License are 21 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 22 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 23 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 25 | # Please see the License for the specific language governing rights and 26 | # limitations under the License. 27 | # 28 | # @APPLE_LICENSE_HEADER_END@ 29 | # 30 | ###################################################################### 31 | package HeaderDoc::ClassArray; 32 | 33 | use HeaderDoc::Utilities qw(findRelativePath safeName getAPINameAndDisc printArray printHash); 34 | 35 | # use HeaderDoc::HeaderElement; 36 | # use HeaderDoc::MinorAPIElement; 37 | # use HeaderDoc::APIOwner; 38 | 39 | # @ISA = qw( HeaderDoc::HeaderElement ); 40 | 41 | use strict; 42 | # use vars qw($VERSION @ISA); 43 | # $VERSION = '1.20'; 44 | 45 | sub new { 46 | my($param) = shift; 47 | my($class) = ref($param) || $param; 48 | my $self = {}; 49 | 50 | bless($self, $class); 51 | $self->_initialize(); 52 | return($self); 53 | } 54 | 55 | sub _initialize { 56 | my($self) = shift; 57 | 58 | # $self->SUPER::_initialize(); 59 | $self->{NAME} = ""; 60 | $self->{BRACECOUNT} = 0; 61 | $self->{LINEARRAY} = (); 62 | } 63 | 64 | sub getarray 65 | { 66 | my $self = shift; 67 | 68 | return @{ $self->{LINEARRAY} }; 69 | } 70 | 71 | sub pushlines 72 | { 73 | my $self = shift; 74 | my @lines = shift; 75 | 76 | foreach my $line (@lines) { 77 | $self->push($line); 78 | } 79 | } 80 | 81 | sub push 82 | { 83 | my $self = shift; 84 | my $line = shift; 85 | my $pushDebug = 0; 86 | 87 | if ($pushDebug) { 88 | my $bc = $self->bracecount(); 89 | print "pushing (bc=$bc) $line\n"; 90 | } 91 | 92 | push(@{ $self->{LINEARRAY} }, $line); 93 | return $line; 94 | } 95 | 96 | sub name { 97 | my $self = shift; 98 | if (@_) { 99 | $self->{NAME} = shift; 100 | } 101 | return $self->{NAME}; 102 | } 103 | 104 | sub bracecount { 105 | my $self = shift; 106 | return $self->{BRACECOUNT}; 107 | } 108 | 109 | sub bracecount_dec { 110 | my $self = shift; 111 | if (@_) { 112 | my $n = shift; 113 | $self->{BRACECOUNT} -= $n; 114 | } else { 115 | $self->{BRACECOUNT}--; 116 | } 117 | return $self->{BRACECOUNT}; 118 | } 119 | 120 | sub bracecount_inc { 121 | my $self = shift; 122 | if (@_) { 123 | my $n = shift; 124 | $self->{BRACECOUNT} += $n; 125 | } else { 126 | $self->{BRACECOUNT}++; 127 | } 128 | return $self->{BRACECOUNT}; 129 | } 130 | 131 | 1; 132 | 133 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/ObjCProtocol.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: ObjCProtocol 4 | # Synopsis: Holds comments pertaining to an ObjC protocol, as parsed by HeaderDoc 5 | # from an objC header 6 | # 7 | # Initial modifications: SKoT McDonald24 |
60 | 61 | 62 | 63 | 64 |25 | 28 |27 |
26 |29 | 33 |30 | 32 |$$framework@@31 |34 | 37 |36 |
35 |38 | 39 | 41 |$$frameworkdiscussion@@ 40 |42 | 44 |43 | 45 | 50 |46 | 49 |
47 |
48 |51 | 59 |52 | 58 |Headers
53 | 54 | $$headerlist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0" width="420"@@ 55 |Functions
56 | $$functionlist cols=3 order=down atts=border="0" cellpadding="1" cellspacing="0" width="420"@@ 57 |65 |
78 |66 | 67 | 68 | 69 | 77 |70 | 76 |71 |75 |This page is Copyright © 2004 Me.
74 |
72 | All rights reserved.
73 | All wrongs reversed.Aug 2001 8 | # 9 | # Based on CPPClass by Matt Morse (matt@apple.com) 10 | # Last Updated: $Date: 2004/06/10 22:12:16 $ 11 | # 12 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 13 | # 14 | # @APPLE_LICENSE_HEADER_START@ 15 | # 16 | # This file contains Original Code and/or Modifications of Original Code 17 | # as defined in and that are subject to the Apple Public Source License 18 | # Version 2.0 (the 'License'). You may not use this file except in 19 | # compliance with the License. Please obtain a copy of the License at 20 | # http://www.opensource.apple.com/apsl/ and read it before using this 21 | # file. 22 | # 23 | # The Original Code and all software distributed under the License are 24 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 25 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 26 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 27 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 28 | # Please see the License for the specific language governing rights and 29 | # limitations under the License. 30 | # 31 | # @APPLE_LICENSE_HEADER_END@ 32 | # 33 | ###################################################################### 34 | BEGIN { 35 | foreach (qw(Mac::Files)) { 36 | $MOD_AVAIL{$_} = eval "use $_; 1"; 37 | } 38 | } 39 | package HeaderDoc::ObjCProtocol; 40 | 41 | use HeaderDoc::Utilities qw(findRelativePath safeName getAPINameAndDisc printArray printHash); 42 | use HeaderDoc::ObjCContainer; 43 | 44 | # Inheritance 45 | @ISA = qw( HeaderDoc::ObjCContainer ); 46 | 47 | use strict; 48 | use vars qw($VERSION @ISA); 49 | $VERSION = '1.20'; 50 | 51 | ################ Portability ################################### 52 | my $isMacOS; 53 | my $pathSeparator; 54 | if ($^O =~ /MacOS/io) { 55 | $pathSeparator = ":"; 56 | $isMacOS = 1; 57 | } else { 58 | $pathSeparator = "/"; 59 | $isMacOS = 0; 60 | } 61 | ################ General Constants ################################### 62 | my $debugging = 0; 63 | my $tracing = 0; 64 | my $outputExtension = ".html"; 65 | my $tocFrameName = "toc.html"; 66 | # my $theTime = time(); 67 | # my ($sec, $min, $hour, $dom, $moy, $year, @rest); 68 | # ($sec, $min, $hour, $dom, $moy, $year, @rest) = localtime($theTime); 69 | # $moy++; 70 | # $year += 1900; 71 | # my $dateStamp = "$moy/$dom/$year"; 72 | ###################################################################### 73 | 74 | sub _initialize { 75 | my($self) = shift; 76 | $self->SUPER::_initialize(); 77 | $self->tocTitlePrefix('Protocol:'); 78 | $self->{CLASS} = "HeaderDoc::ObjCProtocol"; 79 | } 80 | 81 | sub getMethodType { 82 | return "intfm"; 83 | } 84 | 85 | # we add the apple_ref markup to the navigator comment to identify 86 | # to Project Builder and other applications indexing the documentation 87 | # that this is the entry point for documentation for this protocol 88 | sub docNavigatorComment { 89 | my $self = shift; 90 | my $name = $self->name(); 91 | $name =~ s/;//sgo; 92 | my $uid = $self->apiuid("intf"); # "//apple_ref/occ/intf/$name"; 93 | my $navComment = ""; 94 | my $appleRef = ""; 95 | 96 | return "$navComment\n$appleRef"; 97 | } 98 | 99 | ################## Misc Functions ################################### 100 | sub objName { # used for sorting 101 | my $obj1 = $a; 102 | my $obj2 = $b; 103 | return ($obj1->name() cmp $obj2->name()); 104 | } 105 | 106 | 1; 107 | 108 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/DocReference.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: DocReference 4 | # Synopsis: Used by gatherHeaderDoc.pl to hold references to doc 5 | # for individual headers and classes 6 | # Author: Matt Morse (matt@apple.com) 7 | # Last Updated: $Date: 2004/06/02 22:39:14 $ 8 | # 9 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 10 | # 11 | # @APPLE_LICENSE_HEADER_START@ 12 | # 13 | # This file contains Original Code and/or Modifications of Original Code 14 | # as defined in and that are subject to the Apple Public Source License 15 | # Version 2.0 (the 'License'). You may not use this file except in 16 | # compliance with the License. Please obtain a copy of the License at 17 | # http://www.opensource.apple.com/apsl/ and read it before using this 18 | # file. 19 | # 20 | # The Original Code and all software distributed under the License are 21 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 22 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 23 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 25 | # Please see the License for the specific language governing rights and 26 | # limitations under the License. 27 | # 28 | # @APPLE_LICENSE_HEADER_END@ 29 | # 30 | ###################################################################### 31 | package HeaderDoc::DocReference; 32 | 33 | use strict; 34 | use vars qw($VERSION @ISA); 35 | $VERSION = '1.00'; 36 | ################ General Constants ################################### 37 | my $debugging = 0; 38 | 39 | sub new { 40 | my($param) = shift; 41 | my($class) = ref($param) || $param; 42 | my $self = {}; 43 | 44 | bless($self, $class); 45 | $self->_initialize(); 46 | # Now grab any key => value pairs passed in 47 | my (%attributeHash) = @_; 48 | foreach my $key (keys(%attributeHash)) { 49 | my $ucKey = uc($key); 50 | $self->{$ucKey} = $attributeHash{$key}; 51 | } 52 | return ($self); 53 | } 54 | 55 | sub _initialize { 56 | my($self) = shift; 57 | $self->{OUTPUTFORMAT} = undef; 58 | $self->{UID} = undef; 59 | $self->{NAME} = undef; 60 | $self->{TYPE} = undef; # Header, CPPClass, etc 61 | $self->{PATH} = undef; 62 | $self->{LANGUAGE} = ""; 63 | } 64 | 65 | sub path { 66 | my $self = shift; 67 | 68 | if (@_) { 69 | $self->{PATH} = shift; 70 | } 71 | return $self->{PATH}; 72 | } 73 | 74 | 75 | sub language { 76 | my $self = shift; 77 | 78 | if (@_) { 79 | $self->{LANGUAGE} = shift; 80 | } 81 | return $self->{LANGUAGE}; 82 | } 83 | 84 | 85 | sub outputformat { 86 | my $self = shift; 87 | 88 | if (@_) { 89 | $self->{OUTPUTFORMAT} = shift; 90 | } 91 | return $self->{OUTPUTFORMAT}; 92 | } 93 | 94 | 95 | sub uid { 96 | my $self = shift; 97 | 98 | if (@_) { 99 | $self->{UID} = shift; 100 | } 101 | return $self->{UID}; 102 | } 103 | 104 | 105 | sub name { 106 | my $self = shift; 107 | 108 | if (@_) { 109 | $self->{NAME} = shift; 110 | } 111 | return $self->{NAME}; 112 | } 113 | 114 | 115 | sub shortname { 116 | my $self = shift; 117 | 118 | if (@_) { 119 | $self->{SHORTNAME} = shift; 120 | } 121 | return $self->{SHORTNAME}; 122 | } 123 | 124 | 125 | sub type { 126 | my $self = shift; 127 | 128 | if (@_) { 129 | $self->{TYPE} = shift; 130 | } 131 | return $self->{TYPE}; 132 | } 133 | 134 | 135 | sub printObject { 136 | my $self = shift; 137 | 138 | print "----- DocReference Object ------\n"; 139 | print "uid: $self->{UID}\n"; 140 | print "name: $self->{NAME}\n"; 141 | print "type: $self->{TYPE}\n"; 142 | print "path: $self->{PATH}\n"; 143 | print "language: $self->{LANGUAGE}\n"; 144 | print "\n"; 145 | } 146 | 147 | 1; 148 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/ObjCClass.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: ObjCClass 4 | # Synopsis: Container for doc declared in an Objective-C class. 5 | # 6 | # Initial modifications: SKoT McDonald Aug 2001 7 | # 8 | # Based on CPPClass by Matt Morse (matt@apple.com) 9 | # Last Updated: $Date: 2004/06/10 22:12:16 $ 10 | # 11 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 12 | # 13 | # @APPLE_LICENSE_HEADER_START@ 14 | # 15 | # This file contains Original Code and/or Modifications of Original Code 16 | # as defined in and that are subject to the Apple Public Source License 17 | # Version 2.0 (the 'License'). You may not use this file except in 18 | # compliance with the License. Please obtain a copy of the License at 19 | # http://www.opensource.apple.com/apsl/ and read it before using this 20 | # file. 21 | # 22 | # The Original Code and all software distributed under the License are 23 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 24 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 25 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 26 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 27 | # Please see the License for the specific language governing rights and 28 | # limitations under the License. 29 | # 30 | # @APPLE_LICENSE_HEADER_END@ 31 | # 32 | ###################################################################### 33 | BEGIN { 34 | foreach (qw(Mac::Files)) { 35 | $MOD_AVAIL{$_} = eval "use $_; 1"; 36 | } 37 | } 38 | package HeaderDoc::ObjCClass; 39 | 40 | use HeaderDoc::Utilities qw(findRelativePath safeName getAPINameAndDisc printArray printHash); 41 | use HeaderDoc::ObjCContainer; 42 | 43 | # Inheritance 44 | @ISA = qw( HeaderDoc::ObjCContainer ); 45 | 46 | use strict; 47 | use vars qw($VERSION @ISA); 48 | $VERSION = '1.20'; 49 | 50 | ################ Portability ################################### 51 | my $isMacOS; 52 | my $pathSeparator; 53 | if ($^O =~ /MacOS/io) { 54 | $pathSeparator = ":"; 55 | $isMacOS = 1; 56 | } else { 57 | $pathSeparator = "/"; 58 | $isMacOS = 0; 59 | } 60 | ################ General Constants ################################### 61 | my $debugging = 0; 62 | my $tracing = 0; 63 | my $outputExtension = ".html"; 64 | my $tocFrameName = "toc.html"; 65 | # my $theTime = time(); 66 | # my ($sec, $min, $hour, $dom, $moy, $year, @rest); 67 | # ($sec, $min, $hour, $dom, $moy, $year, @rest) = localtime($theTime); 68 | # $moy++; 69 | # $year += 1900; 70 | # my $dateStamp = "$moy/$dom/$year"; 71 | ###################################################################### 72 | 73 | sub _initialize { 74 | my($self) = shift; 75 | $self->SUPER::_initialize(); 76 | $self->tocTitlePrefix('Class:'); 77 | $self->{CLASS} = "HeaderDoc::ObjCClass"; 78 | } 79 | 80 | sub getMethodType { 81 | my $self = shift; 82 | my $declaration = shift; 83 | my $methodType = ""; 84 | 85 | if ($declaration =~ /^\s*-/o) { 86 | $methodType = "instm"; 87 | } elsif ($declaration =~ /^\s*\+/o) { 88 | $methodType = "clm"; 89 | } else { 90 | # my $filename = $HeaderDoc::headerObject->filename(); 91 | my $filename = $self->filename(); 92 | my $linenum = $self->linenum(); 93 | print "$filename:$linenum:Unable to determine whether declaration is for an instance or class method[class].\n"; 94 | print "$filename:$linenum: '$declaration'\n"; 95 | } 96 | return $methodType; 97 | } 98 | 99 | # we add the apple_ref markup to the navigator comment to identify 100 | # to Project Builder and other applications indexing the documentation 101 | # that this is the entry point for documentation for this class 102 | sub docNavigatorComment { 103 | my $self = shift; 104 | my $name = $self->name(); 105 | $name =~ s/;//sgo; 106 | my $uid = $self->apiuid("cl"); # "//apple_ref/occ/cl/$name"; 107 | my $navComment = ""; 108 | my $appleRef = ""; 109 | 110 | return "$navComment\n$appleRef"; 111 | } 112 | 113 | ################## Misc Functions ################################### 114 | sub objName { # used for sorting 115 | my $obj1 = $a; 116 | my $obj2 = $b; 117 | return ($obj1->name() cmp $obj2->name()); 118 | } 119 | 120 | 121 | 1; 122 | -------------------------------------------------------------------------------- /ExampleHeaders/Objective-C/CategoryTests/categoryWithOwningClass/Trains.h: -------------------------------------------------------------------------------- 1 | /* 2 | Trains.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header Trains.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class Trains 45 | @abstract NSBox provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface Trains : Vehicles 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method trainsMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an Train's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)trainsMethodOne; 78 | 79 | 80 | /*! 81 | @method trainsMethodTwo 82 | @abstract Returns a constant representing the title position. 83 | */ 84 | - (NSTitlePosition)trainsMethodTwo; 85 | 86 | /*! 87 | @method dateWithString:calendarFormat: 88 | @abstract Creates and returns a calendar date initialized with the date 89 | specified in the string description. 90 | @discussion Test method three in class one. 91 | @param description A string specifying the date. 92 | @param format Conversion specifiers similar to those used in strftime(). 93 | @result Returns the newly initialized date object or nil on error. 94 | */ 95 | + (id)dateWithString:(NSString *)description calendarFormat:(NSString *)format; 96 | 97 | 98 | @end 99 | 100 | 101 | /*! 102 | @category Trains(TrainsCanFly) 103 | @abstract The TrainsCanFly category adds levitation methods to the Train class. 104 | @discussion Methods declared in the TrainsCanFly category of the Train class can only be used with properly equiped Train objects. 105 | */ 106 | 107 | @interface Trains(TrainsCanFly) 108 | /*! 109 | @method levitateToHeight: 110 | @abstract Raises the train specified number of centimeters 111 | @param height The number of centimeters to levitate. 112 | */ 113 | - (void)levitateToHeight:(float)height; 114 | @end 115 | 116 | /*! 117 | @category Trains(TrainsUnderWater) 118 | @abstract The TrainsUnderWater category adds submarine methods to the Train class. 119 | @discussion Methods declared in the TrainsUnderWater category of the Train class can only be used with properly equiped Train objects and appropriate infrastructure. 120 | */ 121 | 122 | @interface Trains(TrainsUnderWater) 123 | /*! 124 | @method enterChunnelOnTrack: 125 | @abstract Directs the train to Channel Tunnel 126 | @param num Track number. 127 | */ 128 | - (void)enterChunnelOnTrack:(int)num; 129 | @end 130 | 131 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/MinorAPIElement.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: MinorAPIElement 4 | # Synopsis: Class for parameters and members of structs, etc. Primary use 5 | # is to hold info for data export to Inside Mac Database 6 | # 7 | # Author: Matt Morse (matt@apple.com) 8 | # Last Updated: $Date: 2004/06/13 04:59:12 $ 9 | # 10 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 11 | # 12 | # @APPLE_LICENSE_HEADER_START@ 13 | # 14 | # This file contains Original Code and/or Modifications of Original Code 15 | # as defined in and that are subject to the Apple Public Source License 16 | # Version 2.0 (the 'License'). You may not use this file except in 17 | # compliance with the License. Please obtain a copy of the License at 18 | # http://www.opensource.apple.com/apsl/ and read it before using this 19 | # file. 20 | # 21 | # The Original Code and all software distributed under the License are 22 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 23 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 24 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 26 | # Please see the License for the specific language governing rights and 27 | # limitations under the License. 28 | # 29 | # @APPLE_LICENSE_HEADER_END@ 30 | # 31 | ###################################################################### 32 | 33 | package HeaderDoc::MinorAPIElement; 34 | 35 | use HeaderDoc::Utilities qw(findRelativePath safeName getAPINameAndDisc convertCharsForFileMaker printArray printHash); 36 | use HeaderDoc::HeaderElement; 37 | @ISA = qw( HeaderDoc::HeaderElement ); 38 | 39 | use strict; 40 | use vars qw($VERSION @ISA); 41 | $VERSION = '1.20'; 42 | 43 | sub new { 44 | my($param) = shift; 45 | my($class) = ref($param) || $param; 46 | my $self = {}; 47 | 48 | bless($self, $class); 49 | $self->_initialize(); 50 | return ($self); 51 | } 52 | 53 | sub _initialize { 54 | my($self) = shift; 55 | $self->SUPER::_initialize(); 56 | # $self->{POSITION} = undef; 57 | # $self->{TYPE} = undef; 58 | $self->{USERDICTARRAY} = (); 59 | # $self->{HIDDEN} = 0; 60 | $self->{CLASS} = "HeaderDoc::MinorAPIElement"; 61 | } 62 | 63 | sub clone { 64 | my $self = shift; 65 | my $clone = undef; 66 | if (@_) { 67 | $clone = shift; 68 | } else { 69 | $clone = HeaderDoc::MinorAPIElement->new(); 70 | } 71 | 72 | $self->SUPER::clone($clone); 73 | 74 | # now clone stuff specific to function 75 | 76 | $clone->{POSITION} = $self->{POSITION}; 77 | $clone->{TYPE} = $self->{TYPE}; 78 | $clone->{HIDDEN} = $self->{HIDDEN}; 79 | $clone->{USERDICTARRAY} = $self->{USERDICTARRAY}; 80 | 81 | return $clone; 82 | } 83 | 84 | 85 | sub position { 86 | my $self = shift; 87 | 88 | if (@_) { 89 | $self->{POSITION} = shift; 90 | } 91 | return $self->{POSITION}; 92 | } 93 | 94 | sub hidden { 95 | my $self = shift; 96 | 97 | if (@_) { 98 | $self->{HIDDEN} = shift; 99 | } 100 | return $self->{HIDDEN}; 101 | } 102 | 103 | sub type { 104 | my $self = shift; 105 | 106 | if (@_) { 107 | $self->{TYPE} = shift; 108 | } 109 | return $self->{TYPE}; 110 | } 111 | 112 | # for miscellaneous data, such as the parameters within a typedef'd struct of callbacks 113 | # stored as an array to preserve order. 114 | sub userDictArray { 115 | my $self = shift; 116 | 117 | if (@_) { 118 | @{ $self->{USERDICTARRAY} } = @_; 119 | } 120 | ($self->{USERDICTARRAY}) ? return @{ $self->{USERDICTARRAY} } : return (); 121 | } 122 | 123 | sub addToUserDictArray { 124 | my $self = shift; 125 | 126 | if (@_) { 127 | foreach my $item (@_) { 128 | push (@{ $self->{USERDICTARRAY} }, $item); 129 | } 130 | } 131 | return @{ $self->{USERDICTARRAY} }; 132 | } 133 | 134 | 135 | sub addKeyAndValueInUserDict { 136 | my $self = shift; 137 | 138 | if (@_) { 139 | my $key = shift; 140 | my $value = shift; 141 | $self->{USERDICT}{$key} = $value; 142 | } 143 | return %{ $self->{USERDICT} }; 144 | } 145 | 146 | sub printObject { 147 | my $self = shift; 148 | my $dec = $self->declaration(); 149 | 150 | $self->SUPER::printObject(); 151 | print "position: $self->{POSITION}\n"; 152 | print "type: $self->{TYPE}\n"; 153 | } 154 | 155 | 1; 156 | -------------------------------------------------------------------------------- /ExampleHeaders/operators_spaces.h: -------------------------------------------------------------------------------- 1 | /*! @functiongroup Operators */ 2 | 3 | /*! 4 | @function operator << 5 | @abstract Inequality operator 6 | @discussion All message contents, including the parameters, are checked. 7 | @result True if the messages are different. 8 | @param inOtherMessage The message to compare. 9 | */ 10 | bool 11 | operator << ( 12 | const Message &inOtherMessage) const 13 | { 14 | return !(*this == inOtherMessage); 15 | } 16 | 17 | /*! 18 | @function operator >> 19 | @abstract Inequality operator 20 | @discussion All message contents, including the parameters, are checked. 21 | @result True if the messages are different. 22 | @param inOtherMessage The message to compare. 23 | */ 24 | bool 25 | operator >> ( 26 | const Message &inOtherMessage) const 27 | { 28 | return !(*this == inOtherMessage); 29 | } 30 | /*! 31 | @constant foo 32 | */ 33 | const int foo; 34 | 35 | /*! 36 | @function operator == 37 | @abstract Equality operator 38 | @discussion All message contents, including the parameters, are checked. 39 | @result True if the messages are identical. 40 | @param inOtherMessage The message to compare. 41 | */ 42 | bool 43 | operator == ( 44 | const Message &inOtherMessage) const; 45 | /*! 46 | @function operator != 47 | @abstract Inequality operator 48 | @discussion All message contents, including the parameters, are checked. 49 | @result True if the messages are different. 50 | @param inOtherMessage The message to compare. 51 | */ 52 | bool 53 | operator != ( 54 | const Message &inOtherMessage) const 55 | { 56 | return !(*this == inOtherMessage); 57 | } 58 | 59 | /*! 60 | @function operator + 61 | @abstract Addition operator 62 | @discussion All message contents, including the parameters, are checked. 63 | @result I dunno what this does.... 64 | @param inOtherMessage The message to compare. 65 | */ 66 | bool 67 | operator +( 68 | const Message &inOtherMessage) const 69 | { 70 | return !(*this == inOtherMessage); 71 | } 72 | 73 | /*! 74 | @function operator ++ 75 | @abstract Increment operator 76 | @discussion All message contents, including the parameters, are checked. 77 | @result I dunno what this does.... 78 | @param inOtherMessage The message to compare. 79 | */ 80 | bool 81 | operator ++( 82 | const Message &inOtherMessage) const 83 | { 84 | return !(*this == inOtherMessage); 85 | } 86 | 87 | /*! 88 | @function operator - 89 | @abstract Subtraction operator 90 | @discussion All message contents, including the parameters, are checked. 91 | @result I dunno what this does.... 92 | @param inOtherMessage The message to compare. 93 | */ 94 | bool 95 | operator -( 96 | const Message &inOtherMessage) const 97 | { 98 | return !(*this == inOtherMessage); 99 | } 100 | 101 | /*! 102 | @function operator -- 103 | @abstract Decrement operator 104 | @discussion All message contents, including the parameters, are checked. 105 | @result I dunno what this does.... 106 | @param inOtherMessage The message to compare. 107 | */ 108 | bool 109 | operator --( 110 | const Message &inOtherMessage) const 111 | { 112 | return !(*this == inOtherMessage); 113 | } 114 | 115 | /*! 116 | @function operator * 117 | @abstract Multiplication operator 118 | @discussion All message contents, including the parameters, are checked. 119 | @result I dunno what this does.... 120 | @param inOtherMessage The message to compare. 121 | */ 122 | bool 123 | operator *( 124 | const Message &inOtherMessage) const 125 | { 126 | return !(*this == inOtherMessage); 127 | } 128 | 129 | /*! 130 | @function operator / 131 | @abstract Division operator 132 | @discussion All message contents, including the parameters, are checked. 133 | @result I dunno what this does.... 134 | @param inOtherMessage The message to compare. 135 | */ 136 | bool 137 | operator /( 138 | const Message &inOtherMessage) const 139 | { 140 | return !(*this == inOtherMessage); 141 | } 142 | 143 | 144 | -------------------------------------------------------------------------------- /testsuite/sources/ObjCTwoClasses.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassAlpha 45 | @abstract ObjCClassAlpha provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassAlpha : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | /*! 80 | @method classOneMethodTwo 81 | @abstract Returns a constant representing the title position. 82 | */ 83 | - (NSTitlePosition)classOneMethodTwo; 84 | 85 | @end 86 | 87 | /*! 88 | @class ObjCClassBeta 89 | @abstract ObjCClassBeta provides a visual grouping element. 90 | @discussion An NSBox object is a simple NSView that can do two things: It can draw a border around itself, and it can title itself. 91 | */ 92 | 93 | @interface ObjCClassBeta : NSObject 94 | { 95 | /*All instance variables are private*/ 96 | struct __bFlags { 97 | NSBorderType borderType:2; 98 | NSTitlePosition titlePosition:3; 99 | unsigned int transparent:1; 100 | unsigned int boxType:2; 101 | unsigned int _RESERVED:24; 102 | } _bFlags; 103 | id _unused; 104 | } 105 | 106 | /*! 107 | @method classTwoMethodOne 108 | @abstract Returns the receiver's border type. 109 | @discussion Returns the receiver's border type. Border types are defined in NSView.h. Currently, the following border types are defined: 110 | 111 | * NSNoBorder 112 | 113 | * NSLineBorder 114 | 115 | * NSBezelBorder 116 | 117 | * NSGrooveBorder 118 | 119 | By default, an NSBox's border type is NSGrooveBorder. 120 | */ 121 | - (NSBorderType)classTwoMethodOne; 122 | 123 | /*! 124 | @method classTwoMethodTwo 125 | @abstract Returns a constant representing the title position. 126 | */ 127 | - (NSTitlePosition)classTwoMethodTwo; 128 | 129 | /*! 130 | @method classTwoMethodThree 131 | @abstract Sets the border type to aType, which must be a valid border type. 132 | @discussion Border types are defined in NSView.h. Currently, the following border types are defined: 133 | 134 | * NSNoBorder 135 | * NSLineBorder 136 | * NSBezelBorder 137 | * NSGrooveBorder 138 | 139 | By default, an NSBox's border type is NSGrooveBorder. 140 | 141 | @param aType The specified type. 142 | */ 143 | - (void)classTwoMethodThree:(NSBorderType)aType; 144 | 145 | /*! 146 | @method classTwoMethodFour:bogusOne:bogusTwo 147 | @abstract Sets the title position and includes two bogus args for 148 | testing purposes 149 | @param bogusOne Fictive at best. 150 | @param bogusTwo This argument is rarely used. 151 | */ 152 | - (void)classTwoMethodFour:(NSTitlePosition)aPosition bogusOne:(NSView *)bogusOne bogusTwo:(NSView *)bogusTwo; 153 | 154 | @end 155 | 156 | 157 | -------------------------------------------------------------------------------- /ExampleHeaders/Objective-C/TwoClasses/ObjCTwoClasses.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassAlpha 45 | @abstract ObjCClassAlpha provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassAlpha : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | /*! 80 | @method classOneMethodTwo 81 | @abstract Returns a constant representing the title position. 82 | */ 83 | - (NSTitlePosition)classOneMethodTwo; 84 | 85 | @end 86 | 87 | /*! 88 | @class ObjCClassBeta 89 | @abstract ObjCClassBeta provides a visual grouping element. 90 | @discussion An NSBox object is a simple NSView that can do two things: It can draw a border around itself, and it can title itself. 91 | */ 92 | 93 | @interface ObjCClassBeta : NSObject 94 | { 95 | /*All instance variables are private*/ 96 | struct __bFlags { 97 | NSBorderType borderType:2; 98 | NSTitlePosition titlePosition:3; 99 | unsigned int transparent:1; 100 | unsigned int boxType:2; 101 | unsigned int _RESERVED:24; 102 | } _bFlags; 103 | id _unused; 104 | } 105 | 106 | /*! 107 | @method classTwoMethodOne 108 | @abstract Returns the receiver's border type. 109 | @discussion Returns the receiver's border type. Border types are defined in NSView.h. Currently, the following border types are defined: 110 | 111 | * NSNoBorder 112 | 113 | * NSLineBorder 114 | 115 | * NSBezelBorder 116 | 117 | * NSGrooveBorder 118 | 119 | By default, an NSBox's border type is NSGrooveBorder. 120 | */ 121 | - (NSBorderType)classTwoMethodOne; 122 | 123 | /*! 124 | @method classTwoMethodTwo 125 | @abstract Returns a constant representing the title position. 126 | */ 127 | - (NSTitlePosition)classTwoMethodTwo; 128 | 129 | /*! 130 | @method classTwoMethodThree 131 | @abstract Sets the border type to aType, which must be a valid border type. 132 | @discussion Border types are defined in NSView.h. Currently, the following border types are defined: 133 | 134 | * NSNoBorder 135 | * NSLineBorder 136 | * NSBezelBorder 137 | * NSGrooveBorder 138 | 139 | By default, an NSBox's border type is NSGrooveBorder. 140 | 141 | @param aType The specified type. 142 | */ 143 | - (void)classTwoMethodThree:(NSBorderType)aType; 144 | 145 | /*! 146 | @method classTwoMethodFour:bogusOne:bogusTwo 147 | @abstract Sets the title position and includes two bogus args for 148 | testing purposes 149 | @param bogusOne Fictive at best. 150 | @param bogusTwo This argument is rarely used. 151 | */ 152 | - (void)classTwoMethodFour:(NSTitlePosition)aPosition bogusOne:(NSView *)bogusOne bogusTwo:(NSView *)bogusTwo; 153 | 154 | @end 155 | 156 | 157 | -------------------------------------------------------------------------------- /Documentation/usage/chapter_2_section_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HeaderDoc Unfettered: Cocoa Front End 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Cocoa Front End
52 |Kyle Hammond has made a Cocoa front end available for HeaderDoc. 53 | Mac OS X users can download this from their website at http://www.isd.net/dsl03002/CocoaProgramming.html.
54 | 55 |
56 | 57 |80 | 81 |
58 | 59 | 60 | 61 | 72 | 73 | 74 | 75 | 76 | < Previous PageNext Page > 77 | 78 | 79 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ExampleHeaders/nestComments.h: -------------------------------------------------------------------------------- 1 | /*! @header 2 | This header tests single-line and c-style headerdoc 3 | markup embedded in the body of a struct or other block. 4 | */ 5 | 6 | /*! 7 | @struct SimpleStruct 8 | @abstract Abstract for this API. 9 | @discussion Discussion that applies to the entire simple struct. 10 | */ 11 | 12 | struct _structTag { 13 | short firstField; /*! @field firstField 1 Description of first field */ 14 | unsigned long secondField; /*! @field secondField 1 Description of second field */ 15 | } SimpleStruct; 16 | 17 | 18 | /*! 19 | @typedef TypedefdSimpleStruct 20 | @abstract Abstract for this API. 21 | @discussion Discussion that applies to the entire typedef'd simple struct. 22 | */ 23 | 24 | typedef struct _structTag { 25 | short //! @field firstField 1 Description of first field 26 | firstField; 27 | unsigned long secondFieldX //! 1 Description of second field 28 | } TypedefdSimpleStruct; 29 | 30 | /*! 31 | @typedef TypedefdEnum 32 | @abstract Abstract for this API. 33 | @discussion Discussion that applies to the entire typedef'd enum. 34 | */ 35 | 36 | typedef enum { 37 | kCFCompareLessThan = -1, /*! @constant kCFCompareLessThan Description of first constant. */ 38 | kCFCompareEqualTo = 0, /*! @constant kCFCompareEqualTo Description of second constant. */ 39 | kCFCompareGreaterThan = 1 /*! Description of third constant. */ 40 | } TypedefdEnum; 41 | 42 | 43 | /*! 44 | @typedef simpleCallback 45 | @abstract Abstract for this API. 46 | @discussion Discussion that applies to the entire callback. 47 | @result Returns what it can when it is possible to do so. 48 | */ 49 | typedef long (*simpleCallback)( 50 | short inFirstParameter, /*! @param inFirstParameter Description of the callback's first parameter. */ 51 | unsigned long long *outSecondParameter /*! @param outSecondParameter Description of the callback's second parameter. */ 52 | ); 53 | 54 | 55 | /*! @typedef This is a TypedefdStructWithCallbacks 56 | @abstract Abstract for this API. 57 | @discussion Defines the basic interface for Command DescriptorBlock (CDB) commands, which you use 58 | to control SCSI Architectural Model (SAM) devices, including ATAPI, Firewire SBP2, and SCSI devices. 59 | 60 | @field firstField 1 Description of first field. 61 | 62 | @callback getPointers Gets the location of the data buffer for an I/O command. The buffer 63 | can be in one or more, possibly discontiguous, locations. 64 | 65 | The getPointers function has the following parameters: 66 | @param cmd A pointer to the CDB command interface instance for the current command. 67 | You must always pass this reference. 68 | 69 | @param outSGList A pointer to a pointer to a scatter/gather list (scatter for reading, gather for writing) 70 | containing one or more records that specify the ranges of virtual memory in the command's 71 | I/O buffer. Each element in a scatter/gather list describes the location and size of one buffer, 72 | allowing you to group multiple buffers of any size into a single virtual buffer for an 73 | I/O transaction. On return, the list specifies the I/O buffer for the command. 74 | 75 | @param outSGEntries On return, specifies the number of records in the scatter/gather list pointed to 76 | by the outSGList parameter. 77 | 78 | @param outTransferCount On return, the maximum data transfer count in bytes for the 79 | command. 80 | 81 | @param outIsWrite On return, specifies whether the command is a write command (true), 82 | or a read command (false) 83 | 84 | @field lastField Description of the struct's last field. 85 | */ 86 | typedef struct _someTag { 87 | IUNKNOWN_C_GUTS; 88 | short firstField; 89 | 90 | /* Set the data pointers */ 91 | /*! 92 | @callback setPointers Specifies the location of the data buffer for an I/O command, 93 | as well as the maximum data transfer count and data transfer direction. 94 | 95 | The setPointers function has the following parameters: 96 | @param cmd A pointer to the CDB command interface instance for the current command. 97 | You must always pass this reference. 98 | 99 | @param sgList A pointer to a scatter/gather list (scatter for reading, gather for writing) 100 | containing one or more records that specify the ranges of virtual memory in the command's 101 | I/O buffer. Each element in a scatter/gather list describes the location and size of one buffer, 102 | allowing you to group multiple buffers of any size into a single virtual buffer for an 103 | I/O transaction. You can pass NULL for this parameter (for a command that doesn't require 104 | a data buffer). 105 | 106 | @result An IOReturn structure which returns the return value in the structure returned. 107 | */ 108 | 109 | IOReturn (*setPointers)(void *cmd, 110 | IOVirtualRange *sgList); 111 | void (*getPointers)(void *cmd, IOVirtualRange **outSGList, int *outSGEntries, UInt32 *outTransferCount, Boolean *outIsWrite); 112 | 113 | unsigned long lastField; 114 | } TypedefdStructWithCallbacks; 115 | 116 | -------------------------------------------------------------------------------- /Documentation/usage/chapter_3_section_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Tools: HeaderDoc Unfettered: Cocoa Front End 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Cocoa Front End
52 |Kyle Hammond has made a Cocoa front end available for HeaderDoc. 53 | Mac OS X users can download this from their website at http://www.isd.net/dsl03002/CocoaProgramming.html.
54 | 55 |
56 | 57 |80 | 81 |
58 | 59 | 60 | 61 | 72 | 73 | 74 | 75 | 76 | < Previous PageNext Page > 77 | 78 | 79 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /testsuite/sources/ObjCTwoClassesOneProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassUn 45 | @abstract ObjCClassUn provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassUn : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | /*! 80 | @method classOneMethodTwo 81 | @abstract Returns a constant representing the title position. 82 | */ 83 | - (NSTitlePosition)classOneMethodTwo; 84 | 85 | @end 86 | 87 | /*! 88 | @class ObjCClassDeux 89 | @abstract ObjCClassDeux provides a visual grouping element. 90 | @discussion An NSBox object is a simple NSView that can do two things: It can draw a border around itself, and it can title itself. 91 | */ 92 | 93 | @interface ObjCClassDeux : NSObject 94 | { 95 | /*All instance variables are private*/ 96 | struct __bFlags { 97 | NSBorderType borderType:2; 98 | NSTitlePosition titlePosition:3; 99 | unsigned int transparent:1; 100 | unsigned int boxType:2; 101 | unsigned int _RESERVED:24; 102 | } _bFlags; 103 | id _unused; 104 | } 105 | 106 | /*! 107 | @method classTwoMethodOne 108 | @abstract Returns the receiver's border type. 109 | @discussion Returns the receiver's border type. Border types are defined in NSView.h. Currently, the following border types are defined: 110 | 111 | * NSNoBorder 112 | 113 | * NSLineBorder 114 | 115 | * NSBezelBorder 116 | 117 | * NSGrooveBorder 118 | 119 | By default, an NSBox's border type is NSGrooveBorder. 120 | */ 121 | - (NSBorderType)classTwoMethodOne; 122 | 123 | /*! 124 | @method classTwoMethodTwo 125 | @abstract Returns a constant representing the title position. 126 | */ 127 | - (NSTitlePosition)classTwoMethodTwo; 128 | 129 | /*! 130 | @method classTwoMethodThree 131 | @abstract Sets the border type to aType, which must be a valid border type. 132 | @discussion Border types are defined in NSView.h. Currently, the following border types are defined: 133 | 134 | * NSNoBorder 135 | * NSLineBorder 136 | * NSBezelBorder 137 | * NSGrooveBorder 138 | 139 | By default, an NSBox's border type is NSGrooveBorder. 140 | 141 | @param aType The specified type. 142 | */ 143 | - (void)classTwoMethodThree:(NSBorderType)aType; 144 | 145 | /*! 146 | @method classTwoMethodFour:bogusOne:bogusTwo 147 | @abstract Sets the title position and includes two bogus args for 148 | testing purposes 149 | @param bogusOne Fictive at best. 150 | @param bogusTwo This argument is rarely used. 151 | */ 152 | - (void)classTwoMethodFour:(NSTitlePosition)aPosition bogusOne:(NSView *)bogusOne bogusTwo:(NSView *)bogusTwo; 153 | 154 | @end 155 | 156 | /*! 157 | @protocol ObjCValidatorProtocol 158 | @abstract Protocol implemented by validator objects. 159 | @discussion All validator objects validate--in fact, they can't 160 | help themselves. That's what they do. 161 | */ 162 | 163 | @protocol ObjCValidatorProtocol 164 | /*! 165 | @method validateUserInterfaceItem: 166 | @abstract Validates the specified item. 167 | @param anItem The item to be validated. 168 | */ 169 | - (BOOL)validateUserInterfaceItem:(id )anItem; 170 | @end 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /ExampleHeaders/Objective-C/TwoClassesOneProtocol/ObjCTwoClassesOneProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | @class NSFont; 15 | 16 | /*! 17 | @typedef NSTitlePosition 18 | Constants that represent title positions. 19 | @abstract Abstract for this API. 20 | @discussion Discussion that applies to the entire typedef'd enum. 21 | @constant NSNoTitle No title. 22 | @constant NSAboveTop Description of second constant. 23 | @constant NSAtTop Description of third constant. 24 | */ 25 | typedef enum _NSTitlePosition { 26 | NSNoTitle = 0, 27 | NSAboveTop = 1, 28 | NSAtTop = 2, 29 | NSBelowTop = 3, 30 | NSAboveBottom = 4, 31 | NSAtBottom = 5, 32 | NSBelowBottom = 6 33 | } NSTitlePosition; 34 | 35 | typedef enum { 36 | NSBoxPrimary = 0, // default 37 | NSBoxSecondary = 1, 38 | NSBoxSeparator = 2, 39 | NSBoxOldStyle = 3 // use border type 40 | } NSBoxType; 41 | 42 | 43 | /*! 44 | @class ObjCClassUn 45 | @abstract ObjCClassUn provides a visual grouping element. 46 | @discussion An NSBox object is a simple NSView that can do two things: 47 | It can draw a border around itself, and it can title itself. 48 | */ 49 | 50 | @interface ObjCClassUn : NSObject 51 | { 52 | /*All instance variables are private*/ 53 | id _titleCell; 54 | id _contentView; 55 | NSSize _offsets; 56 | NSRect _borderRect; 57 | NSRect _titleRect; 58 | id _unused; 59 | } 60 | 61 | /*! 62 | @method classOneMethodOne 63 | @abstract Returns the receiver's border type. 64 | @discussion Returns the receiver's border type. Border types are defined 65 | in NSView.h. Currently, the following border types are defined: 66 | 67 | * NSNoBorder 68 | 69 | * NSLineBorder 70 | 71 | * NSBezelBorder 72 | 73 | * NSGrooveBorder 74 | 75 | By default, an NSBox's border type is NSGrooveBorder. 76 | */ 77 | - (NSBorderType)classOneMethodOne; 78 | 79 | /*! 80 | @method classOneMethodTwo 81 | @abstract Returns a constant representing the title position. 82 | */ 83 | - (NSTitlePosition)classOneMethodTwo; 84 | 85 | @end 86 | 87 | /*! 88 | @class ObjCClassDeux 89 | @abstract ObjCClassDeux provides a visual grouping element. 90 | @discussion An NSBox object is a simple NSView that can do two things: It can draw a border around itself, and it can title itself. 91 | */ 92 | 93 | @interface ObjCClassDeux : NSObject 94 | { 95 | /*All instance variables are private*/ 96 | struct __bFlags { 97 | NSBorderType borderType:2; 98 | NSTitlePosition titlePosition:3; 99 | unsigned int transparent:1; 100 | unsigned int boxType:2; 101 | unsigned int _RESERVED:24; 102 | } _bFlags; 103 | id _unused; 104 | } 105 | 106 | /*! 107 | @method classTwoMethodOne 108 | @abstract Returns the receiver's border type. 109 | @discussion Returns the receiver's border type. Border types are defined in NSView.h. Currently, the following border types are defined: 110 | 111 | * NSNoBorder 112 | 113 | * NSLineBorder 114 | 115 | * NSBezelBorder 116 | 117 | * NSGrooveBorder 118 | 119 | By default, an NSBox's border type is NSGrooveBorder. 120 | */ 121 | - (NSBorderType)classTwoMethodOne; 122 | 123 | /*! 124 | @method classTwoMethodTwo 125 | @abstract Returns a constant representing the title position. 126 | */ 127 | - (NSTitlePosition)classTwoMethodTwo; 128 | 129 | /*! 130 | @method classTwoMethodThree 131 | @abstract Sets the border type to aType, which must be a valid border type. 132 | @discussion Border types are defined in NSView.h. Currently, the following border types are defined: 133 | 134 | * NSNoBorder 135 | * NSLineBorder 136 | * NSBezelBorder 137 | * NSGrooveBorder 138 | 139 | By default, an NSBox's border type is NSGrooveBorder. 140 | 141 | @param aType The specified type. 142 | */ 143 | - (void)classTwoMethodThree:(NSBorderType)aType; 144 | 145 | /*! 146 | @method classTwoMethodFour:bogusOne:bogusTwo 147 | @abstract Sets the title position and includes two bogus args for 148 | testing purposes 149 | @param bogusOne Fictive at best. 150 | @param bogusTwo This argument is rarely used. 151 | */ 152 | - (void)classTwoMethodFour:(NSTitlePosition)aPosition bogusOne:(NSView *)bogusOne bogusTwo:(NSView *)bogusTwo; 153 | 154 | @end 155 | 156 | /*! 157 | @protocol ObjCValidatorProtocol 158 | @abstract Protocol implemented by validator objects. 159 | @discussion All validator objects validate--in fact, they can't 160 | help themselves. That's what they do. 161 | */ 162 | 163 | @protocol ObjCValidatorProtocol 164 | /*! 165 | @method validateUserInterfaceItem: 166 | @abstract Validates the specified item. 167 | @param anItem The item to be validated. 168 | */ 169 | - (BOOL)validateUserInterfaceItem:(id )anItem; 170 | @end 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /Documentation/intro/chapter_1_section_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Tools: HeaderDoc Unfettered: Introduction to HeaderDoc: API Documentation From Header Files 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | Next Page > 45 | 46 | 47 |
50 | 51 |Introduction to HeaderDoc: API Documentation 52 | From Header Files
This document describes how to use the HeaderDoc 53 | tool. It also explains how to insert HeaderDoc comments into your 54 | headers and other files.
55 | 56 | 57 | 58 | 59 | 60 |Contents:
61 | 62 |63 | 64 | What is HeaderDoc? 65 | 66 |73 | 74 | 75 | 76 |
67 | 68 | Organization of this Document 69 | 70 |
71 | 72 |
77 | 78 |101 | 102 |
79 | 80 | 81 | 82 | 93 | 94 | 95 | 96 | 97 | Next Page > 98 | 99 | 100 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /Modules/HeaderDoc/DBLookup.pm: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | # 3 | # Class name: DBLookup 4 | # Synopsis: Encapsulates the look-up tables and routines to get info 5 | # from database output. Since we need only one of these DBLookups 6 | # we implement only class methods 7 | # 8 | # Author: Matt Morse (matt@apple.com) 9 | # Last Updated: $Date: 2004/03/10 19:12:17 $ 10 | # 11 | # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. 12 | # 13 | # @APPLE_LICENSE_HEADER_START@ 14 | # 15 | # This file contains Original Code and/or Modifications of Original Code 16 | # as defined in and that are subject to the Apple Public Source License 17 | # Version 2.0 (the 'License'). You may not use this file except in 18 | # compliance with the License. Please obtain a copy of the License at 19 | # http://www.opensource.apple.com/apsl/ and read it before using this 20 | # file. 21 | # 22 | # The Original Code and all software distributed under the License are 23 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 24 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 25 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 26 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 27 | # Please see the License for the specific language governing rights and 28 | # limitations under the License. 29 | # 30 | # @APPLE_LICENSE_HEADER_END@ 31 | # 32 | ###################################################################### 33 | 34 | ## 35 | ## This module is slated to be removed in future releases. It was used 36 | ## for special purpose dumps of the documentation, and is no longer needed. 37 | ## If you rely on this module, please send a note to matt@apple.com and 38 | ## we can reconsider its future. 39 | ## 40 | 41 | 42 | package HeaderDoc::DBLookup; 43 | 44 | use strict; 45 | use vars qw($VERSION @ISA); 46 | $VERSION = '1.20'; 47 | 48 | ################ Portability ################################### 49 | my $isMacOS; 50 | my $pathSeparator; 51 | if ($^O =~ /MacOS/i) { 52 | $pathSeparator = ":"; 53 | $isMacOS = 1; 54 | } else { 55 | $pathSeparator = "/"; 56 | $isMacOS = 0; 57 | } 58 | 59 | ################ General Constants ################################### 60 | my $debugging = 0; 61 | 62 | # my $theTime = time(); 63 | # my ($sec, $min, $hour, $dom, $moy, $year, @rest); 64 | # ($sec, $min, $hour, $dom, $moy, $year, @rest) = localtime($theTime); 65 | # $moy++; 66 | # $year += 1900; 67 | # my $dateStamp = "$moy/$dom/$year"; 68 | ###################################################################### 69 | 70 | ################ Lookup Hashes ################################### 71 | my %datatypeNameToIDHash; 72 | my %functionNameToIDHash; 73 | ###################################################################### 74 | 75 | 76 | sub loadUsingFolderAndFiles { 77 | my($class) = shift; 78 | my $folder = shift; 79 | my $functionFilename = shift; 80 | my $typesFilename = shift; 81 | my $enumsFilename = shift; 82 | 83 | if (ref $class) { die "Class method called as object method" }; 84 | 85 | ###################### Read in lookup table of functionID to name ###################### 86 | my $functionTable = $folder.$pathSeparator.$functionFilename; 87 | open(FUNCIDS, "<$functionTable") || die "Can't open $functionTable.\n"; 88 | my @funcIDLines =; 89 | close FUNCIDS; 90 | foreach my $line (@funcIDLines) { 91 | if ($line =~/^#/) {next;}; 92 | chomp $line; 93 | my ($funcID, $funcName); 94 | ($funcID, $funcName) = split (/\t/, $line); 95 | if (length($funcID)) { 96 | $functionNameToIDHash{$funcName} = $funcID; 97 | } 98 | } 99 | undef @funcIDLines; 100 | 101 | ###################### Read in lookup table of typeID to name ###################### 102 | my $typeTable = $folder.$pathSeparator.$typesFilename; 103 | open(TYPEIDS, "<$typeTable") || die "Can't open $typeTable.\n"; 104 | my @typeIDLines = ; 105 | close TYPEIDS; 106 | foreach my $line (@typeIDLines) { 107 | if ($line =~/^#/) {next;}; 108 | chomp $line; 109 | my ($typeID, $typeName); 110 | ($typeID, $typeName) = split (/\t/, $line); 111 | if (length($typeID)) { 112 | $datatypeNameToIDHash{$typeName} = $typeID; 113 | } 114 | } 115 | undef @typeIDLines; 116 | 117 | ###################### Read in lookup table of enumID to name ###################### 118 | ##### Add this to the types lookup since enums are often identified by the name of their first constant ##### 119 | my $enumTable = $folder.$pathSeparator.$enumsFilename; 120 | open(ENUMIDS, "<$enumTable") || die "Can't open $enumTable.\n"; 121 | my @enumIDLines = ; 122 | close ENUMIDS; 123 | foreach my $line (@enumIDLines) { 124 | if ($line =~/^#/) {next;}; 125 | chomp $line; 126 | my ($enumID, $enumName); 127 | ($enumID, $enumName) = split (/\t/, $line); 128 | if (length($enumID)) { 129 | $datatypeNameToIDHash{$enumName} = $enumID; 130 | } 131 | } 132 | undef @enumIDLines; 133 | } 134 | 135 | sub dataTypeNameToIDHash { 136 | return %datatypeNameToIDHash; 137 | } 138 | 139 | sub functionNameToIDHash { 140 | return %functionNameToIDHash; 141 | } 142 | 143 | sub functionIDForName { 144 | my $class = shift; 145 | my $name = shift; 146 | 147 | if (exists ($functionNameToIDHash{$name})) { 148 | return $functionNameToIDHash{$name}; 149 | } else { 150 | return "UNKNOWN_ID"; 151 | } 152 | } 153 | 154 | sub typeIDForName { 155 | my $class = shift; 156 | my $name = shift; 157 | 158 | if (exists ($datatypeNameToIDHash{$name})) { 159 | return $datatypeNameToIDHash{$name}; 160 | } else { 161 | return "UNKNOWN_ID"; 162 | } 163 | } 164 | 165 | 1; 166 | -------------------------------------------------------------------------------- /testsuite/sources/grouptest.h: -------------------------------------------------------------------------------- 1 | /* 2 | ObjCTestHeader.h 3 | Application Kit 4 | Copyright (c) 1994-1997, Apple Computer, Inc. 5 | All rights reserved. 6 | */ 7 | 8 | /*! @header ObjCTestHeader.h 9 | @discussion This header is used to exercise HeaderDoc's ability to generate documentation from Objective-C headers. It includes declarations for C API and Objective-C classes, protocols, categories, and methods. The code is definitely NOT part of Cocoa, although some declarations have been snagged from Cocoa headers. 10 | */ 11 | 12 | #import 13 | 14 | /*! @class NSFont 15 | @abstract This is a stupid placeholder just to prove we can. 16 | */ 17 | @class NSFont; 18 | 19 | /*! 20 | @typedef NSTitlePosition 21 | Constants that represent title positions. 22 | @abstract Abstract for this API. 23 | @discussion Discussion that applies to the entire typedef'd enum. 24 | @constant NSNoTitle No title. 25 | @constant NSAboveTop Description of second constant. 26 | @constant NSAtTop Description of third constant. 27 | */ 28 | typedef enum _NSTitlePosition { 29 | NSNoTitle = 0, 30 | NSAboveTop = 1, 31 | NSAtTop = 2, 32 | NSBelowTop = 3, 33 | NSAboveBottom = 4, 34 | NSAtBottom = 5, 35 | NSBelowBottom = 6 36 | } NSTitlePosition; 37 | 38 | typedef enum { 39 | NSBoxPrimary = 0, // default 40 | NSBoxSecondary = 1, 41 | NSBoxSeparator = 2, 42 | NSBoxOldStyle = 3 // use border type 43 | } NSBoxType; 44 | 45 | 46 | /*! 47 | @class ObjCClassUn 48 | @abstract ObjCClassUn provides a visual grouping element. 49 | @discussion An NSBox object is a simple NSView that can do two things: 50 | It can draw a border around itself, and it can title itself. 51 | */ 52 | 53 | @interface ObjCClassUn : NSObject 54 | { 55 | /*All instance variables are private*/ 56 | id _titleCell; 57 | id _contentView; 58 | NSSize _offsets; 59 | NSRect _borderRect; 60 | NSRect _titleRect; 61 | /*! @var _unused 62 | This is... um... unused. I know these are private, but somebody 63 | wanted this documentation anyway. 64 | */ 65 | id _unused; 66 | } 67 | 68 | /*! @methodgroup group_one */ 69 | /*! 70 | @method classOneMethodOne 71 | @abstract Returns the receiver's border type. 72 | @see foo 73 | @seealso bar 74 | @discussion Returns the receiver's border type. Border types are defined 75 | in NSView.h. Currently, the following border types are defined: 76 | 77 | * NSNoBorder 78 | 79 | * NSLineBorder 80 | 81 | * NSBezelBorder 82 | 83 | * NSGrooveBorder 84 | 85 | By default, an NSBox's border type is NSGrooveBorder. 86 | */ 87 | - (NSBorderType)classOneMethodOne; 88 | 89 | /*! @methodgroup group_two */ 90 | /*! 91 | @method classOneMethodTwo 92 | @abstract Returns a constant representing the title position. 93 | */ 94 | - (NSTitlePosition)classOneMethodTwo; 95 | /*! @methodgroup group_one */ 96 | /*! 97 | @method classOneMethodThree 98 | @abstract Returns a constant representing the title position. 99 | */ 100 | - (NSTitlePosition)classOneMethodThree; 101 | 102 | @end 103 | 104 | /*! 105 | @class ObjCClassDeux 106 | @abstract ObjCClassDeux provides a visual grouping element. 107 | @discussion An NSBox object is a simple NSView that can do two things: It can draw a border around itself, and it can title itself. 108 | */ 109 | 110 | @interface ObjCClassDeux : NSObject 111 | { 112 | /*All instance variables are private*/ 113 | struct __bFlags { 114 | NSBorderType borderType:2; 115 | NSTitlePosition titlePosition:3; 116 | unsigned int transparent:1; 117 | unsigned int boxType:2; 118 | unsigned int _RESERVED:24; 119 | } _bFlags; 120 | id _unused; 121 | } 122 | 123 | /*! 124 | @method classTwoMethodOne 125 | @abstract Returns the receiver's border type. 126 | @discussion Returns the receiver's border type. Border types are defined in NSView.h. Currently, the following border types are defined: 127 | 128 | * NSNoBorder 129 | 130 | * NSLineBorder 131 | 132 | * NSBezelBorder 133 | 134 | * NSGrooveBorder 135 | 136 | By default, an NSBox's border type is NSGrooveBorder. 137 | */ 138 | - (NSBorderType)classTwoMethodOne; 139 | 140 | /*! 141 | @method classTwoMethodTwo 142 | @abstract Returns a constant representing the title position. 143 | */ 144 | - (NSTitlePosition)classTwoMethodTwo; 145 | 146 | /*! 147 | @method classTwoMethodThree 148 | @abstract Sets the border type to aType, which must be a valid border type. 149 | @discussion Border types are defined in NSView.h. Currently, the following border types are defined: 150 | 151 | * NSNoBorder 152 | * NSLineBorder 153 | * NSBezelBorder 154 | * NSGrooveBorder 155 | 156 | By default, an NSBox's border type is NSGrooveBorder. 157 | 158 | @param aType The specified type. 159 | */ 160 | - (void)classTwoMethodThree:(NSBorderType)aType; 161 | 162 | /*! 163 | @method classTwoMethodFour:bogusOne:bogusTwo 164 | @abstract Sets the title position and includes two bogus args for 165 | testing purposes 166 | @param bogusOne Fictive at best. 167 | @param bogusTwo This argument is rarely used. 168 | */ 169 | - (void)classTwoMethodFour:(NSTitlePosition)aPosition bogusOne:(NSView *)bogusOne bogusTwo:(NSView *)bogusTwo; 170 | 171 | @end 172 | 173 | /*! 174 | @protocol ObjCValidatorProtocol 175 | @abstract Protocol implemented by validator objects. 176 | @discussion All validator objects validate--in fact, they can't 177 | help themselves. That's what they do. 178 | */ 179 | 180 | @protocol ObjCValidatorProtocol 181 | /*! 182 | @method validateUserInterfaceItem: 183 | @abstract Validates the specified item. 184 | @param anItem The item to be validated. 185 | */ 186 | - (BOOL)validateUserInterfaceItem:(id )anItem; 187 | @end 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /Documentation/tags/chapter_3_section_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HeaderDoc Unfettered: Tags Common to All API Types 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Tags Common to All API Types
52 |The @abstract, @updated, 53 | and @discussion tags can be used within any of 54 | the type-specific tags below. For example,:
55 |56 |
/*!@enum Beverage Categories@abstract Constants to group beverage types.@discussion These constants (such as kSoda, kBeer, etc.) can be used...@updated 2003-04-15*/They are not required within any HeaderDoc comment, but can 57 | improve the formatting of the HTML output, and can help automate 58 | the importation of comments into the Inside Mac documentation database.
59 |60 | 61 |
62 | 63 |86 | 87 |
64 | 65 | 66 | 67 | 78 | 79 | 80 | 81 | 82 | < Previous PageNext Page > 83 | 84 | 85 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Documentation/usage/chapter_2_section_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |HeaderDoc Unfettered: Running the Scripts using MacPerl 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Running the Scripts using MacPerl
52 |Most of HeaderDoc runs on Mac OS 9 and earlier assuming MacPerl 53 | is installed. (You can get MacPerl from the CPAN ports page.) Here's what you need to do to run HeaderDoc using 54 | MacPerl:
55 |65 |
- Change the 56 | line endings in the scripts and modules (*.pm files) from UNIX to Macintosh. 57 | Many text editors (BBEdit, for example) let you easily change line 58 | ending types.
59 |- Run MacPerl, open headerDoc2HTML.pl and gatherHeaderDoc.pl 60 | and save them as droplets. You might save them with a different 61 | names (say, the script names minus the “.pl” extensions) to 62 | preserve the original versions.
63 |- Now, you can drag a header file or folder of header files 64 | on each droplet in turn, and the files will be processed in place.
Note: Some 66 | advanced features, including automatic linking, man page output, 67 | and XML output will not work in Mac OS 9, as these require69 | 70 |libxml2, 68 | which is only available for UNIX-based and UNIX-like systems.
71 | 72 |95 | 96 |
73 | 74 | 75 | 76 | 87 | 88 | 89 | 90 | 91 | < Previous PageNext Page > 92 | 93 | 94 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Documentation/gatherheaderdoc/chapter_7_section_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |HeaderDoc Unfettered: Using GatherHeaderDoc 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Using GatherHeaderDoc
GatherHeaderDoc is a post-processing script 52 | for HeaderDoc. Its primary purpose is to take a directory containing 53 | output from HeaderDoc and create a table of contents with links.
54 |GatherHeaderDoc is highly configurable. You can configure 55 | it to insert custom breadcrumb links, use a custom TOC template, 56 | and even automatically insert “framework” information into the 57 | TOC template on a per-directory basis.
58 | 59 | 60 | 61 | 62 | 63 |Contents:
64 | 65 |66 | 67 | Running gatherHeaderDoc.pl 68 | 69 |80 | 81 | 82 | 83 | 84 |
70 | 71 | Creating a TOC Template File 72 | 73 |
74 | 75 | Example gatherHeaderDoc Template 76 | 77 |
78 | 79 |
85 | 86 |109 | 110 |
87 | 88 | 89 | 90 | 101 | 102 | 103 | 104 | 105 | < Previous PageNext Page > 106 | 107 | 108 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Documentation/tags/chapter_2_section_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Tools: HeaderDoc Unfettered: Tags Common to All API Types 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Tags Common to All API Types
52 |The @abstract, @updated, 53 | and @discussion tags 54 | can be used within any of the type-specific tags below. For example:
55 |56 |
/*!@enum Beverage Categories@abstract Constants to group beverage types.@discussion These constants (such as kSoda, kBeer, etc.) can be used...@updated 2003-04-15*/They are not required within any HeaderDoc comment, but can 57 | improve the formatting of the HTML output, and can help automate 58 | the importation of comments into the Inside Mac documentation database.
59 |60 | 61 |
62 | 63 |86 | 87 |
64 | 65 | 66 | 67 | 78 | 79 | 80 | 81 | 82 | < Previous PageNext Page > 83 | 84 | 85 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Documentation/usage/chapter_2_section_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |HeaderDoc Unfettered: Using HeaderDoc 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Using HeaderDoc
HeaderDoc includes two scripts, headerDoc2HTML.pl which 52 | generates documentation for each header it encounters, and gatherHeaderDoc.pl which 53 | finds these islands of documentation and assembles a master table 54 | of contents linking them together.
55 |This section describes headerDoc2HTML.pl. For information 56 | on GatherHeaderDoc, see “Using GatherHeaderDoc”.
57 | 58 | 59 | 60 | 61 | 62 |Contents:
63 | 64 |65 | 66 | Running headerDoc2HTML.pl 67 | 68 |79 | 80 | 81 | 82 | 83 |
69 | 70 | Running the Scripts using MacPerl 71 | 72 |
73 | 74 | Cocoa Front End 75 | 76 |
77 | 78 |
84 | 85 |108 | 109 |
86 | 87 | 88 | 89 | 100 | 101 | 102 | 103 | 104 | < Previous PageNext Page > 105 | 106 | 107 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Documentation/tags/chapter_3_section_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |HeaderDoc Unfettered: Automatic Tagging 8 |9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |48 | 49 |
26 | 27 | 28 | 29 | 40 | 41 | 42 | 43 | 44 | < Previous PageNext Page > 45 | 46 | 47 |
50 | 51 |Automatic Tagging
52 |Beginning in HeaderDoc 8, certain tags are often not needed. 53 | These include:
54 |73 | 74 |
- Numbered 55 | lists
56 |- It is no longer necessary to mark up numbered lists 57 | with <ol><li>. 58 | HeaderDoc will automatically detect numbered lists.
59 |- Declaration types
60 |- Declaration type tags such as @function, @class, 61 | and @typedef are no longer required unless you 62 | are trying to override HeaderDoc’s normal behavior (such as using @class or @interface to 63 | change the display of a
64 |typedef struct.- Availability macros
65 |- It is no longer necessary to ignore availability macros 66 | with @ignore. The file
Availability.listin 67 | the HeaderDoc modules directory contains a mapping of availability 68 | macros to strings. When any macros described in this file appear 69 | in a declaration, the corresponding text will automatically be added 70 | to its documentation as an availability attribute.You can 71 | add your own availability macros by adding them to the
Availability.listfile 72 | or by adding an @availabilitymacro block in your headers.
75 | 76 |99 | 100 |
77 | 78 | 79 | 80 | 91 | 92 | 93 | 94 | 95 | < Previous PageNext Page > 96 | 97 | 98 |© 1999, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-05-27)
101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | --------------------------------------------------------------------------------