1 /******************************************************************************
2 * ftvhelp.cpp,v 1.0 2000/09/06 16:09:00
4 * Copyright (C) 1997-2012 by Dimitri van Heesch.
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.
12 * Documents produced by Doxygen are derivative works derived from the
13 * input used in their production; they are not affected by this license.
15 * Original version contributed by Kenney Wong <kwong@ea.com>
16 * Modified by Dimitri van Heesch
18 * Folder Tree View for offline help on browsers that do not support HTML Help.
25 #include <qfileinfo.h>
35 #include "docparser.h"
36 #include "htmldocvisitor.h"
38 #define MAX_INDENT 1024
41 static const char navtree_script[]=
42 #include "navtree_js.h"
45 static const char resize_script[]=
46 #include "resize_js.h"
49 static const char navtree_css[]=
50 #include "navtree_css.h"
53 static unsigned char blank_png[352] =
55 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
63 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
64 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
66 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
69 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
72 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
73 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
75 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
79 static unsigned char folderopen_png[528] =
81 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
82 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
83 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
84 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
85 255,255,255,255,255,255,228,195,193,190,187,218,255,255,255,255,255,255,255,255,255,255,255,255,
86 255,255,255,255,255,255,195,215,221,225,225,178,176,176,175,176,178,180,255,255,255,255,255,255,
87 255,255,255,255,255,255,189,206,215,219,226,220,214,212,207,204,200,176,255,255,255,255,255,255,
88 255,255,255,255,168,154,153,153,152,152,151,149,150,150,149,147,146,145,145,167,255,255,255,255,
89 255,255,255,255,146,187,187,188,187,187,185,183,183,182,179,178,175,173,174,145,255,255,255,255,
90 255,255,255,255,146,180,182,182,181,181,179,178,176,174,173,171,169,170,168,144,255,255,255,255,
91 255,255,255,255,144,173,176,176,177,175,175,174,171,170,168,168,166,166,164,143,255,255,255,255,
92 255,255,255,255,142,168,170,171,170,170,169,168,166,166,165,163,163,164,162,142,255,255,255,255,
93 255,255,255,255,141,162,166,164,164,165,163,163,161,161,161,161,161,160,159,141,255,255,255,255,
94 255,255,255,255,138,157,159,159,158,158,158,157,157,157,157,156,157,157,155,138,255,255,255,255,
95 255,255,255,255,137,154,153,154,154,153,154,154,154,153,154,154,154,154,154,137,255,255,255,255,
96 255,255,255,255,137,154,154,154,154,154,154,154,153,154,154,153,153,153,154,137,255,255,255,255,
97 255,255,255,255,137,125,125,125,125,124,125,124,124,125,124,124,125,124,125,138,255,255,255,255,
98 255,255,255,255,212,209,204,199,193,190,186,183,180,181,185,188,192,197,202,203,255,255,255,255,
99 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
100 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
101 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
102 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
105 static unsigned char folderopen_a_png[528] =
107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 0, 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
112 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,
113 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,
114 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
115 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
116 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
117 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
118 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
119 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
120 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
121 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
122 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
123 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
124 0, 0, 0, 0,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
131 static unsigned char folderclosed_png[528] =
133 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
134 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
135 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
136 255,255,255,255,255,197,155,155,155,155,196,255,255,255,255,255,255,255,255,255,255,255,255,255,
137 255,255,255,255,255,155,191,191,191,192,155,255,255,255,255,255,255,255,255,255,255,255,255,255,
138 255,255,255,255,168,144,180,180,181,180,145,145,146,145,146,146,146,146,145,167,255,255,255,255,
139 255,255,255,255,147,225,226,226,225,226,225,221,221,219,215,214,212,211,213,145,255,255,255,255,
140 255,255,255,255,147,212,211,211,210,211,210,205,206,205,201,201,199,196,201,145,255,255,255,255,
141 255,255,255,255,146,204,203,204,203,203,202,200,200,197,197,196,195,194,196,145,255,255,255,255,
142 255,255,255,255,146,202,200,201,201,200,199,198,198,195,194,194,193,192,194,145,255,255,255,255,
143 255,255,255,255,145,200,196,196,196,195,195,193,192,192,190,189,189,189,191,143,255,255,255,255,
144 255,255,255,255,143,192,191,190,190,189,189,188,186,187,186,185,185,185,187,142,255,255,255,255,
145 255,255,255,255,142,186,184,183,182,183,182,183,180,181,181,181,181,181,182,141,255,255,255,255,
146 255,255,255,255,138,177,175,176,176,177,177,176,175,174,175,175,175,174,176,138,255,255,255,255,
147 255,255,255,255,138,173,169,170,168,170,169,170,170,169,171,171,171,171,174,137,255,255,255,255,
148 255,255,255,255,138,166,163,163,162,162,162,162,162,162,164,163,163,163,166,137,255,255,255,255,
149 255,255,255,255,137,124,124,124,125,124,124,124,125,125,124,124,125,124,125,138,255,255,255,255,
150 255,255,255,255,231,231,228,225,222,220,218,216,214,215,217,219,221,224,227,226,255,255,255,255,
151 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
152 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
153 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
154 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
157 static unsigned char folderclosed_a_png[528] =
159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
165 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
166 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
167 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
168 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
169 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
170 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
171 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
172 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
173 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
174 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
175 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
176 0, 0, 0, 0,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148, 0, 0, 0, 0,
177 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
183 static unsigned char doc_png[528] =
185 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
186 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
187 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
188 255,255,255,255,255,218,214,208,208,204,191,179,190,197,209,231,255,255,255,255,255,255,255,255,
189 255,255,255,255,255,195,224,226,226,222,214,204,181,203,229,188,225,255,255,255,255,255,255,255,
190 255,255,255,255,255,198,226,228,227,227,224,215,203,180,252,229,184,224,255,255,255,255,255,255,
191 255,255,255,255,255,198,229,230,229,229,228,224,214,154,252,252,229,187,235,255,255,255,255,255,
192 255,255,255,255,255,198,232,233,233,232,231,230,223,176,154,144,165,177,216,255,255,255,255,255,
193 255,255,255,255,255,198,236,236,216,226,238,219,232,225,209,190,189,166,193,255,255,255,255,255,
194 255,255,255,255,255,198,239,240,178,177,230,175,169,184,188,219,208,189,187,255,255,255,255,255,
195 255,255,255,255,255,198,241,242,240,218,237,236,240,235,241,244,221,208,182,255,255,255,255,255,
196 255,255,255,255,255,198,243,243,188,154,183,158,166,140,185,198,231,219,177,255,255,255,255,255,
197 255,255,255,255,255,198,243,245,248,228,241,241,226,249,237,227,239,232,177,255,255,255,255,255,
198 255,255,255,255,255,198,244,246,213,172,163,149,171,200,167,149,242,239,177,255,255,255,255,255,
199 255,255,255,255,255,198,249,248,240,218,237,236,240,235,241,244,244,242,177,255,255,255,255,255,
200 255,255,255,255,255,198,249,251,188,155,184,158,166,140,185,198,246,244,177,255,255,255,255,255,
201 255,255,255,255,255,198,251,253,248,228,241,241,226,249,237,227,249,246,177,255,255,255,255,255,
202 255,255,255,255,255,196,253,252,252,252,252,251,251,250,250,249,249,248,175,255,255,255,255,255,
203 255,255,255,255,255,194, 64, 30, 37, 37, 37, 37, 37, 37, 37, 37, 30, 64,188,255,255,255,255,255,
204 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
205 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
206 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
209 static unsigned char doc_a_png[528] =
211 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
212 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
213 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
214 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
215 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0,
216 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,
217 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
218 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
219 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
220 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
221 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
224 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
225 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
226 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
229 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0,
230 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
235 static unsigned char module_png[528] =
237 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
238 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
239 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
240 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
241 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
242 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
243 255,128,128,255,255,255,193,128,136,255,255,255,217,128,128,255,255,255,255,255,255,255,255,255,
244 255,128,128,255,255,255,213,128,170,255,255,255,217,128,128,255,255,255,255,255,255,255,255,255,
245 255,128,128,255,255,247,247,128,196,255,247,255,217,128,128,255,255,255,255,255,255,255,255,255,
246 255,128,128,255,255,213,255,153,230,255,213,255,217,128,128,255,255,255,255,255,255,255,255,255,
247 255,128,128,255,255,187,255,187,255,230,204,255,217,128,128,255,255,255,255,255,255,255,255,255,
248 255,128,128,255,255,153,255,247,255,196,204,255,217,128,128,255,255,255,255,255,255,255,255,255,
249 255,128,128,255,255,128,247,255,255,170,204,255,217,128,128,255,255,255,255,255,255,255,255,255,
250 255,128,128,255,255,128,213,255,255,136,204,255,217,128,128,255,255,255,255,255,255,255,255,255,
251 255,128,128,255,255,128,187,255,230,138,204,255,217,128,128,255,255,255,255,255,255,255,255,255,
252 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
253 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
254 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
255 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
256 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
257 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
258 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
261 static unsigned char namespace_png[528] =
263 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
264 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
265 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
266 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
267 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
268 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
269 255,128,128,157,255,255,226,128,128,198,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
270 255,128,128,157,255,255,255,189,128,198,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
271 255,128,128,157,255,255,255,244,141,198,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
272 255,128,128,157,255,255,255,255,220,198,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
273 255,128,128,157,255,255,226,255,255,220,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
274 255,128,128,157,255,255,198,220,255,255,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
275 255,128,128,157,255,255,198,141,250,255,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
276 255,128,128,157,255,255,198,128,198,255,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
277 255,128,128,157,255,255,198,128,128,226,255,255,157,128,128,255,255,255,255,255,255,255,255,255,
278 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
279 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
280 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
281 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
282 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
283 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
284 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
287 static unsigned char class_png[528] =
289 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
290 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
291 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
292 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
293 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
294 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
295 255,128,128,128,128,187,247,255,255,230,170,128,128,128,128,255,255,255,255,255,255,255,255,255,
296 255,128,128,128,196,255,255,255,255,255,255,170,128,128,128,255,255,255,255,255,255,255,255,255,
297 255,128,128,145,255,255,230,128,136,230,247,179,128,128,128,255,255,255,255,255,255,255,255,255,
298 255,128,128,179,255,255,170,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
299 255,128,128,179,255,255,162,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
300 255,128,128,179,255,255,170,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
301 255,128,128,145,255,255,221,128,128,221,255,179,128,128,128,255,255,255,255,255,255,255,255,255,
302 255,128,128,128,196,255,255,255,255,255,255,187,128,128,128,255,255,255,255,255,255,255,255,255,
303 255,128,128,128,128,187,247,255,255,240,179,128,128,128,128,255,255,255,255,255,255,255,255,255,
304 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
305 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,
306 255,255,128,128,128,128,128,128,128,128,128,128,128,128,255,255,255,255,255,255,255,255,255,255,
307 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
308 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
309 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
310 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
314 static unsigned char letter_a_png[528] =
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
319 0, 0, 60,156,204,204,204,204,204,204,204,204,156, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
320 0, 78,255,255,255,255,255,255,255,255,255,255,255,252, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0,
321 0,210,255,255,255,255,255,255,255,255,255,255,255,255,207, 0, 0, 0, 0, 0, 0, 0, 0, 0,
322 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
324 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
325 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
326 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
327 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
328 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
329 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
330 0,240,255,255,255,255,255,255,255,255,255,255,255,255,240, 0, 0, 0, 0, 0, 0, 0, 0, 0,
331 0,222,255,255,255,255,255,255,255,255,255,255,255,255,219, 0, 0, 0, 0, 0, 0, 0, 0, 0,
332 0,111,255,255,255,255,255,255,255,255,255,255,255,255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0,
333 0, 0, 99,198,204,204,204,204,204,204,204,204,195, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
341 static unsigned char arrow_right_png[352] =
343 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
344 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
345 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
346 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
347 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
348 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
349 255,255,255,152,152,255,255,255,255,255,255,255,255,255,255,255,
350 255,255,255,152,152,152,152,255,255,255,255,255,255,255,255,255,
351 255,255,255,152,152,152,152,152,255,255,255,255,255,255,255,255,
352 255,255,255,152,152,152,152,152,152,152,255,255,255,255,255,255,
353 255,255,255,152,152,152,152,152,152,152,152,255,255,255,255,255,
354 255,255,255,152,152,152,152,152,152,152,255,255,255,255,255,255,
355 255,255,255,152,152,152,152,152,255,255,255,255,255,255,255,255,
356 255,255,255,152,152,152,152,255,255,255,255,255,255,255,255,255,
357 255,255,255,152,152,255,255,255,255,255,255,255,255,255,255,255,
358 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
359 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
360 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
361 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
362 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
363 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
364 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
367 static unsigned char arrow_right_a_png[352] =
369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
371 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
375 0, 0, 0,223, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
376 0, 0, 0,255,255,176, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,
377 0, 0, 0,255,255,255,248,117, 0, 0, 0, 0, 0, 0, 0, 0,
378 0, 0, 0,255,255,255,255,255,211, 60, 0, 0, 0, 0, 0, 0,
379 0, 0, 0,255,255,255,255,255,255,255, 77, 0, 0, 0, 0, 0,
380 0, 0, 0,255,255,255,255,255,211, 60, 0, 0, 0, 0, 0, 0,
381 0, 0, 0,255,255,255,248,117, 0, 0, 0, 0, 0, 0, 0, 0,
382 0, 0, 0,255,255,176, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,
383 0, 0, 0,223, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
384 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
393 static unsigned char arrow_down_png[352] =
395 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
396 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
397 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
398 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
399 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
400 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
401 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
402 255,255,255,152,152,152,152,152,152,152,152,152,255,255,255,255,
403 255,255,255,152,152,152,152,152,152,152,152,152,255,255,255,255,
404 255,255,255,255,152,152,152,152,152,152,152,255,255,255,255,255,
405 255,255,255,255,152,152,152,152,152,152,152,255,255,255,255,255,
406 255,255,255,255,255,152,152,152,152,152,255,255,255,255,255,255,
407 255,255,255,255,255,255,152,152,152,255,255,255,255,255,255,255,
408 255,255,255,255,255,255,152,152,152,255,255,255,255,255,255,255,
409 255,255,255,255,255,255,255,152,255,255,255,255,255,255,255,255,
410 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
411 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
412 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
413 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
414 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
415 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
416 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
419 static unsigned char arrow_down_a_png[352] =
421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
422 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
428 0, 0, 0,231,255,255,255,255,255,255,255,216, 0, 0, 0, 0,
429 0, 0, 0, 87,255,255,255,255,255,255,255, 65, 0, 0, 0, 0,
430 0, 0, 0, 0,186,255,255,255,255,255,164, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 38,251,255,255,255,241, 25, 0, 0, 0, 0, 0,
432 0, 0, 0, 0, 0,127,255,255,255,107, 0, 0, 0, 0, 0, 0,
433 0, 0, 0, 0, 0, 0,221,255,204, 0, 0, 0, 0, 0, 0, 0,
434 0, 0, 0, 0, 0, 0, 72,253, 52, 0, 0, 0, 0, 0, 0, 0,
435 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
439 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
440 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
441 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
442 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
445 #define SPLITBAR_LINE 170,242,224,202,183,170
446 #define SPLITBAR_BLOCK2 SPLITBAR_LINE , SPLITBAR_LINE
447 #define SPLITBAR_BLOCK4 SPLITBAR_BLOCK2 , SPLITBAR_BLOCK2
448 #define SPLITBAR_BLOCK8 SPLITBAR_BLOCK4 , SPLITBAR_BLOCK4
449 #define SPLITBAR_BLOCK16 SPLITBAR_BLOCK8 , SPLITBAR_BLOCK8
450 #define SPLITBAR_BLOCK32 SPLITBAR_BLOCK16 , SPLITBAR_BLOCK16
452 #define SPLITBAR_ALTLINE1 170,242,170,202,170,170
453 #define SPLITBAR_ALTLINE2 170,243,224,255,183,255
454 #define SPLITBAR_ALTBLOCK2 SPLITBAR_ALTLINE1 , SPLITBAR_ALTLINE2
455 #define SPLITBAR_ALTBLOCK4 SPLITBAR_ALTBLOCK2 , SPLITBAR_ALTBLOCK2
456 #define SPLITBAR_ALTBLOCK8 SPLITBAR_ALTBLOCK4 , SPLITBAR_ALTBLOCK4
458 static unsigned char splitbar_png[32*32*6] =
501 const unsigned char *data;
503 unsigned short width, height;
506 //extern FTVImageInfo image_info[];
508 #define FTVIMG_blank 0
510 #define FTVIMG_folderclosed 2
511 #define FTVIMG_folderopen 3
512 #define FTVIMG_lastnode 4
513 #define FTVIMG_link 5
514 #define FTVIMG_mlastnode 6
515 #define FTVIMG_mnode 7
516 #define FTVIMG_node 8
517 #define FTVIMG_plastnode 9
518 #define FTVIMG_pnode 10
519 #define FTVIMG_vertline 11
524 #define FTV_S(name) #name
525 #define FTV_ICON_FILE(name) "ftv2" FTV_S(name) ".png"
526 #define FTVIMG_INDEX(name) FTVIMG_ ## name
527 #define FTV_INFO(name) ( image_info[FTVIMG_INDEX(name)] )
528 #define FTV_IMGATTRIBS(name) \
529 "src=\"" FTV_ICON_FILE(name) "\" " \
530 "alt=\"" << FTV_INFO(name).alt << "\" " \
531 "width=\"" << FTV_INFO(name).width << "\" " \
532 "height=\"" << FTV_INFO(name).height << "\" "
535 static FTVImageInfo image_info[] =
537 { " ", "ftv2blank.png", 0 /*ftv2blank_png*/ /*,174*/,16,22 },
538 { "*", "ftv2doc.png", 0 /*ftv2doc_png*/ /*,255*/,24,22 },
539 { "+", "ftv2folderclosed.png", 0 /*ftv2folderclosed_png*/ /*,259*/,24,22 },
540 { "-", "ftv2folderopen.png", 0 /*ftv2folderopen_png*/ /*,261*/,24,22 },
541 { "\\", "ftv2lastnode.png", 0 /*ftv2lastnode_png*/ /*,233*/,16,22 },
542 { "-", "ftv2link.png", 0 /*ftv2link_png*/ /*,358*/,24,22 },
543 { "\\", "ftv2mlastnode.png", 0 /*ftv2mlastnode_png*/ /*,160*/,16,22 },
544 { "o", "ftv2mnode.png", 0 /*ftv2mnode_png*/ /*,194*/,16,22 },
545 { "o", "ftv2node.png", 0 /*ftv2node_png*/ /*,235*/,16,22 },
546 { "\\", "ftv2plastnode.png", 0 /*ftv2plastnode_png*/ /*,165*/,16,22 },
547 { "o", "ftv2pnode.png", 0 /*ftv2pnode_png*/ /*,200*/,16,22 },
548 { "|", "ftv2vertline.png", 0 /*ftv2vertline_png*/ /*,229*/,16,22 },
549 { "N", "ftv2ns.png", 0 /*ftv2vertline_png*/ /*,352*/,24,22 },
550 { "C", "ftv2cl.png", 0 /*ftv2vertline_png*/ /*,352*/,24,22 },
551 { "M", "ftv2mo.png", 0 /*ftv2vertline_png*/ /*,352*/,24,22 },
552 { 0, 0, 0 /*, 0*/, 0, 0 }
555 static ColoredImgDataItem ftv_image_data[] =
557 { "ftv2blank.png", 16, 22, blank_png, blank_png },
558 { "ftv2doc.png", 24, 22, doc_png, doc_a_png },
559 { "ftv2folderclosed.png", 24, 22, folderclosed_png, folderclosed_a_png },
560 { "ftv2folderopen.png", 24, 22, folderopen_png, folderopen_a_png },
561 { "ftv2ns.png", 24, 22, namespace_png, letter_a_png },
562 { "ftv2mo.png", 24, 22, module_png, letter_a_png },
563 { "ftv2cl.png", 24, 22, class_png, letter_a_png },
564 { "ftv2lastnode.png", 16, 22, blank_png, blank_png },
565 { "ftv2link.png", 24, 22, doc_png, doc_a_png },
566 { "ftv2mlastnode.png", 16, 22, arrow_down_png, arrow_down_a_png },
567 { "ftv2mnode.png", 16, 22, arrow_down_png, arrow_down_a_png },
568 { "ftv2node.png", 16, 22, blank_png, blank_png },
569 { "ftv2plastnode.png", 16, 22, arrow_right_png, arrow_right_a_png },
570 { "ftv2pnode.png", 16, 22, arrow_right_png, arrow_right_a_png },
571 { "ftv2vertline.png", 16, 22, blank_png, blank_png },
572 { "ftv2splitbar.png", 6,1024, splitbar_png, 0 },
576 static int folderId=1;
580 FTVNode(bool dir,const char *r,const char *f,const char *a,
581 const char *n,bool sepIndex,bool navIndex,Definition *df)
582 : isLast(TRUE), isDir(dir),ref(r),file(f),anchor(a),name(n), index(0),
583 parent(0), separateIndex(sepIndex), addToNavIndex(navIndex),
584 def(df) { children.setAutoDelete(TRUE); }
585 int computeTreeDepth(int level) const;
586 int numNodesAtLevel(int level,int maxLevel) const;
594 QList<FTVNode> children;
601 int FTVNode::computeTreeDepth(int level) const
604 QListIterator<FTVNode> li(children);
606 for (;(n=li.current());++li)
608 if (n->children.count()>0)
610 int d = n->computeTreeDepth(level+1);
611 if (d>maxDepth) maxDepth=d;
617 int FTVNode::numNodesAtLevel(int level,int maxLevel) const
623 QListIterator<FTVNode> li(children);
625 for (;(n=li.current());++li)
627 num+=n->numNodesAtLevel(level+1,maxLevel);
633 //----------------------------------------------------------------------------
635 /*! Constructs an ftv help object.
636 * The object has to be \link initialize() initialized\endlink before it can
639 FTVHelp::FTVHelp(bool TLI)
642 m_indentNodes = new QList<FTVNode>[MAX_INDENT];
643 m_indentNodes[0].setAutoDelete(TRUE);
645 m_topLevelIndex = TLI;
648 /*! Destroys the ftv help object. */
651 delete[] m_indentNodes;
654 /*! This will create a folder tree view table of contents file (tree.js).
657 void FTVHelp::initialize()
661 /*! Finalizes the FTV help. This will finish and close the
662 * contents file (index.js).
665 void FTVHelp::finalize()
670 /*! Increase the level of the contents hierarchy.
671 * This will start a new sublist in contents file.
672 * \sa decContentsDepth()
674 void FTVHelp::incContentsDepth()
676 //printf("incContentsDepth() indent=%d\n",m_indent);
678 ASSERT(m_indent<MAX_INDENT);
681 /*! Decrease the level of the contents hierarchy.
682 * This will end the current sublist.
683 * \sa incContentsDepth()
685 void FTVHelp::decContentsDepth()
687 //printf("decContentsDepth() indent=%d\n",m_indent);
692 QList<FTVNode> *nl = &m_indentNodes[m_indent];
693 FTVNode *parent = nl->getLast();
696 QList<FTVNode> *children = &m_indentNodes[m_indent+1];
697 while (!children->isEmpty())
699 parent->children.append(children->take(0));
705 /*! Add a list item to the contents file.
706 * \param isDir TRUE if the item is a directory, FALSE if it is a text
707 * \param ref the URL of to the item.
708 * \param file the file containing the definition of the item
709 * \param anchor the anchor within the file.
710 * \param name the name of the item.
711 * \param separateIndex put the entries in a separate index file
712 * \param addToNavIndex add this entry to the quick navigation index
713 * \param def Definition corresponding to this entry
715 void FTVHelp::addContentsItem(bool isDir,
725 //printf("%p: m_indent=%d addContentsItem(%s,%s,%s,%s)\n",this,m_indent,name,ref,file,anchor);
726 QList<FTVNode> *nl = &m_indentNodes[m_indent];
727 FTVNode *newNode = new FTVNode(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def);
730 nl->getLast()->isLast=FALSE;
733 newNode->index = nl->count()-1;
736 QList<FTVNode> *pnl = &m_indentNodes[m_indent-1];
737 newNode->parent = pnl->getLast();
742 static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE)
744 QCString url = n->file;
745 if (!url.isEmpty() && url.at(0)=='!') // relative URL
750 else if (!url.isEmpty() && url.at(0)=='^') // absolute URL
752 // skip, keep ^ in the output
754 else // local file (with optional anchor)
756 if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile)
758 FileDef *fd = (FileDef*)n->def;
761 url = fd->getSourceFileBase();
765 url = fd->getOutputFileBase();
768 url+=Doxygen::htmlFileExtension;
769 if (!n->anchor.isEmpty()) url+="#"+n->anchor;
774 QCString FTVHelp::generateIndentLabel(FTVNode *n,int level)
779 result=generateIndentLabel(n->parent,level+1);
781 result+=QCString().sprintf("%d_",n->index);
785 void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level, bool opened)
789 generateIndent(t,n->parent,level+1,opened);
791 // from the root up to node n do...
792 if (level==0) // item before a dir or document
798 t << "<img id=\"arr_" << generateIndentLabel(n,0)
801 t << FTV_IMGATTRIBS(mlastnode);
803 t << FTV_IMGATTRIBS(plastnode);
804 t << "onclick=\"toggleFolder('"
805 << generateIndentLabel(n,0)
810 t << "<img " << FTV_IMGATTRIBS(lastnode) << "/>";
817 t << "<img id=\"arr_" << generateIndentLabel(n,0)
820 t << FTV_IMGATTRIBS(mnode);
822 t << FTV_IMGATTRIBS(pnode);
823 t << "onclick=\"toggleFolder('"
824 << generateIndentLabel(n,0)
829 t << "<img " << FTV_IMGATTRIBS(node) << "/>";
833 else // item at another level
837 t << "<img " << FTV_IMGATTRIBS(blank) << "/>";
841 t << "<img " << FTV_IMGATTRIBS(vertline) << "/>";
846 void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
848 //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
849 // n->ref.data(),n->file.data(),n->anchor.data());
850 if (n->file.isEmpty()) // no link
852 t << "<b>" << convertToHtml(n->name) << "</b>";
854 else // link into other frame
856 if (!n->ref.isEmpty()) // link to entity imported via tag file
858 t << "<a class=\"elRef\" ";
859 t << externalLinkTarget() << externalRef("",n->ref,FALSE);
863 t << "<a class=\"el\" ";
866 t << externalRef("",n->ref,TRUE);
869 t << "\" target=\"basefrm\">";
871 t << "\" target=\"_self\">";
872 t << convertToHtml(n->name);
874 if (!n->ref.isEmpty())
876 t << " [external]";
881 static void generateBriefDoc(FTextStream &t,Definition *def)
883 QCString brief = def->briefDescription(TRUE);
884 if (!brief.isEmpty())
886 DocNode *root = validatingParseDoc(def->briefFile(),def->briefLine(),
887 def,0,brief,FALSE,FALSE,0,TRUE,TRUE);
888 QCString relPath = relativePathToRoot(def->getOutputFileBase());
889 HtmlCodeGenerator htmlGen(t,relPath);
890 HtmlDocVisitor *visitor = new HtmlDocVisitor(t,htmlGen,def,0);
891 root->accept(visitor);
897 void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index)
899 QListIterator<FTVNode> nli(nl);
901 for (nli.toFirst();(n=nli.current());++nli)
903 t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\"";
904 if ((index&1)==0) // even row
905 t << " class=\"even\"";
906 if (level>=maxLevel) // item invisible by default
907 t << " style=\"display:none;\"";
908 else // item visible by default
910 t << "><td class=\"entry\">";
911 bool nodeOpened = level+1<maxLevel;
912 generateIndent(t,n,0,nodeOpened);
915 if (n->def && n->def->definitionType()==Definition::TypeGroup)
919 else if (n->def && n->def->definitionType()==Definition::TypePage)
923 else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
926 t << FTV_IMGATTRIBS(ns);
929 else if (n->def && n->def->definitionType()==Definition::TypeClass)
932 t << FTV_IMGATTRIBS(cl);
938 t << "id=\"img_" << generateIndentLabel(n,0)
941 t << FTV_IMGATTRIBS(folderopen);
943 t << FTV_IMGATTRIBS(folderclosed);
944 t << "onclick=\"toggleFolder('"
945 << generateIndentLabel(n,0)
950 t << "</td><td class=\"desc\">";
953 generateBriefDoc(t,n->def);
955 t << "</td></tr>" << endl;
957 generateTree(t,n->children,level+1,maxLevel,index);
962 if (n->def && n->def->definitionType()==Definition::TypeFile &&
963 ((FileDef*)n->def)->generateSourceFile())
965 srcRef = (FileDef*)n->def;
969 t << "<a href=\"" << srcRef->getSourceFileBase()
970 << Doxygen::htmlFileExtension
973 if (n->def && n->def->definitionType()==Definition::TypeGroup)
977 else if (n->def && n->def->definitionType()==Definition::TypePage)
981 else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
984 t << FTV_IMGATTRIBS(ns);
987 else if (n->def && n->def->definitionType()==Definition::TypeClass)
990 t << FTV_IMGATTRIBS(cl);
996 t << FTV_IMGATTRIBS(doc);
1004 t << "</td><td class=\"desc\">";
1007 generateBriefDoc(t,n->def);
1009 t << "</td></tr>" << endl;
1014 //-----------------------------------------------------------
1016 struct NavIndexEntry
1018 NavIndexEntry(const QCString &u,const QCString &p) : url(u), path(p) {}
1023 class NavIndexEntryList : public QList<NavIndexEntry>
1026 NavIndexEntryList() : QList<NavIndexEntry>() { setAutoDelete(TRUE); }
1027 ~NavIndexEntryList() {}
1028 int compareItems(GCI item1,GCI item2)
1030 // sort list based on url
1031 return qstrcmp(((NavIndexEntry*)item1)->url,((NavIndexEntry*)item2)->url);
1035 static QCString pathToNode(FTVNode *leaf,FTVNode *n)
1040 result+=pathToNode(leaf,n->parent);
1042 result+=QCString().setNum(n->index);
1043 if (leaf!=n) result+=",";
1047 static bool dupOfParent(const FTVNode *n)
1049 if (n->parent==0) return FALSE;
1050 if (n->file==n->parent->file) return TRUE;
1054 static void generateJSLink(FTextStream &t,FTVNode *n)
1056 if (n->file.isEmpty()) // no link
1058 t << "\"" << convertToJSString(n->name) << "\", null, ";
1060 else // link into other page
1062 t << "\"" << convertToJSString(n->name) << "\", \"";
1063 t << externalRef("",n->ref,TRUE);
1069 static QCString convertFileId2Var(const QCString &fileId)
1071 QCString varId = fileId;
1072 int i=varId.findRev('/');
1073 if (i>=0) varId = varId.mid(i+1);
1074 return substitute(varId,"-","_");
1077 static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
1078 const QList<FTVNode> &nl,int level,bool &first)
1080 static QCString htmlOutput = Config_getString("HTML_OUTPUT");
1082 indentStr.fill(' ',level*2);
1084 QListIterator<FTVNode> nli(nl);
1086 for (nli.toFirst();(n=nli.current());++nli)
1088 // terminate previous entry
1089 if (!first) t << "," << endl;
1099 if (n->addToNavIndex) // add entry to the navigation index
1101 if (n->def && n->def->definitionType()==Definition::TypeFile)
1103 FileDef *fd = (FileDef*)n->def;
1105 doc = fileVisibleInIndex(fd,src);
1108 navIndex.append(new NavIndexEntry(node2URL(n,TRUE,FALSE),pathToNode(n,n)));
1112 navIndex.append(new NavIndexEntry(node2URL(n,TRUE,TRUE),pathToNode(n,n)));
1117 navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n)));
1121 if (n->separateIndex) // store items in a separate file for dynamic loading
1123 bool firstChild=TRUE;
1124 t << indentStr << " [ ";
1125 generateJSLink(t,n);
1126 if (n->children.count()>0) // write children to separate file for dynamic loading
1128 QCString fileId = n->file;
1129 if (dupOfParent(n)) fileId+="_dup";
1130 QFile f(htmlOutput+"/"+fileId+".js");
1131 if (f.open(IO_WriteOnly))
1134 tt << "var " << convertFileId2Var(fileId) << " =" << endl;
1135 generateJSTree(navIndex,tt,n->children,1,firstChild);
1138 t << "\"" << fileId << "\" ]";
1145 else // show items in this file
1147 bool firstChild=TRUE;
1148 t << indentStr << " [ ";
1149 generateJSLink(t,n);
1150 bool emptySection = !generateJSTree(navIndex,t,n->children,level+1,firstChild);
1154 t << endl << indentStr << " ] ]";
1160 static void generateJSNavTree(const QList<FTVNode> &nodeList)
1162 QCString htmlOutput = Config_getString("HTML_OUTPUT");
1163 QFile f(htmlOutput+"/navtree.js");
1164 NavIndexEntryList navIndex;
1165 if (f.open(IO_WriteOnly) /*&& fidx.open(IO_WriteOnly)*/)
1167 //FTextStream tidx(&fidx);
1168 //tidx << "var NAVTREEINDEX =" << endl;
1169 //tidx << "{" << endl;
1171 t << "var NAVTREE =" << endl;
1174 QCString &projName = Config_getString("PROJECT_NAME");
1175 if (projName.isEmpty())
1177 if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty()) // Use title of main page as root
1179 t << "\"" << convertToJSString(Doxygen::mainPage->title()) << "\", ";
1181 else // Use default section title as root
1183 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::MainPage);
1184 t << "\"" << convertToJSString(lne->title()) << "\", ";
1187 else // use PROJECT_NAME as root tree element
1189 t << "\"" << convertToJSString(projName) << "\", ";
1191 t << "\"index" << Doxygen::htmlFileExtension << "\", ";
1193 // add special entry for index page
1194 navIndex.append(new NavIndexEntry("index"+Doxygen::htmlFileExtension,""));
1195 // related page index is written as a child of index.html, so add this as well
1196 navIndex.append(new NavIndexEntry("pages"+Doxygen::htmlFileExtension,""));
1199 generateJSTree(navIndex,t,nodeList,1,first);
1204 t << endl << " ] ]" << endl;
1205 t << "];" << endl << endl;
1207 // write the navigation index (and sub-indices)
1211 const int maxElemCount=250;
1212 //QFile fidx(htmlOutput+"/navtreeindex.js");
1213 QFile fsidx(htmlOutput+"/navtreeindex0.js");
1214 if (/*fidx.open(IO_WriteOnly) &&*/ fsidx.open(IO_WriteOnly))
1216 //FTextStream tidx(&fidx);
1217 FTextStream tsidx(&fsidx);
1218 t << "var NAVTREEINDEX =" << endl;
1220 tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
1221 tsidx << "{" << endl;
1222 QListIterator<NavIndexEntry> li(navIndex);
1225 for (li.toFirst();(e=li.current());) // for each entry
1237 t << "\"" << e->url << "\"";
1239 tsidx << "\"" << e->url << "\":[" << e->path << "]";
1241 if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
1245 if (li.current() && elemCount>=maxElemCount) // switch to new sub-index
1247 tsidx << "};" << endl;
1251 fsidx.setName(htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js");
1252 if (!fsidx.open(IO_WriteOnly)) break;
1253 tsidx.setDevice(&fsidx);
1254 tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
1255 tsidx << "{" << endl;
1258 tsidx << "};" << endl;
1259 t << endl << "];" << endl;
1261 t << endl << "var SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
1262 t << endl << "var SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
1263 t << endl << navtree_script;
1267 //-----------------------------------------------------------
1270 void FTVHelp::generateTreeViewImages()
1272 QCString dname=Config_getString("HTML_OUTPUT");
1273 writeColoredImgData(dname,ftv_image_data);
1276 // new style scripts
1277 void FTVHelp::generateTreeViewScripts()
1279 QCString htmlOutput = Config_getString("HTML_OUTPUT");
1281 // generate navtree.js & navtreeindex.js
1282 generateJSNavTree(m_indentNodes[0]);
1284 // generate resize.js
1286 QFile f(htmlOutput+"/resize.js");
1287 if (f.open(IO_WriteOnly))
1293 // generate navtree.css
1295 QFile f(htmlOutput+"/navtree.css");
1296 if (f.open(IO_WriteOnly))
1299 t << replaceColorMarkers(navtree_css);
1304 // write tree inside page
1305 void FTVHelp::generateTreeViewInline(FTextStream &t)
1307 int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES");
1308 t << "<div class=\"directory\">\n";
1309 QListIterator<FTVNode> li(m_indentNodes[0]);
1312 for (;(n=li.current());++li)
1314 if (n->children.count()>0)
1316 d = n->computeTreeDepth(2);
1317 if (d>depth) depth=d;
1320 int preferredDepth = depth;
1321 // write level selector
1324 t << "<div class=\"levels\">[";
1325 t << theTranslator->trDetailLevel();
1328 for (i=1;i<=depth;i++)
1330 t << "<span onclick=\"javascript:toggleLevel(" << i << ");\">" << i << "</span>";
1334 if (preferredNumEntries>0)
1337 for (int i=1;i<=depth;i++)
1340 QListIterator<FTVNode> li(m_indentNodes[0]);
1342 for (;(n=li.current());++li)
1344 num+=n->numNodesAtLevel(0,i);
1346 if (num<=preferredNumEntries)
1357 //printf("preferred depth=%d\n",preferredDepth);
1359 t << "<table class=\"directory\">\n";
1361 generateTree(t,m_indentNodes[0],0,preferredDepth,index);
1364 t << "</div><!-- directory -->\n";
1367 // write old style index.html and tree.html
1368 void FTVHelp::generateTreeView()
1370 generateTreeViewImages();
1371 generateTreeViewScripts();