📄 delphidoc.dpr
字号:
{ JADD - Just Another DelphiDoc: Documentation from Delphi Source Code
Copyright (C) 2003-2008 Gerold Veith
This file is part of JADD - Just Another DelphiDoc.
DelphiDoc is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
DelphiDoc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permission under GNU GPL version 3 section 7
In addition, as a special exception, Gerold Veith gives permission to link
the code of this program with
* "HTML Help Kit for Delphi",
* TPNGImage and
* TRegExpr
(or with modified versions of them that use the same licenses), and distribute
linked combinations including the three. You must obey the GNU General Public
License in all respects for all of the code used other than that. If you
modify this program, you may extend this exception to your version, but you
are not obligated to do so. If you do not wish to do so, delete this exception
statement from your version.
}
program DelphiDoc;
{This is the project file of the program that generates documentation from
pascal source code files.
~[UserDoc UserDocumentation.txt ]
}
//-p dd.ddp -d .\_doc -o AutoLaunchHelp=true -g TWinHelpDoc -o AutoLaunchDocumentation=true /o AutoCompileHelpProject=1 -r
//-p dd.ddp -d .\_doc -o AutoLaunchHelp=true -g TICWinHelpDoc -o AutoLaunchDocumentation=true /o AutoCompileHelpProject=1 -r -o DocumentationSectionsFilter=I -o DisableHelpFileCompression=1 -g TICHTMLDoc
//-p dd.ddp -d .\_doc -o DisableHelpFileCompression=1 -g TICHTMLDoc
//-pdogo DDTestPr.ddp .\_doc AutoLaunchHelp=true TICWinHelpDoc "AutoLaunchDocumentation=true" /orooo AutoCompileHelpProject=1 DisableHelpFileCompression=1 ExtraWinHelpFilesFor=C DontOverrideMainFile=True
//-pdogo DD.ddp .\_doc AutoLaunchHelp=true TICWinHelpDoc "AutoLaunchDocumentation=true" /orooo AutoCompileHelpProject=1 DisableHelpFileCompression=1 ExtraWinHelpFilesFor=C DontOverrideMainFile=True
//GUIHelp: -Hdgo z_html\generate\DelphiDoc .\_doc TICHTMLHelpDoc "AutoLaunchDocumentation=true" /o AutoCompileHelpProject=1 --generate=GUIHelp
//-gpHdoo TICHTMLHelpDoc DDTestPr.ddp .\z_html\generate\DelphiDoc.ddgh .\_doc AutoLaunchHelp=true "AutoLaunchDocumentation=true" /orooo AutoCompileHelpProject=1 DisableHelpFileCompression=1 ExtraWinHelpFilesFor=C DontOverrideMainFile=True
//-dogo .\_doc AutoLaunchHelp=true PDF "AutoLaunchDocumentation=true" /orooo AutoCompileHelpProject=1 DisableHelpFileCompression=1 ExtraWinHelpFilesFor=C DontOverrideMainFile=True -p DD.ddp -ooo GenerateVisualHelpContextRedirector=1 GenerateHelpContextRedirector=1 DisablePDFCompression=1
//
{$DEFINE USEFASTMM}
//
{$DEFINE USECHM}
//{$DEFINE USESPECIALHELPSUPPORT}
uses
{$IFDEF USEFASTMM}
FastMM4,
{$ENDIF}
// UDebugMem,
{$IFNDEF LINUX}
SysUtils, Forms,
{$ELSE}
QForms,
{$ENDIF}
UMain in 'GUI\UMain.pas' {FormMain},
UAbout in 'GUI\UAbout.pas' {FormAbout},
UEditDefines in 'GUI\UEditDefines.pas' {FormDefines},
UAddInteractively in 'GUI\UAddInteractively.pas' {FormAddInteractively},
UWorkProgress in 'GUI\UWorkProgress.pas' {FormWorkProgress},
UShowSourceForm in 'GUI\UShowSourceForm.pas' {FormShowSource},
UDiagramForm in 'GUI\UDiagramForm.pas' {FormDiagram},
USelectParsedDirectory in 'GUI\USelectParsedDirectory.pas' {FormSelectParsedDirectory},
UComparison in 'GUI\UComparison.pas' {FormComparison},
UExpert in 'GUI\UExpert.pas' {FormExpert},
UCatExpert in 'GUI\UCatExpert.pas' {FormCatExpert},
UCatExpertSearchDlg in 'GUI\UCatExpertSearchDlg.pas' {FormOptionSearchDialog},
UEditGUITopics in 'GUI\UEditGUITopics.pas' {TFormGUITopics},
UMessageFilterForm in 'GUI\UMessageFilterForm.pas' {FormMessageFilter},
UWizard in 'GUI\Wizard\UWizard.pas' {FormWizard}
{$IFDEF USECHM}
{$IFNDEF LINUX}
, HH_FUNCS
{$IFDEF CONDITIONALEXPRESSIONS}
, D6OnHelpFix
{$ENDIF}
{$ENDIF}
{$ELSE}
{$IFDEF USESPECIALHELPSUPPORT}
, UUseGUIHelp
{$ENDIF}
{$ENDIF}
;
// duplicate resource id: type 3 id 1
{$IFNDEF LINUX}
{$R Resources\Icons.res}
{$ENDIF}
{$R Resources\Manual\Additional.RES Resources\Manual\Additional.RC}
{$R *.res}
{Creates the main window of the application.}
procedure CreateMainWindow;
var Main :TFormMain; //the variable for the main window
begin
Application.CreateForm(TFormMain, Main);
end;
{Sets the help file to be used. Again needed to circumvent errors in parsing
of this project file by the IDE. }
procedure SetHelpFile;
begin
with Application do
{$IFDEF USECHM}
{$IFNDEF LINUX}
HelpFile := ExtractFilePath(ParamStr(0)) + 'DelphiDocGUI.chm';
{$ELSE}
HelpFile := 'DelphiDocGUI.hlp';
{$ENDIF}
{$ELSE}
HelpFile := 'DelphiDocGUI.hlp';
{$ENDIF}
end;
{$IFDEF USECHM}
{$IFNDEF LINUX}
//a system to use Compiled HTML Help files (.chm) as help files
var HelpSystem: THookHelpSystem;
{$ENDIF}
{$ENDIF}
{Initializes the help system. }
procedure InitializeHelpSystem;
{$IFNDEF USECHM}
{$IFDEF USESPECIALHELPSUPPORT}
var ExePath :String; //the directory this executable file resides in
{$ENDIF}
{$ENDIF}
begin
//don't use Application followed by a dot in this file outside the
//main program or the dialog for the options of the project of the Delphi IDE
//will be really confused!
{$IFDEF USECHM}
{$IFNDEF LINUX}
with Application do
//create help system (Warning: there is also a (read-only) property
//HelpSystem in Application in D6 or D7+)
DelphiDoc.HelpSystem := THookHelpSystem.Create(HelpFile, '', htHHAPI);
{$ENDIF}
{$ELSE}
{$IFDEF USESPECIALHELPSUPPORT}
//get absolute path of the program itself
ExePath := ExtractFilePath(ParamStr(0));
//just for testing, use directory containing documentation
// ExePath := ExePath + 'z_html\generate\_doc\';
{
with Application do
WinHelpContextMapping(HelpFile, ExePath + 'HelpContextFileMap.ini');
//}
{
CHM(ExePath + 'DelphiDocGUI.chm');
//}
//
{
CHMByHHexe(ExePath + 'DelphiDocGUI.chm');
//}
{
// HTMLContextFile(ExePath + 'helpcontext.html');
HTMLContextFile(ExePath + 'helpcontextvis.html');
//}
{
// HTMLContextFile(ExePath + 'helpcontext.html');
HTMLContextActiveX(ExePath + 'helpcontextvis.html');
//}
{
HTMLLookUpFile(ExePath,
THelpContextFromIni.CreateFileName(ExePath +
'HelpContexts.ini'));
//}
{
HTMLLookUpActiveX(ExePath,
THelpContextFromIni.CreateFileName(ExePath +
'HelpContexts.ini'));
//}
{
HTMLLookUpFile(ExePath,
THelpContextNameValue.CreateFile(ExePath +
'HelpContexts.txt'));
//}
//
{
HTMLLookUpActiveX(ExePath,
THelpContextNameValue.CreateFile(ExePath +
'HelpContexts.txt'));
//}
//{
PDFContextFileHTML(ExePath + 'DelphiDocGUI.pdf');
//}
{
PDFLookUpFileHTML(ExePath + 'DelphiDocGUI.pdf',
THelpContextFromIni.CreateFileName(ExePath +
'HelpContexts.ini'));
//}
{
PDFLookUpFileHTML(ExePath + 'DelphiDocGUI.pdf',
THelpContextNameValue.CreateFile(ExePath +
'HelpContexts.txt'));
//}
//
{
PDFContextFileDDE(ExePath + 'DelphiDocGUI.pdf');
//}
{
PDFLookUpFileDDE(ExePath + 'DelphiDocGUI.pdf',
THelpContextFromIni.CreateFileName(ExePath +
'HelpContexts.ini'));
//}
{
PDFLookUpFileDDE(ExePath + 'DelphiDocGUI.pdf',
THelpContextNameValue.CreateFile(ExePath +
'HelpContexts.txt'));
//}
//
{
PDFContextFileActiveX(ExePath + 'DelphiDocGUI.pdf');
//}
//
{
PDFLookUpFileActiveX(ExePath + 'DelphiDocGUI.pdf',
THelpContextFromIni.CreateFileName(ExePath +
'HelpContexts.ini'));
//}
{
PDFLookUpFileActiveX(ExePath + 'DelphiDocGUI.pdf',
THelpContextNameValue.CreateFile(ExePath +
'HelpContexts.txt'));
//}
{$ENDIF}
{$ENDIF}
end;
{Finalizes the help system. }
procedure FinalizeHelpSystem;
begin
{$IFDEF USECHM}
{$IFNDEF LINUX}
HelpSystem.Free; //finalize the help system
// HHCloseAll; //close help before shutdown or we'll get big trouble
{$ENDIF}
{$ELSE}
{$IFDEF USESPECIALHELPSUPPORT}
ShutDownHelpSystem; //finalize the help system
{$ENDIF}
{$ENDIF}
end;
{This is the main program of the application, it shows the main window. }
begin
Application.Initialize;
Application.Title := 'JADD - DelphiDoc';
Application.HintHidePause := Application.HintHidePause * 3;
SetHelpFile; //set name of the help file
{$IFDEF WARNWHENCHANGINGTHEPROJECTOPTIONS}
//these texts will be shown in the project options instead of the correct ones
Application.Title := 'Change Title in the Source Code!!!';
Application.HelpFile := 'Change Help File in the Source Code!!!';
//if these texts would be changed in the projekt options, the dialog would
//mess up this file (it doesn't care for conditional compiling)
{$ENDIF}
InitializeHelpSystem; //initialize the help system
DelphiDoc.CreateMainWindow; //create the main window
Application.Run;
FinalizeHelpSystem; //finalize the help system
{$IFDEF USEFASTMM}
{$IFDEF VER120} //you might want to remove this line
//it seems the exception object is not freed so FastMM will
//report a memory leak of the object and its message
if Assigned(ExceptObject()) then
begin
// ExceptObject.Free;
FastMM4.RegisterExpectedMemoryLeak(ExceptObject); //register the object
if (ExceptObject is Exception) and //is an exception and message
(Exception(ExceptObject).Message <> '') then //is not empty?
FastMM4.RegisterExpectedMemoryLeak(Pointer(Cardinal( //register it too
Pointer(Exception(ExceptObject).Message)) - 8));
end;
{$ENDIF}
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -