* Correct documenting of advanced records

git-svn-id: trunk@31184 -
This commit is contained in:
michael 2015-07-01 19:44:47 +00:00
parent a5715c078b
commit 8cb651c0a5
13 changed files with 776 additions and 563 deletions

View File

@ -1,9 +1,9 @@
Const Const
DefaultCSS : Array[0..2242] of byte = ( DefaultCSS : Array[0..2254] of byte = (
47, 42, 10, 32, 32, 36, 73,100, 58, 32,102,112,100,111, 99, 46, 99, 47, 42, 10, 32, 32, 36, 73,100, 58, 32,102,112,100,111, 99, 46, 99,
115,116, 44,118, 32, 49, 46, 49, 32, 50, 48, 48, 53, 47, 48, 49, 47, 115,115, 44,118, 32, 49, 46, 49, 32, 50, 48, 48, 51, 47, 48, 51, 47,
48, 50, 32, 49, 54, 58, 50, 50, 58, 49, 54, 32,109,105, 99,104, 97, 49, 55, 32, 50, 51, 58, 48, 51, 58, 50, 48, 32,109,105, 99,104, 97,
101,108, 32, 69,120,112, 32, 36, 10, 10, 32, 32, 68,101,102, 97,117, 101,108, 32, 69,120,112, 32, 36, 10, 10, 32, 32, 68,101,102, 97,117,
108,116, 32,115,116,121,108,101, 32,115,104,101,101,116, 32,102,111, 108,116, 32,115,116,121,108,101, 32,115,104,101,101,116, 32,102,111,
114, 32, 70, 80, 68,111, 99, 32,114,101,102,101,114,101,110, 99,101, 114, 32, 70, 80, 68,111, 99, 32,114,101,102,101,114,101,110, 99,101,
@ -53,83 +53,84 @@ Const
32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97,103,109,101, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97,103,109,101,
110,116,115, 32, 42, 47, 10,115,112, 97,110, 46,115,121,109, 32,123, 110,116,115, 32, 42, 47, 10,115,112, 97,110, 46,115,121,109, 32,123,
10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,114,101,100, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,114,101,100,
10,125, 10, 47, 42, 32, 78,111, 32,119,111,114,100,119,114, 97,112, 10,125, 10, 10, 47, 42, 32,107,101,121,119,111,114,100,115, 32,105,
32,105,110, 32, 99,111,100,101, 32,102,114, 97,103,109,101,110,116, 110, 32,115,111,117,114, 99,101, 32,102,114, 97,103,109,101,110,116,
115, 32, 42, 47, 10,115,112, 97,110, 46, 99,111,100,101, 32,123, 10, 115, 32, 42, 47, 10,115,112, 97,110, 46,107,119, 32,123, 10, 32, 32,
32, 32, 32,119,104,105,116,101, 45,115,112, 97, 99,101, 58, 32,110, 102,111,110,116, 45,119,101,105,103,104,116, 58, 32, 98,111,108,100,
111,119,114, 97,112, 10,125, 10, 10, 47, 42, 32,107,101,121,119,111, 10,125, 10, 10, 47, 42, 32, 99,111,109,109,101,110,116,115, 32,105,
114,100,115, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97, 110, 32,115,111,117,114, 99,101, 32,102,114, 97,103,109,101,110,116,
103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 46,107,119, 115, 32, 42, 47, 10,115,112, 97,110, 46, 99,109,116, 32,123, 10, 32,
32,123, 10, 32, 32,102,111,110,116, 45,119,101,105,103,104,116, 58, 32, 99,111,108,111,114, 58, 32,100, 97,114,107, 99,121, 97,110, 59,
32, 98,111,108,100, 10,125, 10, 10, 47, 42, 32, 99,111,109,109,101, 10, 32, 32,102,111,110,116, 45,115,116,121,108,101, 58, 32,105,116,
110,116,115, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97, 97,108,105, 99, 10,125, 10, 10, 47, 42, 32,100,105,114,101, 99,116,
103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 46, 99,109, 105,118,101,115, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114,
116, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107, 97,103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 46,100,
99,121, 97,110, 59, 10, 32, 32,102,111,110,116, 45,115,116,121,108, 105,114, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,
101, 58, 32,105,116, 97,108,105, 99, 10,125, 10, 10, 47, 42, 32,100, 107,121,101,108,108,111,119, 59, 10, 32, 32,102,111,110,116, 45,115,
105,114,101, 99,116,105,118,101,115, 32,105,110, 32,115,111,117,114, 116,121,108,101, 58, 32,105,116, 97,108,105, 99, 10,125, 10, 10, 47,
42, 32,110,117,109, 98,101,114,115, 32,105,110, 32,115,111,117,114,
99,101, 32,102,114, 97,103,109,101,110,116,115, 32, 42, 47, 10,115, 99,101, 32,102,114, 97,103,109,101,110,116,115, 32, 42, 47, 10,115,
112, 97,110, 46,100,105,114, 32,123, 10, 32, 32, 99,111,108,111,114, 112, 97,110, 46,110,117,109, 32,123, 10, 32, 32, 99,111,108,111,114,
58, 32,100, 97,114,107,121,101,108,108,111,119, 59, 10, 32, 32,102, 58, 32,100, 97,114,107,109, 97,103,101,110,116, 97, 10,125, 10, 10,
111,110,116, 45,115,116,121,108,101, 58, 32,105,116, 97,108,105, 99, 47, 42, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32, 40, 35, 46,
10,125, 10, 10, 47, 42, 32,110,117,109, 98,101,114,115, 32,105,110, 46, 46, 41, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97,
32,115,111,117,114, 99,101, 32,102,114, 97,103,109,101,110,116,115, 103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 46, 99,104,
32, 42, 47, 10,115,112, 97,110, 46,110,117,109, 32,123, 10, 32, 32, 114, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,
99,111,108,111,114, 58, 32,100, 97,114,107,109, 97,103,101,110,116, 99,121, 97,110, 10,125, 10, 10, 47, 42, 32,115,116,114,105,110,103,
97, 10,125, 10, 10, 47, 42, 32, 99,104, 97,114, 97, 99,116,101,114, 115, 32,105,110, 32,115,111,117,114, 99,101, 32,102,114, 97,103,109,
115, 32, 40, 35, 46, 46, 46, 41, 32,105,110, 32,115,111,117,114, 99, 101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 46,115,116,114, 32,
101, 32,102,114, 97,103,109,101,110,116,115, 32, 42, 47, 10,115,112, 123, 10, 32, 32, 99,111,108,111,114, 58, 32, 98,108,117,101, 10,125,
97,110, 46, 99,104,114, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 10, 10, 47, 42, 32, 97,115,115,101,109, 98,108,101,114, 32,112, 97,
32,100, 97,114,107, 99,121, 97,110, 10,125, 10, 10, 47, 42, 32,115, 115,115, 97,103,101,115, 32,105,110, 32,115,111,117,114, 99,101, 32,
116,114,105,110,103,115, 32,105,110, 32,115,111,117,114, 99,101, 32,
102,114, 97,103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110, 102,114, 97,103,109,101,110,116,115, 32, 42, 47, 10,115,112, 97,110,
46,115,116,114, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32, 98, 46, 97,115,109, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32,103,
108,117,101, 10,125, 10, 10, 47, 42, 32, 97,115,115,101,109, 98,108, 114,101,101,110, 10,125, 10, 10, 10,116,100, 46,112,114,101, 32,123,
101,114, 32,112, 97,115,115, 97,103,101,115, 32,105,110, 32,115,111, 10, 32, 32,119,104,105,116,101, 45,115,112, 97, 99,101, 58, 32,112,
117,114, 99,101, 32,102,114, 97,103,109,101,110,116,115, 32, 42, 47, 114,101, 10,125, 10, 10,112, 46, 99,109,116, 32,123, 10, 32, 32, 99,
10,115,112, 97,110, 46, 97,115,109, 32,123, 10, 32, 32, 99,111,108, 111,108,111,114, 58, 32,103,114, 97,121, 10,125, 10, 10,115,112, 97,
111,114, 58, 32,103,114,101,101,110, 10,125, 10, 10, 10,116,100, 46, 110, 46,119, 97,114,110,105,110,103, 32,123, 10, 32, 32, 99,111,108,
112,114,101, 32,123, 10, 32, 32,119,104,105,116,101, 45,115,112, 97, 111,114, 58, 32,114,101,100, 59, 10, 32, 32,102,111,110,116, 45,119,
99,101, 58, 32,112,114,101, 10,125, 10, 10,112, 46, 99,109,116, 32, 101,105,103,104,116, 58, 32, 98,111,108,100, 10,125, 10, 10, 47, 42,
123, 10, 32, 32, 99,111,108,111,114, 58, 32,103,114, 97,121, 10,125, 32, 33, 33, 33, 58, 32, 72,111,119, 32,115,104,111,117,108,100, 32,
10, 10,115,112, 97,110, 46,119, 97,114,110,105,110,103, 32,123, 10, 119,101, 32,100,101,102,105,110,101, 32,116,104,105,115, 46, 46, 46,
32, 32, 99,111,108,111,114, 58, 32,114,101,100, 59, 10, 32, 32,102, 63, 32, 42, 47, 10,115,112, 97,110, 46,102,105,108,101, 32,123, 10,
111,110,116, 45,119,101,105,103,104,116, 58, 32, 98,111,108,100, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,103,114,101,101,
125, 10, 10, 47, 42, 32, 33, 33, 33, 58, 32, 72,111,119, 32,115,104, 110, 10,125, 10, 10,116, 97, 98,108,101, 46,114,101,109, 97,114,107,
111,117,108,100, 32,119,101, 32,100,101,102,105,110,101, 32,116,104, 32,123, 10, 32, 32, 98, 97, 99,107,103,114,111,117,110,100, 45, 99,
105,115, 46, 46, 46, 63, 32, 42, 47, 10,115,112, 97,110, 46,102,105, 111,108,111,114, 58, 32, 35,102,102,102,102, 99, 48, 59, 10,125, 10,
108,101, 32,123, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114, 10,116, 97, 98,108,101, 46, 98, 97,114, 32,123, 10, 32, 32, 98, 97,
107,103,114,101,101,110, 10,125, 10, 10,116, 97, 98,108,101, 46,114, 99,107,103,114,111,117,110,100, 45, 99,111,108,111,114, 58, 32, 35,
101,109, 97,114,107, 32,123, 10, 32, 32, 98, 97, 99,107,103,114,111, 97, 48, 99, 48,102,102, 59, 10,125, 10, 10,115,112, 97,110, 46, 98,
117,110,100, 45, 99,111,108,111,114, 58, 32, 35,102,102,102,102, 99, 97,114,116,105,116,108,101, 32,123, 10, 32, 32,102,111,110,116, 45,
48, 59, 10,125, 10, 10,116, 97, 98,108,101, 46, 98, 97,114, 32,123, 119,101,105,103,104,116, 58, 32, 98,111,108,100, 59, 10, 32, 32,102,
10, 32, 32, 98, 97, 99,107,103,114,111,117,110,100, 45, 99,111,108, 111,110,116, 45,115,116,121,108,101, 58, 32,105,116, 97,108,105, 99,
111,114, 58, 32, 35, 97, 48, 99, 48,102,102, 59, 10,125, 10, 10,116, 59, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107, 98,108,
100, 32,112, 32,123, 10, 32,109, 97,114,103,105,110, 58, 32, 48, 59, 117,101, 10,125, 10, 10,115,112, 97,110, 46,102,111,111,116,101,114,
10,125, 10, 10,115,112, 97,110, 46, 98, 97,114,116,105,116,108,101, 32,123, 10, 32, 32,102,111,110,116, 45,115,116,121,108,101, 58, 32,
32,123, 10, 32, 32,102,111,110,116, 45,119,101,105,103,104,116, 58, 105,116, 97,108,105, 99, 59, 10, 32, 32, 99,111,108,111,114, 58, 32,
32, 98,111,108,100, 59, 10, 32, 32,102,111,110,116, 45,115,116,121, 100, 97,114,107, 98,108,117,101, 10,125, 10, 10, 47, 42, 32,100,101,
108,101, 58, 32,105,116, 97,108,105, 99, 59, 10, 32, 32, 99,111,108, 102,105,110,105,116,105,111,110, 32,108,105,115,116, 32, 42, 47, 10,
111,114, 58, 32,100, 97,114,107, 98,108,117,101, 10,125, 10, 10,115, 100,108, 32,123, 10, 32, 98,111,114,100,101,114, 58, 32, 51,112,120,
112, 97,110, 46,116,111,103,103,108,101,116,114,101,101, 99,108,111, 32,100,111,117, 98,108,101, 32, 35, 99, 99, 99, 59, 10, 32,112, 97,
115,101, 32,123, 10, 32, 32, 32, 32, 98, 97, 99,107,103,114,111,117, 100,100,105,110,103, 58, 32, 48, 46, 53,101,109, 59, 10,125, 10, 10,
110,100, 58, 32,117,114,108, 40,109,105,110,117,115, 46,112,110,103, 47, 42, 32,100,101,102,105,110,105,116,105,111,110, 32,108,105,115,
41, 32, 99,101,110,116,101,114, 32,108,101,102,116, 32,110,111, 45, 116, 58, 32,116,101,114,109, 32, 42, 47, 10,100,116, 32,123, 10, 32,
114,101,112,101, 97,116, 59, 10, 32, 32, 32, 32,112, 97,100,100,105, 102,108,111, 97,116, 58, 32,108,101,102,116, 59, 10, 32, 99,108,101,
110,103, 45,108,101,102,116, 58, 32, 50, 48,112,120, 59, 32, 10,125, 97,114, 58, 32,108,101,102,116, 59, 10, 32,119,105,100,116,104, 58,
10, 10,115,112, 97,110, 46,116,111,103,103,108,101,116,114,101,101, 32, 97,117,116,111, 59, 32, 47, 42, 32,110,111,114,109, 97,108,108,
111,112,101,110, 32,123, 10, 32, 32, 32, 32, 98, 97, 99,107,103,114, 121, 32, 98,114,111,119,115,101,114,115, 32,100,101,102, 97,117,108,
111,117,110,100, 58, 32,117,114,108, 40,112,108,117,115, 46,112,110, 116, 32,119,105,100,116,104, 32,111,102, 32,108, 97,114,103,101,115,
103, 41, 32, 99,101,110,116,101,114, 32,108,101,102,116, 32,110,111, 116, 32,105,116,101,109, 32, 42, 47, 10, 32,112, 97,100,100,105,110,
45,114,101,112,101, 97,116, 59, 10, 32, 32, 32, 32,112, 97,100,100, 103, 45,114,105,103,104,116, 58, 32, 50, 48,112,120, 59, 10, 32,102,
105,110,103, 45,108,101,102,116, 58, 32, 50, 48,112,120, 59, 32, 10, 111,110,116, 45,119,101,105,103,104,116, 58, 32, 98,111,108,100, 59,
125, 10, 10,117,108, 46, 99,108, 97,115,115,116,114,101,101,108,105, 10, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,103,114,101,101,
115,116, 32,108,105, 32,123, 32,112, 97,100,100,105,110,103, 45,108, 110, 59, 10,125, 10, 10, 47, 42, 32,100,101,102,105,110,105,116,105,
101,102,116, 58, 32, 48,112,120, 59, 32,125, 10, 10,117,108, 46, 99, 111,110, 32,108,105,115,116, 58, 32,100,101,115, 99,114,105,112,116,
108, 97,115,115,116,114,101,101,108,105,115,116, 32,123, 32,108,105, 105,111,110, 32, 42, 47, 10,100,100, 32,123, 10, 32,109, 97,114,103,
115,116, 45,115,116,121,108,101, 45,116,121,112,101, 58,110,111,110, 105,110, 58, 32, 48, 32, 48, 32, 48, 32, 49, 49, 48,112,120, 59, 10,
101, 59, 32,125, 10, 10,108,105, 46, 99,108, 97,115,115,116,114,101, 32,112, 97,100,100,105,110,103, 58, 32, 48, 32, 48, 32, 48, 46, 53,
101, 32,117,108, 32,123, 32,100,105,115,112,108, 97,121, 58, 32, 98, 101,109, 32, 48, 59, 10,125, 10, 10, 47, 42, 32,102,111,114, 32, 98,
108,111, 99,107, 59, 32,125, 10, 10,108,105, 46, 99,108, 97,115,115, 114,111,119,115,101,114,115, 32,105,110, 32,115,116, 97,110,100, 97,
116,114,101,101, 99,108,111,115,101,100, 32,117,108, 32,123, 32,100, 114,100,115, 32, 99,111,109,112,108,105, 97,110, 99,101, 32,109,111,
105,115,112,108, 97,121, 58, 32,110,111,110,101, 59, 32,125, 10); 100,101, 32, 42, 47, 10,116,100, 32,112, 32,123, 10, 32, 32,109, 97,
114,103,105,110, 58, 32, 48, 59, 10,125, 10);

View File

@ -70,6 +70,7 @@ resourcestring
SDocMethodOverview = 'Method overview'; SDocMethodOverview = 'Method overview';
SDocPropertyOverview = 'Property overview'; SDocPropertyOverview = 'Property overview';
SDocInterfacesOverview = 'Interfaces overview'; SDocInterfacesOverview = 'Interfaces overview';
SDocInterface = 'Interfaces';
SDocPage = 'Page'; SDocPage = 'Page';
SDocMethod = 'Method'; SDocMethod = 'Method';
SDocProperty = 'Property'; SDocProperty = 'Property';

View File

@ -89,8 +89,6 @@ type
FOnTest: TNotifyEvent; FOnTest: TNotifyEvent;
FPackage: TPasPackage; FPackage: TPasPackage;
FCharSet : String; FCharSet : String;
procedure AddElementsFromList(L: TStrings; List: TFPList; UsePathName : Boolean = False);
procedure AppendTypeDecl(AType: TPasType; TableEl, CodeEl: TDomElement);
procedure CreateMinusImage; procedure CreateMinusImage;
procedure CreatePlusImage; procedure CreatePlusImage;
function GetPageCount: Integer; function GetPageCount: Integer;
@ -218,12 +216,10 @@ type
function AppendProcType(CodeEl, TableEl: TDOMElement; function AppendProcType(CodeEl, TableEl: TDOMElement;
Element: TPasProcedureType; Indent: Integer): TDOMElement; Element: TPasProcedureType; Indent: Integer): TDOMElement;
procedure AppendProcExt(CodeEl: TDOMElement; Element: TPasProcedure); procedure AppendProcExt(CodeEl: TDOMElement; Element: TPasProcedure);
procedure AppendProcDecl(CodeEl, TableEl: TDOMElement; procedure AppendProcDecl(CodeEl, TableEl: TDOMElement; Element: TPasProcedureBase);
Element: TPasProcedureBase); procedure AppendProcArgsSection(Parent: TDOMNode; Element: TPasProcedureType; SkipResult : Boolean = False);
procedure AppendProcArgsSection(Parent: TDOMNode; function AppendRecordType(CodeEl, TableEl: TDOMElement; Element: TPasRecordType; NestingLevel: Integer): TDOMElement;
Element: TPasProcedureType; SkipResult : Boolean = False); procedure CreateMemberDeclarations(AParent: TPasElement; Members: TFPList; TableEl : TDOmelement);
function AppendRecordType(CodeEl, TableEl: TDOMElement;
Element: TPasRecordType; NestingLevel: Integer): TDOMElement;
procedure AppendTitle(const AText: DOMString; Hints : TPasMemberHints = []); procedure AppendTitle(const AText: DOMString; Hints : TPasMemberHints = []);
procedure AppendMenuBar(ASubpageIndex: Integer); procedure AppendMenuBar(ASubpageIndex: Integer);
@ -250,15 +246,15 @@ type
procedure CreateVarPageBody(AVar: TPasVariable); procedure CreateVarPageBody(AVar: TPasVariable);
procedure CreateProcPageBody(AProc: TPasProcedureBase); procedure CreateProcPageBody(AProc: TPasProcedureBase);
Procedure CreateTopicLinks(Node : TDocNode; PasElement : TPasElement); Procedure CreateTopicLinks(Node : TDocNode; PasElement : TPasElement);
procedure AddElementsFromList(L: TStrings; List: TFPList; UsePathName : Boolean = False);
procedure AppendTypeDecl(AType: TPasType; TableEl, CodeEl: TDomElement);
public public
constructor Create(APackage: TPasPackage; AEngine: TFPDocEngine); override; constructor Create(APackage: TPasPackage; AEngine: TFPDocEngine); override;
destructor Destroy; override; destructor Destroy; override;
// Single-page generation // Single-page generation
function CreateHTMLPage(AElement: TPasElement; function CreateHTMLPage(AElement: TPasElement; ASubpageIndex: Integer): TXMLDocument;
ASubpageIndex: Integer): TXMLDocument; function CreateXHTMLPage(AElement: TPasElement; ASubpageIndex: Integer): TXMLDocument;
function CreateXHTMLPage(AElement: TPasElement;
ASubpageIndex: Integer): TXMLDocument;
// For producing complete package documentation // For producing complete package documentation
procedure WriteHTMLPages; virtual; procedure WriteHTMLPages; virtual;
@ -523,18 +519,6 @@ constructor THTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
end; end;
end; end;
procedure AddPages(AElement: TPasElement; ASubpageIndex: Integer;
AList: TFPList);
var
i: Integer;
begin
if AList.Count > 0 then
begin
AddPage(AElement, ASubpageIndex);
for i := 0 to AList.Count - 1 do
AddPage(TPasElement(AList[i]), 0);
end;
end;
Function HaveClasses(AModule: TPasModule) : Boolean; Function HaveClasses(AModule: TPasModule) : Boolean;
@ -545,7 +529,40 @@ constructor THTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
and (AModule.InterfaceSection.Classes.Count>0); and (AModule.InterfaceSection.Classes.Count>0);
end; end;
procedure ScanModule(AModule: TPasModule; LinkList : TObjectList); procedure AddPages(AElement: TPasElement; ASubpageIndex: Integer;
AList: TFPList);
var
i,j: Integer;
R : TPasRecordtype;
FPEl : TPasElement;
DocNode: TDocNode;
begin
if AList.Count > 0 then
begin
AddPage(AElement, ASubpageIndex);
for i := 0 to AList.Count - 1 do
begin
AddPage(TPasElement(AList[i]), 0);
if (TObject(AList[i]) is TPasRecordType) then
begin
R:=TObject(AList[I]) as TPasRecordType;
For J:=0 to R.Members.Count-1 do
begin
FPEl:=TPasElement(R.Members[J]);
if ((FPEL is TPasProperty) or (FPEL is TPasProcedureBase))
and Engine.ShowElement(FPEl) then
begin
DocNode := Engine.FindDocNode(FPEl);
if Assigned(DocNode) then
AddPage(FPEl, 0);
end;
end;
end;
end;
end;
end;
Procedure AddClassMemberPages(AModule: TPasModule; LinkList : TObjectList);
var var
i, j, k: Integer; i, j, k: Integer;
s: String; s: String;
@ -554,6 +571,71 @@ constructor THTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
DocNode: TDocNode; DocNode: TDocNode;
ALink : DOMString; ALink : DOMString;
DidAutolink: Boolean; DidAutolink: Boolean;
begin
for i := 0 to AModule.InterfaceSection.Classes.Count - 1 do
begin
ClassEl := TPasClassType(AModule.InterfaceSection.Classes[i]);
AddPage(ClassEl, 0);
// !!!: Only add when there are items
AddPage(ClassEl, PropertiesByInheritanceSubindex);
AddPage(ClassEl, PropertiesByNameSubindex);
AddPage(ClassEl, MethodsByInheritanceSubindex);
AddPage(ClassEl, MethodsByNameSubindex);
AddPage(ClassEl, EventsByInheritanceSubindex);
AddPage(ClassEl, EventsByNameSubindex);
for j := 0 to ClassEl.Members.Count - 1 do
begin
FPEl := TPasElement(ClassEl.Members[j]);
if Not Engine.ShowElement(FPEl) then
continue;
DocNode := Engine.FindDocNode(FPEl);
if Assigned(DocNode) then
begin
if Assigned(DocNode.Node) then
ALink:=DocNode.Node['link']
else
ALink:='';
If (ALink<>'') then
LinkList.Add(TLinkData.Create(FPEl.PathName,ALink,AModule.name))
else
AddPage(FPEl, 0);
end
else
begin
DidAutolink := False;
if Assigned(ClassEl.AncestorType) and
(ClassEl.AncestorType.ClassType.inheritsfrom(TPasClassType)) then
begin
for k := 0 to TPasClassType(ClassEl.AncestorType).Members.Count - 1 do
begin
AncestorMemberEl :=
TPasElement(TPasClassType(ClassEl.AncestorType).Members[k]);
if AncestorMemberEl.Name = FPEl.Name then
begin
DocNode := Engine.FindDocNode(AncestorMemberEl);
if Assigned(DocNode) then
begin
DidAutolink := True;
Engine.AddLink(FPEl.PathName,
Engine.FindAbsoluteLink(AncestorMemberEl.PathName));
break;
end;
end;
end;
end;
if not DidAutolink then
AddPage(FPEl, 0);
end;
end;
end;
end;
procedure ScanModule(AModule: TPasModule; LinkList : TObjectList);
var
i: Integer;
s: String;
begin begin
if not assigned(Amodule.Interfacesection) then if not assigned(Amodule.Interfacesection) then
exit; exit;
@ -575,65 +657,9 @@ constructor THTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
if InterfaceSection.Classes.Count > 0 then if InterfaceSection.Classes.Count > 0 then
begin begin
AddPage(AModule, ClassesSubindex); AddPage(AModule, ClassesSubindex);
for i := 0 to InterfaceSection.Classes.Count - 1 do AddClassMemberPages(AModule,LinkList);
begin
ClassEl := TPasClassType(InterfaceSection.Classes[i]);
AddPage(ClassEl, 0);
// !!!: Only add when there are items
AddPage(ClassEl, PropertiesByInheritanceSubindex);
AddPage(ClassEl, PropertiesByNameSubindex);
AddPage(ClassEl, MethodsByInheritanceSubindex);
AddPage(ClassEl, MethodsByNameSubindex);
AddPage(ClassEl, EventsByInheritanceSubindex);
AddPage(ClassEl, EventsByNameSubindex);
for j := 0 to ClassEl.Members.Count - 1 do
begin
FPEl := TPasElement(ClassEl.Members[j]);
if Not Engine.ShowElement(FPEl) then
continue;
DocNode := Engine.FindDocNode(FPEl);
if Assigned(DocNode) then
begin
if Assigned(DocNode.Node) then
ALink:=DocNode.Node['link']
else
ALink:='';
If (ALink<>'') then
LinkList.Add(TLinkData.Create(FPEl.PathName,ALink,AModule.name))
else
AddPage(FPEl, 0);
end
else
begin
DidAutolink := False;
if Assigned(ClassEl.AncestorType) and
(ClassEl.AncestorType.ClassType.inheritsfrom(TPasClassType)) then
begin
for k := 0 to TPasClassType(ClassEl.AncestorType).Members.Count - 1 do
begin
AncestorMemberEl :=
TPasElement(TPasClassType(ClassEl.AncestorType).Members[k]);
if AncestorMemberEl.Name = FPEl.Name then
begin
DocNode := Engine.FindDocNode(AncestorMemberEl);
if Assigned(DocNode) then
begin
DidAutolink := True;
Engine.AddLink(FPEl.PathName,
Engine.FindAbsoluteLink(AncestorMemberEl.PathName));
break;
end;
end;
end;
end;
if not DidAutolink then
AddPage(FPEl, 0);
end;
end;
end;
end; end;
AddPages(AModule, ProcsSubindex, InterfaceSection.Functions); AddPages(AModule, ProcsSubindex, InterfaceSection.Functions);
AddPages(AModule, VarsSubindex, InterfaceSection.Variables); AddPages(AModule, VarsSubindex, InterfaceSection.Variables);
end; end;
@ -1822,7 +1848,7 @@ procedure THTMLWriter.AppendProcDecl(CodeEl, TableEl: TDOMElement;
AppendProcArgsSection(TableEl.ParentNode, AProc.ProcType, SkipResult); AppendProcArgsSection(TableEl.ParentNode, AProc.ProcType, SkipResult);
AppendKw(CodeEl, AProc.TypeName); AppendKw(CodeEl, AProc.TypeName);
if Element.Parent.ClassType = TPasClassType then if (Element.Parent.ClassType = TPasClassType) or (Element.Parent.ClassType = TPasRecordType) then
begin begin
AppendText(CodeEl, ' '); AppendText(CodeEl, ' ');
AppendHyperlink(CodeEl, Element.Parent); AppendHyperlink(CodeEl, Element.Parent);
@ -1908,6 +1934,8 @@ var
Variable: TPasVariable; Variable: TPasVariable;
TREl, TDEl: TDOMElement; TREl, TDEl: TDOMElement;
CurVariant: TPasVariant; CurVariant: TPasVariant;
isExtended : Boolean;
begin begin
if not (Element.Parent is TPasVariant) then if not (Element.Parent is TPasVariant) then
if Element.IsPacked then if Element.IsPacked then
@ -1918,18 +1946,28 @@ begin
else else
AppendKw(CodeEl, 'record'); AppendKw(CodeEl, 'record');
for i := 0 to Element.Members.Count - 1 do isExtended:=False;
begin I:=0;
Variable := TPasVariable(Element.Members[i]); while (not isExtended) and (I<Element.Members.Count) do
TREl := CreateTR(TableEl); begin
CodeEl := CreateCode(CreatePara(CreateTD_vtop(TREl))); isExtended:=Not (TObject(Element.Members[i]) is TPasVariable);
AppendShortDescrCell(TREl, Variable); Inc(i);
AppendNbSp(CodeEl, NestingLevel * 2 + 2); end;
AppendText(CodeEl, Variable.Name); if isExtended then
AppendSym(CodeEl, ': '); CreateMemberDeclarations(Element,Element.Members,TableEl)
CodeEl := AppendType(CodeEl, TableEl, Variable.VarType, False, NestingLevel + 1); else
AppendSym(CodeEl, ';'); for i := 0 to Element.Members.Count - 1 do
end; begin
Variable := TPasVariable(Element.Members[i]);
TREl := CreateTR(TableEl);
CodeEl := CreateCode(CreatePara(CreateTD_vtop(TREl)));
AppendShortDescrCell(TREl, Variable);
AppendNbSp(CodeEl, NestingLevel * 2 + 2);
AppendText(CodeEl, Variable.Name);
AppendSym(CodeEl, ': ');
CodeEl := AppendType(CodeEl, TableEl, Variable.VarType, False, NestingLevel + 1);
AppendSym(CodeEl, ';');
end;
if Assigned(Element.VariantType) then if Assigned(Element.VariantType) then
begin begin
@ -3106,6 +3144,143 @@ begin
(Copy(AMember.Name, 1, 2) = 'On'); (Copy(AMember.Name, 1, 2) = 'On');
end; end;
procedure THTMLWriter.CreateMemberDeclarations(AParent : TPasElement; Members : TFPList; TableEl : TDOmelement);
var
TREl, TDEl, CodeEl: TDOMElement;
DocNode: TDocNode;
Member: TPasElement;
MVisibility,
CurVisibility: TPasMemberVisibility;
i: Integer;
s: String;
t : TPasType;
ah,ol,wt,ct,wc,cc : boolean;
isRecord : Boolean;
begin
isRecord:=AParent is TPasRecordType;
if Members.Count > 0 then
begin
wt:=False;
wc:=False;
CurVisibility := visDefault;
for i := 0 to Members.Count - 1 do
begin
Member := TPasElement(Members[i]);
MVisibility:=Member.Visibility;
ol:=(Member is TPasOverloadedProc);
ah:=ol or ((Member is TPasProcedure) and (TPasProcedure(Member).ProcType.Args.Count > 0));
if ol then
Member:=TPasElement((Member as TPasOverloadedProc).Overloads[0]);
if Not Engine.ShowElement(Member) then
continue;
if (CurVisibility <> MVisibility) then
begin
CurVisibility := MVisibility;
s:=VisibilityNames[MVisibility];
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), s);
end;
ct:=(Member is TPasType);
if ct and (not wt) then
begin
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), 'Type');
end;
wt:=ct;
cc:=(Member is TPasConst);
if cc and (not wc) then
begin
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), 'Const');
end;
wc:=cc;
TREl := CreateTR(TableEl);
CodeEl := CreateCode(CreatePara(CreateTD_vtop(TREl)));
AppendNbSp(CodeEl, 2);
AppendShortDescrCell(TREl, Member);
if (Member is TPasProcedureBase) then
begin
AppendKw(CodeEl, TPasProcedureBase(Member).TypeName + ' ');
AppendHyperlink(CodeEl, Member);
if ah then
AppendSym(CodeEl, '();')
else
AppendSym(CodeEl, ';');
if Not OL then
AppendProcExt(CodeEl, TPasProcedure(Member));
end
else if (Member is TPasConst) then
begin
AppendHyperlink(CodeEl, Member);
If Assigned(TPasConst(Member).VarType) then
begin
AppendSym(CodeEl, ' = ');
AppendTypeDecl(TPasType(Member),TableEl,CodeEl);
end;
AppendSym(CodeEl, ' = ');
AppendText(CodeEl,TPasConst(Member).Expr.GetDeclaration(True));
end
else if (Member is TPasType) then
begin
AppendHyperlink(CodeEl, Member);
AppendSym(CodeEl, ' = ');
AppendTypeDecl(TPasType(Member),TableEl,CodeEl);
end
else if (Member is TPasProperty) then
begin
AppendKw(CodeEl, 'property ');
AppendHyperlink(CodeEl, Member);
t:=TPasProperty(Member).ResolvedType;
if Assigned(T) then
begin
AppendSym(CodeEl, ': ');
AppendHyperlink(CodeEl, T);
end;
AppendSym(CodeEl, ';');
if TPasProperty(Member).IsDefault then
begin
AppendKw(CodeEl, ' default');
AppendSym(CodeEl, ';');
end;
if (TPasProperty(Member).ImplementsName<>'') then
begin
AppendKw(CodeEl, ' implements');
AppendText(CodeEl, ' '+TPasProperty(Member).ImplementsName);
AppendSym(CodeEl, ';');
end;
SetLength(s, 0);
if Length(TPasProperty(Member).ReadAccessorName) > 0 then
s := s + 'r';
if Length(TPasProperty(Member).WriteAccessorName) > 0 then
s := s + 'w';
if Length(TPasProperty(Member).StoredAccessorName) > 0 then
s := s + 's';
if Length(s) > 0 then
AppendText(CodeEl, ' [' + s + ']');
end
else if (Member is TPasVariable) then
begin
if not isRecord then
AppendHyperlink(CodeEl, Member)
else
AppendText(CodeEl, Member.Name);
AppendSym(CodeEl, ': ');
AppendHyperlink(CodeEl, TPasVariable(Member).VarType);
AppendSym(CodeEl, ';');
end
else
AppendText(CreateWarning(CodeEl), '<' + Member.ClassName + '>');
if (Member.Hints<>[]) then
begin
AppendKW(CodeEl,' '+Engine.HintsToStr(Member.Hints));
AppendText(CodeEl, ' ');
AppendSym(CodeEl, ';');
end;
end;
CodeEl := CreateCode(CreatePara(CreateTD(CreateTR(TableEl))));
end;
end;
procedure THTMLWriter.CreateClassPageBody(AClass: TPasClassType; procedure THTMLWriter.CreateClassPageBody(AClass: TPasClassType;
ASubpageIndex: Integer); ASubpageIndex: Integer);
type type
@ -3159,14 +3334,7 @@ var
procedure CreateMainPage; procedure CreateMainPage;
var var
TableEl, TREl, TDEl, CodeEl: TDOMElement; TableEl, TREl, TDEl, CodeEl: TDOMElement;
DocNode: TDocNode;
Member: TPasElement;
MVisibility,
CurVisibility: TPasMemberVisibility;
i: Integer; i: Integer;
s: String;
t : TPasType;
ah,ol,wt,ct,wc,cc : boolean;
ThisInterface, ThisInterface,
ThisClass: TPasClassType; ThisClass: TPasClassType;
HaveSeenTObject: Boolean; HaveSeenTObject: Boolean;
@ -3225,123 +3393,7 @@ var
AppendSym(CodeEl, ')'); AppendSym(CodeEl, ')');
end; end;
end; end;
if AClass.Members.Count > 0 then CreateMemberDeclarations(AClass, AClass.Members,TableEl);
begin
wt:=False;
wc:=False;
CurVisibility := visDefault;
for i := 0 to AClass.Members.Count - 1 do
begin
Member := TPasElement(AClass.Members[i]);
MVisibility:=Member.Visibility;
ol:=(Member is TPasOverloadedProc);
ah:=ol or ((Member is TPasProcedure) and (TPasProcedure(Member).ProcType.Args.Count > 0));
if ol then
Member:=TPasElement((Member as TPasOverloadedProc).Overloads[0]);
if Not Engine.ShowElement(Member) then
continue;
if (CurVisibility <> MVisibility) then
begin
CurVisibility := MVisibility;
s:=VisibilityNames[MVisibility];
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), s);
end;
ct:=(Member is TPasType);
if ct and (not wt) then
begin
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), 'Type');
end;
wt:=ct;
cc:=(Member is TPasConst);
if cc and (not wc) then
begin
AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), 'Const');
end;
wc:=cc;
TREl := CreateTR(TableEl);
CodeEl := CreateCode(CreatePara(CreateTD_vtop(TREl)));
AppendNbSp(CodeEl, 2);
AppendShortDescrCell(TREl, Member);
if (Member is TPasProcedureBase) then
begin
AppendKw(CodeEl, TPasProcedureBase(Member).TypeName + ' ');
AppendHyperlink(CodeEl, Member);
if ah then
AppendSym(CodeEl, '();')
else
AppendSym(CodeEl, ';');
if Not OL then
AppendProcExt(CodeEl, TPasProcedure(Member));
end
else if (Member is TPasConst) then
begin
AppendHyperlink(CodeEl, Member);
If Assigned(TPasConst(Member).VarType) then
begin
AppendSym(CodeEl, ' = ');
AppendTypeDecl(TPasType(Member),TableEl,CodeEl);
end;
AppendSym(CodeEl, ' = ');
AppendText(CodeEl,TPasConst(Member).Expr.GetDeclaration(True));
end
else if (Member is TPasType) then
begin
AppendHyperlink(CodeEl, Member);
AppendSym(CodeEl, ' = ');
AppendTypeDecl(TPasType(Member),TableEl,CodeEl);
end
else if (Member is TPasProperty) then
begin
AppendKw(CodeEl, 'property ');
AppendHyperlink(CodeEl, Member);
t:=TPasProperty(Member).ResolvedType;
if Assigned(T) then
begin
AppendSym(CodeEl, ': ');
AppendHyperlink(CodeEl, T);
end;
AppendSym(CodeEl, ';');
if TPasProperty(Member).IsDefault then
begin
AppendKw(CodeEl, ' default');
AppendSym(CodeEl, ';');
end;
if (TPasProperty(Member).ImplementsName<>'') then
begin
AppendKw(CodeEl, ' implements');
AppendText(CodeEl, ' '+TPasProperty(Member).ImplementsName);
AppendSym(CodeEl, ';');
end;
SetLength(s, 0);
if Length(TPasProperty(Member).ReadAccessorName) > 0 then
s := s + 'r';
if Length(TPasProperty(Member).WriteAccessorName) > 0 then
s := s + 'w';
if Length(TPasProperty(Member).StoredAccessorName) > 0 then
s := s + 's';
if Length(s) > 0 then
AppendText(CodeEl, ' [' + s + ']');
end
else if (Member is TPasVariable) then
begin
AppendHyperlink(CodeEl, Member);
AppendSym(CodeEl, ': ');
AppendHyperlink(CodeEl, TPasVariable(Member).VarType);
AppendSym(CodeEl, ';');
end
else
AppendText(CreateWarning(CodeEl), '<' + Member.ClassName + '>');
if (Member.Hints<>[]) then
begin
AppendKW(CodeEl,' '+Engine.HintsToStr(Member.Hints));
AppendText(CodeEl, ' ');
AppendSym(CodeEl, ';');
end;
end;
CodeEl := CreateCode(CreatePara(CreateTD(CreateTR(TableEl))));
end;
AppendText(CodeEl, ' '); // !!!: Dirty trick, necessary for current XML writer AppendText(CodeEl, ' '); // !!!: Dirty trick, necessary for current XML writer
if not AClass.IsShortDefinition then if not AClass.IsShortDefinition then

View File

@ -29,6 +29,9 @@ const
TIPFExtension = '.ipf'; TIPFExtension = '.ipf';
type type
{ TIPFNewWriter }
TIPFNewWriter = class(TLinearWriter) TIPFNewWriter = class(TLinearWriter)
private private
InPackageOverview: Boolean; InPackageOverview: Boolean;
@ -85,7 +88,7 @@ type
procedure StartSubSection(SubSectionName : String);override; procedure StartSubSection(SubSectionName : String);override;
procedure StartSubSubSection(SubSubSectionName : String);override; procedure StartSubSubSection(SubSubSectionName : String);override;
procedure StartChapter(ChapterName : String); override; procedure StartChapter(ChapterName : String); override;
procedure StartOverview(WithAccess : Boolean); override; procedure StartOverview(Const What : String;WithAccess : Boolean); override;
procedure EndOverview; override; procedure EndOverview; override;
procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override;
procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override;
@ -613,7 +616,7 @@ end;
{ TLinearWriter overrides} { TLinearWriter overrides}
class function TIPFNewWriter.FileNameExtension: String; class function TIPFNewWriter.FileNameExtension: string;
begin begin
Result := TIPFExtension; Result := TIPFExtension;
end; end;
@ -641,7 +644,7 @@ begin
Result := StringReplace(Result, ' ', '_', [rfReplaceAll]); Result := StringReplace(Result, ' ', '_', [rfReplaceAll]);
end; end;
Function TIPFNewWriter.EscapeText(S : String) : String; function TIPFNewWriter.EscapeText(S: String): String;
var var
i: Integer; i: Integer;
begin begin
@ -697,7 +700,7 @@ begin
end; end;
end; end;
Function TIPFNewWriter.StripText(S : String) : String; function TIPFNewWriter.StripText(S: String): String;
var var
I: Integer; I: Integer;
begin begin
@ -740,7 +743,7 @@ begin
writeln(''); writeln('');
end; end;
procedure TIPFNewWriter.WriteLabel(const s: String); procedure TIPFNewWriter.WriteLabel(const S: String);
var var
x: String; x: String;
begin begin
@ -762,7 +765,7 @@ begin
end; end;
end; end;
procedure TIPFNewWriter.WriteIndex(const s : String); procedure TIPFNewWriter.WriteIndex(const S: String);
begin begin
// writeln(':i1 id=' + s + '.'); // writeln(':i1 id=' + s + '.');
end; end;
@ -878,19 +881,19 @@ begin
//Writeln(':h5.' + SubSubSectionName); //Writeln(':h5.' + SubSubSectionName);
end; end;
Procedure TIPFNewWriter.StartProcedure; procedure TIPFNewWriter.StartProcedure;
begin begin
//writeln(''); //writeln('');
//writeln(':ul.'); //writeln(':ul.');
end; end;
Procedure TIPFNewWriter.EndProcedure; procedure TIPFNewWriter.EndProcedure;
begin begin
//writeln(''); //writeln('');
//writeln(':eul.'); //writeln(':eul.');
end; end;
Procedure TIPFNewWriter.StartSynopsis; procedure TIPFNewWriter.StartSynopsis;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -900,7 +903,7 @@ begin
writeln(':lm margin=3.'); writeln(':lm margin=3.');
end; end;
Procedure TIPFNewWriter.StartDeclaration; procedure TIPFNewWriter.StartDeclaration;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -909,7 +912,7 @@ begin
writeln(':lm margin=3.'); writeln(':lm margin=3.');
end; end;
Procedure TIPFNewWriter.StartVisibility; procedure TIPFNewWriter.StartVisibility;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -919,7 +922,7 @@ begin
writeln('.br'); writeln('.br');
end; end;
Procedure TIPFNewWriter.StartDescription; procedure TIPFNewWriter.StartDescription;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -929,7 +932,7 @@ begin
writeln('.br'); writeln('.br');
end; end;
Procedure TIPFNewWriter.StartErrors; procedure TIPFNewWriter.StartErrors;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -949,7 +952,7 @@ begin
writeln('.br'); writeln('.br');
end; end;
Procedure TIPFNewWriter.StartAccess; procedure TIPFNewWriter.StartAccess;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');
@ -959,14 +962,14 @@ begin
writeln('.br'); writeln('.br');
end; end;
Procedure TIPFNewWriter.StartProperty; procedure TIPFNewWriter.StartProperty;
begin begin
//writeln(''); //writeln('');
//Writeln('.* here I am'); //Writeln('.* here I am');
//writeln(':ul.'); //writeln(':ul.');
end; end;
Procedure TIPFNewWriter.EndProperty; procedure TIPFNewWriter.EndProperty;
begin begin
//writeln(''); //writeln('');
//writeln(':eul.'); //writeln(':eul.');
@ -1003,7 +1006,7 @@ begin
end; end;
end; end;
procedure TIPFNewWriter.StartOverview(WithAccess : Boolean); procedure TIPFNewWriter.StartOverview(const What: String; WithAccess: Boolean);
begin begin
{ {
If With access then it is a property overview. If With access then it is a property overview.
@ -1065,7 +1068,7 @@ begin
WriteLn(Format(':pd. %s', [ADescr])); WriteLn(Format(':pd. %s', [ADescr]));
end; end;
Procedure TIPFNewWriter.StartSeeAlso; procedure TIPFNewWriter.StartSeealso;
begin begin
writeln(''); writeln('');
writeln(':p.'); writeln(':p.');

View File

@ -75,7 +75,7 @@ Type
procedure StartSubSection(SubSectionName : String);override; procedure StartSubSection(SubSectionName : String);override;
procedure StartSubSubSection(SubSubSectionName : String);override; procedure StartSubSubSection(SubSubSectionName : String);override;
procedure StartChapter(ChapterName : String); override; procedure StartChapter(ChapterName : String); override;
procedure StartOverview(WithAccess : Boolean); override; procedure StartOverview(Const What : String; WithAccess : Boolean); override;
procedure EndOverview; override; procedure EndOverview; override;
procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override;
procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override;
@ -154,7 +154,7 @@ begin
end; end;
Function TLatexWriter.EscapeText(S : String) : String; function TLaTeXWriter.EscapeText(S: String): String;
var var
i: Integer; i: Integer;
@ -179,7 +179,7 @@ begin
end; end;
end; end;
Function TLatexWriter.StripText(S : String) : String; function TLaTeXWriter.StripText(S: String): String;
var var
I: Integer; I: Integer;
@ -476,12 +476,12 @@ begin
// Do nothing // Do nothing
end; end;
procedure TLaTeXWriter.WriteLabel(const s: String); procedure TLaTeXWriter.WriteLabel(const S: String);
begin begin
WriteLnF('\label{%s}', [LowerCase(StripText(s))]); WriteLnF('\label{%s}', [LowerCase(StripText(s))]);
end; end;
procedure TLaTeXWriter.WriteIndex(const s : String); procedure TLaTeXWriter.WriteIndex(const S: String);
begin begin
Write('\index{'); Write('\index{');
Write(EscapeText(s)); Write(EscapeText(s));
@ -512,7 +512,7 @@ begin
Writeln('\end{verbatim}') Writeln('\end{verbatim}')
end; end;
procedure TLatexWriter.WriteCommentLine; procedure TLaTeXWriter.WriteCommentLine;
const const
CommentLine = CommentLine =
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'; '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%';
@ -520,13 +520,13 @@ begin
Writeln(CommentLine); Writeln(CommentLine);
end; end;
procedure TLatexWriter.WriteComment(Comment : String); procedure TLaTeXWriter.WriteComment(Comment: String);
begin begin
Write('% '); Write('% ');
Writeln(Comment); Writeln(Comment);
end; end;
procedure TLatexWriter.StartChapter(ChapterName : String); procedure TLaTeXWriter.StartChapter(ChapterName: String);
begin begin
WriteCommentLine; WriteCommentLine;
WriteComment(ChapterName); WriteComment(ChapterName);
@ -534,20 +534,20 @@ begin
Writeln('\chapter{'+EscapeText(ChapterName)+'}'); Writeln('\chapter{'+EscapeText(ChapterName)+'}');
end; end;
procedure TLatexWriter.StartSection(SectionName : String); procedure TLaTeXWriter.StartSection(SectionName: String);
begin begin
WriteCommentLine; WriteCommentLine;
WriteComment(SectionName); WriteComment(SectionName);
Writeln('\section{'+EscapeText(SectionName)+'}'); Writeln('\section{'+EscapeText(SectionName)+'}');
end; end;
procedure TLatexWriter.StartSubSection(SubSectionName : String); procedure TLaTeXWriter.StartSubSection(SubSectionName: String);
begin begin
WriteComment(SubSectionName); WriteComment(SubSectionName);
Writeln('\subsection{'+EscapeText(SubSectionName)+'}'); Writeln('\subsection{'+EscapeText(SubSectionName)+'}');
end; end;
procedure TLatexWriter.StartSubSubSection(SubSubSectionName : String); procedure TLaTeXWriter.StartSubSubSection(SubSubSectionName: String);
begin begin
Writeln('\subsubsection{'+EscapeText(SubSubSectionName)+'}'); Writeln('\subsubsection{'+EscapeText(SubSubSectionName)+'}');
end; end;
@ -564,38 +564,38 @@ begin
end; end;
end; end;
Procedure TLatexWriter.StartProcedure; procedure TLaTeXWriter.StartProcedure;
begin begin
Writeln('\begin{FPCList}'); Writeln('\begin{FPCList}');
InList:=True; InList:=True;
end; end;
Procedure TLatexWriter.StartSynopsis; procedure TLaTeXWriter.StartSynopsis;
begin begin
Writeln('\Synopsis'); Writeln('\Synopsis');
end; end;
Procedure TLatexWriter.StartDeclaration; procedure TLaTeXWriter.StartDeclaration;
begin begin
Writeln('\Declaration '); Writeln('\Declaration ');
end; end;
Procedure TLatexWriter.StartVisibility; procedure TLaTeXWriter.StartVisibility;
begin begin
Writeln('\Visibility'); Writeln('\Visibility');
end; end;
Procedure TLatexWriter.StartDescription; procedure TLaTeXWriter.StartDescription;
begin begin
Writeln('\Description'); Writeln('\Description');
end; end;
Procedure TLatexWriter.StartErrors; procedure TLaTeXWriter.StartErrors;
begin begin
Writeln('\Errors'); Writeln('\Errors');
@ -606,68 +606,69 @@ begin
Writeln('\VersionInfo'); Writeln('\VersionInfo');
end; end;
Procedure TLatexWriter.StartAccess; procedure TLaTeXWriter.StartAccess;
begin begin
Writeln('\Access') Writeln('\Access')
end; end;
Procedure TLatexWriter.EndProcedure; procedure TLaTeXWriter.EndProcedure;
begin begin
InList:=False; InList:=False;
Writeln('\end{FPCList}'); Writeln('\end{FPCList}');
end; end;
Procedure TLatexWriter.StartProperty; procedure TLaTeXWriter.StartProperty;
begin begin
Writeln('\begin{FPCList}'); Writeln('\begin{FPCList}');
InList:=True; InList:=True;
end; end;
Procedure TLatexWriter.EndProperty; procedure TLaTeXWriter.EndProperty;
begin begin
InList:=False; InList:=False;
Writeln('\end{FPCList}'); Writeln('\end{FPCList}');
end; end;
procedure TLateXWriter.WriteExampleFile(FN : String); procedure TLaTeXWriter.WriteExampleFile(FN: String);
begin begin
If (FN<>'') then If (FN<>'') then
WritelnF('\FPCexample{%s}', [ChangeFileExt(FN,'')]); WritelnF('\FPCexample{%s}', [ChangeFileExt(FN,'')]);
end; end;
procedure TLatexWriter.StartOverview(WithAccess : Boolean); procedure TLaTeXWriter.StartOverview(const What: String; WithAccess: Boolean);
begin begin
If WithAccess then If WithAccess then
begin begin
WriteLn('\begin{tabularx}{\textwidth}{lllX}'); WriteLn('\begin{tabularx}{\textwidth}{lllX}');
WriteLnF('%s & %s & %s & %s \\ \hline',[EscapeText(SDocPage), EscapeText(SDocProperty), EscapeText(SDocAccess), EscapeText(SDocDescription)]) WriteLnF('%s & %s & %s & %s \\ \hline',[EscapeText(SDocPage), EscapeText(What), EscapeText(SDocAccess), EscapeText(SDocDescription)])
end end
else else
begin begin
WriteLn('\begin{tabularx}{\textwidth}{llX}'); WriteLn('\begin{tabularx}{\textwidth}{llX}');
WriteLnF('%s & %s & %s \\ \hline',[EscapeText(SDocPage), EscapeText(SDocProperty), EscapeText(SDocDescription)]) WriteLnF('%s & %s & %s \\ \hline',[EscapeText(SDocPage), EscapeText(What), EscapeText(SDocDescription)])
end; end;
end; end;
procedure TLatexWriter.EndOverview; procedure TLaTeXWriter.EndOverview;
begin begin
WriteLn('\hline'); WriteLn('\hline');
WriteLn('\end{tabularx}'); WriteLn('\end{tabularx}');
end; end;
procedure TLatexWriter.WriteOverviewMember(const ALabel,AName,Access,ADescr : String); procedure TLaTeXWriter.WriteOverviewMember(const ALabel, AName, Access,
ADescr: String);
begin begin
WriteLnF('\pageref{%s} & %s & %s & %s \\',[ALabel,EscapeText(AName),Access,ADescr]); WriteLnF('\pageref{%s} & %s & %s & %s \\',[ALabel,EscapeText(AName),Access,ADescr]);
end; end;
procedure TLatexWriter.WriteOverviewMember(const ALabel,AName,ADescr : String); procedure TLaTeXWriter.WriteOverviewMember(const ALabel, AName, ADescr: String);
begin begin
WriteLnF('\pageref{%s} & %s & %s \\',[ALabel,EscapeText(AName),ADescr]); WriteLnF('\pageref{%s} & %s & %s \\',[ALabel,EscapeText(AName),ADescr]);
@ -678,7 +679,7 @@ begin
Result:=TexExtension; Result:=TexExtension;
end; end;
Procedure TLatexWriter.StartSeeAlso; procedure TLaTeXWriter.StartSeealso;
begin begin
If not InList then If not InList then
@ -695,7 +696,7 @@ begin
Writeln('\end{FPCList}'); Writeln('\end{FPCList}');
end; end;
procedure TLatexWriter.StartUnitOverview(AModuleName,AModuleLabel : String); procedure TLaTeXWriter.StartUnitOverview(AModuleName, AModuleLabel: String);
begin begin
WriteLnF('\begin{FPCltable}{lr}{%s}{%s:0units}', WriteLnF('\begin{FPCltable}{lr}{%s}{%s:0units}',
@ -703,20 +704,20 @@ begin
WriteLn('Name & Page \\ \hline'); WriteLn('Name & Page \\ \hline');
end; end;
procedure TLatexWriter.WriteUnitEntry(UnitRef : TPasType); procedure TLaTeXWriter.WriteUnitEntry(UnitRef: TPasType);
begin begin
WriteLnF('%s\index{unit!%s} & \pageref{%s} \\', WriteLnF('%s\index{unit!%s} & \pageref{%s} \\',
[EscapeText(UnitRef.Name), EscapeText(UnitRef.Name), StripText(GetLabel(UnitRef))]); [EscapeText(UnitRef.Name), EscapeText(UnitRef.Name), StripText(GetLabel(UnitRef))]);
end; end;
procedure TLatexWriter.EndUnitOverview; procedure TLaTeXWriter.EndUnitOverview;
begin begin
WriteLn('\end{FPCltable}'); WriteLn('\end{FPCltable}');
end; end;
Function TLatexWriter.InterPretOption(Const Cmd,Arg : String) : boolean; function TLaTeXWriter.InterPretOption(const Cmd, Arg: String): boolean;
begin begin
Result:=True; Result:=True;

View File

@ -110,7 +110,7 @@ type
procedure StartSubSection(SubSectionName : String);override; procedure StartSubSection(SubSectionName : String);override;
procedure StartSubSubSection(SubSubSectionName : String);override; procedure StartSubSubSection(SubSubSectionName : String);override;
procedure StartChapter(ChapterName : String); override; procedure StartChapter(ChapterName : String); override;
procedure StartOverview(WithAccess : Boolean); override; procedure StartOverview(Const What : String; WithAccess : Boolean); override;
procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override;
procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override;
procedure EndOverview; override; procedure EndOverview; override;
@ -185,7 +185,7 @@ begin
end; end;
Function TRTFWriter.EscapeText(S : String) : String; function TRTFWriter.EscapeText(S: String): String;
var var
i: Integer; i: Integer;
@ -206,7 +206,7 @@ begin
end; end;
end; end;
Function TRTFWriter.StripText(S : String) : String; function TRTFWriter.StripText(S: String): String;
var var
I: Integer; I: Integer;
@ -558,14 +558,14 @@ begin
write('\cell'); write('\cell');
end; end;
procedure TRTFWriter.WriteLabel(const s: String); procedure TRTFWriter.WriteLabel(const S: String);
var b: string; var b: string;
begin begin
b := LowerCase(StripText(s)); b := LowerCase(StripText(s));
WriteF('{\bkmkstart %s}{\bkmkend %s}', [b,b]); WriteF('{\bkmkstart %s}{\bkmkend %s}', [b,b]);
end; end;
procedure TRTFWriter.WriteIndex(const s : String); procedure TRTFWriter.WriteIndex(const S: String);
begin begin
Write('{\xe{\v '+EscapeText(s)+'}}'); Write('{\xe{\v '+EscapeText(s)+'}}');
end; end;
@ -632,57 +632,57 @@ begin
EscapeText(SubSubSectionName)]); EscapeText(SubSubSectionName)]);
end; end;
Procedure TRTFWriter.StartProcedure; procedure TRTFWriter.StartProcedure;
begin begin
Write('{\pard'); Write('{\pard');
end; end;
Procedure TRTFWriter.StartProperty; procedure TRTFWriter.StartProperty;
begin begin
Write('{\pard'); Write('{\pard');
end; end;
Procedure TRTFWriter.Header(text:string; font:integer); procedure TRTFWriter.Header(text: string; font: integer);
begin begin
WriteF('\par\s9 %s\pard\par\s10\f%d ',[text, font]); WriteF('\par\s9 %s\pard\par\s10\f%d ',[text, font]);
end; end;
Procedure TRTFWriter.StartSynopsis; procedure TRTFWriter.StartSynopsis;
begin begin
Header(SDocSynopsis,2); Header(SDocSynopsis,2);
end; end;
Procedure TRTFWriter.StartDeclaration; procedure TRTFWriter.StartDeclaration;
begin begin
Header(SDocDeclaration,1); Header(SDocDeclaration,1);
end; end;
Procedure TRTFWriter.StartVisibility; procedure TRTFWriter.StartVisibility;
begin begin
Header(SDocVisibility,2); Header(SDocVisibility,2);
end; end;
Procedure TRTFWriter.StartDescription; procedure TRTFWriter.StartDescription;
begin begin
Header(SDocDescription,2); Header(SDocDescription,2);
end; end;
Procedure TRTFWriter.StartErrors; procedure TRTFWriter.StartErrors;
begin begin
Header(SDocErrors,2); Header(SDocErrors,2);
end; end;
Procedure TRTFWriter.StartAccess; procedure TRTFWriter.StartAccess;
begin begin
Header(SDocAccess,2) Header(SDocAccess,2)
end; end;
Procedure TRTFWriter.EndProcedure; procedure TRTFWriter.EndProcedure;
begin begin
Write('}'); Write('}');
end; end;
Procedure TRTFWriter.EndProperty; procedure TRTFWriter.EndProperty;
begin begin
Write('}'); Write('}');
end; end;
@ -705,14 +705,14 @@ begin
end; end;
end; end;
procedure TRTFWriter.StartOverview(WithAccess : Boolean); procedure TRTFWriter.StartOverview(const What: String; WithAccess: Boolean);
begin begin
If WithAccess then If WithAccess then
WriteF('\par\trowd\pard\intbl %s\cell\pard\intbl %s\cell\pard\intbl %s \cell\pard\intbl %s \cell\row', WriteF('\par\trowd\pard\intbl %s\cell\pard\intbl %s\cell\pard\intbl %s \cell\pard\intbl %s \cell\row',
[EscapeText(SDocPage), EscapeText(SDocProperty), EscapeText(SDocAccess), EscapeText(SDocDescription)]) [EscapeText(SDocPage), EscapeText(What), EscapeText(SDocAccess), EscapeText(SDocDescription)])
else else
WriteF('\par\trowd\pard\intbl %s\cell\pard\intbl %s\cell\pard\intbl %s\cell\row', WriteF('\par\trowd\pard\intbl %s\cell\pard\intbl %s\cell\pard\intbl %s\cell\row',
[EscapeText(SDocPage), EscapeText(SDocProperty), EscapeText(SDocDescription)]); [EscapeText(SDocPage), EscapeText(What), EscapeText(SDocDescription)]);
end; end;
procedure TRTFWriter.WriteOverviewMember(const ALabel,AName,Access,ADescr : String); procedure TRTFWriter.WriteOverviewMember(const ALabel,AName,Access,ADescr : String);
@ -736,7 +736,7 @@ begin
Write ('\par'); Write ('\par');
end; end;
Procedure TRTFWriter.StartSeeAlso; procedure TRTFWriter.StartSeealso;
begin begin
Header(SDocSeeAlso, 2); Header(SDocSeeAlso, 2);
end; end;
@ -776,7 +776,7 @@ begin
end; end;
end; end;
Function TRTFWriter.InterPretOption(Const Cmd,Arg : String) : boolean; function TRTFWriter.InterPretOption(const Cmd, Arg: String): boolean;
begin begin
if Cmd = '--RTF-extension' then if Cmd = '--RTF-extension' then
begin begin

View File

@ -960,8 +960,6 @@ procedure TManWriter.WriteDoc;
var var
i : Integer; i : Integer;
L : TstringList; L : TstringList;
DocNode : TDocNode;
begin begin
PackageName := LowerCase(Copy(Package.Name, 2, 255)); PackageName := LowerCase(Copy(Package.Name, 2, 255));
If (Engine.Output<>'') then If (Engine.Output<>'') then

View File

@ -78,7 +78,7 @@ Type
procedure StartSubSection(SubSectionName : String);override; procedure StartSubSection(SubSectionName : String);override;
procedure StartSubSubSection(SubSubSectionName : String);override; procedure StartSubSubSection(SubSubSectionName : String);override;
procedure StartChapter(ChapterName : String); override; procedure StartChapter(ChapterName : String); override;
procedure StartOverview(WithAccess : Boolean); override; procedure StartOverview(Const What : String;WithAccess : Boolean); override;
procedure EndOverview; override; procedure EndOverview; override;
procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); override;
procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override; procedure WriteOverviewMember(const ALabel,AName,ADescr : String); override;
@ -135,7 +135,7 @@ Type
end; end;
procedure TTxtWriter.WriteUnderline(Const Msg : String; DoubleLine : Boolean); procedure TTXTWriter.WriteUnderline(const Msg: String; DoubleLine: Boolean);
Var Var
L : Integer; L : Integer;
@ -146,7 +146,7 @@ begin
WriteLine(L,DoubleLine); WriteLine(L,DoubleLine);
end; end;
procedure TTxtWriter.WriteLine(DoubleLine : Boolean); procedure TTXTWriter.WriteLine(DoubleLine: Boolean);
begin begin
Writeline(LineWidth,DoubleLine); Writeline(LineWidth,DoubleLine);
@ -216,14 +216,14 @@ begin
end; end;
end; end;
procedure TTxtWriter.NewLine; procedure TTXTWriter.NewLine;
begin begin
If Not FCurrentPos=0 then If Not FCurrentPos=0 then
Writeln(''); Writeln('');
end; end;
procedure TTxtWriter.WriteLine(LineLength : Integer; DoubleLine : Boolean); procedure TTXTWriter.WriteLine(LineLength: Integer; DoubleLine: Boolean);
begin begin
NewLine; NewLine;
@ -234,7 +234,7 @@ begin
end; end;
function TTxtWriter.GetLabel(AElement: TPasElement): String; function TTXTWriter.GetLabel(AElement: TPasElement): String;
begin begin
if AElement.ClassType = TPasUnresolvedTypeRef then if AElement.ClassType = TPasUnresolvedTypeRef then
@ -246,87 +246,87 @@ begin
end; end;
end; end;
procedure TTxtWriter.DescrBeginBold; procedure TTXTWriter.DescrBeginBold;
begin begin
end; end;
procedure TTxtWriter.DescrEndBold; procedure TTXTWriter.DescrEndBold;
begin begin
end; end;
procedure TTxtWriter.DescrBeginItalic; procedure TTXTWriter.DescrBeginItalic;
begin begin
end; end;
procedure TTxtWriter.DescrEndItalic; procedure TTXTWriter.DescrEndItalic;
begin begin
end; end;
procedure TTxtWriter.DescrBeginEmph; procedure TTXTWriter.DescrBeginEmph;
begin begin
end; end;
procedure TTxtWriter.DescrEndEmph; procedure TTXTWriter.DescrEndEmph;
begin begin
end; end;
procedure TTxtWriter.DescrWriteFileEl(const AText: DOMString); procedure TTXTWriter.DescrWriteFileEl(const AText: DOMString);
begin begin
DescrWriteText(AText); DescrWriteText(AText);
end; end;
procedure TTxtWriter.DescrWriteKeywordEl(const AText: DOMString); procedure TTXTWriter.DescrWriteKeywordEl(const AText: DOMString);
begin begin
DescrWriteText(AText); DescrWriteText(AText);
end; end;
procedure TTxtWriter.DescrWriteVarEl(const AText: DOMString); procedure TTXTWriter.DescrWriteVarEl(const AText: DOMString);
begin begin
DescrWriteText(AText); DescrWriteText(AText);
end; end;
procedure TTxtWriter.DescrBeginLink(const AId: DOMString); procedure TTXTWriter.DescrBeginLink(const AId: DOMString);
begin begin
Write('['); Write('[');
end; end;
procedure TTxtWriter.DescrEndLink; procedure TTXTWriter.DescrEndLink;
begin begin
Write('] '); Write('] ');
end; end;
procedure TTxtWriter.DescrWriteLinebreak; procedure TTXTWriter.DescrWriteLinebreak;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginParagraph; procedure TTXTWriter.DescrBeginParagraph;
begin begin
// Do nothing // Do nothing
end; end;
procedure TTxtWriter.DescrEndParagraph; procedure TTXTWriter.DescrEndParagraph;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginCode(HasBorder: Boolean; procedure TTXTWriter.DescrBeginCode(HasBorder: Boolean;
const AHighlighterName: String); const AHighlighterName: String);
begin begin
StartListing(HasBorder,''); StartListing(HasBorder,'');
end; end;
procedure TTxtWriter.DescrWriteCodeLine(const ALine: String); procedure TTXTWriter.DescrWriteCodeLine(const ALine: String);
begin begin
WriteLn(ALine); WriteLn(ALine);
end; end;
procedure TTxtWriter.DescrEndCode; procedure TTXTWriter.DescrEndCode;
begin begin
EndListing EndListing
end; end;
procedure TTxtWriter.NewListLevel(Initial : Integer); procedure TTXTWriter.NewListLevel(Initial: Integer);
begin begin
Inc(FListLevel); Inc(FListLevel);
@ -334,44 +334,44 @@ begin
FLists[FListLevel]:=0; FLists[FListLevel]:=0;
end; end;
procedure TTxtWriter.DecListLevel; procedure TTXTWriter.declistlevel;
begin begin
If (FListLevel>0) then If (FListLevel>0) then
Dec(FListLevel) Dec(FListLevel)
end; end;
procedure TTxtWriter.DescrBeginOrderedList; procedure TTXTWriter.DescrBeginOrderedList;
begin begin
NewListLevel(0); NewListLevel(0);
end; end;
procedure TTxtWriter.DescrEndOrderedList; procedure TTXTWriter.DescrEndOrderedList;
begin begin
DecListLevel; DecListLevel;
end; end;
procedure TTxtWriter.DescrBeginUnorderedList; procedure TTXTWriter.DescrBeginUnorderedList;
begin begin
NewListLevel(-1); NewListLevel(-1);
end; end;
procedure TTxtWriter.DescrEndUnorderedList; procedure TTXTWriter.DescrEndUnorderedList;
begin begin
DecListLevel; DecListLevel;
end; end;
procedure TTxtWriter.DescrBeginDefinitionList; procedure TTXTWriter.DescrBeginDefinitionList;
begin begin
NewListLevel(-2); NewListLevel(-2);
end; end;
procedure TTxtWriter.DescrEndDefinitionList; procedure TTXTWriter.DescrEndDefinitionList;
begin begin
DecListLevel; DecListLevel;
end; end;
procedure TTxtWriter.DescrBeginListItem; procedure TTXTWriter.DescrBeginListItem;
begin begin
If FLists[FListLevel]>=0 then If FLists[FListLevel]>=0 then
begin begin
@ -381,105 +381,105 @@ begin
Write(' '); Write(' ');
end; end;
procedure TTxtWriter.DescrEndListItem; procedure TTXTWriter.DescrEndListItem;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginDefinitionTerm; procedure TTXTWriter.DescrBeginDefinitionTerm;
begin begin
Write('<<'); Write('<<');
end; end;
procedure TTxtWriter.DescrEndDefinitionTerm; procedure TTXTWriter.DescrEndDefinitionTerm;
begin begin
WriteLn('>>:'); WriteLn('>>:');
end; end;
procedure TTxtWriter.DescrBeginDefinitionEntry; procedure TTXTWriter.DescrBeginDefinitionEntry;
begin begin
// Do nothing // Do nothing
end; end;
procedure TTxtWriter.DescrEndDefinitionEntry; procedure TTXTWriter.DescrEndDefinitionEntry;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginSectionTitle; procedure TTXTWriter.DescrBeginSectionTitle;
begin begin
Inc(FSectionCount); Inc(FSectionCount);
WritelnF('%s %d.%d: ',[SDocSection,FChapterCount,FSectionCount]); WritelnF('%s %d.%d: ',[SDocSection,FChapterCount,FSectionCount]);
end; end;
procedure TTxtWriter.DescrBeginSectionBody; procedure TTXTWriter.DescrBeginSectionBody;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrEndSection; procedure TTXTWriter.DescrEndSection;
begin begin
// Do noting // Do noting
end; end;
procedure TTxtWriter.DescrBeginRemark; procedure TTXTWriter.DescrBeginRemark;
begin begin
WriteLn(SDocRemark+': '); WriteLn(SDocRemark+': ');
end; end;
procedure TTxtWriter.DescrEndRemark; procedure TTXTWriter.DescrEndRemark;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginTable(ColCount: Integer; HasBorder: Boolean); procedure TTXTWriter.DescrBeginTable(ColCount: Integer; HasBorder: Boolean);
begin begin
WriteLine(False); WriteLine(False);
end; end;
procedure TTxtWriter.DescrEndTable; procedure TTXTWriter.DescrEndTable;
begin begin
WriteLine(False); WriteLine(False);
end; end;
procedure TTxtWriter.DescrBeginTableCaption; procedure TTXTWriter.DescrBeginTableCaption;
begin begin
// Do nothing. // Do nothing.
end; end;
procedure TTxtWriter.DescrEndTableCaption; procedure TTXTWriter.DescrEndTableCaption;
begin begin
Inc(FTableCount); Inc(FTableCount);
WriteF('%s %d :',[SDoctable,FTableCount]); WriteF('%s %d :',[SDoctable,FTableCount]);
TableCaptionWritten := True; TableCaptionWritten := True;
end; end;
procedure TTxtWriter.DescrBeginTableHeadRow; procedure TTXTWriter.DescrBeginTableHeadRow;
begin begin
if not TableCaptionWritten then if not TableCaptionWritten then
DescrEndTableCaption; DescrEndTableCaption;
TableRowStartFlag := True; TableRowStartFlag := True;
end; end;
procedure TTxtWriter.DescrEndTableHeadRow; procedure TTXTWriter.DescrEndTableHeadRow;
begin begin
WriteLine(False); WriteLine(False);
end; end;
procedure TTxtWriter.DescrBeginTableRow; procedure TTXTWriter.DescrBeginTableRow;
begin begin
if not TableCaptionWritten then if not TableCaptionWritten then
DescrEndTableCaption; DescrEndTableCaption;
TableRowStartFlag := True; TableRowStartFlag := True;
end; end;
procedure TTxtWriter.DescrEndTableRow; procedure TTXTWriter.DescrEndTableRow;
begin begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.DescrBeginTableCell; procedure TTXTWriter.DescrBeginTableCell;
begin begin
if TableRowStartFlag then if TableRowStartFlag then
TableRowStartFlag := False TableRowStartFlag := False
@ -487,7 +487,7 @@ begin
Write(' '); Write(' ');
end; end;
procedure TTxtWriter.DescrEndTableCell; procedure TTXTWriter.DescrEndTableCell;
begin begin
// Do nothing // Do nothing
end; end;
@ -514,15 +514,15 @@ begin
Result:=inherited InterpretOption(Cmd, Arg); Result:=inherited InterpretOption(Cmd, Arg);
end; end;
procedure TTxtWriter.WriteLabel(const s: String); procedure TTXTWriter.WriteLabel(const S: String);
begin begin
end; end;
procedure TTxtWriter.WriteIndex(const s : String); procedure TTXTWriter.WriteIndex(const S: String);
begin begin
end; end;
procedure TTxtWriter.StartListing(Frames: Boolean; const name: String); procedure TTXTWriter.StartListing(Frames: Boolean; const name: String);
begin begin
FInVerbatim:=True; FInVerbatim:=True;
If (Name<>'') then If (Name<>'') then
@ -533,21 +533,21 @@ begin
WriteLn(''); WriteLn('');
end; end;
procedure TTxtWriter.EndListing; procedure TTXTWriter.EndListing;
begin begin
FInVerbatim:=False; FInVerbatim:=False;
end; end;
procedure TTxtWriter.WriteCommentLine; procedure TTXTWriter.WriteCommentLine;
begin begin
end; end;
procedure TTxtWriter.WriteComment(Comment : String); procedure TTXTWriter.WriteComment(Comment: String);
begin begin
end; end;
procedure TTxtWriter.StartChapter(ChapterName : String); procedure TTXTWriter.StartChapter(ChapterName: String);
begin begin
Inc(FChapterCount); Inc(FChapterCount);
FSectionCount:=0; FSectionCount:=0;
@ -559,7 +559,7 @@ begin
Writeln(''); Writeln('');
end; end;
procedure TTxtWriter.StartSection(SectionName : String); procedure TTXTWriter.StartSection(SectionName: String);
begin begin
Inc(FSectionCount); Inc(FSectionCount);
FSubSectionCount:=0; FSubSectionCount:=0;
@ -570,7 +570,7 @@ begin
Writeln(''); Writeln('');
end; end;
procedure TTxtWriter.StartSubSection(SubSectionName : String); procedure TTXTWriter.StartSubSection(SubSectionName: String);
begin begin
Inc(FSubSectionCount); Inc(FSubSectionCount);
Writeln(''); Writeln('');
@ -579,7 +579,7 @@ begin
Writeln(''); Writeln('');
end; end;
procedure TTxtWriter.StartSubSubSection(SubSubSectionName : String); procedure TTXTWriter.StartSubSubSection(SubSubSectionName: String);
begin begin
Writeln(''); Writeln('');
Writeln(SubSubSectionName); Writeln(SubSubSectionName);
@ -598,7 +598,7 @@ begin
end; end;
end; end;
procedure TTxtWriter.WriteExampleFile(FN : String); procedure TTXTWriter.WriteExampleFile(FN: String);
Var Var
L : TStringList; L : TStringList;
@ -622,51 +622,52 @@ begin
end; end;
end; end;
procedure TTxtWriter.StartOverview(WithAccess : Boolean); procedure TTXTWriter.StartOverview(const What: String; WithAccess: Boolean);
begin begin
If WithAccess then If WithAccess then
WriteUnderLine(Format('%.30s %.10s %s',[EscapeText(SDocProperty), EscapeText(SDocAccess), EscapeText(SDocDescription)]),False) WriteUnderLine(Format('%.30s %.10s %s',[EscapeText(What), EscapeText(SDocAccess), EscapeText(SDocDescription)]),False)
else else
WriteUnderLine(Format('%.30s %s',[EscapeText(SDocMethod), EscapeText(SDocDescription)]),False); WriteUnderLine(Format('%.30s %s',[EscapeText(What), EscapeText(SDocDescription)]),False);
end; end;
procedure TTxtWriter.EndOverview; procedure TTXTWriter.EndOverview;
begin begin
WriteLine(False); WriteLine(False);
end; end;
procedure TTxtWriter.WriteOverviewMember(const ALabel,AName,Access,ADescr : String); procedure TTXTWriter.WriteOverviewMember(const ALabel, AName, Access,
ADescr: String);
begin begin
WriteLnF('%.30s %.10s %s',[AName,Access,ADescr]); WriteLnF('%.30s %.10s %s',[AName,Access,ADescr]);
end; end;
procedure TTxtWriter.WriteOverviewMember(const ALabel,AName,ADescr : String); procedure TTXTWriter.WriteOverviewMember(const ALabel, AName, ADescr: String);
begin begin
WriteLnF('%.30s %s ',[AName,ADescr]); WriteLnF('%.30s %s ',[AName,ADescr]);
end; end;
class function TTxtWriter.FileNameExtension: String; class function TTXTWriter.FileNameExtension: String;
begin begin
Result:=TxtExtension; Result:=TxtExtension;
end; end;
procedure TTxtWriter.StartUnitOverview(AModuleName,AModuleLabel : String); procedure TTXTWriter.StartUnitOverview(AModuleName, AModuleLabel: String);
begin begin
WriteUnderLine('Unit Name',False); WriteUnderLine('Unit Name',False);
end; end;
procedure TTxtWriter.WriteUnitEntry(UnitRef : TPasType); procedure TTXTWriter.WriteUnitEntry(UnitRef: TPasType);
begin begin
Writeln(EscapeText(UnitRef.Name)); Writeln(EscapeText(UnitRef.Name));
end; end;
procedure TTxtWriter.EndUnitOverview; procedure TTXTWriter.EndUnitOverview;
begin begin
Writeln(''); Writeln('');

View File

@ -78,7 +78,7 @@ Type
procedure StartListing(Frames: Boolean; const name: String); virtual; abstract; procedure StartListing(Frames: Boolean; const name: String); virtual; abstract;
procedure EndListing; virtual; abstract; procedure EndListing; virtual; abstract;
Procedure WriteExampleFile(FN : String); virtual; abstract; Procedure WriteExampleFile(FN : String); virtual; abstract;
procedure StartOverview(WithAccess : Boolean); virtual; Abstract; procedure StartOverview(Const What : String; WithAccess : Boolean); virtual; Abstract;
procedure EndOverview; virtual; Abstract; procedure EndOverview; virtual; Abstract;
procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); virtual; Abstract; procedure WriteOverviewMember(const ALabel,AName,Access,ADescr : String); virtual; Abstract;
procedure WriteOverviewMember(const ALabel,AName,ADescr : String); virtual; Abstract; procedure WriteOverviewMember(const ALabel,AName,ADescr : String); virtual; Abstract;
@ -106,9 +106,10 @@ Type
procedure WriteFunctionsAndProcedures(ASection: TPasSection); procedure WriteFunctionsAndProcedures(ASection: TPasSection);
procedure WriteProcedure(ProcDecl: TPasProcedureBase); procedure WriteProcedure(ProcDecl: TPasProcedureBase);
procedure WriteClasses(ASection: TPasSection); procedure WriteClasses(ASection: TPasSection);
Procedure WriteExtendedRecords(Asection : TPasSection);
procedure WriteClassDecl(ClassDecl: TPasClassType); procedure WriteClassDecl(ClassDecl: TPasClassType);
procedure WriteClassMethodOverview(ClassDecl: TPasClassType); procedure WriteMethodOverview(AParent: TPasType; Members : TFPList);
procedure WriteClassPropertyOverview(ClassDecl: TPasClassType); procedure WritePropertyOverview(AParent: TPasType; Members : TFPList);
procedure WriteClassInterfacesOverview(ClassDecl: TPasClassType); procedure WriteClassInterfacesOverview(ClassDecl: TPasClassType);
procedure WriteClassInheritanceOverview(ClassDecl: TPasClassType); virtual; procedure WriteClassInheritanceOverview(ClassDecl: TPasClassType); virtual;
procedure WriteProperty(PropDecl: TPasProperty); procedure WriteProperty(PropDecl: TPasProperty);
@ -128,14 +129,14 @@ const
Writing support Writing support
---------------------------------------------------------------------} ---------------------------------------------------------------------}
Function TLinearWriter.PushWriteContext(S : TStream) : TStream; function TLinearWriter.PushWriteContext(S: TStream): TStream;
begin begin
Result:=FStream; Result:=FStream;
FStream:=S; FStream:=S;
end; end;
Procedure TLinearWriter.PopWriteContext(S : TSTream); procedure TLinearWriter.PopWriteContext(S: TSTream);
begin begin
FStream:=S; FStream:=S;
@ -174,7 +175,8 @@ begin
Write(EscapeText(AText)); Write(EscapeText(AText));
end; end;
Function TLinearWriter.GetDescrString(AContext: TPasElement; DescrNode: TDOMElement) : String; function TLinearWriter.GetDescrString(AContext: TPasElement;
DescrNode: TDOMElement): String;
Var Var
S : TStringStream; S : TStringStream;
@ -274,74 +276,74 @@ end;
Default implementations, may be overridden in descendents Default implementations, may be overridden in descendents
---------------------------------------------------------------------} ---------------------------------------------------------------------}
Function TLinearWriter.EscapeText(S : String) : String; function TLinearWriter.EscapeText(S: String): String;
begin begin
Result:=S; Result:=S;
end; end;
Function TLinearWriter.StripText(S : String) : String; function TLinearWriter.StripText(S: String): String;
begin begin
Result:=S; Result:=S;
end; end;
Procedure TLinearWriter.StartProcedure; procedure TLinearWriter.StartProcedure;
begin begin
Writeln(SDocProcedure+':'); Writeln(SDocProcedure+':');
end; end;
Procedure TLinearWriter.StartSynopsis; procedure TLinearWriter.StartSynopsis;
begin begin
Writeln(''); Writeln('');
Writeln(SDocSynopsis+':'); Writeln(SDocSynopsis+':');
end; end;
Procedure TLinearWriter.StartDeclaration; procedure TLinearWriter.StartDeclaration;
begin begin
Writeln(''); Writeln('');
Writeln(SDocDeclaration+':'); Writeln(SDocDeclaration+':');
end; end;
Procedure TLinearWriter.StartVisibility; procedure TLinearWriter.StartVisibility;
begin begin
Writeln(''); Writeln('');
Writeln(SDocVisibility+':'); Writeln(SDocVisibility+':');
end; end;
Procedure TLinearWriter.StartDescription; procedure TLinearWriter.StartDescription;
begin begin
Writeln(''); Writeln('');
Writeln(SDocDescription+':'); Writeln(SDocDescription+':');
end; end;
Procedure TLinearWriter.StartAccess; procedure TLinearWriter.StartAccess;
begin begin
Writeln(''); Writeln('');
Writeln(SDocAccess+':'); Writeln(SDocAccess+':');
end; end;
Procedure TLinearWriter.StartErrors; procedure TLinearWriter.StartErrors;
begin begin
Writeln(''); Writeln('');
Writeln(SDocErrors+':'); Writeln(SDocErrors+':');
end; end;
Procedure TLinearWriter.StartVersion; procedure TLinearWriter.StartVersion;
begin begin
Writeln(''); Writeln('');
Writeln(SDocVersion+':'); Writeln(SDocVersion+':');
end; end;
Procedure TLinearWriter.StartSeealso; procedure TLinearWriter.StartSeealso;
begin begin
Writeln(''); Writeln('');
@ -349,20 +351,20 @@ begin
end; end;
Procedure TLinearWriter.StartProperty; procedure TLinearWriter.StartProperty;
begin begin
Writeln(''); Writeln('');
Writeln(SDocProperty+':'); Writeln(SDocProperty+':');
end; end;
Procedure TLinearWriter.EndProcedure; procedure TLinearWriter.EndProcedure;
begin begin
Writeln(''); Writeln('');
end; end;
Procedure TLinearWriter.EndProperty; procedure TLinearWriter.EndProperty;
begin begin
Writeln(''); Writeln('');
@ -422,9 +424,9 @@ begin
// Write Interfaces Overview; // Write Interfaces Overview;
WriteClassInterfacesOverView(ClassDecl); WriteClassInterfacesOverView(ClassDecl);
// Write method overview // Write method overview
WriteClassMethodOverView(ClassDecl); WriteMethodOverView(ClassDecl,ClassDecl.Members);
// Write Property Overview; // Write Property Overview;
WriteClassPropertyOverView(ClassDecl); WritePropertyOverView(ClassDecl,ClassDecl.Members);
// Write method & property descriptions // Write method & property descriptions
@ -448,7 +450,7 @@ begin
end; end;
procedure TLinearWriter.WriteClassPropertyOverview(ClassDecl : TPasClassType); procedure TLinearWriter.WritePropertyOverview(AParent: TPasType; Members : TFPList);
var var
Member: TPasElement; Member: TPasElement;
@ -462,9 +464,9 @@ begin
List:=TStringList.Create; List:=TStringList.Create;
Try Try
List.Sorted:=True; List.Sorted:=True;
for i := 0 to ClassDecl.Members.Count - 1 do for i := 0 to Members.Count - 1 do
begin begin
Member := TPasElement(ClassDecl.Members[i]); Member := TPasElement(Members[i]);
With Member do With Member do
if InheritsFrom(TPasProperty) and SHowMember(Member) then if InheritsFrom(TPasProperty) and SHowMember(Member) then
List.AddObject(Member.Name,Member) List.AddObject(Member.Name,Member)
@ -472,8 +474,8 @@ begin
If (List.Count>0) then If (List.Count>0) then
begin begin
StartSubSection(SDocPropertyOverview); StartSubSection(SDocPropertyOverview);
WriteLabel(GetLabel(ClassDecl) + ':Properties'); WriteLabel(GetLabel(AParent) + ':Properties');
StartOverView(True); StartOverView(SDocProperties,True);
For I:=0 to List.Count-1 do For I:=0 to List.Count-1 do
begin begin
Member:=TPasElement(List.objects[i]); Member:=TPasElement(List.objects[i]);
@ -535,7 +537,7 @@ begin
begin begin
StartSubSection(SDocInterfacesOverview); StartSubSection(SDocInterfacesOverview);
WriteLabel(GetLabel(ClassDecl) + ':Interfaces'); WriteLabel(GetLabel(ClassDecl) + ':Interfaces');
StartOverView(False); StartOverView(SDocInterface,False);
for i := 0 to List.Count-1 do for i := 0 to List.Count-1 do
begin begin
lInterface := TPasElement(List.Objects[i]); lInterface := TPasElement(List.Objects[i]);
@ -648,6 +650,7 @@ begin
WriteVarsConstsTypes(ASection); WriteVarsConstsTypes(ASection);
WriteFunctionsAndProcedures(ASection); WriteFunctionsAndProcedures(ASection);
WriteExtendedRecords(ASection);
WriteClasses(ASection); WriteClasses(ASection);
end; end;
@ -721,7 +724,7 @@ begin
end; end;
end; end;
Procedure TLinearWriter.ProcessPackage; procedure TLinearWriter.ProcessPackage;
var var
DocNode: TDocNode; DocNode: TDocNode;
@ -740,7 +743,7 @@ begin
ProcessTopics(DocNode,1); ProcessTopics(DocNode,1);
end; end;
Procedure TLinearWriter.ProcessTopics(DocNode : TDocNode; Alevel : Integer); procedure TLinearWriter.ProcessTopics(DocNode: TDocNode; Alevel: Integer);
Var Var
Node : TDocNode; Node : TDocNode;
@ -758,7 +761,7 @@ begin
end; end;
Procedure TLinearWriter.WriteTopicNode(Node : TDocNode; Level : Integer); procedure TLinearWriter.WriteTopicNode(Node: TDocNode; Level: Integer);
Var Var
Element : TTopicElement; Element : TTopicElement;
@ -860,48 +863,53 @@ end;
procedure TLinearWriter.WriteTypes(ASection: TPasSection); procedure TLinearWriter.WriteTypes(ASection: TPasSection);
var var
i: Integer; i,j: Integer;
TypeDecl: TPasType; TypeDecl: TPasType;
Recdecl: TPasRecordType;
Member : TPasElement;
DocNode : TDocNode; DocNode : TDocNode;
begin begin
if ASection.Types.Count > 0 then if ASection.Types.Count > 0 then
begin begin
StartSubSection(SDocTypes,ModuleName+'Types'); StartSubSection(SDocTypes,ModuleName+'Types');
for i := 0 to ASection.Types.Count - 1 do for i := 0 to ASection.Types.Count - 1 do
begin
DescrBeginParagraph;
TypeDecl := TPasType(ASection.Types[i]);
WriteTypeDecl(TypeDecl);
StartListing(False,'');
DocNode := Engine.FindDocNode(TypeDecl);
If Assigned(DocNode) and
Assigned(DocNode.Node) and
(Docnode.Node['opaque']='1') then
Writeln(TypeDecl.Name+' = '+SDocOpaque)
else
begin begin
Writeln(EscapeText(TypeDecl.GetDeclaration(True))); TypeDecl := TPasType(ASection.Types[i]);
end; if not ((TypeDecl is TPasRecordType) and TPasRecordType(TypeDecl).IsAdvancedRecord) then
EndListing;
WriteLabel(TypeDecl);
WriteIndex(TypeDecl);
If TypeDecl is TPasEnumType then
WriteENumElements(TypeDecl as TPasEnumType)
else If (TypeDecl is TPasSetType)
and (TPasSetType(TypeDecl).EnumType is TPasEnumType)
and (TPasSetType(TypeDecl).EnumType.Name='') then
WriteENumElements(TPasSetType(TypeDecl).EnumType as TPasEnumType);
WriteDescr(TypeDecl,DocNode);
If Assigned(DocNode) and Assigned(DocNode.Version) then
begin begin
Writeln(Format('%s : ',[SDocVersion])); DescrBeginParagraph;
WriteDescr(TypeDecl, DocNode.Version); WriteTypeDecl(TypeDecl);
StartListing(False,'');
DocNode := Engine.FindDocNode(TypeDecl);
If Assigned(DocNode) and
Assigned(DocNode.Node) and
(Docnode.Node['opaque']='1') then
Writeln(TypeDecl.Name+' = '+SDocOpaque)
else
begin
Writeln(EscapeText(TypeDecl.GetDeclaration(True)));
end;
EndListing;
WriteLabel(TypeDecl);
WriteIndex(TypeDecl);
If TypeDecl is TPasEnumType then
WriteENumElements(TypeDecl as TPasEnumType)
else If (TypeDecl is TPasSetType)
and (TPasSetType(TypeDecl).EnumType is TPasEnumType)
and (TPasSetType(TypeDecl).EnumType.Name='') then
WriteENumElements(TPasSetType(TypeDecl).EnumType as TPasEnumType);
WriteDescr(TypeDecl,DocNode);
If Assigned(DocNode) and Assigned(DocNode.Version) then
begin
Writeln(Format('%s : ',[SDocVersion]));
WriteDescr(TypeDecl, DocNode.Version);
end;
if Assigned(DocNode) and assigned(DocNode.Notes) then
ConvertNotes(TypeDecl,DocNode.Notes);
DescrEndParagraph;
end; end;
if Assigned(DocNode) and assigned(DocNode.Notes) then
ConvertNotes(TypeDecl,DocNode.Notes);
DescrEndParagraph;
end; end;
end; end;
end; end;
procedure TLinearWriter.WriteVars(ASection: TPasSection); procedure TLinearWriter.WriteVars(ASection: TPasSection);
@ -945,7 +953,7 @@ var
begin begin
With ProcDecl do With ProcDecl do
begin begin
if Not (Assigned(Parent) and Parent.InheritsFrom(TPasClassType)) then if Not (Assigned(Parent) and ((Parent.InheritsFrom(TPasClassType)) or Parent.InheritsFrom(TPasRecordType))) then
begin begin
StartSubSection(Name); StartSubSection(Name);
WriteLabel(ProcDecl); WriteLabel(ProcDecl);
@ -1174,7 +1182,7 @@ begin
List.Sort(@CompareElements); List.Sort(@CompareElements);
end; end;
Function TLinearWriter.ShowMember(M : TPasElement) : boolean; function TLinearWriter.ShowMember(M: TPasElement): boolean;
begin begin
Result:=Engine.ShowElement(M); Result:=Engine.ShowElement(M);
@ -1189,7 +1197,67 @@ begin
WriteClassDecl(TPasClassType(ASection.Classes[i])); WriteClassDecl(TPasClassType(ASection.Classes[i]));
end; end;
procedure TLinearWriter.WriteClassMethodOverview(ClassDecl: TPasClassType); procedure TLinearWriter.WriteExtendedRecords(Asection: TPasSection);
var
i,j : Integer;
Recdecl : TPasRecordType;
DocNode : TDocNode;
Member : TPasElement;
begin
if (ASection.Types.Count > 0) then
for i := 0 to ASection.Types.Count - 1 do
begin
If TPasElement(ASection.Types[i]) is TPasRecordType then
begin
Recdecl:=TPasRecordType(ASection.Types[i]);
if RecDecl.IsAdvancedRecord then
begin
StartSection(RecDecl.Name);
DescrBeginParagraph;
WriteTypeDecl(RecDecl);
StartListing(False,'');
DocNode := Engine.FindDocNode(RecDecl);
If Assigned(DocNode) and
Assigned(DocNode.Node) and
(Docnode.Node['opaque']='1') then
Writeln(RecDecl.Name+' = '+SDocOpaque)
else
begin
Writeln(EscapeText(RecDecl.GetDeclaration(True)));
end;
EndListing;
WriteLabel(RecDecl);
WriteIndex(RecDecl);
WriteDescr(RecDecl,DocNode);
If Assigned(DocNode) and Assigned(DocNode.Version) then
begin
Writeln(Format('%s : ',[SDocVersion]));
WriteDescr(RecDecl, DocNode.Version);
end;
if Assigned(DocNode) and assigned(DocNode.Notes) then
ConvertNotes(RecDecl,DocNode.Notes);
DescrEndParagraph;
WriteMethodOverView(Recdecl,Recdecl.Members);
WritePropertyOverView(Recdecl,Recdecl.Members);
for J := 0 to Recdecl.Members.Count - 1 do
begin
Member := TPasElement(Recdecl.Members[j]);
if Member.InheritsFrom(TPasProcedureBase) and Engine.ShowElement(Member) then
WriteProcedure(TPasProcedureBase(Member));
end;
for j := 0 to Recdecl.Members.Count - 1 do
begin
Member := TPasElement(Recdecl.Members[j]);
if Member.InheritsFrom(TPasProperty) and Engine.ShowElement(Member) then
WriteProperty(TPasProperty(Member));
end;
end;
end;
end;
end;
procedure TLinearWriter.WriteMethodOverview(AParent: TPasType; Members : TFPList);
var var
Member : TPasElement; Member : TPasElement;
@ -1202,9 +1270,9 @@ begin
List:=TStringList.Create; List:=TStringList.Create;
Try Try
List.Sorted:=True; List.Sorted:=True;
for i := 0 to ClassDecl.Members.Count - 1 do for i := 0 to Members.Count - 1 do
begin begin
Member := TPasElement(ClassDecl.Members[i]); Member := TPasElement(Members[i]);
With Member do With Member do
if InheritsFrom(TPasProcedureBase) and ShowMember(Member) then if InheritsFrom(TPasProcedureBase) and ShowMember(Member) then
List.AddObject(Member.Name,Member); List.AddObject(Member.Name,Member);
@ -1212,8 +1280,8 @@ begin
If List.Count>0 then If List.Count>0 then
begin begin
StartSubSection(SDocMethodOverview); StartSubSection(SDocMethodOverview);
WriteLabel(GetLabel(ClassDecl) + ':Methods'); WriteLabel(GetLabel(AParent) + ':Methods');
StartOverview(False); StartOverview(SDocMethod,False);
For I:=0 to List.Count-1 do For I:=0 to List.Count-1 do
begin begin
Member:=TPasElement(List.Objects[i]); Member:=TPasElement(List.Objects[i]);
@ -1243,10 +1311,31 @@ constructor TLinearWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
procedure AddList(AElement: TPasElement; AList: TFPList); procedure AddList(AElement: TPasElement; AList: TFPList);
var var
i: Integer; i,j: Integer;
R : TPasRecordType;
FPEl : TPaselement;
DocNode: TDocNode;
begin begin
for i := 0 to AList.Count - 1 do for i := 0 to AList.Count - 1 do
begin
AddLabel(TPasElement(AList[i])); AddLabel(TPasElement(AList[i]));
if (TObject(AList[i]) is TPasRecordType) then
begin
R:=TObject(AList[I]) as TPasRecordType;
For J:=0 to R.Members.Count-1 do
begin
FPEl:=TPasElement(R.Members[J]);
if ((FPEL is TPasProperty) or (FPEL is TPasProcedureBase))
and Engine.ShowElement(FPEl) then
begin
DocNode := Engine.FindDocNode(FPEl);
if Assigned(DocNode) then
AddLabel(FPEl);
end;
end;
end;
end;
end; end;
procedure AddTopicPages(AElement: TPasElement); procedure AddTopicPages(AElement: TPasElement);
@ -1381,7 +1470,7 @@ begin
// do nothing // do nothing
end; end;
function TLinearWriter.InterpretOption(const Cmd: String; const Arg: String): Boolean; function TLinearWriter.InterpretOption(const Cmd, Arg: String): Boolean;
begin begin
Result := True; Result := True;
if Cmd = cDupLinkedDocParam then if Cmd = cDupLinkedDocParam then

View File

@ -1,5 +1,5 @@
/* /*
$Id: fpdoc.cst,v 1.1 2005/01/02 16:22:16 michael Exp $ $Id: fpdoc.css,v 1.1 2003/03/17 23:03:20 michael Exp $
Default style sheet for FPDoc reference documentation Default style sheet for FPDoc reference documentation
by Sebastian Guenther, sg@freepascal.org by Sebastian Guenther, sg@freepascal.org
@ -62,10 +62,6 @@ span.code {
span.sym { span.sym {
color: darkred color: darkred
} }
/* No wordwrap in code fragments */
span.code {
white-space: nowrap
}
/* keywords in source fragments */ /* keywords in source fragments */
span.kw { span.kw {
@ -131,30 +127,40 @@ table.bar {
background-color: #a0c0ff; background-color: #a0c0ff;
} }
td p {
margin: 0;
}
span.bartitle { span.bartitle {
font-weight: bold; font-weight: bold;
font-style: italic; font-style: italic;
color: darkblue color: darkblue
} }
span.toggletreeclose { span.footer {
background: url(minus.png) center left no-repeat; font-style: italic;
padding-left: 20px; color: darkblue
} }
span.toggletreeopen { /* definition list */
background: url(plus.png) center left no-repeat; dl {
padding-left: 20px; border: 3px double #ccc;
padding: 0.5em;
} }
ul.classtreelist li { padding-left: 0px; } /* definition list: term */
dt {
float: left;
clear: left;
width: auto; /* normally browsers default width of largest item */
padding-right: 20px;
font-weight: bold;
color: darkgreen;
}
ul.classtreelist { list-style-type:none; } /* definition list: description */
dd {
margin: 0 0 0 110px;
padding: 0 0 0.5em 0;
}
li.classtree ul { display: block; } /* for browsers in standards compliance mode */
td p {
li.classtreeclosed ul { display: none; } margin: 0;
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/> <Version Value="9"/>
@ -31,8 +31,7 @@
<RunParams> <RunParams>
<local> <local>
<FormatVersion Value="1"/> <FormatVersion Value="1"/>
<CommandLineParams Value="--package=me --output=me --input=ct.pp --format=html"/> <CommandLineParams Value="--package=fpdoc --input=testunit.pp --output=testunit --format=html --descr=testunit.xml"/>
<LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="1"> <RequiredPackages Count="1">
@ -64,7 +63,6 @@
<Unit4> <Unit4>
<Filename Value="dw_ipflin.pas"/> <Filename Value="dw_ipflin.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dw_ipflin"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="dw_latex.pp"/> <Filename Value="dw_latex.pp"/>
@ -74,7 +72,6 @@
<Unit6> <Unit6>
<Filename Value="dwlinear.pp"/> <Filename Value="dwlinear.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dwlinear"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="dw_linrtf.pp"/> <Filename Value="dw_linrtf.pp"/>
@ -84,7 +81,6 @@
<Unit8> <Unit8>
<Filename Value="dw_man.pp"/> <Filename Value="dw_man.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dw_man"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
<Filename Value="dwriter.pp"/> <Filename Value="dwriter.pp"/>
@ -94,7 +90,6 @@
<Unit10> <Unit10>
<Filename Value="dw_txt.pp"/> <Filename Value="dw_txt.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dw_txt"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="dw_xml.pp"/> <Filename Value="dw_xml.pp"/>
@ -104,22 +99,18 @@
<Unit12> <Unit12>
<Filename Value="fpdocproj.pas"/> <Filename Value="fpdocproj.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="fpdocproj"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
<Filename Value="fpdocxmlopts.pas"/> <Filename Value="fpdocxmlopts.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="fpdocxmlopts"/>
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="mkfpdoc.pp"/> <Filename Value="mkfpdoc.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="mkfpdoc"/>
</Unit14> </Unit14>
<Unit15> <Unit15>
<Filename Value="fpdocclasstree.pp"/> <Filename Value="fpdocclasstree.pp"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="fpdocclasstree"/>
</Unit15> </Unit15>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
@ -132,12 +123,6 @@
<IncludeFiles Value="$(ProjOutDir)"/> <IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
<Debugging> <Debugging>
<Exceptions Count="3"> <Exceptions Count="3">

View File

@ -1,5 +1,7 @@
{$mode objfpc} {$mode objfpc}
{$h+} {$h+}
{$modeswitch advancedrecords}
unit testunit; unit testunit;
interface interface
@ -41,6 +43,19 @@ Type
end; end;
TADeprecatedType = Integer deprecated; TADeprecatedType = Integer deprecated;
TMethodRecord = Record
Private
X22 : Integer;
Procedure SetX(AValue : Integer);
Function GetX : Integer;
Public
Procedure MyMethod;
Property MyX : Integer Read GetX Write SetX;
Case Integer of
1 : (X2,Y2 : Integer);
2 : (phi,Omega : Real);
end;
Var Var
ASimpleVar : Integer; ASimpleVar : Integer;
@ -276,4 +291,18 @@ begin
end; end;
Procedure TMethodRecord.SetX(AValue : Integer);
begin
end;
Function TMEthodRecord.GetX : Integer;
begin
end;
Procedure TMEthodRecord.MyMethod;
begin
end;
end. end.

View File

@ -9,8 +9,9 @@
--> -->
<module name="testunit"> <module name="testunit">
<short></short> <short>This cannot be</short>
<descr> <descr>
We have here a description
</descr> </descr>
<notes> <notes>
<note>Unit note</note> <note>Unit note</note>
@ -18,7 +19,7 @@
<!-- constant Visibility: default --> <!-- constant Visibility: default -->
<element name="AnIntegerConst"> <element name="AnIntegerConst">
<short></short> <short>Aha this is not me</short>
<descr> <descr>
</descr> </descr>
<version> <version>
@ -206,7 +207,7 @@ Appears in 2.0
<!-- record type Visibility: default --> <!-- record type Visibility: default -->
<element name="TAVariantRecordType"> <element name="TAVariantRecordType">
<short></short> <short>Some record with variants</short>
<descr> <descr>
</descr> </descr>
<seealso> <seealso>
@ -215,7 +216,7 @@ Appears in 2.0
<!-- variable Visibility: default --> <!-- variable Visibility: default -->
<element name="TAVariantRecordType.A"> <element name="TAVariantRecordType.A">
<short></short> <short>A short description for A </short>
<descr> <descr>
</descr> </descr>
<seealso> <seealso>
@ -224,7 +225,7 @@ Appears in 2.0
<!-- variable Visibility: default --> <!-- variable Visibility: default -->
<element name="TAVariantRecordType.X"> <element name="TAVariantRecordType.X">
<short></short> <short>A short description for X</short>
<descr> <descr>
</descr> </descr>
<seealso> <seealso>
@ -233,7 +234,53 @@ Appears in 2.0
<!-- variable Visibility: default --> <!-- variable Visibility: default -->
<element name="TAVariantRecordType.Y"> <element name="TAVariantRecordType.Y">
<short></short> <short>A short description for Y</short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- record type Visibility: default -->
<element name="TMethodRecord">
<short>Some record with variants</short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TMethodRecord.MyMethod">
<short>A short description for MyMethod</short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TMethodRecord.A">
<short>A short description for A </short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TMethodRecord.X">
<short>A short description for X</short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TMethodRecord.Y">
<short>A short description for Y</short>
<descr> <descr>
</descr> </descr>
<seealso> <seealso>