ftvhelp.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * ftvhelp.cpp,v 1.0 2000/09/06 16:09:00
3  *
4  * Copyright (C) 1997-2015 by Dimitri van Heesch.
5  *
6  * Permission to use, copy, modify, and distribute this software and its
7  * documentation under the terms of the GNU General Public License is hereby
8  * granted. No representations are made about the suitability of this software
9  * for any purpose. It is provided "as is" without express or implied warranty.
10  * See the GNU General Public License for more details.
11  *
12  * Documents produced by Doxygen are derivative works derived from the
13  * input used in their production; they are not affected by this license.
14  *
15  * Original version contributed by Kenney Wong <kwong@ea.com>
16  * Modified by Dimitri van Heesch
17  *
18  * Folder Tree View for offline help on browsers that do not support HTML Help.
19  */
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <qlist.h>
24 #include <qdict.h>
25 #include <qfileinfo.h>
26 
27 #include "ftvhelp.h"
28 #include "config.h"
29 #include "message.h"
30 #include "doxygen.h"
31 #include "language.h"
32 #include "htmlgen.h"
33 #include "layout.h"
34 #include "pagedef.h"
35 #include "docparser.h"
36 #include "htmldocvisitor.h"
37 #include "filedef.h"
38 #include "util.h"
39 #include "resourcemgr.h"
40 
41 #define MAX_INDENT 1024
42 
43 static int folderId=1;
44 
45 struct FTVNode
46 {
47  FTVNode(bool dir,const char *r,const char *f,const char *a,
48  const char *n,bool sepIndex,bool navIndex,Definition *df)
49  : isLast(TRUE), isDir(dir),ref(r),file(f),anchor(a),name(n), index(0),
50  parent(0), separateIndex(sepIndex), addToNavIndex(navIndex),
51  def(df) { children.setAutoDelete(TRUE); }
52  int computeTreeDepth(int level) const;
53  int numNodesAtLevel(int level,int maxLevel) const;
54  bool isLast;
55  bool isDir;
60  int index;
66 };
67 
69 {
70  int maxDepth=level;
72  FTVNode *n;
73  for (;(n=li.current());++li)
74  {
75  if (n->children.count()>0)
76  {
77  int d = n->computeTreeDepth(level+1);
78  if (d>maxDepth) maxDepth=d;
79  }
80  }
81  return maxDepth;
82 }
83 
84 int FTVNode::numNodesAtLevel(int level,int maxLevel) const
85 {
86  int num=0;
87  if (level<maxLevel)
88  {
89  num++; // this node
91  FTVNode *n;
92  for (;(n=li.current());++li)
93  {
94  num+=n->numNodesAtLevel(level+1,maxLevel);
95  }
96  }
97  return num;
98 }
99 
100 //----------------------------------------------------------------------------
101 
102 /*! Constructs an ftv help object.
103  * The object has to be \link initialize() initialized\endlink before it can
104  * be used.
105  */
107 {
108  /* initial depth */
109  m_indentNodes = new QList<FTVNode>[MAX_INDENT];
110  m_indentNodes[0].setAutoDelete(TRUE);
111  m_indent=0;
112  m_topLevelIndex = TLI;
113 }
114 
115 /*! Destroys the ftv help object. */
117 {
118  delete[] m_indentNodes;
119 }
120 
121 /*! This will create a folder tree view table of contents file (tree.js).
122  * \sa finalize()
123  */
125 {
126 }
127 
128 /*! Finalizes the FTV help. This will finish and close the
129  * contents file (index.js).
130  * \sa initialize()
131  */
133 {
134  generateTreeView();
135 }
136 
137 /*! Increase the level of the contents hierarchy.
138  * This will start a new sublist in contents file.
139  * \sa decContentsDepth()
140  */
142 {
143  //printf("incContentsDepth() indent=%d\n",m_indent);
144  m_indent++;
145  ASSERT(m_indent<MAX_INDENT);
146 }
147 
148 /*! Decrease the level of the contents hierarchy.
149  * This will end the current sublist.
150  * \sa incContentsDepth()
151  */
153 {
154  //printf("decContentsDepth() indent=%d\n",m_indent);
155  ASSERT(m_indent>0);
156  if (m_indent>0)
157  {
158  m_indent--;
159  QList<FTVNode> *nl = &m_indentNodes[m_indent];
160  FTVNode *parent = nl->getLast();
161  if (parent)
162  {
163  QList<FTVNode> *children = &m_indentNodes[m_indent+1];
164  while (!children->isEmpty())
165  {
166  parent->children.append(children->take(0));
167  }
168  }
169  }
170 }
171 
172 /*! Add a list item to the contents file.
173  * \param isDir TRUE if the item is a directory, FALSE if it is a text
174  * \param name The name of the item.
175  * \param ref the URL of to the item.
176  * \param file the file containing the definition of the item
177  * \param anchor the anchor within the file.
178  * \param name the name of the item.
179  * \param separateIndex put the entries in a separate index file
180  * \param addToNavIndex add this entry to the quick navigation index
181  * \param def Definition corresponding to this entry
182  */
184  const char *name,
185  const char *ref,
186  const char *file,
187  const char *anchor,
188  bool separateIndex,
189  bool addToNavIndex,
190  Definition *def
191  )
192 {
193  //printf("%p: m_indent=%d addContentsItem(%s,%s,%s,%s)\n",this,m_indent,name,ref,file,anchor);
194  QList<FTVNode> *nl = &m_indentNodes[m_indent];
195  FTVNode *newNode = new FTVNode(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def);
196  if (!nl->isEmpty())
197  {
198  nl->getLast()->isLast=FALSE;
199  }
200  nl->append(newNode);
201  newNode->index = nl->count()-1;
202  if (m_indent>0)
203  {
204  QList<FTVNode> *pnl = &m_indentNodes[m_indent-1];
205  newNode->parent = pnl->getLast();
206  }
207 
208 }
209 
210 static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE)
211 {
212  QCString url = n->file;
213  if (!url.isEmpty() && url.at(0)=='!') // relative URL
214  {
215  // remove leading !
216  url = url.mid(1);
217  }
218  else if (!url.isEmpty() && url.at(0)=='^') // absolute URL
219  {
220  // skip, keep ^ in the output
221  }
222  else // local file (with optional anchor)
223  {
224  if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile)
225  {
226  FileDef *fd = (FileDef*)n->def;
227  if (srcLink)
228  {
229  url = fd->getSourceFileBase();
230  }
231  else
232  {
233  url = fd->getOutputFileBase();
234  }
235  }
237  if (!n->anchor.isEmpty()) url+="#"+n->anchor;
238  }
239  return url;
240 }
241 
243 {
245  if (n->parent)
246  {
247  result=generateIndentLabel(n->parent,level+1);
248  }
249  result+=QCString().setNum(n->index)+"_";
250  return result;
251 }
252 
254 {
255  int indent=0;
256  FTVNode *p = n->parent;
257  while (p) { indent++; p=p->parent; }
258  if (n->isDir)
259  {
260  QCString dir = opened ? "&#9660;" : "&#9658;";
261  t << "<span style=\"width:" << (indent*16) << "px;display:inline-block;\">&#160;</span>"
262  << "<span id=\"arr_" << generateIndentLabel(n,0) << "\" class=\"arrow\" ";
263  t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\"";
264  t << ">" << dir
265  << "</span>";
266  }
267  else
268  {
269  t << "<span style=\"width:" << ((indent+1)*16) << "px;display:inline-block;\">&#160;</span>";
270  }
271 }
272 
274 {
275  //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
276  // n->ref.data(),n->file.data(),n->anchor.data());
277  if (n->file.isEmpty()) // no link
278  {
279  t << "<b>" << convertToHtml(n->name) << "</b>";
280  }
281  else // link into other frame
282  {
283  if (!n->ref.isEmpty()) // link to entity imported via tag file
284  {
285  t << "<a class=\"elRef\" ";
286  t << externalLinkTarget() << externalRef("",n->ref,FALSE);
287  }
288  else // local link
289  {
290  t << "<a class=\"el\" ";
291  }
292  t << "href=\"";
293  t << externalRef("",n->ref,TRUE);
294  t << node2URL(n);
295  if (m_topLevelIndex)
296  t << "\" target=\"basefrm\">";
297  else
298  t << "\" target=\"_self\">";
299  t << convertToHtml(n->name);
300  t << "</a>";
301  if (!n->ref.isEmpty())
302  {
303  t << "&#160;[external]";
304  }
305  }
306 }
307 
309 {
311  //printf("*** %p: generateBriefDoc(%s)='%s'\n",def,def->name().data(),brief.data());
312  if (!brief.isEmpty())
313  {
314  DocNode *root = validatingParseDoc(def->briefFile(),def->briefLine(),
315  def,0,brief,FALSE,FALSE,0,TRUE,TRUE);
317  HtmlCodeGenerator htmlGen(t,relPath);
318  HtmlDocVisitor *visitor = new HtmlDocVisitor(t,htmlGen,def);
319  root->accept(visitor);
320  delete visitor;
321  delete root;
322  }
323 }
324 
325 void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index)
326 {
327  QListIterator<FTVNode> nli(nl);
328  FTVNode *n;
329  for (nli.toFirst();(n=nli.current());++nli)
330  {
331  t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\"";
332  if ((index&1)==0) // even row
333  t << " class=\"even\"";
334  if (level>=maxLevel) // item invisible by default
335  t << " style=\"display:none;\"";
336  else // item visible by default
337  index++;
338  t << "><td class=\"entry\">";
339  bool nodeOpened = level+1<maxLevel;
340  generateIndent(t,n,nodeOpened);
341  if (n->isDir)
342  {
343  if (n->def && n->def->definitionType()==Definition::TypeGroup)
344  {
345  // no icon
346  }
347  else if (n->def && n->def->definitionType()==Definition::TypePage)
348  {
349  // no icon
350  }
351  else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
352  {
353  t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
354  }
355  else if (n->def && n->def->definitionType()==Definition::TypeClass)
356  {
357  t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
358  }
359  else
360  {
361  t << "<span id=\"img_" << generateIndentLabel(n,0)
362  << "\" class=\"iconf"
363  << (nodeOpened?"open":"closed")
364  << "\" onclick=\"toggleFolder('" << generateIndentLabel(n,0)
365  << "')\">&#160;</span>";
366  }
367  generateLink(t,n);
368  t << "</td><td class=\"desc\">";
369  if (n->def)
370  {
371  generateBriefDoc(t,n->def);
372  }
373  t << "</td></tr>" << endl;
374  folderId++;
375  generateTree(t,n->children,level+1,maxLevel,index);
376  }
377  else // leaf node
378  {
379  FileDef *srcRef=0;
380  if (n->def && n->def->definitionType()==Definition::TypeFile &&
381  ((FileDef*)n->def)->generateSourceFile())
382  {
383  srcRef = (FileDef*)n->def;
384  }
385  if (srcRef)
386  {
387  t << "<a href=\"" << srcRef->getSourceFileBase()
389  << "\">";
390  }
391  if (n->def && n->def->definitionType()==Definition::TypeGroup)
392  {
393  // no icon
394  }
395  else if (n->def && n->def->definitionType()==Definition::TypePage)
396  {
397  // no icon
398  }
399  else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
400  {
401  t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
402  }
403  else if (n->def && n->def->definitionType()==Definition::TypeClass)
404  {
405  t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
406  }
407  else
408  {
409  t << "<span class=\"icondoc\"></span>";
410  }
411  if (srcRef)
412  {
413  t << "</a>";
414  }
415  generateLink(t,n);
416  t << "</td><td class=\"desc\">";
417  if (n->def)
418  {
419  generateBriefDoc(t,n->def);
420  }
421  t << "</td></tr>" << endl;
422  }
423  }
424 }
425 
426 //-----------------------------------------------------------
427 
429 {
430  NavIndexEntry(const QCString &u,const QCString &p) : url(u), path(p) {}
433 };
434 
435 class NavIndexEntryList : public QList<NavIndexEntry>
436 {
437  public:
438  NavIndexEntryList() : QList<NavIndexEntry>() { setAutoDelete(TRUE); }
440  private:
441  int compareValues(const NavIndexEntry *item1,const NavIndexEntry *item2) const
442  {
443  // sort list based on url
444  return qstrcmp(item1->url,item2->url);
445  }
446 };
447 
449 {
451  if (n->parent)
452  {
453  result+=pathToNode(leaf,n->parent);
454  }
455  result+=QCString().setNum(n->index);
456  if (leaf!=n) result+=",";
457  return result;
458 }
459 
460 static bool dupOfParent(const FTVNode *n)
461 {
462  if (n->parent==0) return FALSE;
463  if (n->file==n->parent->file) return TRUE;
464  return FALSE;
465 }
466 
468 {
469  if (n->file.isEmpty()) // no link
470  {
471  t << "\"" << convertToJSString(n->name) << "\", null, ";
472  }
473  else // link into other page
474  {
475  t << "\"" << convertToJSString(n->name) << "\", \"";
476  t << externalRef("",n->ref,TRUE);
477  t << node2URL(n);
478  t << "\", ";
479  }
480 }
481 
482 static QCString convertFileId2Var(const QCString &fileId)
483 {
484  QCString varId = fileId;
485  int i=varId.findRev('/');
486  if (i>=0) varId = varId.mid(i+1);
487  return substitute(varId,"-","_");
488 }
489 
491  const QList<FTVNode> &nl,int level,bool &first)
492 {
493  static QCString htmlOutput = Config_getString("HTML_OUTPUT");
494  QCString indentStr;
495  indentStr.fill(' ',level*2);
496  bool found=FALSE;
497  QListIterator<FTVNode> nli(nl);
498  FTVNode *n;
499  for (nli.toFirst();(n=nli.current());++nli)
500  {
501  // terminate previous entry
502  if (!first) t << "," << endl;
503  first=FALSE;
504 
505  // start entry
506  if (!found)
507  {
508  t << "[" << endl;
509  }
510  found=TRUE;
511 
512  if (n->addToNavIndex) // add entry to the navigation index
513  {
514  if (n->def && n->def->definitionType()==Definition::TypeFile)
515  {
516  FileDef *fd = (FileDef*)n->def;
517  bool doc,src;
518  doc = fileVisibleInIndex(fd,src);
519  if (doc)
520  {
521  navIndex.append(new NavIndexEntry(node2URL(n,TRUE,FALSE),pathToNode(n,n)));
522  }
523  if (src)
524  {
525  navIndex.append(new NavIndexEntry(node2URL(n,TRUE,TRUE),pathToNode(n,n)));
526  }
527  }
528  else
529  {
530  navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n)));
531  }
532  }
533 
534  if (n->separateIndex) // store items in a separate file for dynamic loading
535  {
536  bool firstChild=TRUE;
537  t << indentStr << " [ ";
538  generateJSLink(t,n);
539  if (n->children.count()>0) // write children to separate file for dynamic loading
540  {
541  QCString fileId = n->file;
542  if (n->anchor)
543  {
544  fileId+="_"+n->anchor;
545  }
546  if (dupOfParent(n))
547  {
548  fileId+="_dup";
549  }
550  QFile f(htmlOutput+"/"+fileId+".js");
551  if (f.open(IO_WriteOnly))
552  {
553  FTextStream tt(&f);
554  tt << "var " << convertFileId2Var(fileId) << " =" << endl;
555  generateJSTree(navIndex,tt,n->children,1,firstChild);
556  tt << endl << "];";
557  }
558  t << "\"" << fileId << "\" ]";
559  }
560  else // no children
561  {
562  t << "null ]";
563  }
564  }
565  else // show items in this file
566  {
567  bool firstChild=TRUE;
568  t << indentStr << " [ ";
569  generateJSLink(t,n);
570  bool emptySection = !generateJSTree(navIndex,t,n->children,level+1,firstChild);
571  if (emptySection)
572  t << "null ]";
573  else
574  t << endl << indentStr << " ] ]";
575  }
576  }
577  return found;
578 }
579 
580 static void generateJSNavTree(const QList<FTVNode> &nodeList)
581 {
582  QCString htmlOutput = Config_getString("HTML_OUTPUT");
583  QFile f(htmlOutput+"/navtreedata.js");
584  NavIndexEntryList navIndex;
585  if (f.open(IO_WriteOnly) /*&& fidx.open(IO_WriteOnly)*/)
586  {
587  //FTextStream tidx(&fidx);
588  //tidx << "var NAVTREEINDEX =" << endl;
589  //tidx << "{" << endl;
590  FTextStream t(&f);
591  t << "var NAVTREE =" << endl;
592  t << "[" << endl;
593  t << " [ ";
594  QCString &projName = Config_getString("PROJECT_NAME");
595  if (projName.isEmpty())
596  {
597  if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty()) // Use title of main page as root
598  {
599  t << "\"" << convertToJSString(Doxygen::mainPage->title()) << "\", ";
600  }
601  else // Use default section title as root
602  {
604  t << "\"" << convertToJSString(lne->title()) << "\", ";
605  }
606  }
607  else // use PROJECT_NAME as root tree element
608  {
609  t << "\"" << convertToJSString(projName) << "\", ";
610  }
611  t << "\"index" << Doxygen::htmlFileExtension << "\", ";
612 
613  // add special entry for index page
614  navIndex.append(new NavIndexEntry("index"+Doxygen::htmlFileExtension,""));
615  // related page index is written as a child of index.html, so add this as well
616  navIndex.append(new NavIndexEntry("pages"+Doxygen::htmlFileExtension,""));
617 
618  bool first=TRUE;
619  generateJSTree(navIndex,t,nodeList,1,first);
620 
621  if (first)
622  t << "]" << endl;
623  else
624  t << endl << " ] ]" << endl;
625  t << "];" << endl << endl;
626 
627  // write the navigation index (and sub-indices)
628  navIndex.sort();
629  int subIndex=0;
630  int elemCount=0;
631  const int maxElemCount=250;
632  //QFile fidx(htmlOutput+"/navtreeindex.js");
633  QFile fsidx(htmlOutput+"/navtreeindex0.js");
634  if (/*fidx.open(IO_WriteOnly) &&*/ fsidx.open(IO_WriteOnly))
635  {
636  //FTextStream tidx(&fidx);
637  FTextStream tsidx(&fsidx);
638  t << "var NAVTREEINDEX =" << endl;
639  t << "[" << endl;
640  tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
641  tsidx << "{" << endl;
642  QListIterator<NavIndexEntry> li(navIndex);
643  NavIndexEntry *e;
644  bool first=TRUE;
645  for (li.toFirst();(e=li.current());) // for each entry
646  {
647  if (elemCount==0)
648  {
649  if (!first)
650  {
651  t << "," << endl;
652  }
653  else
654  {
655  first=FALSE;
656  }
657  t << "\"" << e->url << "\"";
658  }
659  tsidx << "\"" << e->url << "\":[" << e->path << "]";
660  ++li;
661  if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
662  tsidx << endl;
663 
664  elemCount++;
665  if (li.current() && elemCount>=maxElemCount) // switch to new sub-index
666  {
667  tsidx << "};" << endl;
668  elemCount=0;
669  fsidx.close();
670  subIndex++;
671  fsidx.setName(htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js");
672  if (!fsidx.open(IO_WriteOnly)) break;
673  tsidx.setDevice(&fsidx);
674  tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
675  tsidx << "{" << endl;
676  }
677  }
678  tsidx << "};" << endl;
679  t << endl << "];" << endl;
680  }
681  t << endl << "var SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
682  t << endl << "var SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
683  }
684  ResourceMgr::instance().copyResource("navtree.js",htmlOutput);
685 }
686 
687 //-----------------------------------------------------------
688 
689 // new style images
691 {
692  QCString dname=Config_getString("HTML_OUTPUT");
693  const ResourceMgr &rm = ResourceMgr::instance();
694  rm.copyResource("doc.luma",dname);
695  rm.copyResource("folderopen.luma",dname);
696  rm.copyResource("folderclosed.luma",dname);
697  rm.copyResource("arrowdown.luma",dname);
698  rm.copyResource("arrowright.luma",dname);
699  rm.copyResource("splitbar.lum",dname);
700 }
701 
702 // new style scripts
704 {
705  QCString htmlOutput = Config_getString("HTML_OUTPUT");
706 
707  // generate navtree.js & navtreeindex.js
708  generateJSNavTree(m_indentNodes[0]);
709 
710  // copy resize.js & navtree.css
711  ResourceMgr::instance().copyResource("resize.js",htmlOutput);
712  ResourceMgr::instance().copyResource("navtree.css",htmlOutput);
713 }
714 
715 // write tree inside page
717 {
718  int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES");
719  t << "<div class=\"directory\">\n";
720  QListIterator<FTVNode> li(m_indentNodes[0]);
721  FTVNode *n;
722  int d=1, depth=1;
723  for (;(n=li.current());++li)
724  {
725  if (n->children.count()>0)
726  {
727  d = n->computeTreeDepth(2);
728  if (d>depth) depth=d;
729  }
730  }
731  int preferredDepth = depth;
732  // write level selector
733  if (depth>1)
734  {
735  t << "<div class=\"levels\">[";
736  t << theTranslator->trDetailLevel();
737  t << " ";
738  int i;
739  for (i=1;i<=depth;i++)
740  {
741  t << "<span onclick=\"javascript:toggleLevel(" << i << ");\">" << i << "</span>";
742  }
743  t << "]</div>";
744 
745  if (preferredNumEntries>0)
746  {
747  preferredDepth=1;
748  for (int i=1;i<=depth;i++)
749  {
750  int num=0;
751  QListIterator<FTVNode> li(m_indentNodes[0]);
752  FTVNode *n;
753  for (;(n=li.current());++li)
754  {
755  num+=n->numNodesAtLevel(0,i);
756  }
757  if (num<=preferredNumEntries)
758  {
759  preferredDepth=i;
760  }
761  else
762  {
763  break;
764  }
765  }
766  }
767  }
768  //printf("preferred depth=%d\n",preferredDepth);
769 
770  t << "<table class=\"directory\">\n";
771  int index=0;
772  generateTree(t,m_indentNodes[0],0,preferredDepth,index);
773  t << "</table>\n";
774 
775  t << "</div><!-- directory -->\n";
776 }
777 
778 // write old style index.html and tree.html
780 {
781  generateTreeViewImages();
782  generateTreeViewScripts();
783 }
784 
int numNodesAtLevel(int level, int maxLevel) const
Definition: ftvhelp.cpp:84
Definition * def
Definition: ftvhelp.cpp:65
void generateIndent(FTextStream &t, FTVNode *n, bool opened)
Definition: ftvhelp.cpp:253
bool isDir
Definition: ftvhelp.cpp:55
LayoutNavEntry * find(LayoutNavEntry::Kind k, const char *file=0) const
Definition: layout.cpp:76
static void generateLink(CodeOutputInterface &ol, char *lname)
bool brief
bool addToNavIndex
Definition: ftvhelp.cpp:64
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
static void generateJSLink(FTextStream &t, FTVNode *n)
Definition: ftvhelp.cpp:467
bool fileVisibleInIndex(FileDef *fd, bool &genSourceFile)
Definition: util.cpp:8177
static int folderId
Definition: ftvhelp.cpp:43
void append(const type *d)
Definition: qlist.h:73
#define IO_WriteOnly
Definition: qiodevice.h:62
static QCString htmlFileExtension
Definition: doxygen.h:130
void finalize()
Definition: ftvhelp.cpp:132
Concrete visitor implementation for HTML output.
void generateTree(FTextStream &t, const QList< FTVNode > &nl, int level, int maxLevel, int &index)
Definition: ftvhelp.cpp:325
int computeTreeDepth(int level) const
Definition: ftvhelp.cpp:68
char & at(uint i) const
Definition: qcstring.h:326
void setDevice(QIODevice *)
void initialize()
Definition: ftvhelp.cpp:124
const bool FALSE
Definition: qglobal.h:370
bool copyResource(const char *name, const char *targetDir) const
static LayoutDocManager & instance()
Definition: layout.cpp:1359
static ResourceMgr & instance()
Definition: resourcemgr.cpp:35
DocRoot * validatingParseDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const char *input, bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex)
Definition: docparser.cpp:7179
int briefLine() const
QCString relativePathToRoot(const char *name)
Definition: util.cpp:5436
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
static QCString pathToNode(FTVNode *leaf, FTVNode *n)
Definition: ftvhelp.cpp:448
string dir
void generateTreeViewInline(FTextStream &t)
Definition: ftvhelp.cpp:716
void setName(const QString &name)
Definition: qfile.cpp:167
virtual QCString getOutputFileBase() const =0
static bool dupOfParent(const FTVNode *n)
Definition: ftvhelp.cpp:460
virtual QCString trDetailLevel()=0
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
Base class for the layout of a navigation item at the top of the HTML pages.
Definition: layout.h:118
QCString file
Definition: ftvhelp.cpp:57
QCString path
Definition: ftvhelp.cpp:432
#define Config_getInt(val)
Definition: config.cpp:661
virtual DefType definitionType() const =0
Definition: type_traits.h:61
uint count() const
Definition: qlist.h:66
QList< FTVNode > children
Definition: ftvhelp.cpp:61
type * getLast() const
Definition: qlist.h:96
FTVNode(bool dir, const char *r, const char *f, const char *a, const char *n, bool sepIndex, bool navIndex, Definition *df)
Definition: ftvhelp.cpp:47
void generateTreeView()
Definition: ftvhelp.cpp:779
static void generateBriefDoc(FTextStream &t, Definition *def)
Definition: ftvhelp.cpp:308
const double e
static bool generateJSTree(NavIndexEntryList &navIndex, FTextStream &t, const QList< FTVNode > &nl, int level, bool &first)
Definition: ftvhelp.cpp:490
Singleton for managing resources compiled into an executable.
Definition: resourcemgr.h:32
bool isEmpty() const
Definition: qlist.h:67
static QCString convertFileId2Var(const QCString &fileId)
Definition: ftvhelp.cpp:482
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
QCString getSourceFileBase() const
Definition: filedef.cpp:1771
std::void_t< T > n
QCString convertToJSString(const char *s)
Definition: util.cpp:5792
const double a
bool open(int)
Definition: qfile_unix.cpp:134
static void generateJSNavTree(const QList< FTVNode > &nodeList)
Definition: ftvhelp.cpp:580
void sort()
Definition: qlist.h:85
FTVHelp(bool LTI)
Definition: ftvhelp.cpp:106
QCString generateIndentLabel(FTVNode *n, int level)
Definition: ftvhelp.cpp:242
int index
Definition: ftvhelp.cpp:60
void generateTreeViewScripts()
Definition: ftvhelp.cpp:703
p
Definition: test.py:223
A bunch of utility functions.
void generateLink(FTextStream &t, FTVNode *n)
Definition: ftvhelp.cpp:273
#define Config_getString(val)
Definition: config.cpp:660
type * current() const
Definition: qlist.h:146
virtual QCString trPanelSynchronisationTooltip(bool enable)=0
QCString ref
Definition: ftvhelp.cpp:56
void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex, bool addToNavIndex, Definition *def)
Definition: ftvhelp.cpp:183
QCString briefFile() const
virtual QCString briefDescription(bool abbreviate=FALSE) const
QCString anchor
Definition: ftvhelp.cpp:58
static void generateTreeViewImages()
Definition: ftvhelp.cpp:690
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
QCString getOutputFileBase() const
Definition: filedef.h:83
QCString url
Definition: ftvhelp.cpp:431
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
FTVNode * parent
Definition: ftvhelp.cpp:62
LayoutNavEntry * rootNavEntry() const
Definition: layout.cpp:1370
QCString & setNum(short n)
Definition: qcstring.cpp:469
NavIndexEntry(const QCString &u, const QCString &p)
Definition: ftvhelp.cpp:430
static QCString node2URL(FTVNode *n, bool overruleFile=FALSE, bool srcLink=FALSE)
Definition: ftvhelp.cpp:210
#define MAX_INDENT
Definition: ftvhelp.cpp:41
bool isLast
Definition: ftvhelp.cpp:54
~FTVHelp()
Definition: ftvhelp.cpp:116
bool fill(char c, int len=-1)
Definition: qcstring.h:243
QCString doc
QCString name
Definition: ftvhelp.cpp:59
QCString title() const
Definition: layout.h:150
void decContentsDepth()
Definition: ftvhelp.cpp:152
Translator * theTranslator
Definition: language.cpp:157
void incContentsDepth()
Definition: ftvhelp.cpp:141
type * take(uint i)
Definition: qlist.h:81
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
void close()
Definition: qfile_unix.cpp:614
if(!yymsg) yymsg
void setAutoDelete(bool enable)
Definition: qlist.h:99
QCString externalLinkTarget()
Definition: util.cpp:7850
static PageDef * mainPage
Definition: doxygen.h:103
std::string nl(std::size_t i=1)
int compareValues(const NavIndexEntry *item1, const NavIndexEntry *item2) const
Definition: ftvhelp.cpp:441
virtual void accept(DocVisitor *v)=0
const bool TRUE
Definition: qglobal.h:371
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: util.cpp:5088
bool separateIndex
Definition: ftvhelp.cpp:63
QTextStream & endl(QTextStream &s)
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:7856
#define ASSERT(x)
Definition: qglobal.h:590
type * toFirst()
Definition: qlist.h:135