My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
htmlgen.cpp File Reference
#include <stdlib.h>
#include <qdir.h>
#include <qregexp.h>
#include "message.h"
#include "htmlgen.h"
#include "config.h"
#include "util.h"
#include "doxygen.h"
#include "logos.h"
#include "diagram.h"
#include "version.h"
#include "dot.h"
#include "language.h"
#include "htmlhelp.h"
#include "docparser.h"
#include "htmldocvisitor.h"
#include "searchindex.h"
#include "pagedef.h"
#include "debug.h"
#include "dirdef.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "image.h"
#include "ftvhelp.h"
#include "bufstr.h"
#include "resourcemgr.h"

Go to the source code of this file.

Macros

#define DBG_HTML(x)
 

Functions

static void writeClientSearchBox (FTextStream &t, const char *relPath)
 
static void writeServerSearchBox (FTextStream &t, const char *relPath, bool highlightSearch)
 
QCString clearBlock (const char *s, const char *begin, const char *end)
 Clear a text block s from begin to end markers.
 
QCString selectBlock (const QCString &s, const QCString &name, bool enable)
 
static QCString getSearchBox (bool serverSide, QCString relPath, bool highlightSearch)
 
static QCString removeEmptyLines (const QCString &s)
 
static QCString substituteHtmlKeywords (const QCString &s, const QCString &title, const QCString &relPath, const QCString &navPath=QCString())
 
static void startSectionHeader (FTextStream &t, const QCString &relPath, int sectionCount)
 
static void endSectionHeader (FTextStream &t)
 
static void startSectionSummary (FTextStream &t, int sectionCount)
 
static void endSectionSummary (FTextStream &t)
 
static void startSectionContent (FTextStream &t, int sectionCount)
 
static void endSectionContent (FTextStream &t)
 
static void startQuickIndexList (FTextStream &t, bool compact, bool topLevel=TRUE)
 
static void endQuickIndexList (FTextStream &t, bool compact)
 
static void startQuickIndexItem (FTextStream &t, const char *l, bool hl, bool, const QCString &relPath)
 
static void endQuickIndexItem (FTextStream &t, const char *l)
 
static bool quickLinkVisible (LayoutNavEntry::Kind kind)
 
static void renderQuickLinksAsTree (FTextStream &t, const QCString &relPath, LayoutNavEntry *root)
 
static void renderQuickLinksAsTabs (FTextStream &t, const QCString &relPath, LayoutNavEntry *hlEntry, LayoutNavEntry::Kind kind, bool highlightParent, bool highlightSearch)
 
static void writeDefaultQuickLinks (FTextStream &t, bool compact, HighlightedItem hli, const char *file, const QCString &relPath)
 

Variables

static QCString g_header
 
static QCString g_footer
 
static QCString g_mathjax_code
 

Macro Definition Documentation

#define DBG_HTML (   x)

Definition at line 48 of file htmlgen.cpp.

Referenced by HtmlGenerator::endIndent(), HtmlGenerator::endInlineMemberDoc(), HtmlGenerator::endInlineMemberName(), HtmlGenerator::endInlineMemberType(), HtmlGenerator::endLabels(), HtmlGenerator::endMemberDescription(), HtmlGenerator::endMemberDoc(), HtmlGenerator::endMemberDocList(), HtmlGenerator::endMemberDocName(), HtmlGenerator::endMemberDocPrefixItem(), HtmlGenerator::endMemberDocSimple(), HtmlGenerator::endMemberHeader(), HtmlGenerator::endMemberList(), HtmlGenerator::endMemberSections(), HtmlGenerator::endMemberSubtitle(), HtmlGenerator::endParameterList(), HtmlGenerator::endParameterName(), HtmlGenerator::endParameterType(), HtmlGenerator::exceptionEntry(), HtmlGenerator::insertMemberAlign(), HtmlGenerator::startIndent(), HtmlGenerator::startInlineMemberDoc(), HtmlGenerator::startInlineMemberName(), HtmlGenerator::startInlineMemberType(), HtmlGenerator::startLabels(), HtmlGenerator::startMemberDescription(), HtmlGenerator::startMemberDoc(), HtmlGenerator::startMemberDocList(), HtmlGenerator::startMemberDocName(), HtmlGenerator::startMemberDocPrefixItem(), HtmlGenerator::startMemberDocSimple(), HtmlGenerator::startMemberHeader(), HtmlGenerator::startMemberItem(), HtmlGenerator::startMemberList(), HtmlGenerator::startMemberSections(), HtmlGenerator::startMemberSubtitle(), HtmlGenerator::startParameterList(), HtmlGenerator::startParameterName(), HtmlGenerator::startParameterType(), HtmlGenerator::writeInheritedSectionTitle(), and HtmlGenerator::writeLabel().

Function Documentation

QCString clearBlock ( const char *  s,
const char *  begin,
const char *  end 
)

Clear a text block s from begin to end markers.

Definition at line 110 of file htmlgen.cpp.

Referenced by selectBlock().

{
if (s==0 || begin==0 || end==0) return s;
const char *p, *q;
int beginLen = qstrlen(begin);
int endLen = qstrlen(end);
int resLen = 0;
for (p=s; (q=strstr(p,begin))!=0; p=q+endLen)
{
resLen+=(int)(q-p);
p=q+beginLen;
if ((q=strstr(p,end))==0)
{
resLen+=beginLen;
break;
}
}
resLen+=qstrlen(p);
// resLen is the length of the string without the marked block
QCString result(resLen+1);
char *r;
for (r=result.rawData(), p=s; (q=strstr(p,begin))!=0; p=q+endLen)
{
int l = (int)(q-p);
memcpy(r,p,l);
r+=l;
p=q+beginLen;
if ((q=strstr(p,end))==0)
{
memcpy(r,begin,beginLen);
r+=beginLen;
break;
}
}
qstrcpy(r,p);
return result;
}
static void endQuickIndexItem ( FTextStream t,
const char *  l 
)
static

Definition at line 1996 of file htmlgen.cpp.

Referenced by renderQuickLinksAsTabs().

{
t << "</span>";
if (l) t << "</a>";
t << "</li>\n";
}
static void endQuickIndexList ( FTextStream t,
bool  compact 
)
static

Definition at line 1969 of file htmlgen.cpp.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

{
if (compact)
{
t << " </ul>\n";
t << " </div>\n";
}
else
{
t << "</ul>\n";
}
}
static void endSectionContent ( FTextStream t)
static
static void endSectionHeader ( FTextStream t)
static
static void endSectionSummary ( FTextStream t)
static

Definition at line 1311 of file htmlgen.cpp.

References Config_getBool, and endl().

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

{
//t << "<!-- endSectionSummary -->";
static bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
if (dynamicSections)
{
t << "</div>" << endl;
}
}
static QCString getSearchBox ( bool  serverSide,
QCString  relPath,
bool  highlightSearch 
)
static

Definition at line 175 of file htmlgen.cpp.

References writeClientSearchBox(), and writeServerSearchBox().

Referenced by substituteHtmlKeywords().

{
QGString result;
FTextStream t(&result);
if (serverSide)
{
writeServerSearchBox(t, relPath, highlightSearch);
}
else
{
writeClientSearchBox(t, relPath);
}
return QCString(result);
}
static bool quickLinkVisible ( LayoutNavEntry::Kind  kind)
static

Definition at line 2003 of file htmlgen.cpp.

References annotatedClasses, LayoutNavEntry::Classes, LayoutNavEntry::ClassHierarchy, LayoutNavEntry::ClassIndex, LayoutNavEntry::ClassList, LayoutNavEntry::ClassMembers, CMHL_All, Config_getBool, SDict< T >::count(), documentedClassMembers, documentedFileMembers, documentedGroups, documentedHtmlFiles, documentedNamespaceMembers, documentedNamespaces, LayoutNavEntry::Examples, Doxygen::exampleSDict, LayoutNavEntry::FileGlobals, LayoutNavEntry::FileList, LayoutNavEntry::Files, FMHL_All, hierarchyClasses, indexedPages, LayoutNavEntry::MainPage, LayoutNavEntry::Modules, LayoutNavEntry::NamespaceList, LayoutNavEntry::NamespaceMembers, LayoutNavEntry::Namespaces, NMHL_All, LayoutNavEntry::Pages, LayoutNavEntry::User, and LayoutNavEntry::UserGroup.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

{
static bool showFiles = Config_getBool(SHOW_FILES);
static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
switch (kind)
{
case LayoutNavEntry::MainPage: return TRUE;
case LayoutNavEntry::User: return TRUE;
case LayoutNavEntry::UserGroup: return TRUE;
case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
//case LayoutNavEntry::Dirs: return documentedDirs>0;
}
return FALSE;
}
static QCString removeEmptyLines ( const QCString &  s)
static

Definition at line 190 of file htmlgen.cpp.

References BufStr::data().

Referenced by substituteHtmlKeywords().

{
BufStr out(s.length()+1);
const char *p=s.data();
if (p)
{
char c;
while ((c=*p++))
{
if (c=='\n')
{
const char *e = p;
while (*e==' ' || *e=='\t') e++;
if (*e=='\n')
{
p=e;
}
else out.addChar(c);
}
else
{
out.addChar(c);
}
}
}
out.addChar('\0');
//printf("removeEmptyLines(%s)=%s\n",s.data(),out.data());
return out.data();
}
static void renderQuickLinksAsTabs ( FTextStream t,
const QCString &  relPath,
LayoutNavEntry hlEntry,
LayoutNavEntry::Kind  kind,
bool  highlightParent,
bool  highlightSearch 
)
static

Definition at line 2062 of file htmlgen.cpp.

References LayoutNavEntry::children(), Config_getBool, endQuickIndexItem(), endQuickIndexList(), fixSpaces(), LayoutDocManager::instance(), LayoutNavEntry::parent(), quickLinkVisible(), HtmlGenerator::relPath, LayoutDocManager::rootNavEntry(), startQuickIndexItem(), startQuickIndexList(), writeClientSearchBox(), and writeServerSearchBox().

{
if (hlEntry->parent()) // first draw the tabs for the parent of hlEntry
{
renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch);
}
if (hlEntry->parent() && hlEntry->parent()->children().count()>0) // draw tabs for row containing hlEntry
{
bool topLevel = hlEntry->parent()->parent()==0;
QListIterator<LayoutNavEntry> li(hlEntry->parent()->children());
int count=0;
for (li.toFirst();(entry=li.current());++li)
{
if (entry->visible() && quickLinkVisible(entry->kind())) count++;
}
if (count>0) // at least one item is visible
{
startQuickIndexList(t,TRUE,topLevel);
for (li.toFirst();(entry=li.current());++li)
{
if (entry->visible() && quickLinkVisible(entry->kind()))
{
QCString url = entry->url();
entry==hlEntry &&
(entry->children().count()>0 ||
(entry->kind()==kind && !highlightParent)
),
TRUE,relPath);
t << fixSpaces(entry->title());
}
}
if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row is special as it contains the search box
{
static bool searchEngine = Config_getBool(SEARCHENGINE);
static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
if (searchEngine)
{
t << " <li>\n";
if (!serverBasedSearch) // pure client side search
{
t << " </li>\n";
}
else // server based search
{
writeServerSearchBox(t,relPath,highlightSearch);
if (!highlightSearch)
{
t << " </li>\n";
}
}
}
if (!highlightSearch) // on the search page the index will be ended by the
// page itself
{
}
}
else // normal case for other rows than first one
{
}
}
}
}
static void renderQuickLinksAsTree ( FTextStream t,
const QCString &  relPath,
LayoutNavEntry root 
)
static

Definition at line 2031 of file htmlgen.cpp.

References LayoutNavEntry::children(), endQuickIndexList(), fixSpaces(), quickLinkVisible(), and startQuickIndexList().

Referenced by writeDefaultQuickLinks().

{
QListIterator<LayoutNavEntry> li(root->children());
int count=0;
for (li.toFirst();(entry=li.current());++li)
{
if (entry->visible() && quickLinkVisible(entry->kind())) count++;
}
if (count>0) // at least one item is visible
{
for (li.toFirst();(entry=li.current());++li)
{
if (entry->visible() && quickLinkVisible(entry->kind()))
{
QCString url = entry->url();
t << "<li><a href=\"" << relPath << url << "\"><span>";
t << fixSpaces(entry->title());
t << "</span></a>\n";
// recursive into child list
renderQuickLinksAsTree(t,relPath,entry);
t << "</li>";
}
}
}
}
QCString selectBlock ( const QCString &  s,
const QCString &  name,
bool  enable 
)

Definition at line 150 of file htmlgen.cpp.

References clearBlock(), and substitute().

Referenced by substituteHtmlKeywords().

{
// TODO: this is an expensive function that is called a lot -> optimize it
const QCString begin = "<!--BEGIN " + name + "-->";
const QCString end = "<!--END " + name + "-->";
const QCString nobegin = "<!--BEGIN !" + name + "-->";
const QCString noend = "<!--END !" + name + "-->";
QCString result = s;
if (enable)
{
result = substitute(result, begin, "");
result = substitute(result, end, "");
result = clearBlock(result, nobegin, noend);
}
else
{
result = substitute(result, nobegin, "");
result = substitute(result, noend, "");
result = clearBlock(result, begin, end);
}
return result;
}
static void startQuickIndexItem ( FTextStream t,
const char *  l,
bool  hl,
bool  ,
const QCString &  relPath 
)
static

Definition at line 1982 of file htmlgen.cpp.

References correctURL().

Referenced by renderQuickLinksAsTabs().

{
t << " <li";
if (hl)
{
t << " class=\"current\"";
}
t << ">";
if (l) t << "<a href=\"" << correctURL(l,relPath) << "\">";
t << "<span>";
}
static void startQuickIndexList ( FTextStream t,
bool  compact,
bool  topLevel = TRUE 
)
static

Definition at line 1949 of file htmlgen.cpp.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

{
if (compact)
{
if (topLevel)
{
t << " <div id=\"navrow1\" class=\"tabs\">\n";
}
else
{
t << " <div id=\"navrow2\" class=\"tabs2\">\n";
}
t << " <ul class=\"tablist\">\n";
}
else
{
t << "<ul>";
}
}
static void startSectionContent ( FTextStream t,
int  sectionCount 
)
static

Definition at line 1321 of file htmlgen.cpp.

References Config_getBool, and endl().

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

{
//t << "<!-- startSectionContent -->";
static bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
if (dynamicSections)
{
t << "<div id=\"dynsection-" << sectionCount << "-content\" "
"class=\"dyncontent\" "
"style=\"display:none;\">" << endl;
}
else
{
t << "<div class=\"dyncontent\">" << endl;
}
}
static void startSectionHeader ( FTextStream t,
const QCString &  relPath,
int  sectionCount 
)
static

Definition at line 1273 of file htmlgen.cpp.

References Config_getBool, and endl().

Referenced by HtmlGenerator::startCallGraph(), HtmlGenerator::startClassDiagram(), HtmlGenerator::startDirDepGraph(), HtmlGenerator::startDotGraph(), HtmlGenerator::startGroupCollaboration(), and HtmlGenerator::startInclDepGraph().

{
//t << "<!-- startSectionHeader -->";
static bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
if (dynamicSections)
{
t << "<div id=\"dynsection-" << sectionCount << "\" "
"onclick=\"return toggleVisibility(this)\" "
"class=\"dynheader closed\" "
"style=\"cursor:pointer;\">" << endl;
t << " <img id=\"dynsection-" << sectionCount << "-trigger\" src=\""
<< relPath << "closed.png\" alt=\"+\"/> ";
}
else
{
t << "<div class=\"dynheader\">" << endl;
}
}
static void startSectionSummary ( FTextStream t,
int  sectionCount 
)
static

Definition at line 1299 of file htmlgen.cpp.

References Config_getBool, and endl().

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

{
//t << "<!-- startSectionSummary -->";
static bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
if (dynamicSections)
{
t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
"class=\"dynsummary\" "
"style=\"display:block;\">" << endl;
}
}
static QCString substituteHtmlKeywords ( const QCString &  s,
const QCString &  title,
const QCString &  relPath,
const QCString &  navPath = QCString() 
)
static

Definition at line 220 of file htmlgen.cpp.

References Config_getBool, Config_getEnum, Config_getList, Config_getString, convertToHtml(), dateToString(), g_mathjax_code, getSearchBox(), removeEmptyLines(), selectBlock(), stripPath(), substitute(), substituteKeywords(), theTranslator, Translator::trGeneratedAt(), and Translator::trGeneratedBy().

Referenced by HtmlGenerator::startFile(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writePageFooter(), and HtmlGenerator::writeSearchPage().

{
// Build CSS/Javascript tags depending on treeview, search engine settings
QCString cssFile;
QStrList extraCssFile;
QCString generatedBy;
QCString treeViewCssJs;
QCString searchCssJs;
QCString searchBox;
QCString mathJaxJs;
QCString extraCssText;
static QCString projectName = Config_getString(PROJECT_NAME);
static bool timeStamp = Config_getBool(HTML_TIMESTAMP);
static bool treeView = Config_getBool(GENERATE_TREEVIEW);
static bool searchEngine = Config_getBool(SEARCHENGINE);
static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
static bool mathJax = Config_getBool(USE_MATHJAX);
static QCString mathJaxFormat = Config_getEnum(MATHJAX_FORMAT);
static bool disableIndex = Config_getBool(DISABLE_INDEX);
static bool hasProjectName = !projectName.isEmpty();
static bool hasProjectNumber = !Config_getString(PROJECT_NUMBER).isEmpty();
static bool hasProjectBrief = !Config_getString(PROJECT_BRIEF).isEmpty();
static bool hasProjectLogo = !Config_getString(PROJECT_LOGO).isEmpty();
static bool titleArea = (hasProjectName || hasProjectBrief || hasProjectLogo || (disableIndex && searchEngine));
cssFile = Config_getString(HTML_STYLESHEET);
if (cssFile.isEmpty())
{
cssFile = "doxygen.css";
}
else
{
QFileInfo cssfi(cssFile);
if (cssfi.exists())
{
cssFile = cssfi.fileName().utf8();
}
else
{
cssFile = "doxygen.css";
}
}
extraCssText = "";
extraCssFile = Config_getList(HTML_EXTRA_STYLESHEET);
for (uint i=0; i<extraCssFile.count(); ++i)
{
QCString fileName(extraCssFile.at(i));
if (!fileName.isEmpty())
{
QFileInfo fi(fileName);
if (fi.exists())
{
extraCssText += "<link href=\"$relpath^"+stripPath(fileName)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
}
}
}
if (timeStamp)
{
}
else
{
generatedBy = theTranslator->trGeneratedBy();
}
if (treeView)
{
treeViewCssJs = "<link href=\"$relpath^navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
"<script type=\"text/javascript\" src=\"$relpath^resize.js\"></script>\n"
"<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n"
"<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n"
"<script type=\"text/javascript\">\n"
" $(document).ready(initResizable);\n"
"</script>";
}
if (searchEngine)
{
searchCssJs = "<link href=\"$relpath^search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
if (!serverBasedSearch)
{
searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/searchdata.js\"></script>\n";
}
searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/search.js\"></script>\n";
if (!serverBasedSearch)
{
if (disableIndex)
{
searchCssJs += "<script type=\"text/javascript\">\n"
" $(document).ready(function() { init_search(); });\n"
"</script>";
}
}
else
{
if (disableIndex)
{
searchCssJs += "<script type=\"text/javascript\">\n"
" $(document).ready(function() {\n"
" if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
" });\n"
"</script>\n";
}
// OPENSEARCH_PROVIDER {
searchCssJs += "<link rel=\"search\" href=\"" + relPath +
"search_opensearch.php?v=opensearch.xml\" "
"type=\"application/opensearchdescription+xml\" title=\"" +
(hasProjectName ? projectName : QCString("Doxygen")) +
"\"/>";
// OPENSEARCH_PROVIDER }
}
searchBox = getSearchBox(serverBasedSearch, relPath, FALSE);
}
if (mathJax)
{
QCString path = Config_getString(MATHJAX_RELPATH);
if (path.isEmpty() || path.left(2)=="..") // relative path
{
path.prepend(relPath);
}
mathJaxJs = "<script type=\"text/x-mathjax-config\">\n"
" MathJax.Hub.Config({\n"
" extensions: [\"tex2jax.js\"";
QStrList &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
const char *s = mathJaxExtensions.first();
while (s)
{
mathJaxJs+= ", \""+QCString(s)+".js\"";
s = mathJaxExtensions.next();
}
if (mathJaxFormat.isEmpty())
{
mathJaxFormat = "HTML-CSS";
}
mathJaxJs += "],\n"
" jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"],\n"
"});\n";
if (!g_mathjax_code.isEmpty())
{
mathJaxJs += g_mathjax_code;
mathJaxJs += "\n";
}
mathJaxJs += "</script>";
mathJaxJs += "<script type=\"text/javascript\" src=\"" + path + "MathJax.js\"></script>\n";
}
// first substitute generic keywords
QCString result = substituteKeywords(s,title,
convertToHtml(Config_getString(PROJECT_NUMBER)),
convertToHtml(Config_getString(PROJECT_BRIEF)));
// additional HTML only keywords
result = substitute(result,"$navpath",navPath);
result = substitute(result,"$stylesheet",cssFile);
result = substitute(result,"$treeview",treeViewCssJs);
result = substitute(result,"$searchbox",searchBox);
result = substitute(result,"$search",searchCssJs);
result = substitute(result,"$mathjax",mathJaxJs);
result = substitute(result,"$generatedby",generatedBy);
result = substitute(result,"$extrastylesheet",extraCssText);
result = substitute(result,"$relpath$",relPath); //<-- obsolete: for backwards compatibility only
result = substitute(result,"$relpath^",relPath); //<-- must be last
// additional HTML only conditional blocks
result = selectBlock(result,"DISABLE_INDEX",disableIndex);
result = selectBlock(result,"GENERATE_TREEVIEW",treeView);
result = selectBlock(result,"SEARCHENGINE",searchEngine);
result = selectBlock(result,"TITLEAREA",titleArea);
result = selectBlock(result,"PROJECT_NAME",hasProjectName);
result = selectBlock(result,"PROJECT_NUMBER",hasProjectNumber);
result = selectBlock(result,"PROJECT_BRIEF",hasProjectBrief);
result = selectBlock(result,"PROJECT_LOGO",hasProjectLogo);
result = removeEmptyLines(result);
return result;
}
static void writeClientSearchBox ( FTextStream t,
const char *  relPath 
)
static

Definition at line 57 of file htmlgen.cpp.

References theTranslator, and Translator::trSearch().

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <span class=\"left\">\n";
t << " <img id=\"MSearchSelect\" src=\"" << relPath << "search/mag_sel.png\"\n";
t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
t << " alt=\"\"/>\n";
t << " <input type=\"text\" id=\"MSearchField\" value=\""
<< theTranslator->trSearch() << "\" accesskey=\"S\"\n";
t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
t << " onblur=\"searchBox.OnSearchFieldFocus(false)\" \n";
t << " onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n";
t << " </span><span class=\"right\">\n";
t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
<< "<img id=\"MSearchCloseImg\" border=\"0\" src=\"" << relPath << "search/close.png\" alt=\"\"/></a>\n";
t << " </span>\n";
t << " </div>\n";
}
static void writeDefaultQuickLinks ( FTextStream t,
bool  compact,
HighlightedItem  hli,
const char *  file,
const QCString &  relPath 
)
static

Definition at line 2134 of file htmlgen.cpp.

References Config_getBool, endl(), Doxygen::htmlFileExtension, LayoutDocManager::instance(), renderQuickLinksAsTree(), LayoutDocManager::rootNavEntry(), theTranslator, and Translator::trSearch().

Referenced by HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeQuickLinks(), and HtmlGenerator::writeSearchPage().

{
static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
static bool searchEngine = Config_getBool(SEARCHENGINE);
static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
if (compact)
{
QCString searchPage;
if (externalSearch)
{
searchPage = "search" + Doxygen::htmlFileExtension;
}
else
{
searchPage = "search.php";
}
t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>" << endl;
t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>" << endl;
t << "<script type=\"text/javascript\">" << endl;
t << "$(function() {" << endl;
t << " initMenu('" << relPath << "',"
<< (searchEngine?"true":"false") << ","
<< (serverBasedSearch?"true":"false") << ",'"
<< searchPage << "','"
<< theTranslator->trSearch() << "');" << endl;
if (Config_getBool(SEARCHENGINE))
{
if (!serverBasedSearch)
{
t << " $(document).ready(function() { init_search(); });\n";
}
else
{
t << " $(document).ready(function() {\n"
<< " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
<< " });\n";
}
}
t << "});" << endl;
t << "</script>" << endl;
t << "<div id=\"main-nav\"></div>" << endl;
}
else
{
renderQuickLinksAsTree(t,relPath,root);
}
}
static void writeServerSearchBox ( FTextStream t,
const char *  relPath,
bool  highlightSearch 
)
static

Definition at line 79 of file htmlgen.cpp.

References Config_getBool, Doxygen::htmlFileExtension, theTranslator, and Translator::trSearch().

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

{
static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <div class=\"left\">\n";
t << " <form id=\"FSearchBox\" action=\"" << relPath;
if (externalSearch)
{
t << "search" << Doxygen::htmlFileExtension;
}
else
{
t << "search.php";
}
t << "\" method=\"get\">\n";
t << " <img id=\"MSearchSelect\" src=\"" << relPath << "search/mag.png\" alt=\"\"/>\n";
if (!highlightSearch)
{
t << " <input type=\"text\" id=\"MSearchField\" name=\"query\" value=\""
<< theTranslator->trSearch() << "\" size=\"20\" accesskey=\"S\" \n";
t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
t << " onblur=\"searchBox.OnSearchFieldFocus(false)\"/>\n";
t << " </form>\n";
t << " </div><div class=\"right\"></div>\n";
t << " </div>\n";
}
}

Variable Documentation

QCString g_footer
static

Definition at line 51 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and HtmlGenerator::writePageFooter().

QCString g_header
static
QCString g_mathjax_code
static

Definition at line 52 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and substituteHtmlKeywords().