Fix for UBSan build
[platform/upstream/doxygen.git] / src / htmlgen.cpp
1 /******************************************************************************
2  *
3  * $Id: htmlgen.cpp,v 1.56 2001/03/19 19:27:40 root Exp $
4  *
5  * Copyright (C) 1997-2012 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby 
9  * granted. No representations are made about the suitability of this software 
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17
18 #include <stdlib.h>
19
20 #include "qtbc.h"
21 #include <qdir.h>
22 #include <qregexp.h>
23 #include "message.h"
24 #include "htmlgen.h"
25 #include "config.h"
26 #include "util.h"
27 #include "doxygen.h"
28 #include "logos.h"
29 #include "diagram.h"
30 #include "version.h"
31 #include "dot.h"
32 #include "language.h"
33 #include "htmlhelp.h"
34 #include "docparser.h"
35 #include "htmldocvisitor.h"
36 #include "searchindex.h"
37 #include "pagedef.h"
38 #include "debug.h"
39 #include "dirdef.h"
40 #include "vhdldocgen.h"
41 #include "layout.h"
42 #include "image.h"
43 #include "ftvhelp.h"
44 #include "bufstr.h"
45
46
47 //#define DBG_HTML(x) x;
48 #define DBG_HTML(x) 
49
50 static const char defaultHtmlHeader[] =
51 #include "header_html.h"
52 ;
53
54 static const char defaultHtmlFooter[] =
55 #include "footer_html.h"
56 ;
57
58 static const char defaultStyleSheet[] = 
59 #include "doxygen_css.h"
60 ;
61
62 static const char search_functions_script[]=
63 #include "search_functions_php.h"
64 ;
65
66 static const char search_opensearch_script[]=
67 #include "search_opensearch_php.h"
68 ;
69
70 static const char search_styleSheet[] =
71 #include "search_css.h"
72 ;
73
74 static const char search_jquery_script1[]=
75 #include "jquery_p1_js.h"
76 ;
77
78 static const char search_jquery_script2[]=
79 #include "jquery_p2_js.h"
80 ;
81
82 static const char search_jquery_script3[]=
83 #include "jquery_p3_js.h"
84 ;
85
86 static const char search_jquery_script4[]=
87 #include "jquery_ui_js.h"
88 ;
89
90 static const char search_jquery_script5[]=
91 #include "jquery_fx_js.h"
92 ;
93
94 static const char svgpan_script[]=
95 #include "svgpan_js.h"
96 ;
97
98 static const char dynsections_script[]=
99 #include "dynsections_js.h"
100 ;
101
102
103 static QCString g_header;
104 static QCString g_footer;
105
106 //------------------------- Pictures for the Tabs ------------------------
107
108 // active tab background luma
109 static unsigned char tab_a_png[36] =
110 {
111    31,  42,  59,  69,  73,  74,  75,  77,  77,
112    77,  79,  80,  80,  82,  81,  83,  84,  86,
113    87,  88,  89,  90,  91,  91,  93,  94,  94,
114    96,  96,  97,  98,  98,  99,  99,  99, 100
115 };
116
117 // normal tab background luma
118 static unsigned char tab_b_png[36] =
119 {
120     221, 231, 238, 236, 233, 230, 228, 225, 224,
121     221, 220, 218, 217, 216, 215, 214, 213, 212,
122     212, 194, 195, 196, 197, 198, 199, 200, 201,
123     202, 204, 206, 208, 210, 214, 216, 203, 185 
124 };
125
126 // hovering tab background luma
127 static unsigned char tab_h_png[36] =
128 {
129     181, 191, 198, 196, 193, 190, 188, 185, 184,
130     181, 180, 178, 177, 176, 175, 174, 173, 172,
131     172, 154, 155, 156, 157, 158, 159, 160, 161,
132     162, 164, 166, 168, 170, 174, 176, 163, 145
133 };
134
135 // shadowed header
136 static unsigned char header_png[12] = 
137 {
138   255, 240, 241, 242, 243, 244, 
139   245, 246, 247, 248, 249, 250
140 };
141
142 // function header
143 static unsigned char func_header_png[56] =
144 {
145   248, 247, 246, 245, 244, 243, 242, 241,
146   240, 239, 238, 237, 236, 235, 234, 233,
147   232, 231, 230, 229, 228, 223, 223, 223,
148   223, 223, 223, 223, 223, 223, 223, 223,
149   224, 224, 224, 224, 225, 225, 225, 225,
150   225, 226, 226, 226, 227, 227, 227, 227,
151   228, 228, 228, 229, 229, 229, 229, 229
152 };
153
154 // tab separator
155 static unsigned char tab_s_png[36] =
156 {
157   187, 186, 185, 183, 182, 181, 180, 178, 176,
158   174, 173, 171, 169, 167, 164, 163, 161, 158,
159   156, 154, 152, 150, 148, 145, 143, 141, 140,
160   138, 136, 134, 131, 131, 128, 126, 125, 124
161 };
162
163 // breadcrumbs luma
164 static unsigned char bc_s_png[240] =
165 {
166   150,187,187,148,148,148,148,148,
167   147,175,186,147,147,147,147,147,
168   146,153,185,185,146,146,146,146,
169   144,144,177,183,144,144,144,144,
170   144,144,159,182,144,144,144,144,
171   143,143,144,179,181,143,143,143,
172   142,142,142,165,180,142,142,142,
173   141,141,141,144,178,178,141,141,
174   139,139,139,139,167,176,139,139,
175   137,137,137,137,146,174,137,137,
176   137,137,137,137,137,169,173,137,
177   135,135,135,135,135,150,171,135,
178   133,133,133,133,133,135,167,169,
179   132,132,132,132,132,132,154,167,
180   129,129,129,129,129,129,140,164,
181   129,129,129,129,129,129,154,163,
182   127,127,127,127,127,128,161,161,
183   125,125,125,125,125,141,158,125,
184   123,123,123,123,123,152,156,123,
185   121,121,121,121,129,154,121,121,
186   120,120,120,120,143,152,120,120,
187   118,118,118,120,150,150,118,118,
188   117,117,117,132,148,117,117,117,
189   114,114,114,142,145,114,114,114,
190   113,113,120,143,113,113,113,113,
191   111,111,133,141,111,111,111,111,
192   110,112,140,140,110,110,110,110,
193   109,124,138,109,109,109,109,109,
194   107,133,136,107,107,107,107,107,
195   111,134,106,106,106,106,106,106
196 };
197
198 // breadcrumbs alpha map
199 static unsigned char bc_s_a_png[240] =
200 {
201   241,241, 21,  0,  0,  0,  0,  0,
202   162,205,117,  0,  0,  0,  0,  0,
203    54,231,225,  3,  0,  0,  0,  0,
204     0,198,215, 78,  0,  0,  0,  0,
205     0, 93,211,186,  0,  0,  0,  0,
206     0,  6,232,235, 42,  0,  0,  0,
207     0,  0,132,203,147,  0,  0,  0,
208     0,  0, 27,242,241, 15,  0,  0,
209     0,  0,  0,168,205,108,  0,  0,
210     0,  0,  0, 63,228,219,  0,  0,
211     0,  0,  0,  0,207,221, 72,  0,
212     0,  0,  0,  0,102,208,177,  0,
213     0,  0,  0,  0,  9,238,240, 36,
214     0,  0,  0,  0,  0,138,201,138,
215     0,  0,  0,  0,  0, 77,187,158,
216     0,  0,  0,  0,  0,159,204,120,
217     0,  0,  0,  0, 15,241,241, 21,
218     0,  0,  0,  0,111,208,171,  0,
219     0,  0,  0,  0,210,222, 66,  0,
220     0,  0,  0, 60,227,219,  0,  0,
221     0,  0,  0,162,204,114,  0,  0,
222     0,  0, 18,238,238, 21,  0,  0,
223     0,  0,114,205,165,  0,  0,  0,
224     0,  0,216,225, 60,  0,  0,  0,
225     0, 66,226,216,  0,  0,  0,  0,
226     0,165,204,111,  0,  0,  0,  0,
227    21,241,241, 18,  0,  0,  0,  0,
228   117,203,159,  0,  0,  0,  0,  0,
229   219,227, 57,  0,  0,  0,  0,  0,
230   211,201,  0,  0,  0,  0,  0,  0
231 };
232
233 // doxygen logo luma
234 static unsigned char doxygen_png[3224] =
235 {
236   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,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,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,
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,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,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,255,255,255,255,255,255,255,255,255,255,
238    32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,255,255,255,255,255,255,255,255,
239    32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 91, 91, 91, 32, 32,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,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
240    32, 32, 32, 32, 32, 32, 32, 32, 32, 32,255,255,255,255, 32, 32,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,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
241    32, 32, 32, 32, 32, 32, 32, 32, 32, 32,253,253,253,253, 32, 32,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,255,255,255,255,255,255,255,255,
242    32, 32, 32, 32, 32, 32, 32, 32, 32, 32,251,251,251,251, 32, 32,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,255,255,255,255,255,255,255,255,
243    32, 32, 32, 32, 32, 32, 32, 32, 32, 32,249,249,249,249, 32, 32,249,249,249,249, 32, 32, 32, 32, 32, 32,249,249,249,249, 32, 32, 32, 32, 32, 32,249,249,249,249, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,249,249,249, 32, 32, 32, 32, 32,249,249,249,249, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,249,249,249,249,249,249, 32, 32, 32, 32, 32, 32, 32,249,249,249,249,249, 32, 32, 32, 32, 32,249, 32, 32, 32, 32, 32,255,255,255,
244    32, 32, 32, 32, 46,132,190,190,147, 61,247,247,247,247, 32, 32,247,247, 32, 32,118,161,190,190,161,118, 32, 32,247, 32, 46, 89, 89, 89, 89, 46, 32,247,247, 32, 89, 89, 89, 89, 61, 89, 89, 89, 89, 46, 32,247, 32, 46, 89, 89, 89, 89, 32,247, 32, 32,118,175,190,161, 89, 61, 89, 89, 89, 61, 32,247,247,247, 32, 32,104,147,190,190,190,132, 89, 32, 32,247,247, 32, 46, 89, 89, 89, 75, 32, 89,161,190,161, 75, 32,255,255,
245    32, 32, 32, 74,230,244,244,244,244,244,244,244,244,244, 32, 32,244, 32, 74,216,244,244,244,244,244,244,216, 74, 32,244, 32,187,244,244,244,159, 32,244, 32,117,244,244,244,230, 46,173,244,244,244,131, 32,244, 32,131,244,244,244,173, 32, 32, 46,173,244,244,244,244,244,230,244,244,244,131, 32,244,244, 32, 74,202,244,244,244,244,244,244,244,173, 46, 32,244, 32, 89,244,244,244,187,145,244,244,244,244,244, 89, 32,255,
246    32, 32, 46,213,241,241,241,241,241,241,241,241,241,241, 32, 32, 32, 60,227,241,241,241,241,241,241,241,241,227, 60, 32, 32, 46,227,241,241,241,102, 32, 60,227,241,241,241, 88, 32,116,241,241,241,199, 32,241, 32,185,241,241,241,116, 32, 32,143,241,241,241,241,241,241,241,241,241,241,130, 32,241, 32, 74,227,241,241,241,199,185,241,241,241,241,171, 32,241, 32, 88,241,241,241,241,241,241,241,241,241,241,199, 32,255,
247    32, 32,128,237,237,237,223,128, 87,128,237,237,237,237, 32, 32, 32,182,237,237,237,196,100,100,196,237,237,237,182, 32,237, 32,100,237,237,237,223, 59,196,237,237,237,141, 32, 32, 46,237,237,237,237, 59, 32, 46,237,237,237,237, 46, 32, 59,237,237,237,237,169, 87, 87,182,237,237,237,128, 32,237, 32,196,237,237,237, 87, 32, 32, 73,223,237,237,237, 73, 32, 32, 87,237,237,237,237,223,182,223,237,237,237,237, 46, 32,
248    32, 32,207,234,234,234,113, 32, 32, 32,234,234,234,234, 32, 32, 59,234,234,234,221, 45, 32, 32, 45,221,234,234,234, 59, 32,234, 32,140,234,234,234,221,234,234,234,194, 32, 32,234, 32,167,234,234,234,126, 32, 99,234,234,234,167, 32, 32,126,234,234,234,180, 32, 32, 32,126,234,234,234,126, 32, 32, 99,234,234,234,167, 32, 32, 32, 32,153,234,234,234,126, 32, 32, 86,234,234,234,207, 45, 32, 45,234,234,234,234, 86, 32,
249    32, 45,231,231,231,218, 32, 32, 32, 32,231,231,231,231, 32, 32, 98,231,231,231,165, 32,231,231, 32,165,231,231,231, 98, 32,231, 32, 45,191,231,231,231,231,231,218, 72, 32,231,231, 32, 98,231,231,231,165, 32,151,231,231,231,112, 32, 32,165,231,231,231,112, 32,231, 32,125,231,231,231,125, 32, 32,138,231,231,231,178,125,125,125,125,178,231,231,231,178, 32, 32, 85,231,231,231,178, 32,255, 32,191,231,231,231, 85, 32,
250    32, 84,227,227,227,175, 32, 32, 32, 32,227,227,227,227, 32, 32,123,227,227,227,123, 32,227,227, 32,123,227,227,227,123, 32,227,227, 32, 71,227,227,227,227,227,123, 32,227,227,227,227, 32,214,227,227,227, 45,201,227,227,227, 45, 32, 32,175,227,227,227, 84, 32,227, 32,123,227,227,227,123, 32, 32,175,227,227,227,227,227,227,227,227,227,227,227,227,175, 32, 32, 84,227,227,227,175, 32,255, 32,175,227,227,227, 84, 32,
251    32, 83,223,223,223,172, 32, 32, 32, 32,223,223,223,223, 32, 32,121,223,223,223,121, 32,223,223, 32,121,223,223,223,121, 32,223,223,223, 32,172,223,223,223,210, 45, 32,223,223,223,223, 32,147,223,223,223,134,223,223,223,147, 32,223, 32,172,223,223,223, 83, 32,223, 32,121,223,223,223,121, 32, 32,172,223,223,223,223,223,223,223,223,223,223,223,223,172, 32, 32, 83,223,223,223,172, 32,255, 32,172,223,223,223, 83, 32,
252    32, 82,220,220,220,170, 32, 32, 32, 32,220,220,220,220, 32, 32,120,220,220,220,120, 32,220,220, 32,120,220,220,220,120, 32,220,220, 32, 95,220,220,220,220,220,132, 32,220,220,220,220, 32, 95,220,220,220,207,220,220,220, 95, 32,220, 32,170,220,220,220,107, 32,220, 32,120,220,220,220,120, 32, 32,170,220,220,220,132, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 82,220,220,220,170, 32,255, 32,170,220,220,220, 82, 32,
253    32, 57,216,216,216,216, 32, 32, 32, 32,216,216,216,216, 32, 32, 81,216,216,216,167, 32,216,216, 32,155,216,216,216, 81, 32,216, 32, 57,204,216,216,216,216,216,216, 93, 32,216,216,216,216, 32,204,216,216,216,216,216,204, 32,216,216, 32,118,216,216,216,167, 32, 32, 32,130,216,216,216,118, 32, 32,118,216,216,216,191, 32, 32,216,216,216, 32, 32, 44, 57, 32, 32, 81,216,216,216,167, 32,255, 32,167,216,216,216, 81, 32,
254    32, 32,189,213,213,213,116, 32, 32, 80,213,213,213,213, 32, 32, 44,201,213,213,213, 68, 32, 32, 68,213,213,213,213, 44, 32, 32, 32,165,213,213,213,165,213,213,213,201, 44, 32,213,213,213, 32,129,213,213,213,213,213,141, 32,213,213, 32, 80,213,213,213,213,165,116,153,213,213,213,213,116, 32, 32, 56,213,213,213,213,153, 56, 32, 32, 32, 44,104,189,116, 32, 32, 80,213,213,213,165, 32,255, 32,165,213,213,213, 80, 32,
255    32, 32,139,210,210,210,210,174,174,210,210,210,210,210, 32, 32, 32,127,210,210,210,198,127,127,198,210,210,210,127, 32,210, 32,115,210,210,210,174, 44,139,210,210,210,163, 32, 32,210,210, 32, 68,210,210,210,210,210, 91, 32,210,210,210, 32,174,210,210,210,210,210,210,210,210,210,210,115, 32,210, 32,127,210,210,210,210,210,174,163,163,210,210,210,115, 32, 32, 79,210,210,210,163, 32,255, 32,163,210,210,210, 79, 32,
256    32, 32, 55,194,206,206,206,206,206,194,206,206,206,206, 32, 32, 32, 44,171,206,206,206,206,206,206,206,206,171, 44, 32, 32, 67,206,206,206,206, 67, 32, 44,183,206,206,206,113, 32,206,206,206, 32,183,206,206,206,194, 32,206,206,206,206, 32, 67,194,206,206,206,206,206,171,206,206,206,113, 32,206, 32, 32,136,206,206,206,206,206,206,206,206,206,206,113, 32, 32, 78,206,206,206,160, 32,255, 32,160,206,206,206, 78, 32,
257    32, 32, 32,100,192,203,203,203,157, 55,203,203,203,203, 32, 32,203, 32, 43,135,203,203,203,203,203,203,135, 43, 32, 32, 43,180,203,203,203,112, 32,203, 32, 66,203,203,203,203, 66, 32,203,203, 32,157,203,203,203,135, 32,203,203,203,203,203, 32, 43,112,157,157,123, 55,112,203,203,203,112, 32,203,203, 32, 32, 78,146,203,203,203,203,203,203,169,123, 55, 32, 32, 78,203,203,203,157, 32,255, 32,157,203,203,203, 78, 32,
258    32, 32, 32, 32, 54,110,110, 88, 32, 32, 32, 32, 32, 32, 32, 32,200,200, 32, 32, 54, 99,110,110, 99, 54, 32, 32,200,200, 32, 32, 32, 32, 32, 32, 32,200,200, 32, 32, 32, 32, 32, 32,200,200, 32, 54,200,200,200,200, 77, 32,200,200,200,200,200, 32, 32, 32, 32, 32, 32, 32,166,200,200,200, 88, 32,200,200,200,200, 32, 32, 32, 66, 77, 77, 77, 32, 32, 32, 32,200,200, 32, 32, 32, 32, 32, 32,255, 32, 32, 32, 32, 32, 32,255,
259    32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,198,198,198,198, 32, 32, 32, 32, 32, 32,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198, 32,109,198,198,198,176, 32,198,198,198,198,198, 32, 98,121, 76, 32, 32, 54,109,198,198,198,198, 43, 32,198,198,198,198,198,198,198, 32, 32, 32, 32,198,198,198,198,198,198,198,198,198,198,198,198,255,255,255,255,255,255,255,255,
260    32, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 33,159,191,191,191,117, 36, 41, 41, 41, 41, 41, 34,108,191,191,191,191,191,191,191,191,191,117, 36, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,255,
261    32, 41, 97,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 78, 38, 64,190,192,192,192, 66, 66, 41, 41, 85,128, 65, 34,107,190,192,192,192,192,192,192,192,139, 48, 39, 41, 41,105,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 97, 41,255,
262    32, 41, 97,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 96, 36, 95,147,148,148,139, 55, 41, 41, 85,121,128, 91, 38, 75,137,158,190,190,190,170,139, 97, 49, 37, 41, 41,105,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 97, 41,255,
263    32, 41, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 41, 36, 45, 45, 45, 48, 38, 41, 41, 76, 76, 76, 76, 76, 37, 34, 42, 33, 33, 33, 39, 48, 59, 41, 41, 41, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 41,255,
264    32, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,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,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,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,255,255,255,255,255,255,255,255,255,255,
266   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,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,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
267 };
268
269 // doxygen logo alpha map
270 static unsigned char doxygen_a_png[3224] =
271 {
272     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
273     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
274     0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 66, 66, 66, 66,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
275     0,  0,  0,  0,  0,  0,  0,  0,  0,145,247,247,247,247,145,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
276     0,  0,  0,  0,  0,  0,  0,  0,  0,247,247,247,247,247,247,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
277     0,  0,  0,  0,  0,  0,  0,  0,  0,247,247,247,247,247,247,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
278     0,  0,  0,  0,  0,  0,  0,  0,  0,247,247,247,247,247,247,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
279     0,  0,  0,  0, 16,115,181,181,132,247,247,247,247,247,247,  0,  0,  0,  0,  0, 99,148,181,181,148, 99,  0,  0,  0,  0, 16, 66, 66, 66, 66, 16,  0,  0,  0,  0, 66, 66, 66, 66, 33, 66, 66, 66, 66, 16,  0,  0,  0, 16, 66, 66, 66, 66,  0,  0,  0,  0, 99,165,181,148, 66, 33, 66, 66, 66, 33,  0,  0,  0,  0,  0,  0, 82,132,181,181,181,115, 66,  0,  0,  0,  0,  0, 16, 66, 66, 66, 49,  0, 66,148,181,148, 49,  0,  0,  0,
280     0,  0,  0,129,247,247,247,247,247,247,247,247,247,247,247,  0,  0,  0,112,214,247,247,247,247,247,247,214,112,  0, 16,247,247,247,247,247,247, 46,  0,  0,145,247,247,247,247,247,247,247,247,247,247, 16,  0, 16,247,247,247,247,247, 66,  0, 63,165,247,247,247,247,247,247,247,247,247,247, 33,  0,  0,  0, 96,198,247,247,247,247,247,247,247,165, 63,  0,  0, 16,247,247,247,247,247,145,247,247,247,247,247,145,  0,  0,
281     0,  0,112,247,247,247,247,247,247,247,247,247,247,247,247,  0,  0,129,247,247,247,247,247,247,247,247,247,247,129,  0,181,247,247,247,247,247,148,  0,129,247,247,247,247,247,247,247,247,247,247,247,115,  0,115,247,247,247,247,247,165, 30,247,247,247,247,247,247,247,247,247,247,247,247,115,  0,  0,129,247,247,247,247,247,247,247,247,247,247,247, 63,  0, 66,247,247,247,247,247,247,247,247,247,247,247,247, 96,  0,
282     0, 16,247,247,247,247,247,247,247,247,247,247,247,247,247,  0, 79,247,247,247,247,247,247,247,247,247,247,247,247, 79, 79,247,247,247,247,247,247,129,247,247,247,247,247,247,129,247,247,247,247,247,198,  0,181,247,247,247,247,247, 99,145,247,247,247,247,247,247,247,247,247,247,247,247,115,  0, 96,247,247,247,247,247,247,247,247,247,247,247,247,165,  0, 66,247,247,247,247,247,247,247,247,247,247,247,247,198,  0,
283     0,115,247,247,247,247,247,247,247,247,247,247,247,247,247,  0,181,247,247,247,247,247,247,247,247,247,247,247,247,181,  0,129,247,247,247,247,247,247,247,247,247,247,247,145, 16,247,247,247,247,247,247, 33,247,247,247,247,247,247, 33,247,247,247,247,247,247,247,247,247,247,247,247,247,115,  0,198,247,247,247,247,247,198,181,247,247,247,247,247,247, 49, 66,247,247,247,247,247,247,247,247,247,247,247,247,247, 16,
284     0,214,247,247,247,247,247,129, 66,247,247,247,247,247,247, 33,247,247,247,247,247,247, 96, 96,247,247,247,247,247,247, 33,  0,145,247,247,247,247,247,247,247,247,247,198, 30,  0,165,247,247,247,247,247,115,247,247,247,247,247,165,115,247,247,247,247,247,181, 66,115,247,247,247,247,247,115, 82,247,247,247,247,247,165,115,115,148,247,247,247,247,247,115, 66,247,247,247,247,247,247,181,247,247,247,247,247,247, 66,
285    16,247,247,247,247,247,231,  0,  0,247,247,247,247,247,247, 82,247,247,247,247,247,165,  0,  0,165,247,247,247,247,247, 82,  0, 30,247,247,247,247,247,247,247,247,247, 96,  0,  0, 82,247,247,247,247,247,165,247,247,247,247,247, 99,165,247,247,247,247,247, 99,  0,115,247,247,247,247,247,115,132,247,247,247,247,247,247,247,247,247,247,247,247,247,247,181, 66,247,247,247,247,247,181,  0,198,247,247,247,247,247, 66,
286    66,247,247,247,247,247,181,  0,  0,247,247,247,247,247,247,115,247,247,247,247,247,115,  0,  0,115,247,247,247,247,247,115,  0,  0, 96,247,247,247,247,247,247,247,129,  0,  0,  0,  0,231,247,247,247,247,247,247,247,247,247,247, 16,181,247,247,247,247,247, 66,  0,115,247,247,247,247,247,115,181,247,247,247,247,247,247,247,247,247,247,247,247,247,247,181, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
287    66,247,247,247,247,247,181,  0,  0,247,247,247,247,247,247,115,247,247,247,247,247,115,  0,  0,115,247,247,247,247,247,115,  0,  0,  0,181,247,247,247,247,247,247, 30,  0,  0,  0,  0,148,247,247,247,247,247,247,247,247,247,148,  0,181,247,247,247,247,247, 66,  0,115,247,247,247,247,247,115,181,247,247,247,247,247,247,247,247,247,247,247,247,247,247,181, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
288    66,247,247,247,247,247,181,  0,  0,247,247,247,247,247,247,115,247,247,247,247,247,115,  0,  0,115,247,247,247,247,247,115,  0,  0,129,247,247,247,247,247,247,247,145,  0,  0,  0,  0, 82,247,247,247,247,247,247,247,247,247, 82,  0,181,247,247,247,247,247, 99,  0,115,247,247,247,247,247,115,181,247,247,247,247,247,247,247,247,247,247,247,247,247,181, 79, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
289    33,247,247,247,247,247,247, 14,  0,247,247,247,247,247,247, 66,247,247,247,247,247,181,  0,  0,165,247,247,247,247,247, 66,  0, 79,247,247,247,247,247,247,247,247,247,129,  0,  0,  0,  0,231,247,247,247,247,247,247,247,231,  0,  0,115,247,247,247,247,247,181,115,165,247,247,247,247,247,115,115,247,247,247,247,247,214, 63,  0,  0,  0, 16,112,247,247, 33, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
290     0,214,247,247,247,247,247,198,198,247,247,247,247,247,247, 16,247,247,247,247,247,247,132,132,247,247,247,247,247,247, 16, 14,181,247,247,247,247,247,247,247,247,247,247, 79,  0,  0,  0,132,247,247,247,247,247,247,247,148,  0,  0, 66,247,247,247,247,247,247,247,247,247,247,247,247,247,115, 33,247,247,247,247,247,247,247,198,181,181,247,247,247,247,115, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
291     0,148,247,247,247,247,247,247,247,247,247,247,247,247,247,  0,132,247,247,247,247,247,247,247,247,247,247,247,247,145,  0,145,247,247,247,247,247,247,247,247,247,247,247,181, 14,  0,  0, 49,247,247,247,247,247,247,247, 82,  0,  0,  0,198,247,247,247,247,247,247,247,247,247,247,247,247,115,  0,145,247,247,247,247,247,247,247,247,247,247,247,247,247,115, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
292     0, 46,247,247,247,247,247,247,247,247,247,247,247,247,247,  0, 30,247,247,247,247,247,247,247,247,247,247,247,247, 30,112,247,247,247,247,247,247, 96,247,247,247,247,247,247,145,  0,  0,  0,214,247,247,247,247,247,231,  0,  0,  0,  0, 96,247,247,247,247,247,247,247,247,247,247,247,247,115,  0, 30,148,247,247,247,247,247,247,247,247,247,247,247,247,115, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
293     0,  0,129,247,247,247,247,247,247,247,247,247,247,247,247,  0,  0, 96,247,247,247,247,247,247,247,247,247,247, 96, 16,247,247,247,247,247,247,145,  0,112,247,247,247,247,247,247, 49,  0,  0,181,247,247,247,247,247,148,  0,  0,  0,  0,  0,129,247,247,247,247,247,247,247,247,247,247,247,115,  0,  0, 46,148,247,247,247,247,247,247,247,247,247,247,247, 33, 66,247,247,247,247,247,181,  0,181,247,247,247,247,247, 66,
294     0,  0,  0,129,247,247,247,247,181,145,247,247,247,247,145,  0,  0,  0, 46,148,247,247,247,247,247,247,148, 46,  0,  0,112,214,247,247,247,145, 14,  0,  0,145,247,247,247,247,145,  0,  0, 33,247,247,247,247,247,247, 66,  0,  0,  0,  0,  0, 99,132,115,181,181,132,198,247,247,247,247,247, 82,  0,  0,  0,  0, 66,165,247,247,247,247,247,247,198,132, 33,  0,  0,145,247,247,247,181, 79,  0, 79,181,247,247,247,145,  0,
295     0,  0,  0,  0, 33,115,115, 82,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 33, 99,115,115, 99, 33,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,115,247,247,247,247,247,214,  0,  0,  0,  0,  0, 99,247,247,247,247,247,247,247,247,247,247,247,247, 16,  0,  0,  0,  0,  0,  0,  0, 49, 66, 66, 66,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
296     0,165,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,255,255,255,255,255,255,255,255,255,108,224,255,255,255,255,255,255,101,164,255,255,255,143,250,255,255,255,255,255,255,255,255,255,255,255, 98,170,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,165,  0,
297     0,165,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,255,255,255,255,255,255,255,255,255,136,251,255,255,255,255,255,255,101,130,255,255,255,153,250,255,255,255,255,255,255,255,255,255,255,121, 98,189,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,165,  0,
298     0,165,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,255,255,255,255,255,255,255,255,255,198,252,255,255,255,255,255,164,164,255,255,255,255,176,249,251,255,255,255,255,255,255,255,255,150, 86,192,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,165,  0,
299     0,165,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,255,255,255,255,255,255,255,255,255,164,198,255,255,255,255,201,133,164,255,255,255,255,255,145,203,255,255,255,255,255,255,255,117, 79,194,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,165,  0,
300     0, 66,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102, 73, 73,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102, 47, 70,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102, 66,  0,
301     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
302     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
303 };
304
305 // magnifying glass icon (raw png)
306 unsigned char mag_sel_png[] = {
307   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
308   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13,
309   0x08, 0x06, 0x00, 0x00, 0x00, 0x90, 0x8c, 0x2d, 0xb5, 0x00, 0x00, 0x00,
310   0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b,
311   0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48,
312   0x52, 0x4d, 0x00, 0x00, 0x6d, 0x98, 0x00, 0x00, 0x73, 0x8e, 0x00, 0x00,
313   0xe0, 0x38, 0x00, 0x00, 0x82, 0xd5, 0x00, 0x00, 0x7a, 0x07, 0x00, 0x00,
314   0xca, 0xb4, 0x00, 0x00, 0x33, 0x44, 0x00, 0x00, 0x1c, 0x76, 0x84, 0x36,
315   0x2a, 0xbd, 0x00, 0x00, 0x01, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
316   0xe4, 0x94, 0xbb, 0x8a, 0x22, 0x41, 0x14, 0x86, 0xbf, 0xda, 0x16, 0x3a,
317   0x10, 0xba, 0x03, 0x2f, 0x78, 0x03, 0x51, 0x11, 0x4c, 0xd4, 0x40, 0xd4,
318   0x37, 0x30, 0x31, 0x30, 0xe9, 0x07, 0xf0, 0x15, 0x14, 0x7c, 0x1e, 0x31,
319   0x37, 0x33, 0x11, 0x73, 0xe9, 0x56, 0x44, 0x84, 0x36, 0xe9, 0x40, 0x50,
320   0x54, 0x14, 0xc4, 0xc0, 0xa8, 0x6d, 0x50, 0x6a, 0x92, 0x1d, 0xd9, 0x9d,
321   0x99, 0x75, 0x0d, 0x26, 0x58, 0xd8, 0x3f, 0xaa, 0xe2, 0xfc, 0xf5, 0xd5,
322   0x39, 0x9c, 0x53, 0x25, 0xa4, 0x94, 0x7c, 0xa7, 0x7e, 0xf0, 0xcd, 0xfa,
323   0xf7, 0x81, 0xbe, 0xf7, 0xc5, 0xf9, 0x7c, 0x96, 0x93, 0xc9, 0x84, 0xe5,
324   0x72, 0xc9, 0x66, 0xb3, 0x21, 0x99, 0x4c, 0x92, 0xcf, 0xe7, 0xa9, 0x54,
325   0x2a, 0x04, 0x02, 0x01, 0xf1, 0x2a, 0x50, 0x48, 0x29, 0x39, 0x9d, 0x4e,
326   0x72, 0x30, 0x18, 0x60, 0x59, 0xd6, 0x27, 0x43, 0xb5, 0x5a, 0xa5, 0xd1,
327   0x68, 0x10, 0x0c, 0x06, 0xc5, 0xcb, 0x19, 0x4e, 0xa7, 0x53, 0x2c, 0xcb,
328   0x22, 0x95, 0x4a, 0x51, 0x2a, 0x95, 0xc8, 0x64, 0x32, 0xac, 0x56, 0x2b,
329   0x66, 0xb3, 0x19, 0x93, 0xc9, 0x84, 0x48, 0x24, 0x42, 0xbd, 0x5e, 0x7f,
330   0xbd, 0x64, 0xdb, 0xb6, 0x01, 0x28, 0x97, 0xcb, 0x54, 0x2a, 0x15, 0x34,
331   0x4d, 0x13, 0xa1, 0x50, 0x48, 0x2a, 0x8a, 0xc2, 0x7a, 0xbd, 0xc6, 0xb6,
332   0x6d, 0xea, 0xf5, 0x3a, 0xa3, 0xd1, 0x48, 0xf6, 0xfb, 0xfd, 0xc7, 0x61,
333   0xc3, 0x30, 0xa8, 0xd5, 0x6a, 0xe2, 0x53, 0x53, 0xb6, 0xdb, 0x2d, 0x00,
334   0xc5, 0x62, 0x11, 0x4d, 0xd3, 0x04, 0x80, 0xa6, 0x69, 0xa2, 0x50, 0x28,
335   0xf0, 0x6b, 0x1c, 0x10, 0x86, 0x61, 0x3c, 0x60, 0x80, 0xf8, 0xb2, 0xcb,
336   0x89, 0x44, 0x02, 0x00, 0xc7, 0x71, 0x00, 0xde, 0x27, 0x5d, 0xfe, 0xdc,
337   0x3f, 0xe2, 0x1f, 0xa0, 0xe2, 0x8f, 0x63, 0x93, 0xcb, 0xe5, 0x00, 0x18,
338   0x8f, 0xc7, 0x98, 0xa6, 0x89, 0xeb, 0xba, 0xd2, 0x34, 0x4d, 0xc6, 0xe3,
339   0x31, 0x00, 0xe9, 0x74, 0x1a, 0x80, 0x5a, 0xad, 0xf6, 0x80, 0x3e, 0xed,
340   0xf2, 0x7a, 0xbd, 0x96, 0xc3, 0xe1, 0x90, 0xf9, 0x7c, 0xfe, 0xa5, 0x29,
341   0x1c, 0x0e, 0xd3, 0xe9, 0x74, 0xd0, 0x75, 0x5d, 0x00, 0x8c, 0x46, 0xa3,
342   0x8f, 0x17, 0xfc, 0x0e, 0xf4, 0x3c, 0x4f, 0xee, 0x76, 0x3b, 0x16, 0x8b,
343   0x05, 0x8e, 0xe3, 0xb0, 0xdf, 0xef, 0x89, 0xc7, 0xe3, 0xa4, 0xd3, 0x69,
344   0x6c, 0xdb, 0xe6, 0x74, 0x3a, 0x11, 0x8d, 0x46, 0x69, 0xb7, 0xdb, 0x0f,
345   0xe8, 0xd3, 0x0c, 0x01, 0x3c, 0xcf, 0x93, 0xae, 0xeb, 0xe2, 0x79, 0x1e,
346   0xb7, 0xdb, 0x0d, 0x9f, 0xcf, 0x87, 0xa2, 0x28, 0x5c, 0x2e, 0x17, 0x7a,
347   0xbd, 0x1e, 0xc7, 0xe3, 0x91, 0x58, 0x2c, 0x46, 0xab, 0xd5, 0x7a, 0x0a,
348   0x7d, 0xbc, 0x14, 0x55, 0x55, 0x85, 0xaa, 0xaa, 0x9f, 0x0c, 0x7e, 0xbf,
349   0x5f, 0x36, 0x9b, 0x4d, 0xba, 0xdd, 0x2e, 0xd7, 0xeb, 0x95, 0xeb, 0xf5,
350   0x8a, 0xae, 0xeb, 0x7f, 0xcf, 0xf0, 0x99, 0x5c, 0xd7, 0x95, 0x87, 0xc3,
351   0x81, 0xfb, 0xfd, 0x4e, 0x36, 0x9b, 0x7d, 0xad, 0xe4, 0xff, 0xe7, 0xfb,
352   0x7a, 0x1b, 0x00, 0x59, 0xa8, 0xba, 0x68, 0xca, 0x4f, 0xc5, 0xa7, 0x00,
353   0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
354 };
355 unsigned int mag_sel_png_len = 563;
356
357 unsigned char mag_png[] = {
358   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
359   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13,
360   0x08, 0x06, 0x00, 0x00, 0x00, 0x90, 0x8c, 0x2d, 0xb5, 0x00, 0x00, 0x00,
361   0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b,
362   0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48,
363   0x52, 0x4d, 0x00, 0x00, 0x6d, 0x98, 0x00, 0x00, 0x73, 0x8e, 0x00, 0x00,
364   0xe0, 0x38, 0x00, 0x00, 0x82, 0xd5, 0x00, 0x00, 0x7a, 0x07, 0x00, 0x00,
365   0xca, 0xb4, 0x00, 0x00, 0x33, 0x44, 0x00, 0x00, 0x1c, 0x76, 0x84, 0x36,
366   0x2a, 0xbd, 0x00, 0x00, 0x01, 0x92, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
367   0xe4, 0x94, 0xbb, 0xaa, 0xea, 0x50, 0x10, 0x86, 0xbf, 0xec, 0x08, 0x29,
368   0x36, 0x24, 0x85, 0x17, 0xbc, 0x81, 0x18, 0x11, 0x6c, 0xd4, 0x42, 0x8c,
369   0x0f, 0x61, 0xe1, 0x2b, 0xf8, 0x0a, 0x0a, 0x3e, 0x8f, 0xf8, 0x0c, 0x36,
370   0x62, 0x1f, 0x92, 0x88, 0x88, 0x10, 0x9b, 0x14, 0x42, 0x44, 0x45, 0x41,
371   0x2c, 0xac, 0x92, 0x80, 0xb2, 0x4e, 0x73, 0x94, 0x03, 0xfb, 0xb0, 0x4d,
372   0xb1, 0x8b, 0x03, 0xe7, 0xaf, 0xd6, 0x62, 0xfe, 0xf5, 0x31, 0xc3, 0xcc,
373   0x1a, 0x49, 0x08, 0xc1, 0x4f, 0xea, 0x83, 0x1f, 0xd6, 0xbf, 0x0f, 0x4c,
374   0x3c, 0x0f, 0xd7, 0xeb, 0x55, 0x38, 0x8e, 0xc3, 0x66, 0xb3, 0x61, 0xb7,
375   0xdb, 0x51, 0x2a, 0x95, 0xa8, 0xd7, 0xeb, 0x18, 0x86, 0x41, 0x32, 0x99,
376   0x94, 0xe2, 0x02, 0x25, 0x21, 0x04, 0x97, 0xcb, 0x45, 0x4c, 0xa7, 0x53,
377   0x6c, 0xdb, 0xfe, 0x62, 0xe8, 0x74, 0x3a, 0xf4, 0x7a, 0x3d, 0x52, 0xa9,
378   0x94, 0x14, 0x3b, 0xc3, 0xc5, 0x62, 0x81, 0x6d, 0xdb, 0x94, 0xcb, 0x65,
379   0x5a, 0xad, 0x16, 0x95, 0x4a, 0x85, 0xed, 0x76, 0xcb, 0x72, 0xb9, 0xc4,
380   0x71, 0x1c, 0xb2, 0xd9, 0x2c, 0xdd, 0x6e, 0x37, 0x7e, 0xc9, 0xae, 0xeb,
381   0x02, 0xd0, 0x6e, 0xb7, 0x31, 0x0c, 0x03, 0x55, 0x55, 0xa5, 0x74, 0x3a,
382   0x2d, 0x64, 0x59, 0xc6, 0xf7, 0x7d, 0x5c, 0xd7, 0x8d, 0x0d, 0xfc, 0x00,
383   0xd8, 0xef, 0xf7, 0x00, 0x34, 0x9b, 0x4d, 0x54, 0x55, 0x95, 0x00, 0x54,
384   0x55, 0x95, 0x1a, 0x8d, 0x06, 0x7f, 0xc6, 0x63, 0x03, 0x8b, 0xc5, 0x22,
385   0x00, 0x9e, 0xe7, 0x01, 0x3c, 0x27, 0x5d, 0xfc, 0xbe, 0xbf, 0xe2, 0xb1,
386   0x81, 0xb5, 0x5a, 0x0d, 0x00, 0xd3, 0x34, 0xb1, 0x2c, 0x8b, 0x20, 0x08,
387   0x84, 0x65, 0x59, 0x98, 0xa6, 0x09, 0x80, 0xae, 0xeb, 0xaf, 0x07, 0xf3,
388   0xf9, 0xfc, 0x7d, 0x97, 0x7d, 0xdf, 0x17, 0xb3, 0xd9, 0x8c, 0xd5, 0x6a,
389   0xf5, 0x57, 0x53, 0x26, 0x93, 0x61, 0x34, 0x1a, 0xa1, 0x69, 0x9a, 0x14,
390   0x6b, 0x6c, 0xa2, 0x28, 0x12, 0x87, 0xc3, 0x81, 0xf5, 0x7a, 0x8d, 0xe7,
391   0x79, 0x1c, 0x8f, 0x47, 0x0a, 0x85, 0x02, 0xba, 0xae, 0xe3, 0xba, 0x2e,
392   0x97, 0xcb, 0x85, 0x5c, 0x2e, 0xc7, 0x70, 0x38, 0x7c, 0x0b, 0x95, 0x9e,
393   0xcb, 0x21, 0x8a, 0x22, 0x11, 0x04, 0x01, 0x51, 0x14, 0x71, 0xbf, 0xdf,
394   0x49, 0x24, 0x12, 0xc8, 0xb2, 0xcc, 0xed, 0x76, 0x63, 0x32, 0x99, 0x70,
395   0x3e, 0x9f, 0xc9, 0xe7, 0xf3, 0x0c, 0x06, 0x83, 0x6f, 0xa1, 0xaf, 0x9f,
396   0xa2, 0x28, 0x8a, 0xa4, 0x28, 0xca, 0x17, 0xc3, 0xe7, 0xe7, 0xa7, 0xe8,
397   0xf7, 0xfb, 0x8c, 0xc7, 0x63, 0xc2, 0x30, 0x24, 0x0c, 0x43, 0x34, 0x4d,
398   0x7b, 0x9f, 0xe1, 0x77, 0x0a, 0x82, 0x40, 0x9c, 0x4e, 0x27, 0x1e, 0x8f,
399   0x07, 0xd5, 0x6a, 0x35, 0x5e, 0xc9, 0xff, 0xcf, 0xfa, 0xfa, 0x35, 0x00,
400   0x70, 0xf3, 0xae, 0xcb, 0x89, 0xcd, 0xd2, 0x46, 0x00, 0x00, 0x00, 0x00,
401   0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
402 };
403 unsigned int mag_png_len = 524;
404
405 unsigned char search_l_png[] = {
406   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
407   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13,
408   0x08, 0x06, 0x00, 0x00, 0x00, 0x90, 0x8c, 0x2d, 0xb5, 0x00, 0x00, 0x00,
409   0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b,
410   0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48,
411   0x52, 0x4d, 0x00, 0x00, 0x6d, 0x98, 0x00, 0x00, 0x73, 0x8e, 0x00, 0x00,
412   0xe0, 0x38, 0x00, 0x00, 0x82, 0xd5, 0x00, 0x00, 0x7a, 0x07, 0x00, 0x00,
413   0xca, 0xb4, 0x00, 0x00, 0x33, 0x44, 0x00, 0x00, 0x1c, 0x76, 0x84, 0x36,
414   0x2a, 0xbd, 0x00, 0x00, 0x01, 0xe2, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
415   0xac, 0x54, 0x3d, 0xab, 0xda, 0x50, 0x18, 0x7e, 0xce, 0xc9, 0x39, 0x31,
416   0x4d, 0xfc, 0x40, 0x30, 0x46, 0x14, 0xec, 0x50, 0x44, 0x17, 0x2f, 0x9d,
417   0xba, 0x15, 0xda, 0xd1, 0xa1, 0x2e, 0xdd, 0x3b, 0x14, 0x4a, 0xa1, 0x7f,
418   0xa6, 0x74, 0xbd, 0x43, 0xff, 0x84, 0xfd, 0x05, 0x82, 0xda, 0xa5, 0x83,
419   0x1d, 0xdc, 0x8a, 0x88, 0xa0, 0x44, 0x83, 0xc6, 0x28, 0xad, 0x1f, 0x49,
420   0xde, 0x2e, 0x8d, 0x78, 0x6f, 0xaf, 0x34, 0x68, 0x9f, 0xed, 0xbc, 0x70,
421   0x1e, 0x9e, 0x8f, 0xf7, 0x1c, 0x46, 0x44, 0x38, 0x45, 0xaf, 0xd7, 0x63,
422   0xb6, 0x6d, 0xe7, 0x6d, 0xdb, 0x6e, 0xba, 0xae, 0xfb, 0x6e, 0xb3, 0xd9,
423   0xdc, 0x6c, 0xb7, 0xdb, 0x04, 0xe7, 0x1c, 0x8c, 0x31, 0xfc, 0x0b, 0x2c,
424   0x22, 0xec, 0x76, 0xbb, 0xcc, 0xf3, 0xbc, 0xcc, 0x68, 0x34, 0x7a, 0xed,
425   0xba, 0xee, 0x87, 0x6c, 0x36, 0x7b, 0x93, 0xcb, 0xe5, 0x44, 0x3a, 0x9d,
426   0x86, 0xa6, 0x69, 0x50, 0x14, 0x25, 0x3e, 0x61, 0xa7, 0xd3, 0x61, 0xf3,
427   0xf9, 0xfc, 0xc9, 0x78, 0x3c, 0xbe, 0xd5, 0x75, 0xfd, 0x79, 0xa5, 0x52,
428   0x11, 0xa6, 0x69, 0x22, 0x95, 0x4a, 0x41, 0xd3, 0x34, 0x08, 0x21, 0xc0,
429   0x18, 0x8b, 0x45, 0x28, 0x00, 0x60, 0xb5, 0x5a, 0xa5, 0x27, 0x93, 0xc9,
430   0xa7, 0x62, 0xb1, 0xf8, 0xb2, 0x5a, 0xad, 0x22, 0x9f, 0xcf, 0xc3, 0x30,
431   0x0c, 0x48, 0x29, 0xc1, 0x39, 0x47, 0x5c, 0xbb, 0x00, 0x20, 0xda, 0xed,
432   0x36, 0x9f, 0x4e, 0xa7, 0xaf, 0x4c, 0xd3, 0x7c, 0x51, 0xaf, 0xd7, 0x61,
433   0x59, 0x16, 0x74, 0x5d, 0x87, 0x94, 0x12, 0x97, 0x40, 0x2c, 0x16, 0x0b,
434   0x93, 0x88, 0xde, 0xd6, 0x6a, 0x35, 0xdd, 0xb2, 0x2c, 0x18, 0x86, 0x01,
435   0x21, 0x04, 0x2e, 0x05, 0xf7, 0x3c, 0xaf, 0x59, 0x2e, 0x97, 0x9f, 0x45,
436   0xca, 0x38, 0xe7, 0xb8, 0x06, 0x3c, 0x08, 0x82, 0x46, 0xa1, 0x50, 0x78,
437   0x74, 0xad, 0xb2, 0x23, 0xa1, 0x94, 0xf2, 0x69, 0x26, 0x93, 0xe1, 0x51,
438   0x66, 0xf7, 0xf7, 0xd2, 0xf7, 0xfd, 0x07, 0x2f, 0x9e, 0x9b, 0x73, 0x55,
439   0x55, 0xb3, 0x91, 0x55, 0xc6, 0x18, 0xc2, 0x30, 0xbc, 0x1b, 0xf2, 0x19,
440   0xd5, 0xe7, 0xe6, 0x5c, 0x4a, 0x39, 0x06, 0x70, 0x5c, 0x8b, 0xb8, 0xeb,
441   0x71, 0xd6, 0x32, 0x11, 0x75, 0xf6, 0xfb, 0xfd, 0xd1, 0xea, 0xd5, 0xa5,
442   0x10, 0xd1, 0xb7, 0xf5, 0x7a, 0x1d, 0x84, 0x61, 0x08, 0x22, 0xba, 0x9e,
443   0x50, 0x51, 0x94, 0xaf, 0x8e, 0xe3, 0xfc, 0xdc, 0xed, 0x76, 0xf8, 0x1f,
444   0xe0, 0x89, 0x44, 0xe2, 0xc7, 0x72, 0xb9, 0xfc, 0xee, 0x38, 0x0e, 0x7c,
445   0xdf, 0x3f, 0x5a, 0xbf, 0xdf, 0x76, 0x6c, 0xc2, 0x46, 0xa3, 0xf1, 0x2b,
446   0x08, 0x82, 0xdb, 0xe1, 0x70, 0xe8, 0x2c, 0x16, 0x0b, 0x04, 0x41, 0x00,
447   0x22, 0xba, 0xb8, 0x1c, 0xfe, 0x67, 0x05, 0xbe, 0x78, 0x9e, 0xf7, 0x79,
448   0x30, 0x18, 0x8c, 0x67, 0xb3, 0x19, 0x45, 0x25, 0x9d, 0x53, 0x49, 0x44,
449   0x38, 0x1c, 0x0e, 0x38, 0x2d, 0xf3, 0xce, 0x6f, 0x03, 0x60, 0x29, 0x84,
450   0xf8, 0xe8, 0x79, 0x9e, 0xdb, 0xef, 0xf7, 0xdf, 0x97, 0x4a, 0xa5, 0xc7,
451   0xd1, 0x53, 0x54, 0x55, 0x15, 0x52, 0xca, 0xbf, 0x14, 0x0b, 0x21, 0x1e,
452   0x8c, 0x87, 0x9d, 0x1e, 0x5a, 0xad, 0x96, 0x00, 0x50, 0x27, 0xa2, 0x37,
453   0xaa, 0xaa, 0x36, 0x0d, 0xc3, 0x28, 0x26, 0x93, 0x49, 0xa1, 0x69, 0x9a,
454   0xc2, 0x39, 0x8f, 0x95, 0xc1, 0xef, 0x01, 0x00, 0x35, 0xe5, 0xd5, 0x5e,
455   0xd0, 0xed, 0x0c, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
456   0xae, 0x42, 0x60, 0x82
457 };
458 unsigned int search_l_png_len = 604;
459
460 unsigned char search_m_png[] = {
461   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
462   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13,
463   0x08, 0x02, 0x00, 0x00, 0x00, 0x35, 0x5e, 0x4b, 0x4d, 0x00, 0x00, 0x00,
464   0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xd6, 0xd8, 0xd4, 0x4f, 0x58,
465   0x32, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, 0x66,
466   0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20,
467   0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x71, 0xc9,
468   0x65, 0x3c, 0x00, 0x00, 0x00, 0x30, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
469   0x62, 0x2c, 0x2f, 0x2f, 0x67, 0x60, 0x60, 0x60, 0x3c, 0x7e, 0xfc, 0x38,
470   0x88, 0xfa, 0xf8, 0xf1, 0x23, 0x88, 0xfa, 0xff, 0xff, 0x3f, 0x90, 0x62,
471   0x62, 0x00, 0x03, 0x5a, 0x50, 0x2c, 0x10, 0x1b, 0x58, 0x6e, 0xdd, 0xba,
472   0x05, 0xa4, 0x00, 0x02, 0x0c, 0x00, 0xa5, 0x07, 0x0f, 0x3c, 0x7e, 0xe1,
473   0x45, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
474   0x60, 0x82
475 };
476 unsigned int search_m_png_len = 158;
477
478 unsigned char search_r_png[] = {
479   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
480   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13,
481   0x08, 0x06, 0x00, 0x00, 0x00, 0x9d, 0x92, 0x5d, 0xf2, 0x00, 0x00, 0x00,
482   0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b,
483   0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48,
484   0x52, 0x4d, 0x00, 0x00, 0x6d, 0x98, 0x00, 0x00, 0x73, 0x8e, 0x00, 0x00,
485   0xe0, 0x38, 0x00, 0x00, 0x82, 0xd5, 0x00, 0x00, 0x7a, 0x07, 0x00, 0x00,
486   0xca, 0xb4, 0x00, 0x00, 0x33, 0x44, 0x00, 0x00, 0x1c, 0x76, 0x84, 0x36,
487   0x2a, 0xbd, 0x00, 0x00, 0x01, 0xea, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda,
488   0xa4, 0xd4, 0xbf, 0xaa, 0x1a, 0x41, 0x14, 0x06, 0xf0, 0x6f, 0xf6, 0x9f,
489   0xb2, 0x0a, 0x6b, 0xa5, 0x56, 0x8b, 0xa4, 0x92, 0xd4, 0x69, 0x7c, 0x03,
490   0xb1, 0x59, 0x49, 0x11, 0x52, 0xdf, 0xbc, 0x43, 0xcc, 0x2b, 0xa4, 0x4c,
491   0x97, 0x67, 0x08, 0xa4, 0x11, 0x2c, 0x52, 0x5c, 0x42, 0x24, 0x60, 0x8a,
492   0x34, 0x29, 0x42, 0x50, 0x41, 0x21, 0xa0, 0x97, 0xd5, 0x55, 0xb3, 0xbb,
493   0xee, 0xb2, 0xce, 0xee, 0xcc, 0x49, 0x91, 0x28, 0xc2, 0x0d, 0xe6, 0xaa,
494   0xa7, 0x9d, 0xc3, 0x8f, 0x73, 0x98, 0xf9, 0x86, 0x75, 0x3a, 0x1d, 0xc2,
495   0x89, 0x12, 0x42, 0x24, 0xf9, 0x7c, 0x7e, 0x5a, 0x2c, 0x16, 0x3f, 0x96,
496   0x4a, 0xa5, 0x5e, 0xb5, 0x5a, 0xfd, 0x52, 0x2e, 0x97, 0xfd, 0x46, 0xa3,
497   0x21, 0x8e, 0xfb, 0xd8, 0x60, 0x30, 0x38, 0x09, 0x65, 0x59, 0x86, 0x24,
498   0x49, 0x10, 0x04, 0x81, 0xf0, 0x3c, 0x6f, 0xb3, 0xd9, 0x6c, 0x7e, 0x58,
499   0x96, 0x75, 0x5b, 0xab, 0xd5, 0xde, 0x34, 0x9b, 0xcd, 0x5f, 0x07, 0xc8,
500   0xf7, 0xfd, 0x93, 0x90, 0x94, 0xf2, 0x80, 0x85, 0x61, 0x88, 0xe5, 0x72,
501   0x49, 0xe3, 0xf1, 0x58, 0xc6, 0x71, 0xfc, 0xc1, 0xb6, 0xed, 0xe7, 0x8e,
502   0xe3, 0x84, 0x00, 0xc0, 0xa4, 0x94, 0x27, 0x21, 0x22, 0x82, 0x94, 0x12,
503   0x52, 0x4a, 0xa4, 0x69, 0x8a, 0x28, 0x8a, 0xb0, 0x58, 0x2c, 0x30, 0x1c,
504   0x0e, 0x85, 0xeb, 0xba, 0xef, 0x6b, 0xb5, 0xda, 0x4d, 0xab, 0xd5, 0x8a,
505   0x34, 0xc6, 0xd8, 0x29, 0x07, 0x8c, 0x31, 0x28, 0x8a, 0x02, 0x22, 0x82,
506   0xae, 0xeb, 0x30, 0x0c, 0x03, 0xb9, 0x5c, 0x0e, 0x86, 0x61, 0xa8, 0x52,
507   0xca, 0xa7, 0xf3, 0xf9, 0xfc, 0x67, 0xbf, 0xdf, 0x7f, 0xa5, 0xe0, 0x81,
508   0xc5, 0x18, 0x03, 0x63, 0x0c, 0x9a, 0xa6, 0xa1, 0x50, 0x28, 0xa0, 0x52,
509   0xa9, 0xa0, 0x5e, 0xaf, 0x6b, 0x00, 0x5e, 0xac, 0xd7, 0xeb, 0x47, 0x0f,
510   0x86, 0x8e, 0x41, 0x55, 0x55, 0x61, 0x9a, 0x26, 0x2a, 0x95, 0x0a, 0x6c,
511   0xdb, 0xb6, 0x82, 0x20, 0x78, 0x76, 0x36, 0xb4, 0xc7, 0xf6, 0x93, 0x55,
512   0xab, 0x55, 0x26, 0x84, 0x78, 0xac, 0x1c, 0x5f, 0xf3, 0xb9, 0xa5, 0xeb,
513   0x3a, 0x2c, 0xcb, 0x82, 0xae, 0xeb, 0xbb, 0x03, 0xa4, 0x69, 0xda, 0xd9,
514   0x53, 0x29, 0x8a, 0x02, 0xd3, 0x34, 0x99, 0x61, 0x18, 0xcb, 0x8b, 0x56,
515   0x3b, 0xc6, 0xfe, 0x4e, 0x76, 0x77, 0x15, 0x44, 0x44, 0xe0, 0x9c, 0x0b,
516   0x22, 0xfa, 0xaa, 0x5c, 0x83, 0x48, 0x29, 0x11, 0x86, 0xe1, 0x86, 0x88,
517   0xbe, 0x5f, 0x35, 0xd1, 0x6e, 0xb7, 0x83, 0xe7, 0x79, 0x3d, 0x55, 0x55,
518   0x7d, 0xd0, 0x05, 0x25, 0xa5, 0x24, 0xce, 0x39, 0x4d, 0x26, 0x93, 0x45,
519   0xb7, 0xdb, 0x7d, 0x42, 0x44, 0x50, 0x2e, 0x59, 0x49, 0x08, 0x81, 0xf5,
520   0x7a, 0x9d, 0x4c, 0xa7, 0xd3, 0x77, 0x42, 0x88, 0x6f, 0x00, 0xa0, 0xed,
521   0x0f, 0xb3, 0x2c, 0x3b, 0xe4, 0xe9, 0x5f, 0xf9, 0x23, 0xfa, 0x93, 0x6d,
522   0xce, 0x39, 0x56, 0xab, 0x95, 0x18, 0x0e, 0x87, 0x9f, 0x82, 0x20, 0x78,
523   0xdd, 0x6e, 0xb7, 0xd3, 0x7b, 0xe9, 0x27, 0xa2, 0x7b, 0x08, 0x11, 0x21,
524   0x4d, 0x53, 0x70, 0xce, 0x11, 0xc7, 0xb1, 0x74, 0x5d, 0xd7, 0x9f, 0xcd,
525   0x66, 0x3d, 0xce, 0xf9, 0x4b, 0xc7, 0x71, 0xee, 0x0e, 0xef, 0x70, 0x34,
526   0x1a, 0xe1, 0x7f, 0xff, 0x51, 0x92, 0x24, 0xd8, 0x6e, 0xb7, 0x61, 0x14,
527   0x45, 0x9f, 0x39, 0xe7, 0x6f, 0x19, 0x63, 0xb7, 0x8e, 0xe3, 0x44, 0xc7,
528   0x7d, 0xbf, 0x07, 0x00, 0x5f, 0x77, 0x46, 0x8c, 0x30, 0x2c, 0xd8, 0x9d,
529   0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
530 };
531 unsigned int search_r_png_len = 612;
532
533 static unsigned char close_png[] = {
534   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
535   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0b,
536   0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0xac, 0x77, 0x26, 0x00, 0x00, 0x00,
537   0xd8, 0x49, 0x44, 0x41, 0x54, 0x18, 0x19, 0x75, 0x51, 0xbd, 0x12, 0x46,
538   0x40, 0x0c, 0xdc, 0x18, 0x15, 0x0a, 0x14, 0x14, 0x1a, 0x43, 0xeb, 0x35,
539   0xbc, 0x7f, 0xa7, 0x43, 0x67, 0x06, 0x33, 0x28, 0xd0, 0xde, 0x77, 0x7b,
540   0x23, 0x2a, 0xdf, 0x16, 0x97, 0x9f, 0xdb, 0xcb, 0x26, 0x39, 0xc1, 0x83,
541   0x7d, 0xdf, 0xcd, 0xb2, 0x2c, 0xd8, 0xb6, 0x0d, 0xe7, 0x79, 0x22, 0x8a,
542   0x22, 0xc4, 0x71, 0x8c, 0x3c, 0xcf, 0x91, 0xa6, 0xa9, 0x90, 0xe6, 0x8e,
543   0x69, 0x9a, 0xcc, 0x38, 0x8e, 0xb8, 0xae, 0x4b, 0xdf, 0xbe, 0x36, 0x0c,
544   0x43, 0x94, 0x65, 0x89, 0xa2, 0x28, 0xc4, 0x3b, 0x8e, 0xe3, 0x2f, 0x91,
545   0x2f, 0xa8, 0xc2, 0x42, 0x56, 0xd1, 0x78, 0xf3, 0x3c, 0xbb, 0x04, 0x2f,
546   0xda, 0xb6, 0x45, 0x55, 0x55, 0x74, 0x9d, 0x65, 0x2c, 0x22, 0xb8, 0xef,
547   0x1b, 0xeb, 0xba, 0xc2, 0x67, 0x8f, 0x4c, 0x10, 0x7d, 0xdf, 0xa3, 0xae,
548   0x6b, 0xe7, 0xd3, 0x32, 0x56, 0x90, 0xe7, 0x53, 0x46, 0x31, 0x0c, 0x83,
549   0x73, 0x95, 0xa8, 0x31, 0x93, 0x9c, 0xc7, 0xe3, 0xd4, 0x0a, 0xb6, 0xa0,
550   0x44, 0x5a, 0xc6, 0xc6, 0x18, 0x77, 0xcd, 0x41, 0xbd, 0x24, 0x49, 0x94,
551   0xfb, 0x12, 0x59, 0x51, 0x5b, 0xd2, 0x16, 0xed, 0xfa, 0x20, 0xdc, 0x6f,
552   0xd7, 0x75, 0x9f, 0x6b, 0xd3, 0x2a, 0x41, 0x10, 0xa0, 0x69, 0x1a, 0x57,
553   0x59, 0x28, 0x47, 0x99, 0x2f, 0x30, 0xcf, 0x7b, 0xfb, 0x41, 0xcf, 0x1a,
554   0x2c, 0xeb, 0xeb, 0x07, 0x29, 0x9d, 0x65, 0x19, 0x6c, 0xab, 0x6e, 0x5d,
555   0x3f, 0x07, 0x0a, 0x79, 0x90, 0x0e, 0x11, 0x45, 0xc2, 0x00, 0x00, 0x00,
556   0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
557 };
558 static unsigned int close_png_len = 273;
559
560
561 static unsigned char closed_png[81] =
562 {
563   0,  0,  0,  0,142,  0,  0,  0,  0,
564   0,  0,  0,  0,142,142,  0,  0,  0,
565   0,  0,  0,  0,142,142,142,  0,  0,
566   0,  0,  0,  0,142,142,142,142,  0,
567   0,  0,  0,  0,142,142,142,142,142,
568   0,  0,  0,  0,142,142,142,142,  0,
569   0,  0,  0,  0,142,142,142,  0,  0,
570   0,  0,  0,  0,142,142,  0,  0,  0,
571   0,  0,  0,  0,142,  0,  0,  0,  0
572 };
573
574 static unsigned char closed_a_png[81] =
575 {
576   0,  0,  0,  0,255,  0,  0,  0,  0,
577   0,  0,  0,  0,255,255,  0,  0,  0,
578   0,  0,  0,  0,255,255,255,  0,  0,
579   0,  0,  0,  0,255,255,255,255,  0,
580   0,  0,  0,  0,255,255,255,255,255,
581   0,  0,  0,  0,255,255,255,255,  0,
582   0,  0,  0,  0,255,255,255,  0,  0,
583   0,  0,  0,  0,255,255,  0,  0,  0,
584   0,  0,  0,  0,255,  0,  0,  0,  0
585 };
586
587 static unsigned char open_png[81] =
588 {
589     0,  0,  0,  0,  0,  0,  0,  0,  0,
590     0,  0,  0,  0,  0,  0,  0,  0,  0,
591     0,  0,  0,  0,  0,  0,  0,  0,  0,
592     0,  0,  0,  0,  0,  0,  0,  0,  0,
593   142,142,142,142,142,142,142,142,142,
594     0,142,142,142,142,142,142,142,  0,
595     0,  0,142,142,142,142,142,  0,  0,
596     0,  0,  0,142,142,142,  0,  0,  0,
597     0,  0,  0,  0,142,  0,  0,  0,  0
598 };
599
600 static unsigned char open_a_png[81] =
601 {
602     0,  0,  0,  0,  0,  0,  0,  0,  0,
603     0,  0,  0,  0,  0,  0,  0,  0,  0,
604     0,  0,  0,  0,  0,  0,  0,  0,  0,
605     0,  0,  0,  0,  0,  0,  0,  0,  0,
606   255,255,255,255,255,255,255,255,255,
607     0,255,255,255,255,255,255,255,  0,
608     0,  0,255,255,255,255,255,  0,  0,
609     0,  0,  0,255,255,255,  0,  0,  0,
610     0,  0,  0,  0,255,  0,  0,  0,  0
611 };
612
613 static unsigned char bdwn_png[7*8] =
614 {
615     0,  0,  0,142,  0,  0,  0,
616     0,  0,  0,142,  0,  0,  0,
617     0,  0,  0,142,  0,  0,  0,
618   142,  0,  0,142,  0,  0,142,
619   142,142,  0,142,  0,142,142,
620   142,142,142,142,142,142,142,
621     0,142,142,142,142,142,  0,
622     0,  0,142,142,142,  0,  0,
623 };
624
625 static unsigned char bdwn_a_png[7*8] =
626 {
627     0,  0,  0,255,  0,  0,  0,
628     0,  0,  0,255,  0,  0,  0,
629     0,  0,  0,255,  0,  0,  0,
630   128,  0,  0,255,  0,  0,128,
631   255,128,  0,255,  0,128,255,
632   128,255,128,255,128,255,128,
633     0,128,255,255,255,128,  0,
634     0,  0,128,255,128,  0,  0,
635 };
636
637 static unsigned char sync_on_png[576] =
638 {
639   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
640   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
641   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
642   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
643   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
644   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
645   128,128,128,128,128,128,128,128,128,138,128,128,128,128,133,128,128,128,128,128,128,128,128,128,
646   128,128,128,128,128,128,128,129,205,186,128,128,128,128,160,210,134,128,128,128,128,128,128,128,
647   128,128,128,128,128,128,139,217,255,181,128,128,128,128,152,255,229,147,128,128,128,128,128,128,
648   128,128,128,128,128,156,236,255,255,181,128,128,128,128,152,255,255,243,164,128,128,128,128,128,
649   128,128,128,128,175,249,255,255,255,223,196,198,198,197,211,255,255,255,253,186,128,128,128,128,
650   128,128,133,202,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,214,137,128,128,
651   128,128,135,217,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,140,128,128,
652   128,128,128,128,189,255,255,255,255,238,224,225,225,224,232,255,255,255,255,201,131,128,128,128,
653   128,128,128,128,128,167,245,255,255,183,128,128,128,128,155,255,255,250,179,128,128,128,128,128,
654   128,128,128,128,128,128,150,231,255,188,128,128,128,128,161,255,238,158,128,128,128,128,128,128,
655   128,128,128,128,128,128,128,136,216,188,128,128,128,128,161,223,142,128,128,128,128,128,128,128,
656   128,128,128,128,128,128,128,128,130,141,128,128,128,128,135,132,128,128,128,128,128,128,128,128,
657   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
658   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
659   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
660   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
661   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
662   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128
663 };
664
665 static unsigned char sync_off_png[576] =
666 {
667   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
668   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
669   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
670   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
671   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
672   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
673   128,128,128,128,128,128,128,128,138,128,128,128,128,128,128,133,128,128,128,128,128,128,128,128,
674   128,128,128,128,128,128,129,205,186,128,128,128,128,128,128,160,210,134,128,128,128,128,128,128,
675   128,128,128,128,128,139,217,255,181,128,128,128,128,128,128,152,255,229,147,128,128,128,128,128,
676   128,128,128,128,156,236,255,255,181,128,128,128,128,128,128,152,255,255,243,164,128,128,128,128,
677   128,128,128,175,249,255,255,255,223,196,198,198,128,128,197,211,255,255,255,253,186,128,128,128,
678   128,128,202,255,255,255,255,255,255,255,255,225,128,128,255,255,255,255,255,255,255,214,128,128,
679   128,128,217,255,255,255,255,255,255,255,255,128,128,198,255,255,255,255,255,255,255,225,128,128,
680   128,128,128,189,255,255,255,255,238,224,225,128,128,225,224,232,255,255,255,255,201,128,128,128,
681   128,128,128,128,167,245,255,255,183,128,128,128,128,128,128,155,255,255,250,179,128,128,128,128,
682   128,128,128,128,128,150,231,255,188,128,128,128,128,128,128,161,255,238,158,128,128,128,128,128,
683   128,128,128,128,128,128,136,216,188,128,128,128,128,128,128,161,223,142,128,128,128,128,128,128,
684   128,128,128,128,128,128,128,130,141,128,128,128,128,128,128,135,132,128,128,128,128,128,128,128,
685   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
686   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
687   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
688   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
689   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
690   128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128
691 };
692
693 static unsigned char sync_a_png[576] =
694 {
695     0,  0,  0,  0,  0,  0,  0, 29, 98,157,207,231,234,211,164,104, 38,  0,  0,  0,  0,  0,  0,  0,
696     0,  0,  0,  0,  0, 21,143,234,255,255,255,255,255,255,255,255,244,155, 33,  0,  0,  0,  0,  0,
697     0,  0,  0,  0, 70,221,255,255,255,255,255,255,255,255,255,255,255,255,235, 93,  0,  0,  0,  0,
698     0,  0,  0, 92,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,116,  0,  0,  0,
699     0,  0, 68,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 96,  0,  0,
700     0, 20,225,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,243, 41,  0,
701     0,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,172,  1,
702    28,238,255,255,255,255,255,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 42,
703    99,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,133,
704   160,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,204,
705   212,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,224,
706   234,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,237,255,236,
707   235,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,230,255,236,
708   216,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,226,
709   168,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,208,
710   107,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,147,
711    39,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 53,
712     0,159,255,255,255,255,255,255,251,255,255,255,255,255,255,255,255,255,255,255,255,255,190,  3,
713     0, 31,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249, 54,  0,
714     0,  0, 91,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,119,  0,  0,
715     0,  0,  0,116,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,145,  0,  0,  0,
716     0,  0,  0,  0, 98,240,255,255,255,255,255,255,255,255,255,255,255,255,248,119,  0,  0,  0,  0,
717     0,  0,  0,  0,  0, 45,168,252,255,255,255,255,255,255,255,255,255,184, 58,  0,  0,  0,  0,  0,
718     0,  0,  0,  0,  0,  0,  0, 45,131,201,222,234,236,224,204,142, 54,  0,  0,  0,  0,  0,  0,  0
719 };
720
721
722 //------------------------------------------------------------------------
723
724 static const char tabs_css[] = 
725 ".tabs, .tabs2, .tabs3 {\n"
726 "    background-image: url('tab_b.png');\n"
727 "    width: 100%;\n"
728 "    z-index: 101;\n"
729 "    font-size: 13px;\n"
730 "    font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;\n"
731 "}\n"
732 "\n"
733 ".tabs2 {\n"
734 "    font-size: 10px;\n"
735 "}\n"
736 ".tabs3 {\n"
737 "    font-size: 9px;\n"
738 "}\n"
739 "\n"
740 ".tablist {\n"
741 "    margin: 0;\n"
742 "    padding: 0;\n"
743 "    display: table;\n"
744 "}\n"
745 "\n"
746 ".tablist li {\n"
747 "    float: left;\n"
748 "    display: table-cell;\n"
749 "    background-image: url('tab_b.png');\n"
750 "    line-height: 36px;\n"
751 "    list-style: none;\n"
752 "}\n"
753 "\n"
754 ".tablist a {\n"
755 "    display: block;\n"
756 "    padding: 0 20px;\n"
757 "    font-weight: bold;\n"
758 "    background-image:url('tab_s.png');\n"
759 "    background-repeat:no-repeat;\n"
760 "    background-position:right;\n"
761 "    color: ##30;\n"
762 "    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);\n"
763 "    text-decoration: none;\n"
764 "    outline: none;\n"
765 "}\n"
766 "\n"
767 ".tabs3 .tablist a {\n"
768 "    padding: 0 10px;\n"
769 "}\n"
770 "\n"
771 ".tablist a:hover {\n"
772 "    background-image: url('tab_h.png');\n"
773 "    background-repeat:repeat-x;\n"
774 "    color: #fff;\n"
775 "    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);\n"
776 "    text-decoration: none;\n"
777 "}\n"
778 "\n"
779 ".tablist li.current a {\n"
780 "    background-image: url('tab_a.png');\n"
781 "    background-repeat:repeat-x;\n"
782 "    color: #fff;\n"
783 "    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);\n"
784 "}\n"
785 ;
786
787 struct img_data_item
788 {
789   const char *name;
790   unsigned char *content;
791   unsigned int len;
792 };
793
794
795 static void writeImgData(const char *dir,img_data_item *data)
796 {
797   while (data->name)
798   {
799     QCString fileName;
800     fileName=(QCString)dir+"/"+data->name;
801     QFile f(fileName);
802     if (f.open(IO_WriteOnly))
803     {
804       f.writeBlock((char*)data->content,
805                     data->len>0 ? data->len : strlen((char*)data->content));
806     }
807     else
808     {
809       fprintf(stderr,"Warning: Cannot open file %s for writing\n",data->name);
810     }
811     Doxygen::indexList.addImageFile(QCString("/search/")+data->name);
812     data++;
813   }
814 }
815
816 static ColoredImgDataItem colored_tab_data[] =
817 {
818   // file_name      W   H  luma_data        alpha_data
819   { "tab_a.png",    1, 36, tab_a_png,       0 },
820   { "tab_b.png",    1, 36, tab_b_png,       0 },
821   { "tab_h.png",    1, 36, tab_h_png,       0 },
822   { "tab_s.png",    1, 36, tab_s_png,       0 },
823   { "nav_h.png",    1, 12, header_png,      0 },
824   { "nav_f.png",    1, 56, func_header_png, 0 },
825   { "bc_s.png",     8, 30, bc_s_png,        bc_s_a_png },
826   { "doxygen.png", 104,31, doxygen_png,     doxygen_a_png },
827   { "closed.png",   9,  9, closed_png,      closed_a_png },
828   { "open.png",     9,  9, open_png,        open_a_png },
829   { "bdwn.png",     7,  8, bdwn_png,        bdwn_a_png },
830   { "sync_on.png", 24, 24, sync_on_png,     sync_a_png },
831   { "sync_off.png",24, 24, sync_off_png,    sync_a_png },
832   { 0, 0, 0, 0, 0 }
833 };
834
835 static img_data_item search_client_data[] =
836 {
837   // file_name          raw_data          num bytes
838   { "mag_sel.png",      mag_sel_png,      mag_sel_png_len  },
839   { "search_l.png",     search_l_png,     search_l_png_len },
840   { "search_m.png",     search_m_png,     search_m_png_len },
841   { "search_r.png",     search_r_png,     search_r_png_len },
842   { "close.png",        close_png,        close_png_len    },
843   { 0, 0, 0 }
844 };
845
846 static img_data_item search_server_data[] =
847 {
848   // file_name          raw_data          num bytes
849   { "mag.png",          mag_png,          mag_png_len      },
850   { "search_l.png",     search_l_png,     search_l_png_len },
851   { "search_m.png",     search_m_png,     search_m_png_len },
852   { "search_r.png",     search_r_png,     search_r_png_len },
853   { 0, 0, 0 }
854 };
855
856 //------------------------------------------------------------------------
857
858 static void writeClientSearchBox(FTextStream &t,const char *relPath)
859 {
860   t << "        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
861   t << "        <span class=\"left\">\n";
862   t << "          <img id=\"MSearchSelect\" src=\"" << relPath << "search/mag_sel.png\"\n";
863   t << "               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
864   t << "               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
865   t << "               alt=\"\"/>\n";
866   t << "          <input type=\"text\" id=\"MSearchField\" value=\"" 
867     << theTranslator->trSearch() << "\" accesskey=\"S\"\n";
868   t << "               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
869   t << "               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n";
870   t << "               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n";
871   t << "          </span><span class=\"right\">\n";
872   t << "            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
873     << "<img id=\"MSearchCloseImg\" border=\"0\" src=\"" << relPath << "search/close.png\" alt=\"\"/></a>\n";
874   t << "          </span>\n";
875   t << "        </div>\n";
876 }
877
878 static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlightSearch)
879 {
880   t << "        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
881   t << "          <div class=\"left\">\n";
882   t << "            <form id=\"FSearchBox\" action=\"" << relPath << "search.php\" method=\"get\">\n";
883   t << "              <img id=\"MSearchSelect\" src=\"" << relPath << "search/mag.png\" alt=\"\"/>\n";
884   if (!highlightSearch)
885   {
886     t << "              <input type=\"text\" id=\"MSearchField\" name=\"query\" value=\""
887       << theTranslator->trSearch() << "\" size=\"20\" accesskey=\"S\" \n";
888     t << "                     onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
889     t << "                     onblur=\"searchBox.OnSearchFieldFocus(false)\"/>\n";
890     t << "            </form>\n";
891     t << "          </div><div class=\"right\"></div>\n";
892     t << "        </div>\n";
893   }
894 }
895
896 //------------------------------------------------------------------------
897
898 /// substitute all occurrences of \a src in \a s by \a dst
899 QCString substitute(const char *s,const char *src,const char *dst)
900 {
901   if (s==0 || src==0) return s;
902   const char *p, *q;
903   int srcLen = strlen(src);
904   int dstLen = dst ? strlen(dst) : 0;
905   int resLen;
906   if (srcLen!=dstLen)
907   {
908     int count;
909     for (count=0, p=s; (q=strstr(p,src))!=0; p=q+srcLen) count++;
910     resLen = p-s+strlen(p)+count*(dstLen-srcLen);
911   }
912   else // result has same size as s
913   {
914     resLen = strlen(s);
915   }
916   QCString result(resLen+1);
917   char *r;
918   for (r=result.data(), p=s; (q=strstr(p,src))!=0; p=q+srcLen)
919   {
920     int l = (int)(q-p);
921     memcpy(r,p,l);
922     r+=l;
923     if (dst) memcpy(r,dst,dstLen);
924     r+=dstLen;
925   }
926   strcpy(r,p);
927   //printf("substitute(%s,%s,%s)->%s\n",s,src,dst,result.data());
928   return result;
929 }
930 //----------------------------------------------------------------------
931
932 /// Clear a text block \a s from \a begin to \a end markers
933 QCString clearBlock(const char *s,const char *begin,const char *end)
934 {
935   if (s==0 || begin==0 || end==0) return s;
936   const char *p, *q;
937   int beginLen = strlen(begin);
938   int endLen = strlen(end);
939   int resLen = 0;
940   for (p=s; (q=strstr(p,begin))!=0; p=q+endLen)
941   {
942     resLen+=q-p;
943     p=q+beginLen;
944     if ((q=strstr(p,end))==0)
945     {
946       resLen+=beginLen;
947       break;
948     }
949   }
950   resLen+=strlen(p);
951   // resLen is the length of the string without the marked block
952
953   QCString result(resLen+1);
954   char *r;
955   for (r=result.data(), p=s; (q=strstr(p,begin))!=0; p=q+endLen)
956   {
957     int l = (int)(q-p);
958     memcpy(r,p,l);
959     r+=l;
960     p=q+beginLen;
961     if ((q=strstr(p,end))==0)
962     {
963       memcpy(r,begin,beginLen);
964       r+=beginLen;
965       break;
966     }
967   }
968   strcpy(r,p);
969   return result;
970 }
971 //----------------------------------------------------------------------
972
973 QCString selectBlock(const QCString& s,const QCString &name,bool enable)
974 {
975   const QCString begin = "<!--BEGIN " + name + "-->";
976   const QCString end = "<!--END " + name + "-->";
977   const QCString nobegin = "<!--BEGIN !" + name + "-->";
978   const QCString noend = "<!--END !" + name + "-->";
979
980   QCString result = s;
981   if (enable)
982   {
983     result = substitute(result, begin, "");
984     result = substitute(result, end, "");
985     result = clearBlock(result, nobegin, noend);
986   }
987   else
988   {
989     result = substitute(result, nobegin, "");
990     result = substitute(result, noend, "");
991     result = clearBlock(result, begin, end);
992   }
993
994   return result;
995 }
996
997 static QCString getSearchBox(bool serverSide, QCString relPath, bool highlightSearch)
998 {
999   QGString result;
1000   FTextStream t(&result);
1001   if (serverSide) {
1002     writeServerSearchBox(t, relPath, highlightSearch);
1003   }
1004   else {
1005      writeClientSearchBox(t, relPath);
1006   }
1007   return QCString(result);
1008 }
1009
1010 static QCString removeEmptyLines(const QCString &s)
1011 {
1012   BufStr out(s.length()+1);
1013   char *p=s.data();
1014   char c;
1015   while ((c=*p++))
1016   {
1017     if (c=='\n')
1018     {
1019       char *e = p;
1020       while (*e==' ' || *e=='\t') e++;
1021       if (*e=='\n') 
1022       {
1023         p=e;
1024       }
1025       else out.addChar(c);
1026     }
1027     else
1028     {
1029       out.addChar(c);
1030     }
1031   }
1032   out.addChar('\0');
1033   //printf("removeEmptyLines(%s)=%s\n",s.data(),out.data());
1034   return out.data();
1035 }
1036
1037 static QCString substituteHtmlKeywords(const QCString &s,
1038                                        const QCString &title,
1039                                        const QCString &relPath,
1040                                        const QCString &navPath=QCString())
1041 {
1042   // Build CSS/Javascript tags depending on treeview, search engine settings
1043   QCString cssFile;
1044   QCString extraCssFile;
1045   QCString generatedBy;
1046   QCString treeViewCssJs;
1047   QCString searchCssJs;
1048   QCString searchBox;
1049   QCString mathJaxJs;
1050   QCString extraCssText;
1051
1052   static QCString projectName = Config_getString("PROJECT_NAME");
1053   static bool timeStamp = Config_getBool("HTML_TIMESTAMP");
1054   static bool treeView = Config_getBool("GENERATE_TREEVIEW");
1055   static bool searchEngine = Config_getBool("SEARCHENGINE");
1056   static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
1057   static bool mathJax = Config_getBool("USE_MATHJAX");
1058   static bool disableIndex = Config_getBool("DISABLE_INDEX");
1059   static bool hasProjectName = !projectName.isEmpty();
1060   static bool hasProjectNumber = !Config_getString("PROJECT_NUMBER").isEmpty();
1061   static bool hasProjectBrief = !Config_getString("PROJECT_BRIEF").isEmpty();
1062   static bool hasProjectLogo = !Config_getString("PROJECT_LOGO").isEmpty();
1063   static bool titleArea = (hasProjectName || hasProjectBrief || hasProjectLogo || (disableIndex && searchEngine));
1064
1065   cssFile = Config_getString("HTML_STYLESHEET");
1066   if (cssFile.isEmpty())
1067   {
1068     cssFile = "doxygen.css";
1069   }
1070   else
1071   {
1072     QFileInfo cssfi(cssFile);
1073     if (cssfi.exists())
1074     {
1075       cssFile = cssfi.fileName().utf8();
1076     }
1077     else
1078     {
1079       cssFile = "doxygen.css";
1080     }
1081   }
1082   extraCssFile = Config_getString("HTML_EXTRA_STYLESHEET");
1083   if (!extraCssFile.isEmpty())
1084   {
1085     extraCssText = "<link href=\"$relpath$"+stripPath(extraCssFile)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
1086   }
1087
1088   if (timeStamp) {
1089     generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), Config_getString("PROJECT_NAME"));
1090   }
1091   else {
1092     generatedBy = theTranslator->trGeneratedBy();
1093   }
1094
1095   if (treeView)
1096   {
1097     treeViewCssJs = "<link href=\"$relpath$navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
1098                     "<script type=\"text/javascript\" src=\"$relpath$resize.js\"></script>\n"
1099                     "<script type=\"text/javascript\" src=\"$relpath$navtree.js\"></script>\n"
1100                     "<script type=\"text/javascript\">\n"
1101                     "  $(document).ready(initResizable);\n"
1102                     "</script>";
1103   }
1104
1105   if (searchEngine)
1106   {
1107     searchCssJs = "<link href=\"$relpath$search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
1108     searchCssJs += "<script type=\"text/javascript\" src=\"$relpath$search/search.js\"></script>\n";
1109
1110     if (!serverBasedSearch) 
1111     {
1112       searchCssJs += "<script type=\"text/javascript\">\n"
1113                      "  $(document).ready(function() { searchBox.OnSelectItem(0); });\n"
1114                      "</script>";
1115     }
1116     else 
1117     {
1118       searchCssJs += "<script type=\"text/javascript\">\n"
1119                      "  $(document).ready(function() {\n"
1120                      "    if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
1121                      "  });\n"
1122                      "</script>\n";
1123
1124       // OPENSEARCH_PROVIDER {
1125       searchCssJs += "<link rel=\"search\" href=\"" + relPath +
1126                      "search-opensearch.php?v=opensearch.xml\" "
1127                      "type=\"application/opensearchdescription+xml\" title=\"" +
1128                      (hasProjectName ? projectName : QCString("Doxygen")) + 
1129                      "\"/>";
1130       // OPENSEARCH_PROVIDER }
1131     }
1132     searchBox = getSearchBox(serverBasedSearch, relPath, FALSE);
1133   }
1134
1135   if (mathJax)
1136   {
1137     QCString path = Config_getString("MATHJAX_RELPATH");  
1138     if (!path.isEmpty() && path.at(path.length()-1)!='/')  
1139     {   
1140       path+="/";   
1141     }   
1142     if (path.isEmpty() || path.left(2)=="..") // relative path  
1143     {  
1144       path.prepend(relPath);   
1145     }  
1146     mathJaxJs = "<script type=\"text/x-mathjax-config\">\n"
1147                 "  MathJax.Hub.Config({\n"
1148                 "    extensions: [\"tex2jax.js\"";
1149     QStrList &mathJaxExtensions = Config_getList("MATHJAX_EXTENSIONS");
1150     const char *s = mathJaxExtensions.first();
1151     while (s)
1152     {
1153       mathJaxJs+= ", \""+QCString(s)+".js\"";
1154       s = mathJaxExtensions.next();
1155     }
1156     mathJaxJs += "],\n"
1157                  "    jax: [\"input/TeX\",\"output/HTML-CSS\"],\n"
1158                  "});\n"
1159                  "</script>";
1160     mathJaxJs += "<script src=\"" + path + "MathJax.js\"></script>\n";
1161   }
1162
1163   // first substitute generic keywords
1164   QCString result = substituteKeywords(s,title,
1165         convertToHtml(Config_getString("PROJECT_NAME")),
1166         convertToHtml(Config_getString("PROJECT_NUMBER")),
1167         convertToHtml(Config_getString("PROJECT_BRIEF")));
1168
1169   // additional HTML only keywords
1170   result = substitute(result,"$navpath",navPath);
1171   result = substitute(result,"$stylesheet",cssFile);
1172   result = substitute(result,"$treeview",treeViewCssJs);
1173   result = substitute(result,"$searchbox",searchBox);
1174   result = substitute(result,"$search",searchCssJs);
1175   result = substitute(result,"$mathjax",mathJaxJs);
1176   result = substitute(result,"$generatedby",generatedBy);
1177   result = substitute(result,"$extrastylesheet",extraCssText);
1178   result = substitute(result,"$relpath$",relPath); //<-- must be last
1179   
1180   // additional HTML only conditional blocks
1181   result = selectBlock(result,"DISABLE_INDEX",disableIndex);
1182   result = selectBlock(result,"GENERATE_TREEVIEW",treeView);
1183   result = selectBlock(result,"SEARCHENGINE",searchEngine);
1184   result = selectBlock(result,"TITLEAREA",titleArea);
1185   result = selectBlock(result,"PROJECT_NAME",hasProjectName);
1186   result = selectBlock(result,"PROJECT_NUMBER",hasProjectNumber);
1187   result = selectBlock(result,"PROJECT_BRIEF",hasProjectBrief);
1188   result = selectBlock(result,"PROJECT_LOGO",hasProjectLogo);
1189
1190   result = removeEmptyLines(result);
1191
1192   return result;
1193 }
1194
1195 //--------------------------------------------------------------------------
1196
1197 HtmlCodeGenerator::HtmlCodeGenerator()
1198    : m_streamSet(FALSE), m_col(0)
1199 {
1200 }
1201
1202 HtmlCodeGenerator::HtmlCodeGenerator(FTextStream &t,const QCString &relPath) 
1203    : m_col(0), m_relPath(relPath)
1204 {
1205   setTextStream(t);
1206 }
1207
1208 void HtmlCodeGenerator::setTextStream(FTextStream &t)
1209 {
1210   m_streamSet = t.device()!=0;
1211   m_t.setDevice(t.device());
1212 }
1213
1214 void HtmlCodeGenerator::setRelativePath(const QCString &path)
1215 {
1216   m_relPath = path;
1217 }
1218
1219 void HtmlCodeGenerator::codify(const char *str)
1220 {
1221   static int tabSize = Config_getInt("TAB_SIZE");
1222   if (str)
1223   { 
1224     const char *p=str;
1225     char c;
1226     int spacesToNextTabStop;
1227     while (*p)
1228     {
1229       c=*p++;
1230       switch(c)
1231       {
1232         case '\t': spacesToNextTabStop = 
1233                          tabSize - (m_col%tabSize); 
1234                    m_t << Doxygen::spaces.left(spacesToNextTabStop); 
1235                    m_col+=spacesToNextTabStop; 
1236                    break; 
1237         case '\n': m_t << "\n"; m_col=0; 
1238                    break;
1239         case '\r': break;
1240         case '<':  m_t << "&lt;"; m_col++; 
1241                    break;
1242         case '>':  m_t << "&gt;"; m_col++; 
1243                    break;
1244         case '&':  m_t << "&amp;"; m_col++; 
1245                    break;
1246         case '\'': m_t << "&#39;"; m_col++; // &apos; is not valid XHTML
1247                    break;
1248         case '"':  m_t << "&quot;"; m_col++;
1249                    break;
1250         case '\\':
1251                    if (*p=='<')
1252                      { m_t << "&lt;"; p++; }
1253                    else if (*p=='>')
1254                      { m_t << "&gt;"; p++; }
1255                    else
1256                      m_t << "\\";
1257                    m_col++;
1258                    break;
1259         default:   m_t << c;    
1260                    m_col++;                    
1261                    break;
1262       }
1263     }
1264   }
1265 }
1266
1267 void HtmlCodeGenerator::docify(const char *str)
1268 {
1269   if (str)
1270   {
1271     const char *p=str;
1272     char c;
1273     while (*p)
1274     {
1275       c=*p++;
1276       switch(c)
1277       {
1278         case '<':  m_t << "&lt;"; break;
1279         case '>':  m_t << "&gt;"; break;
1280         case '&':  m_t << "&amp;"; break;
1281         case '"':  m_t << "&quot;"; break;
1282         case '\\':
1283                    if (*p=='<')
1284                      { m_t << "&lt;"; p++; }
1285                    else if (*p=='>')
1286                      { m_t << "&gt;"; p++; }
1287                    else
1288                      m_t << "\\";
1289                    break;
1290         default:   m_t << c; 
1291       }
1292     }
1293   }
1294 }
1295
1296 void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename,
1297                                     const char *anchor,int l)
1298 {
1299   QCString lineNumber,lineAnchor;
1300   lineNumber.sprintf("%5d",l);
1301   lineAnchor.sprintf("l%05d",l);
1302
1303   if (filename)
1304   {
1305     startCodeAnchor(lineAnchor);
1306     writeCodeLink(ref,filename,anchor,lineNumber,0);
1307     endCodeAnchor();
1308   }
1309   else
1310   {
1311     startCodeAnchor(lineAnchor);
1312     codify(lineNumber);
1313     endCodeAnchor();
1314   }
1315   m_t << "&#160;";
1316 }
1317
1318
1319 void HtmlCodeGenerator::writeCodeLink(const char *ref,const char *f,
1320                                       const char *anchor, const char *name,
1321                                       const char *tooltip)
1322 {
1323   if (!m_streamSet) return;
1324   //printf("writeCodeLink(ref=%s,f=%s,anchor=%s,name=%s,tooltip=%s)\n",ref,f,anchor,name,tooltip);
1325   if (ref) 
1326   {
1327     m_t << "<a class=\"codeRef\" ";
1328     m_t << externalLinkTarget() << externalRef(m_relPath,ref,FALSE);
1329   }
1330   else
1331   {
1332     m_t << "<a class=\"code\" ";
1333   }
1334   m_t << "href=\"";
1335   m_t << externalRef(m_relPath,ref,TRUE);
1336   if (f) m_t << f << Doxygen::htmlFileExtension;
1337   if (anchor) m_t << "#" << anchor;
1338   m_t << "\"";
1339   if (tooltip) m_t << " title=\"" << tooltip << "\"";
1340   m_t << ">";
1341   docify(name);
1342   m_t << "</a>";
1343   m_col+=strlen(name);
1344 }
1345
1346 void HtmlCodeGenerator::startCodeLine(bool hasLineNumbers) 
1347
1348   if (!hasLineNumbers) m_t << "<div class=\"line\">";
1349   m_col=0; 
1350 }
1351
1352 void HtmlCodeGenerator::endCodeLine() 
1353
1354   m_t << "</div>\n";
1355 }
1356
1357 void HtmlCodeGenerator::startCodeAnchor(const char *label) 
1358
1359   m_t << "<div class=\"line\">";
1360   m_t << "<a name=\"" << label << "\"></a><span class=\"lineno\">"; 
1361 }
1362
1363 void HtmlCodeGenerator::endCodeAnchor() 
1364
1365   m_t << "</span>"; 
1366 }
1367
1368
1369 void HtmlCodeGenerator::startFontClass(const char *s) 
1370
1371   if (m_streamSet) m_t << "<span class=\"" << s << "\">"; 
1372 }
1373
1374 void HtmlCodeGenerator::endFontClass() 
1375
1376   if (m_streamSet) m_t << "</span>"; 
1377 }
1378
1379 void HtmlCodeGenerator::writeCodeAnchor(const char *anchor) 
1380
1381   if (m_streamSet) m_t << "<a name=\"" << anchor << "\"></a>"; 
1382 }
1383
1384 void HtmlCodeGenerator::linkableSymbol(int,const char *,Definition *,Definition *) 
1385 {
1386 }
1387
1388
1389 //--------------------------------------------------------------------------
1390
1391 HtmlGenerator::HtmlGenerator() : OutputGenerator()
1392 {
1393   dir=Config_getString("HTML_OUTPUT");
1394   m_emptySection=FALSE;
1395 }
1396
1397 HtmlGenerator::~HtmlGenerator()
1398 {
1399   //printf("HtmlGenerator::~HtmlGenerator()\n");
1400 }
1401
1402 void HtmlGenerator::init()
1403 {
1404   QCString dname=Config_getString("HTML_OUTPUT");
1405   QDir d(dname);
1406   if (!d.exists() && !d.mkdir(dname))
1407   {
1408     err("Could not create output directory %s\n",dname.data());
1409     exit(1);
1410   }
1411   //writeLogo(dname);
1412   if (!Config_getString("HTML_HEADER").isEmpty()) 
1413   {
1414     g_header=fileToString(Config_getString("HTML_HEADER"));
1415     //printf("g_header='%s'\n",g_header.data());
1416   }
1417   else 
1418   {
1419     g_header = defaultHtmlHeader;
1420   }
1421
1422   if (!Config_getString("HTML_FOOTER").isEmpty()) 
1423   {
1424     g_footer=fileToString(Config_getString("HTML_FOOTER"));
1425     //printf("g_footer='%s'\n",g_footer.data());
1426   }
1427   else 
1428   {
1429     g_footer = defaultHtmlFooter;
1430   }
1431   createSubDirs(d);
1432
1433   QCString fileName=dname+"/tabs.css";
1434   QFile f(fileName);
1435   if (f.open(IO_WriteOnly))
1436   {
1437     FTextStream t(&f);
1438     t << replaceColorMarkers(tabs_css);
1439   }
1440   else
1441   {
1442     fprintf(stderr,"Warning: Cannot open file %s for writing\n",fileName.data());
1443   }
1444
1445   {
1446     QFile f(dname+"/jquery.js");
1447     if (f.open(IO_WriteOnly))
1448     {
1449       FTextStream t(&f);
1450       t << search_jquery_script1 << search_jquery_script2 << search_jquery_script3;
1451       if (Config_getBool("GENERATE_TREEVIEW"))
1452       {
1453         t << search_jquery_script4 << search_jquery_script5;
1454       }
1455     }
1456   }
1457
1458   if (Config_getBool("INTERACTIVE_SVG"))
1459   {
1460     QFile f(dname+"/svgpan.js");
1461     if (f.open(IO_WriteOnly))
1462     {
1463       FTextStream t(&f);
1464       t << svgpan_script;
1465     }
1466   }
1467
1468   {
1469     QFile f(dname+"/dynsections.js");
1470     if (f.open(IO_WriteOnly))
1471     {
1472       FTextStream t(&f);
1473       t << dynsections_script;
1474     }
1475   }
1476 }
1477
1478 /// Additional initialization after indices have been created
1479 void HtmlGenerator::writeTabData()
1480 {
1481   Doxygen::indexList.addStyleSheetFile("tabs.css");
1482   QCString dname=Config_getString("HTML_OUTPUT");
1483   writeColoredImgData(dname,colored_tab_data);
1484
1485   {
1486     unsigned char shadow[6] = { 5, 5, 5, 5, 5, 5 };
1487     unsigned char shadow_alpha[6]  = { 80, 60, 40, 20, 10, 0 };
1488     ColoredImage img(1,6,shadow,shadow_alpha,0,0,100);
1489     img.save(dname+"/nav_g.png");
1490   }
1491 }
1492
1493 void HtmlGenerator::writeSearchData(const char *dir)
1494 {
1495   static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
1496   writeImgData(dir,serverBasedSearch ? search_server_data : search_client_data);
1497   QCString searchDirName = Config_getString("HTML_OUTPUT")+"/search";
1498   QFile f(searchDirName+"/search.css");
1499   if (f.open(IO_WriteOnly))
1500   {
1501     FTextStream t(&f);
1502     QCString searchCss = replaceColorMarkers(search_styleSheet);
1503     if (Config_getBool("DISABLE_INDEX"))
1504     {
1505       // move up the search box if there are no tabs
1506       searchCss = substitute(searchCss,"margin-top: 8px;","margin-top: 0px;");
1507     }
1508     t << searchCss;
1509   }
1510   Doxygen::indexList.addStyleSheetFile("search/search.css");
1511 }
1512
1513 void HtmlGenerator::writeStyleSheetFile(QFile &file)
1514 {
1515   FTextStream t(&file);
1516   t << replaceColorMarkers(defaultStyleSheet);
1517 }
1518
1519 void HtmlGenerator::writeHeaderFile(QFile &file, const char * /*cssname*/)
1520 {
1521   FTextStream t(&file);
1522   QCString contents(defaultHtmlHeader);
1523   t << contents;
1524   
1525 //  QString relPathStr = "$relpath$";
1526
1527 //  QCString id(file.name().utf8());
1528 //  if (id.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension) 
1529 //  {
1530 //    id=id.left(id.length()-Doxygen::htmlFileExtension.length());
1531 //  }
1532
1533 //  t << substitute(defaultHtmlHeader, "$stylesheet", cssname);
1534 }
1535
1536 void HtmlGenerator::writeFooterFile(QFile &file)
1537 {
1538   FTextStream t(&file);
1539   QCString contents(defaultHtmlFooter);
1540   t << contents;
1541 }
1542
1543 void HtmlGenerator::startFile(const char *name,const char *,
1544                               const char *title)
1545 {
1546   //printf("HtmlGenerator::startFile(%s)\n",name);
1547   QCString fileName=name;
1548   lastTitle=title;
1549   relPath = relativePathToRoot(fileName);
1550
1551   if (fileName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension) 
1552   {
1553     fileName+=Doxygen::htmlFileExtension;
1554   }
1555   startPlainFile(fileName);
1556   m_codeGen.setTextStream(t);
1557   m_codeGen.setRelativePath(relPath);
1558   Doxygen::indexList.addIndexFile(fileName);
1559   
1560   lastFile = fileName;
1561   t << substituteHtmlKeywords(g_header,convertToHtml(title),relPath);
1562
1563   t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " 
1564     << versionString << " -->" << endl;
1565   //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
1566   static bool searchEngine = Config_getBool("SEARCHENGINE");
1567   if (searchEngine /*&& !generateTreeView*/)
1568   {
1569     t << "<script type=\"text/javascript\">\n";
1570     t << "var searchBox = new SearchBox(\"searchBox\", \""
1571       << relPath<< "search\",false,'" << theTranslator->trSearch() << "');\n";
1572     t << "</script>\n";
1573   }
1574   //generateDynamicSections(t,relPath);
1575   m_sectionCount=0;
1576 }
1577
1578 void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &relPath)
1579 {
1580   static bool searchEngine      = Config_getBool("SEARCHENGINE");
1581   static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
1582   if (searchEngine && !serverBasedSearch)
1583   {
1584     (void)relPath;
1585     t << "<!-- window showing the filter options -->\n";
1586     t << "<div id=\"MSearchSelectWindow\"\n";
1587     t << "     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
1588     t << "     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
1589     t << "     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n";
1590     writeSearchCategories(t);
1591     t << "</div>\n";
1592     t << "\n";
1593     t << "<!-- iframe showing the search results (closed by default) -->\n";
1594     t << "<div id=\"MSearchResultsWindow\">\n";
1595     t << "<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n";
1596     t << "        name=\"MSearchResults\" id=\"MSearchResults\">\n";
1597     t << "</iframe>\n";
1598     t << "</div>\n";
1599     t << "\n";
1600   }
1601 }
1602
1603 void HtmlGenerator::writeSearchInfo()
1604 {
1605   writeSearchInfo(t,relPath);
1606 }
1607
1608
1609 QCString HtmlGenerator::writeLogoAsString(const char *path)
1610 {
1611   static bool timeStamp = Config_getBool("HTML_TIMESTAMP");
1612   QCString result;
1613   if (timeStamp)
1614   {
1615     result += theTranslator->trGeneratedAt(
1616                dateToString(TRUE),
1617                Config_getString("PROJECT_NAME")
1618               );
1619   }
1620   else
1621   {
1622     result += theTranslator->trGeneratedBy();
1623   }
1624   result += "&#160;\n<a href=\"http://www.doxygen.org/index.html\">\n"
1625             "<img class=\"footer\" src=\"";
1626   result += path;
1627   result += "doxygen.png\" alt=\"doxygen\"/></a> ";
1628   result += versionString;
1629   result += " ";
1630   return result;
1631 }
1632
1633 void HtmlGenerator::writeLogo()
1634 {
1635   t << writeLogoAsString(relPath);
1636 }
1637
1638 void HtmlGenerator::writePageFooter(FTextStream &t,const QCString &lastTitle,
1639                               const QCString &relPath,const QCString &navPath)
1640 {
1641   t << substituteHtmlKeywords(g_footer,convertToHtml(lastTitle),relPath,navPath);
1642 }
1643
1644 void HtmlGenerator::writeFooter(const char *navPath)
1645 {
1646   writePageFooter(t,lastTitle,relPath,navPath);
1647 }
1648
1649 void HtmlGenerator::endFile()
1650 {
1651   endPlainFile();
1652 }
1653
1654 void HtmlGenerator::startProjectNumber()
1655 {
1656   t << "<h3 class=\"version\">";
1657 }
1658
1659 void HtmlGenerator::endProjectNumber()
1660 {
1661   t << "</h3>";
1662 }
1663
1664 void HtmlGenerator::writeStyleInfo(int part)
1665 {
1666   //printf("writeStyleInfo(%d)\n",part);
1667   if (part==0)
1668   {
1669     if (Config_getString("HTML_STYLESHEET").isEmpty()) // write default style sheet
1670     {
1671       //printf("write doxygen.css\n");
1672       startPlainFile("doxygen.css"); 
1673       
1674       // alternative, cooler looking titles
1675       //t << "H1 { text-align: center; border-width: thin none thin none;" << endl;
1676       //t << "     border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }" << endl;
1677
1678       t << replaceColorMarkers(defaultStyleSheet);
1679       endPlainFile();
1680       Doxygen::indexList.addStyleSheetFile("doxygen.css");
1681     }
1682     else // write user defined style sheet
1683     {
1684       QCString cssname=Config_getString("HTML_STYLESHEET");
1685       QFileInfo cssfi(cssname);
1686       if (!cssfi.exists() || !cssfi.isFile() || !cssfi.isReadable())
1687       {
1688         err("error: style sheet %s does not exist or is not readable!", Config_getString("HTML_STYLESHEET").data());
1689       }
1690       else
1691       {
1692         // convert style sheet to string
1693         QCString fileStr = fileToString(cssname);
1694         // write the string into the output dir
1695         startPlainFile(cssfi.fileName().utf8());
1696         t << fileStr;
1697         endPlainFile();
1698       }
1699       Doxygen::indexList.addStyleSheetFile(cssfi.fileName().utf8());
1700     }
1701   }
1702 }
1703
1704 void HtmlGenerator::startDoxyAnchor(const char *,const char *,
1705                                     const char *anchor, const char *,
1706                                     const char *)
1707 {
1708   t << "<a class=\"anchor\" id=\"" << anchor << "\"></a>";
1709 }
1710
1711 void HtmlGenerator::endDoxyAnchor(const char *,const char *)
1712 {
1713 }
1714
1715 //void HtmlGenerator::newParagraph()
1716 //{
1717 //  t << endl << "<p>" << endl;
1718 //}
1719
1720 void HtmlGenerator::startParagraph()
1721 {
1722   t << endl << "<p>";
1723 }
1724
1725 void HtmlGenerator::endParagraph()
1726 {
1727   t << "</p>" << endl;
1728 }
1729
1730 void HtmlGenerator::writeString(const char *text)
1731 {
1732   t << text;
1733 }
1734
1735 void HtmlGenerator::startIndexListItem()
1736 {
1737   t << "<li>";
1738 }
1739
1740 void HtmlGenerator::endIndexListItem()
1741 {
1742   t << "</li>" << endl;
1743 }
1744
1745 void HtmlGenerator::startIndexItem(const char *ref,const char *f)
1746 {
1747   //printf("HtmlGenerator::startIndexItem(%s,%s)\n",ref,f);
1748   if (ref || f)
1749   {
1750     if (ref) 
1751     {
1752       t << "<a class=\"elRef\" ";
1753       t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
1754     }
1755     else
1756     {
1757       t << "<a class=\"el\" ";
1758     }
1759     t << "href=\"";
1760     t << externalRef(relPath,ref,TRUE);
1761     if (f) t << f << Doxygen::htmlFileExtension << "\">";
1762   }
1763   else
1764   {
1765     t << "<b>";
1766   }
1767 }
1768
1769 void HtmlGenerator::endIndexItem(const char *ref,const char *f)
1770 {
1771   //printf("HtmlGenerator::endIndexItem(%s,%s,%s)\n",ref,f,name);
1772   if (ref || f)
1773   {
1774     t << "</a>";
1775   }
1776   else
1777   {
1778     t << "</b>";
1779   }
1780 }
1781
1782 void HtmlGenerator::writeStartAnnoItem(const char *,const char *f,
1783                                        const char *path,const char *name)
1784 {
1785   t << "<li>";
1786   if (path) docify(path);
1787   t << "<a class=\"el\" href=\"" << f << Doxygen::htmlFileExtension << "\">";
1788   docify(name);
1789   t << "</a> ";
1790 }
1791
1792 void HtmlGenerator::writeObjectLink(const char *ref,const char *f,
1793                                     const char *anchor, const char *name)
1794 {
1795   if (ref) 
1796   {
1797     t << "<a class=\"elRef\" ";
1798     t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
1799   }
1800   else
1801   {
1802     t << "<a class=\"el\" ";
1803   }
1804   t << "href=\"";
1805   t << externalRef(relPath,ref,TRUE);
1806   if (f) t << f << Doxygen::htmlFileExtension;
1807   if (anchor) t << "#" << anchor;
1808   t << "\">";
1809   docify(name);
1810   t << "</a>";
1811 }
1812
1813 void HtmlGenerator::startTextLink(const char *f,const char *anchor)
1814 {
1815   t << "<a href=\"";
1816   if (f)   t << relPath << f << Doxygen::htmlFileExtension;
1817   if (anchor) t << "#" << anchor;
1818   t << "\">"; 
1819 }
1820
1821 void HtmlGenerator::endTextLink()
1822 {
1823   t << "</a>";
1824 }
1825
1826 void HtmlGenerator::startHtmlLink(const char *url)
1827 {
1828   static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
1829   t << "<a ";
1830   if (generateTreeView) t << "target=\"top\" ";
1831   t << "href=\"";
1832   if (url) t << url;
1833   t << "\">"; 
1834 }
1835
1836 void HtmlGenerator::endHtmlLink()
1837 {
1838   t << "</a>";
1839 }
1840
1841 void HtmlGenerator::startGroupHeader(int extraIndentLevel)
1842 {
1843   if (extraIndentLevel==2)
1844   {
1845     t << "<h4 class=\"groupheader\">";
1846   }
1847   else if (extraIndentLevel==1)
1848   {
1849     t << "<h3 class=\"groupheader\">";
1850   }
1851   else // extraIndentLevel==0
1852   {
1853     t << "<h2 class=\"groupheader\">";
1854   }
1855 }
1856
1857 void HtmlGenerator::endGroupHeader(int extraIndentLevel)
1858 {
1859   if (extraIndentLevel==2)
1860   {
1861     t << "</h4>" << endl;
1862   }
1863   else if (extraIndentLevel==1)
1864   {
1865     t << "</h3>" << endl;
1866   }
1867   else
1868   {
1869     t << "</h2>" << endl;
1870   }
1871 }
1872
1873 void HtmlGenerator::startSection(const char *lab,const char *,SectionInfo::SectionType type)
1874 {
1875   switch(type)
1876   {
1877     case SectionInfo::Page:          t << "\n\n<h1>"; break;
1878     case SectionInfo::Section:       t << "\n\n<h2>"; break;
1879     case SectionInfo::Subsection:    t << "\n\n<h3>"; break;
1880     case SectionInfo::Subsubsection: t << "\n\n<h4>"; break;
1881     case SectionInfo::Paragraph:     t << "\n\n<h5>"; break;
1882     default: ASSERT(0); break;
1883   }
1884   t << "<a class=\"anchor\" id=\"" << lab << "\"></a>";
1885 }
1886
1887 void HtmlGenerator::endSection(const char *,SectionInfo::SectionType type)
1888 {
1889   switch(type)
1890   {
1891     case SectionInfo::Page:          t << "</h1>"; break;
1892     case SectionInfo::Section:       t << "</h2>"; break;
1893     case SectionInfo::Subsection:    t << "</h3>"; break;
1894     case SectionInfo::Subsubsection: t << "</h4>"; break;
1895     case SectionInfo::Paragraph:     t << "</h5>"; break;
1896     default: ASSERT(0); break;
1897   }
1898 }
1899
1900 void HtmlGenerator::docify(const char *str)
1901 {
1902   docify(str,FALSE);
1903 }
1904
1905 void HtmlGenerator::docify(const char *str,bool inHtmlComment)
1906 {
1907   if (str)
1908   {
1909     const char *p=str;
1910     char c;
1911     while (*p)
1912     {
1913       c=*p++;
1914       switch(c)
1915       {
1916         case '<':  t << "&lt;"; break;
1917         case '>':  t << "&gt;"; break;
1918         case '&':  t << "&amp;"; break;
1919         case '"':  t << "&quot;"; break;
1920         case '-':  if (inHtmlComment) t << "&#45;"; else t << "-"; break;
1921         case '\\':
1922                    if (*p=='<')
1923                      { t << "&lt;"; p++; }
1924                    else if (*p=='>')
1925                      { t << "&gt;"; p++; }
1926                    else
1927                      t << "\\";
1928                    break;
1929         default:   t << c; 
1930       }
1931     }
1932   }
1933 }
1934
1935 void HtmlGenerator::writeChar(char c)
1936 {
1937   char cs[2];
1938   cs[0]=c;
1939   cs[1]=0;
1940   docify(cs);
1941 }
1942
1943 //--- helper function for dynamic sections -------------------------
1944
1945 static void startSectionHeader(FTextStream &t,
1946                                const QCString &relPath,int sectionCount)
1947 {
1948   //t << "<!-- startSectionHeader -->";
1949   static bool dynamicSections = Config_getBool("HTML_DYNAMIC_SECTIONS");
1950   if (dynamicSections)
1951   {
1952     t << "<div id=\"dynsection-" << sectionCount << "\" "
1953          "onclick=\"return toggleVisibility(this)\" "
1954          "class=\"dynheader closed\" "
1955          "style=\"cursor:pointer;\">" << endl;
1956     t << "  <img id=\"dynsection-" << sectionCount << "-trigger\" src=\"" 
1957       << relPath << "closed.png\" alt=\"+\"/> ";
1958   }
1959   else
1960   {
1961     t << "<div class=\"dynheader\">" << endl;
1962   }
1963 }
1964
1965 static void endSectionHeader(FTextStream &t)
1966 {
1967   //t << "<!-- endSectionHeader -->";
1968   t << "</div>" << endl;
1969 }
1970
1971 static void startSectionSummary(FTextStream &t,int sectionCount)
1972 {
1973   //t << "<!-- startSectionSummary -->";
1974   static bool dynamicSections = Config_getBool("HTML_DYNAMIC_SECTIONS");
1975   if (dynamicSections)
1976   {
1977     t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
1978          "class=\"dynsummary\" "
1979          "style=\"display:block;\">" << endl;
1980   }
1981 }
1982
1983 static void endSectionSummary(FTextStream &t)
1984 {
1985   //t << "<!-- endSectionSummary -->";
1986   static bool dynamicSections = Config_getBool("HTML_DYNAMIC_SECTIONS");
1987   if (dynamicSections)
1988   {
1989     t << "</div>" << endl;
1990   }
1991 }
1992
1993 static void startSectionContent(FTextStream &t,int sectionCount)
1994 {
1995   //t << "<!-- startSectionContent -->";
1996   static bool dynamicSections = Config_getBool("HTML_DYNAMIC_SECTIONS");
1997   if (dynamicSections)
1998   {
1999     t << "<div id=\"dynsection-" << sectionCount << "-content\" "
2000          "class=\"dyncontent\" "
2001          "style=\"display:none;\">" << endl;
2002   }
2003   else
2004   {
2005     t << "<div class=\"dyncontent\">" << endl;
2006   }
2007 }
2008
2009 static void endSectionContent(FTextStream &t)
2010 {
2011   //t << "<!-- endSectionContent -->";
2012   t << "</div>" << endl;
2013 }
2014
2015 //----------------------------
2016
2017 void HtmlGenerator::startClassDiagram()
2018 {
2019   startSectionHeader(t,relPath,m_sectionCount);
2020 }
2021
2022 void HtmlGenerator::endClassDiagram(const ClassDiagram &d,
2023                                 const char *fileName,const char *name)
2024 {
2025   endSectionHeader(t);
2026   startSectionSummary(t,m_sectionCount);
2027   endSectionSummary(t);
2028   startSectionContent(t,m_sectionCount);
2029   t << " <div class=\"center\">" << endl;
2030   t << "  <img src=\"";
2031   t << relPath << fileName << ".png\" usemap=\"#";
2032   docify(name);
2033   t << "_map\" alt=\"\"/>" << endl;
2034   t << "  <map id=\"";
2035   docify(name);
2036   t << "_map\" name=\"";
2037   docify(name);
2038   t << "_map\">" << endl;
2039
2040   d.writeImage(t,dir,relPath,fileName);
2041   t << " </div>";
2042   endSectionContent(t);
2043   m_sectionCount++;
2044 }
2045
2046
2047 void HtmlGenerator::startMemberList()  
2048
2049   DBG_HTML(t << "<!-- startMemberList -->" << endl)
2050   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2051   //{
2052   //}
2053   //else
2054   //{
2055   //  t << "<ul>" << endl; 
2056   //}
2057 }
2058
2059 void HtmlGenerator::endMemberList()    
2060
2061   DBG_HTML(t << "<!-- endMemberList -->" << endl)
2062   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2063   //{
2064   //}
2065   //else
2066   //{
2067   //  t << "</ul>" << endl; 
2068   //}
2069 }
2070
2071 // anonymous type:
2072 //  0 = single column right aligned
2073 //  1 = double column left aligned
2074 //  2 = single column left aligned
2075 void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char *inheritId) 
2076
2077   DBG_HTML(t << "<!-- startMemberItem() -->" << endl)
2078   if (m_emptySection)
2079   {
2080     t << "<table class=\"memberdecls\">" << endl;
2081     m_emptySection=FALSE;
2082   }
2083   t << "<tr class=\"memitem:" << anchor;
2084   if (inheritId)
2085   {
2086     t << " inherit " << inheritId;
2087   }
2088   t << "\">";
2089   switch(annoType)
2090   {
2091     case 0:  t << "<td class=\"memItemLeft\" align=\"right\" valign=\"top\">"; break;
2092     case 1:  t << "<td class=\"memItemLeft\" >"; break;
2093     case 2:  t << "<td class=\"memItemLeft\" valign=\"top\">"; break;
2094     default: t << "<td class=\"memTemplParams\" colspan=\"2\">"; break;
2095   }
2096 }
2097
2098 void HtmlGenerator::endMemberItem() 
2099
2100   t << "</td></tr>"; 
2101   t << endl; 
2102 }
2103
2104 void HtmlGenerator::startMemberTemplateParams()
2105 {
2106 }
2107
2108 void HtmlGenerator::endMemberTemplateParams(const char *anchor,const char *inheritId)
2109 {
2110   t << "</td></tr>" << endl;
2111   t << "<tr class=\"memitem:" << anchor;
2112   if (inheritId)
2113   {
2114     t << " inherit " << inheritId;
2115   }
2116   t << "\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">";
2117 }
2118
2119
2120 void HtmlGenerator::insertMemberAlign(bool templ) 
2121
2122   DBG_HTML(t << "<!-- insertMemberAlign -->" << endl)
2123   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2124   //{
2125     QCString className = templ ? "memTemplItemRight" : "memItemRight";
2126     t << "&#160;</td><td class=\"" << className << "\" valign=\"bottom\">"; 
2127   //}
2128 }
2129
2130 void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId) 
2131
2132   DBG_HTML(t << "<!-- startMemberDescription -->" << endl)
2133   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2134   //{
2135     if (m_emptySection)
2136     {
2137       t << "<table class=\"memberdecls\">" << endl;
2138       m_emptySection=FALSE;
2139     }
2140     t << "<tr class=\"memdesc:" << anchor;
2141     if (inheritId)
2142     {
2143       t << " inherit " << inheritId;
2144     }
2145     t << "\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">"; 
2146   //}
2147   //else
2148   //{
2149   //  t << "<dl class=\"el\"><dd class=\"mdescRight\">";
2150   //}
2151 }
2152
2153 void HtmlGenerator::endMemberDescription()   
2154
2155   DBG_HTML(t << "<!-- endMemberDescription -->" << endl)
2156   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2157   //{
2158     t << "<br/></td></tr>" << endl; 
2159   //}
2160   //else
2161   //{
2162   //  t << "<br/></dl>";
2163   //}
2164 }
2165
2166 void HtmlGenerator::startMemberSections()
2167 {
2168   DBG_HTML(t << "<!-- startMemberSections -->" << endl)
2169   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2170   //{
2171     m_emptySection=TRUE; // we postpone writing <table> until we actually
2172                          // write a row to prevent empty tables, which 
2173                          // are not valid XHTML!
2174   //}
2175 }
2176
2177 void HtmlGenerator::endMemberSections()
2178 {
2179   DBG_HTML(t << "<!-- endMemberSections -->" << endl)
2180   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2181   //{
2182     if (!m_emptySection)
2183     {
2184       t << "</table>" << endl;
2185     }
2186   //}
2187 }
2188
2189 void HtmlGenerator::startMemberHeader(const char *anchor)
2190 {
2191   DBG_HTML(t << "<!-- startMemberHeader -->" << endl)
2192   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2193   //{
2194     if (!m_emptySection)
2195     {
2196       t << "</table>";
2197       m_emptySection=TRUE;
2198     }
2199     if (m_emptySection)
2200     {
2201       t << "<table class=\"memberdecls\">" << endl;
2202       m_emptySection=FALSE;
2203     }
2204     t << "<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\">";
2205   //}
2206   //else
2207   //{
2208   //  startGroupHeader(FALSE);
2209   //}
2210   if (anchor)
2211   {
2212     t << "<a name=\"" << anchor << "\"></a>" << endl;
2213   }
2214 }
2215
2216 void HtmlGenerator::endMemberHeader()
2217 {
2218   DBG_HTML(t << "<!-- endMemberHeader -->" << endl)
2219   //if (Config_getBool("HTML_ALIGN_MEMBERS"))
2220   //{
2221     t << "</h2></td></tr>" << endl;
2222   //}
2223   //else
2224   //{
2225   //  endGroupHeader(FALSE);
2226   //}
2227 }
2228
2229 void HtmlGenerator::startMemberSubtitle()
2230 {
2231   DBG_HTML(t << "<!-- startMemberSubtitle -->" << endl)
2232   //if (Config_getBool("HTML_ALIGN_MEMBERS")) 
2233     t << "<tr><td class=\"ititle\" colspan=\"2\">";
2234 }
2235
2236 void HtmlGenerator::endMemberSubtitle()
2237 {
2238   DBG_HTML(t << "<!-- endMemberSubtitle -->" << endl)
2239   //if (Config_getBool("HTML_ALIGN_MEMBERS")) 
2240     t << "</td></tr>" << endl;
2241 }
2242
2243 void HtmlGenerator::startIndexList() 
2244
2245   t << "<table>"  << endl; 
2246 }
2247
2248 void HtmlGenerator::endIndexList()
2249 {
2250   t << "</table>" << endl;
2251 }
2252
2253 void HtmlGenerator::startIndexKey() 
2254
2255   // inserted 'class = ...', 02 jan 2002, jh
2256   t << "  <tr><td class=\"indexkey\">"; 
2257 }
2258
2259 void HtmlGenerator::endIndexKey()
2260 {
2261   t << "</td>";
2262 }
2263
2264 void HtmlGenerator::startIndexValue(bool) 
2265
2266   // inserted 'class = ...', 02 jan 2002, jh
2267   t << "<td class=\"indexvalue\">"; 
2268 }
2269
2270 void HtmlGenerator::endIndexValue(const char *,bool)
2271 {
2272   t << "</td></tr>" << endl;
2273 }
2274
2275 void HtmlGenerator::startMemberDocList()
2276 {
2277   DBG_HTML(t << "<!-- startMemberDocList -->" << endl;)
2278 }
2279
2280 void HtmlGenerator::endMemberDocList()
2281 {
2282   DBG_HTML(t << "<!-- endMemberDocList -->" << endl;)
2283 }
2284
2285 void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *,bool) 
2286
2287   DBG_HTML(t << "<!-- startMemberDoc -->" << endl;)
2288  
2289   t << "\n<div class=\"memitem\">" << endl;
2290   t << "<div class=\"memproto\">" << endl;
2291 }
2292
2293 void HtmlGenerator::startMemberDocPrefixItem()
2294 {
2295   DBG_HTML(t << "<!-- startMemberDocPrefixItem -->" << endl;)
2296   t << "<div class=\"memtemplate\">" << endl;
2297 }
2298
2299 void HtmlGenerator::endMemberDocPrefixItem()
2300 {
2301   DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;)
2302   t << "</div>" << endl;
2303 }
2304
2305 void HtmlGenerator::startMemberDocName(bool /*align*/)
2306 {
2307   DBG_HTML(t << "<!-- startMemberDocName -->" << endl;)
2308
2309   t << "      <table class=\"memname\">" << endl;
2310     
2311   t << "        <tr>" << endl;
2312   t << "          <td class=\"memname\">";
2313 }
2314
2315 void HtmlGenerator::endMemberDocName()
2316 {
2317   DBG_HTML(t << "<!-- endMemberDocName -->" << endl;)
2318   t << "</td>" << endl;
2319 }
2320
2321 void HtmlGenerator::startParameterList(bool openBracket)
2322 {
2323   DBG_HTML(t << "<!-- startParameterList -->" << endl;)
2324   t << "          <td>";
2325   if (openBracket) t << "(";
2326   t << "</td>" << endl;
2327 }
2328
2329 void HtmlGenerator::startParameterType(bool first,const char *key)
2330 {
2331   if (first)
2332   {
2333     DBG_HTML(t << "<!-- startFirstParameterType -->" << endl;)
2334     t << "          <td class=\"paramtype\">";
2335   }
2336   else
2337   {
2338     DBG_HTML(t << "<!-- startParameterType -->" << endl;)
2339     t << "        <tr>" << endl;
2340     t << "          <td class=\"paramkey\">";
2341     if (key) t << key;
2342     t << "</td>" << endl;
2343     t << "          <td></td>" << endl;
2344     t << "          <td class=\"paramtype\">";
2345   }
2346 }
2347
2348 void HtmlGenerator::endParameterType()
2349 {
2350   DBG_HTML(t << "<!-- endParameterType -->" << endl;)
2351   t << "&#160;</td>" << endl;
2352 }
2353
2354 void HtmlGenerator::startParameterName(bool /*oneArgOnly*/)
2355 {
2356   DBG_HTML(t << "<!-- startParameterName -->" << endl;)
2357   t << "          <td class=\"paramname\">";
2358 }
2359
2360 void HtmlGenerator::endParameterName(bool last,bool emptyList,bool closeBracket)
2361 {
2362   DBG_HTML(t << "<!-- endParameterName -->" << endl;)
2363   if (last)
2364   {
2365     if (emptyList)
2366     {
2367       if (closeBracket) t << "</td><td>)";
2368       t << "</td>" << endl;
2369       t << "          <td>";
2370     }
2371     else
2372     {
2373       t << "&#160;</td>" << endl;
2374       t << "        </tr>" << endl;
2375       t << "        <tr>" << endl;
2376       t << "          <td></td>" << endl;
2377       t << "          <td>";
2378       if (closeBracket) t << ")";
2379       t << "</td>" << endl;
2380       t << "          <td></td><td>";
2381     }
2382   }
2383   else
2384   {
2385     t << "</td>" << endl;
2386     t << "        </tr>" << endl;
2387   }
2388 }
2389
2390 void HtmlGenerator::endParameterList()
2391 {
2392   DBG_HTML(t << "<!-- endParameterList -->" << endl;)
2393   t << "</td>" << endl;
2394   t << "        </tr>" << endl;
2395 }
2396
2397 void HtmlGenerator::endMemberDoc(bool hasArgs)     
2398
2399   DBG_HTML(t << "<!-- endMemberDoc -->" << endl;)
2400   if (!hasArgs)
2401   {
2402     t << "        </tr>" << endl;
2403   }
2404   t << "      </table>" << endl;
2405  // t << "</div>" << endl;
2406 }
2407
2408 void HtmlGenerator::startDotGraph()
2409 {
2410   startSectionHeader(t,relPath,m_sectionCount);
2411 }
2412
2413 void HtmlGenerator::endDotGraph(const DotClassGraph &g)
2414 {
2415   bool generateLegend = Config_getBool("GENERATE_LEGEND");
2416   bool umlLook = Config_getBool("UML_LOOK");
2417   endSectionHeader(t);
2418   startSectionSummary(t,m_sectionCount);
2419   endSectionSummary(t);
2420   startSectionContent(t,m_sectionCount);
2421
2422   g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,TRUE,m_sectionCount);
2423   if (generateLegend && !umlLook)
2424   {
2425     t << "<center><span class=\"legend\">[";
2426     startHtmlLink(relPath+"graph_legend"+Doxygen::htmlFileExtension);
2427     t << theTranslator->trLegend();
2428     endHtmlLink();
2429     t << "]</span></center>";
2430   }
2431
2432   endSectionContent(t);
2433   m_sectionCount++;
2434 }
2435
2436 void HtmlGenerator::startInclDepGraph()
2437 {
2438   startSectionHeader(t,relPath,m_sectionCount);
2439 }
2440
2441 void HtmlGenerator::endInclDepGraph(const DotInclDepGraph &g)
2442 {
2443   endSectionHeader(t);
2444   startSectionSummary(t,m_sectionCount);
2445   endSectionSummary(t);
2446   startSectionContent(t,m_sectionCount);
2447
2448   g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,m_sectionCount);
2449
2450   endSectionContent(t);
2451   m_sectionCount++;
2452 }
2453
2454 void HtmlGenerator::startGroupCollaboration()
2455 {
2456   startSectionHeader(t,relPath,m_sectionCount);
2457 }
2458
2459 void HtmlGenerator::endGroupCollaboration(const DotGroupCollaboration &g)
2460 {
2461   endSectionHeader(t);
2462   startSectionSummary(t,m_sectionCount);
2463   endSectionSummary(t);
2464   startSectionContent(t,m_sectionCount);
2465
2466   g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,m_sectionCount);
2467
2468   endSectionContent(t);
2469   m_sectionCount++;
2470 }
2471
2472 void HtmlGenerator::startCallGraph()
2473 {
2474   startSectionHeader(t,relPath,m_sectionCount);
2475 }
2476
2477 void HtmlGenerator::endCallGraph(const DotCallGraph &g)
2478 {
2479   endSectionHeader(t);
2480   startSectionSummary(t,m_sectionCount);
2481   endSectionSummary(t);
2482   startSectionContent(t,m_sectionCount);
2483
2484   g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,m_sectionCount);
2485
2486   endSectionContent(t);
2487   m_sectionCount++;
2488 }
2489
2490 void HtmlGenerator::startDirDepGraph()
2491 {
2492   startSectionHeader(t,relPath,m_sectionCount);
2493 }
2494
2495 void HtmlGenerator::endDirDepGraph(const DotDirDeps &g)
2496 {
2497   endSectionHeader(t);
2498   startSectionSummary(t,m_sectionCount);
2499   endSectionSummary(t);
2500   startSectionContent(t,m_sectionCount);
2501
2502   g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,m_sectionCount);
2503
2504   endSectionContent(t);
2505   m_sectionCount++;
2506 }
2507
2508 void HtmlGenerator::writeGraphicalHierarchy(const DotGfxHierarchyTable &g)
2509 {
2510   g.writeGraph(t,dir,fileName);
2511 }
2512
2513 void HtmlGenerator::startMemberGroupHeader(bool)
2514 {
2515   t << "<tr><td colspan=\"2\"><div class=\"groupHeader\">";
2516 }
2517
2518 void HtmlGenerator::endMemberGroupHeader()
2519 {
2520   t << "</div></td></tr>" << endl;
2521 }
2522
2523 void HtmlGenerator::startMemberGroupDocs()
2524 {
2525   t << "<tr><td colspan=\"2\"><div class=\"groupText\">";
2526 }
2527
2528 void HtmlGenerator::endMemberGroupDocs()
2529 {
2530   t << "</div></td></tr>" << endl;
2531 }
2532
2533 void HtmlGenerator::startMemberGroup()
2534 {
2535 }
2536
2537 void HtmlGenerator::endMemberGroup(bool)
2538 {
2539 }
2540
2541 void HtmlGenerator::startIndent()        
2542
2543   DBG_HTML(t << "<!-- startIndent -->" << endl;)
2544
2545   t << "<div class=\"memdoc\">\n";
2546 }
2547
2548 void HtmlGenerator::endIndent()          
2549
2550   DBG_HTML(t << "<!-- endIndent -->" << endl;)
2551   t << endl << "</div>" << endl << "</div>" << endl; 
2552 }
2553
2554 void HtmlGenerator::addIndexItem(const char *,const char *)
2555 {
2556 }
2557
2558 void HtmlGenerator::writeNonBreakableSpace(int n)
2559 {
2560   int i;
2561   for (i=0;i<n;i++)
2562   {
2563     t << "&#160;";
2564   }
2565 }
2566
2567 void HtmlGenerator::startSimpleSect(SectionTypes,
2568                                 const char *filename,const char *anchor,
2569                                 const char *title)
2570 {
2571   t << "<dl><dt><b>";
2572   if (filename)
2573   {
2574     writeObjectLink(0,filename,anchor,title);
2575   }
2576   else
2577   {
2578     docify(title);
2579   }
2580   t << "</b></dt>";
2581 }
2582
2583 void HtmlGenerator::endSimpleSect()
2584 {
2585   t << "</dl>"; 
2586 }
2587
2588 void HtmlGenerator::startParamList(ParamListTypes,
2589                                 const char *title)
2590 {
2591   t << "<dl><dt><b>";
2592   docify(title);
2593   t << "</b></dt>";
2594 }
2595
2596 void HtmlGenerator::endParamList()
2597 {
2598   t << "</dl>"; 
2599 }
2600
2601 void HtmlGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *md)
2602 {
2603   HtmlDocVisitor *visitor = new HtmlDocVisitor(t,m_codeGen,ctx,md);
2604   n->accept(visitor);
2605   delete visitor; 
2606 }
2607
2608 //---------------- helpers for index generation -----------------------------
2609
2610 static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE)
2611 {
2612   if (compact) 
2613   {
2614     if (topLevel)
2615     {
2616       t << "  <div id=\"navrow1\" class=\"tabs\">\n";
2617     }
2618     else
2619     {
2620       t << "  <div id=\"navrow2\" class=\"tabs2\">\n";
2621     }
2622     t << "    <ul class=\"tablist\">\n"; 
2623   }
2624   else 
2625   {
2626     t << "<ul>";
2627   }
2628 }
2629
2630 static void endQuickIndexList(FTextStream &t,bool compact)
2631 {
2632   if (compact) 
2633   {
2634     t << "    </ul>\n";
2635     t << "  </div>\n";
2636   }
2637   else 
2638   {
2639     t << "</ul>\n";
2640   }
2641 }
2642
2643 static void startQuickIndexItem(FTextStream &t,const char *l,
2644                                 bool hl,bool /*compact*/,
2645                                 const QCString &relPath)
2646 {
2647   t << "      <li"; 
2648   if (hl) 
2649   {
2650     t << " class=\"current\"";
2651   }
2652   t << ">";
2653   if (l) t << "<a href=\"" << correctURL(l,relPath) << "\">";
2654   t << "<span>";
2655 }
2656
2657 static void endQuickIndexItem(FTextStream &t,const char *l)
2658 {
2659   t << "</span>";
2660   if (l) t << "</a>";
2661   t << "</li>\n";
2662 }
2663
2664 static QCString fixSpaces(const QCString &s)
2665 {
2666   return substitute(s," ","&#160;");
2667 }
2668
2669 static bool quickLinkVisible(LayoutNavEntry::Kind kind)
2670 {
2671   static bool showFiles = Config_getBool("SHOW_FILES");
2672   static bool showNamespaces = Config_getBool("SHOW_NAMESPACES");
2673   switch (kind)
2674   {
2675     case LayoutNavEntry::MainPage:         return TRUE; 
2676     case LayoutNavEntry::User:             return TRUE;                                           
2677     case LayoutNavEntry::UserGroup:        return TRUE;                                           
2678     case LayoutNavEntry::Pages:            return indexedPages>0;
2679     case LayoutNavEntry::Modules:          return documentedGroups>0;
2680     case LayoutNavEntry::Namespaces:       return documentedNamespaces>0 && showNamespaces;
2681     case LayoutNavEntry::NamespaceList:    return documentedNamespaces>0 && showNamespaces;
2682     case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
2683     case LayoutNavEntry::Classes:          return annotatedClasses>0;
2684     case LayoutNavEntry::ClassList:        return annotatedClasses>0; 
2685     case LayoutNavEntry::ClassIndex:       return annotatedClasses>0; 
2686     case LayoutNavEntry::ClassHierarchy:   return hierarchyClasses>0;
2687     case LayoutNavEntry::ClassMembers:     return documentedClassMembers[CMHL_All]>0;
2688     case LayoutNavEntry::Files:            return documentedHtmlFiles>0 && showFiles;
2689     case LayoutNavEntry::FileList:         return documentedHtmlFiles>0 && showFiles;
2690     case LayoutNavEntry::FileGlobals:      return documentedFileMembers[FMHL_All]>0;
2691     //case LayoutNavEntry::Dirs:             return documentedDirs>0;
2692     case LayoutNavEntry::Examples:         return Doxygen::exampleSDict->count()>0;
2693   }
2694   return FALSE;
2695 }
2696
2697 static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,LayoutNavEntry *root)
2698
2699 {
2700   QListIterator<LayoutNavEntry> li(root->children());
2701   LayoutNavEntry *entry;
2702   int count=0;
2703   for (li.toFirst();(entry=li.current());++li)
2704   {
2705     if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2706   }
2707   if (count>0) // at least one item is visible
2708   {
2709     startQuickIndexList(t,FALSE);
2710     for (li.toFirst();(entry=li.current());++li)
2711     {
2712       if (entry->visible() && quickLinkVisible(entry->kind()))
2713       {
2714         QCString url = entry->url();
2715         t << "<li><a href=\"" << relPath << url << "\"><span>";
2716         t << fixSpaces(entry->title());
2717         t << "</span></a>\n";
2718         // recursive into child list
2719         renderQuickLinksAsTree(t,relPath,entry);
2720         t << "</li>";
2721       }
2722     }
2723     endQuickIndexList(t,FALSE);
2724   }
2725 }
2726
2727
2728 static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath,
2729                              LayoutNavEntry *hlEntry,LayoutNavEntry::Kind kind,
2730                              bool highlightParent,bool highlightSearch)
2731 {
2732   if (hlEntry->parent()) // first draw the tabs for the parent of hlEntry
2733   {
2734     renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch);
2735   }
2736   if (hlEntry->parent() && hlEntry->parent()->children().count()>0) // draw tabs for row containing hlEntry
2737   {
2738     bool topLevel = hlEntry->parent()->parent()==0;
2739     QListIterator<LayoutNavEntry> li(hlEntry->parent()->children());
2740     LayoutNavEntry *entry;
2741
2742     int count=0;
2743     for (li.toFirst();(entry=li.current());++li)
2744     {
2745       if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2746     }
2747     if (count>0) // at least one item is visible
2748     {
2749       startQuickIndexList(t,TRUE,topLevel);
2750       for (li.toFirst();(entry=li.current());++li)
2751       {
2752         if (entry->visible() && quickLinkVisible(entry->kind()))
2753         {
2754           QCString url = entry->url();
2755           startQuickIndexItem(t,url,
2756               entry==hlEntry  && 
2757               (entry->children().count()>0 || 
2758                (entry->kind()==kind && !highlightParent)
2759               ),
2760               TRUE,relPath);
2761           t << fixSpaces(entry->title());
2762           endQuickIndexItem(t,url);
2763         }
2764       }
2765       if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row is special as it contains the search box
2766       {
2767         static bool searchEngine      = Config_getBool("SEARCHENGINE");
2768         static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
2769         if (searchEngine)
2770         {
2771           t << "      <li>\n";
2772           if (!serverBasedSearch) // pure client side search
2773           {
2774             writeClientSearchBox(t,relPath);
2775             t << "      </li>\n";
2776           }
2777           else // server based search
2778           {
2779             writeServerSearchBox(t,relPath,highlightSearch);
2780             if (!highlightSearch)
2781             {
2782               t << "      </li>\n";
2783             }
2784           }
2785         }
2786         if (!highlightSearch) // on the search page the index will be ended by the
2787           // page itself
2788         {
2789           endQuickIndexList(t,TRUE);
2790         }
2791       }
2792       else // normal case for other rows than first one
2793       {
2794         endQuickIndexList(t,TRUE);
2795       }
2796     }
2797   }
2798 }
2799
2800 static void writeDefaultQuickLinks(FTextStream &t,bool compact,
2801                                    HighlightedItem hli,
2802                                    const char *file,
2803                                    const QCString &relPath)
2804 {
2805   LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
2806   LayoutNavEntry::Kind kind = (LayoutNavEntry::Kind)-1;
2807   LayoutNavEntry::Kind altKind = (LayoutNavEntry::Kind)-1; // fall back for the old layout file
2808   bool highlightParent=FALSE;
2809   switch (hli) // map HLI enums to LayoutNavEntry::Kind enums
2810   {
2811     case HLI_Main:             kind = LayoutNavEntry::MainPage;         break;
2812     case HLI_Modules:          kind = LayoutNavEntry::Modules;          break;
2813     //case HLI_Directories:      kind = LayoutNavEntry::Dirs;             break;
2814     case HLI_Namespaces:       kind = LayoutNavEntry::NamespaceList;    altKind = LayoutNavEntry::Namespaces;  break;
2815     case HLI_Hierarchy:        kind = LayoutNavEntry::ClassHierarchy;   break;
2816     case HLI_Classes:          kind = LayoutNavEntry::ClassIndex;       altKind = LayoutNavEntry::Classes;     break;
2817     case HLI_Annotated:        kind = LayoutNavEntry::ClassList;        altKind = LayoutNavEntry::Classes;     break;
2818     case HLI_Files:            kind = LayoutNavEntry::FileList;         altKind = LayoutNavEntry::Files;       break;
2819     case HLI_NamespaceMembers: kind = LayoutNavEntry::NamespaceMembers; break;
2820     case HLI_Functions:        kind = LayoutNavEntry::ClassMembers;     break;
2821     case HLI_Globals:          kind = LayoutNavEntry::FileGlobals;      break;
2822     case HLI_Pages:            kind = LayoutNavEntry::Pages;            break;
2823     case HLI_Examples:         kind = LayoutNavEntry::Examples;         break;
2824     case HLI_UserGroup:        kind = LayoutNavEntry::UserGroup;        break;
2825     case HLI_ClassVisible:     kind = LayoutNavEntry::ClassList;        altKind = LayoutNavEntry::Classes;          
2826                                highlightParent = TRUE; break;
2827     case HLI_NamespaceVisible: kind = LayoutNavEntry::NamespaceList;    altKind = LayoutNavEntry::Namespaces;       
2828                                highlightParent = TRUE; break;
2829     case HLI_FileVisible:      kind = LayoutNavEntry::FileList;         altKind = LayoutNavEntry::Files;            
2830                                highlightParent = TRUE; break;
2831     case HLI_None:   break;
2832     case HLI_Search: break;
2833   }
2834   
2835   if (compact)
2836   {
2837     // find highlighted index item
2838     LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : 0);
2839     if (!hlEntry && altKind!=(LayoutNavEntry::Kind)-1) { hlEntry=root->find(altKind); kind=altKind; }
2840     if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index...
2841     {
2842       highlightParent=TRUE;
2843       hlEntry = root->children().getFirst();
2844       if (hlEntry==0) 
2845       {
2846         return; // argl, empty index!
2847       }
2848     }
2849     if (kind==LayoutNavEntry::UserGroup)
2850     {
2851       LayoutNavEntry *e = hlEntry->children().getFirst();
2852       if (e)
2853       {
2854         hlEntry = e; 
2855       }
2856     }
2857     renderQuickLinksAsTabs(t,relPath,hlEntry,kind,highlightParent,hli==HLI_Search);
2858   }
2859   else
2860   {
2861     renderQuickLinksAsTree(t,relPath,root);
2862   }
2863 }
2864
2865 void HtmlGenerator::endQuickIndices()
2866 {
2867   t << "</div><!-- top -->" << endl;
2868 }
2869
2870 QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpath)
2871 {
2872   static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
2873   QCString result;
2874   // write split bar
2875   if (generateTreeView)
2876   {
2877     result = QCString(
2878     "<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n"
2879     "  <div id=\"nav-tree\">\n"
2880     "    <div id=\"nav-tree-contents\">\n"
2881     "      <div id=\"nav-sync\" class=\"sync\"></div>\n"
2882     "    </div>\n"
2883     "  </div>\n"
2884     "  <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n"
2885     "       class=\"ui-resizable-handle\">\n"
2886     "  </div>\n"
2887     "</div>\n"
2888     "<script type=\"text/javascript\">\n"
2889     "$(document).ready(function(){initNavTree('") + 
2890     QCString(name) + Doxygen::htmlFileExtension + 
2891     QCString("','") + relpath +
2892     QCString("');});\n"
2893     "</script>\n"
2894     "<div id=\"doc-content\">\n");
2895   }
2896   return result;
2897 }
2898
2899 void HtmlGenerator::writeSplitBar(const char *name)
2900 {
2901   t << writeSplitBarAsString(name,relPath);
2902 }
2903
2904 void HtmlGenerator::writeNavigationPath(const char *s)
2905 {
2906   t << substitute(s,"$relpath$",relPath);
2907 }
2908
2909 void HtmlGenerator::startContents()
2910 {
2911   t << "<div class=\"contents\">" << endl;
2912 }
2913
2914 void HtmlGenerator::endContents()
2915 {
2916   t << "</div><!-- contents -->" << endl;
2917 }
2918
2919 void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli,const char *file)
2920 {
2921   writeDefaultQuickLinks(t,compact,hli,file,relPath);
2922 }
2923
2924 // PHP based search script
2925 void HtmlGenerator::writeSearchPage()
2926 {
2927   static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
2928   static bool disableIndex = Config_getBool("DISABLE_INDEX");
2929   static QCString projectName = Config_getString("PROJECT_NAME");
2930
2931   // OPENSEARCH_PROVIDER {
2932   QCString configFileName = Config_getString("HTML_OUTPUT")+"/search-config.php";
2933   QFile cf(configFileName);
2934   if (cf.open(IO_WriteOnly))
2935   {
2936     FTextStream t(&cf);
2937     t << "<script language=\"php\">\n\n";
2938     t << "$config = array(\n";
2939     t << "  'PROJECT_NAME' => \"" << projectName << "\",\n";
2940     t << "  'GENERATE_TREEVIEW' => " << (generateTreeView?"true":"false") << ",\n";
2941     t << "  'DISABLE_INDEX' => " << (disableIndex?"true":"false") << ",\n";
2942     t << ");\n\n";
2943     t << "$translator = array(\n";
2944     t << "  'search_results_title' => \"" << theTranslator->trSearchResultsTitle() << "\",\n";
2945     t << "  'search_results' => array(\n";  
2946     t << "    0 => \"" << theTranslator->trSearchResults(0) << "\",\n";     
2947     t << "    1 => \"" << theTranslator->trSearchResults(1) << "\",\n";     
2948     t << "    2 => \"" << substitute(theTranslator->trSearchResults(2), "$", "\\$") << "\",\n";     
2949     t << "  ),\n";
2950     t << "  'search_matches' => \"" << theTranslator->trSearchMatches() << "\",\n";
2951     t << "  'search' => \"" << theTranslator->trSearch() << "\",\n";
2952     t << "  'split_bar' => \"" << substitute(substitute(writeSplitBarAsString("",""), "\"","\\\""), "\n","\\n") << "\",\n";
2953     t << "  'logo' => \"" << substitute(substitute(writeLogoAsString(""), "\"","\\\""), "\n","\\n") << "\",\n";
2954     t << ");\n\n";
2955     t << "</script>\n";
2956   }
2957
2958   QCString functionsFileName = Config_getString("HTML_OUTPUT")+"/search-functions.php";
2959   QFile ff(functionsFileName);
2960   if (ff.open(IO_WriteOnly))
2961   {
2962     FTextStream t(&ff);
2963     // Write stuff from search_functions.php source file...
2964     t << search_functions_script;
2965   }
2966
2967   QCString opensearchFileName = Config_getString("HTML_OUTPUT")+"/search-opensearch.php";
2968   QFile of(opensearchFileName);
2969   if (of.open(IO_WriteOnly))
2970   {
2971     FTextStream t(&of);
2972     // Write stuff from search_opensearch.php source file...
2973     t << search_opensearch_script;
2974   }
2975   // OPENSEARCH_PROVIDER }
2976
2977   QCString fileName = Config_getString("HTML_OUTPUT")+"/search.php";
2978   QFile f(fileName);
2979   if (f.open(IO_WriteOnly))
2980   {
2981     FTextStream t(&f);
2982     t << substituteHtmlKeywords(g_header,"Search","");
2983
2984     t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " 
2985       << versionString << " -->" << endl;
2986     //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
2987     static bool searchEngine = Config_getBool("SEARCHENGINE");
2988     if (searchEngine /* && !generateTreeView*/)
2989     {
2990       t << "<script type=\"text/javascript\">\n";
2991       t << "var searchBox = new SearchBox(\"searchBox\", \""
2992         << "search\",false,'" << theTranslator->trSearch() << "');\n";
2993       t << "</script>\n";
2994     }
2995     if (!Config_getBool("DISABLE_INDEX"))
2996     {
2997       writeDefaultQuickLinks(t,TRUE,HLI_Search,0,"");
2998     }
2999     else
3000     {
3001       //t << "&#160;\n<div class=\"qindex\">\n";
3002       //t << "  <form class=\"search\" action=\"search.php\" "
3003       //  << "method=\"get\">\n";
3004       t << "</div>" << endl;
3005     }
3006
3007     t << "<script language=\"php\">\n";
3008     t << "require_once \"search-functions.php\";\n";
3009     t << "main();\n";
3010     t << "</script>\n";
3011
3012     writeSearchInfo(t,"");
3013
3014     // Write empty navigation path, to make footer connect properly
3015     if (generateTreeView)
3016     {
3017       t << "</div><!-- doc-contents -->\n";
3018       //t << "<div id=\"nav-path\" class=\"navpath\">\n";
3019       //t << "  <ul>\n";
3020     }
3021
3022     writePageFooter(t,"Search","","");
3023   }
3024   QCString scriptName = Config_getString("HTML_OUTPUT")+"/search/search.js";
3025   QFile sf(scriptName);
3026   if (sf.open(IO_WriteOnly))
3027   {
3028     FTextStream t(&sf);
3029     t << "function SearchBox(name, resultsPath, inFrame, label)\n";
3030     t << "{\n";
3031     t << "  this.searchLabel = label;\n";
3032     t << "  this.DOMSearchField = function()\n";
3033     t << "  {  return document.getElementById(\"MSearchField\");  }\n";
3034     t << "  this.DOMSearchBox = function()\n";
3035     t << "  {  return document.getElementById(\"MSearchBox\");  }\n";
3036     t << "  this.OnSearchFieldFocus = function(isActive)\n";
3037     t << "  {\n";
3038     t << "    if (isActive)\n";
3039     t << "    {\n";
3040     t << "      this.DOMSearchBox().className = 'MSearchBoxActive';\n";
3041     t << "      var searchField = this.DOMSearchField();\n";
3042     t << "      if (searchField.value == this.searchLabel) \n";
3043     t << "      {\n";
3044     t << "        searchField.value = '';\n";
3045     t << "      }\n";
3046     t << "    }\n";
3047     t << "    else\n";
3048     t << "    {\n";
3049     t << "      this.DOMSearchBox().className = 'MSearchBoxInactive';\n";
3050     t << "      this.DOMSearchField().value   = this.searchLabel;\n";
3051     t << "    }\n";
3052     t << "  }\n";
3053     t << "}\n";
3054   }
3055   else
3056   {
3057      err("Failed to open file '%s' for writing...\n",scriptName.data());
3058   }
3059
3060 }
3061
3062 void HtmlGenerator::startConstraintList(const char *header)
3063 {
3064   t << "<div class=\"typeconstraint\">" << endl;
3065   t << "<dl><dt><b>" << header << "</b><dt><dd>" << endl;
3066   t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl;
3067 }
3068
3069 void HtmlGenerator::startConstraintParam()
3070 {
3071   t << "<tr><td valign=\"top\"><em>";
3072 }
3073
3074 void HtmlGenerator::endConstraintParam()
3075 {
3076   t << "</em></td>";
3077 }
3078
3079 void HtmlGenerator::startConstraintType()
3080 {
3081   t << "<td>&#160;:</td><td valign=\"top\"><em>";
3082 }
3083
3084 void HtmlGenerator::endConstraintType()
3085 {
3086   t << "</em></td>";
3087 }
3088
3089 void HtmlGenerator::startConstraintDocs()
3090 {
3091   t << "<td>&#160;";
3092 }
3093
3094 void HtmlGenerator::endConstraintDocs()
3095 {
3096   t << "</td></tr>" << endl;
3097 }
3098
3099 void HtmlGenerator::endConstraintList()
3100 {
3101   t << "</table>" << endl;
3102   t << "</dl>" << endl;
3103   t << "</div>" << endl;
3104 }
3105
3106 void HtmlGenerator::lineBreak(const char *style)
3107 {
3108   if (style)
3109   {
3110     t << "<br class=\"" << style << "\"/>" << endl;
3111   }
3112   else
3113   {
3114     t << "<br/>" << endl;
3115   }
3116 }
3117
3118 void HtmlGenerator::startHeaderSection()
3119 {
3120   t << "<div class=\"header\">" << endl;
3121 }
3122
3123 void HtmlGenerator::startTitleHead(const char *) 
3124
3125   t << "  <div class=\"headertitle\">" << endl;
3126   startTitle(); 
3127 }
3128
3129 void HtmlGenerator::endTitleHead(const char *,const char *) 
3130
3131   endTitle(); 
3132   t << "  </div>" << endl;
3133 }
3134
3135 void HtmlGenerator::endHeaderSection()
3136 {
3137   t << "</div><!--header-->" << endl;
3138 }
3139
3140 void HtmlGenerator::startInlineHeader()
3141 {
3142   if (m_emptySection)
3143   {
3144     t << "<table class=\"memberdecls\">" << endl;
3145     m_emptySection=FALSE;
3146   }
3147   t << "<tr><td colspan=\"2\"><h3>";
3148 }
3149
3150 void HtmlGenerator::endInlineHeader()
3151 {
3152   t << "</h3></td></tr>" << endl;
3153 }
3154
3155 void HtmlGenerator::startMemberDocSimple()
3156 {
3157   DBG_HTML(t << "<!-- startMemberDocSimple -->" << endl;)
3158   t << "<table class=\"fieldtable\">" << endl;
3159   t << "<tr><th colspan=\"3\">" << theTranslator->trCompoundMembers() << "</th></tr>" << endl;
3160 }
3161
3162 void HtmlGenerator::endMemberDocSimple()
3163 {
3164   DBG_HTML(t << "<!-- endMemberDocSimple -->" << endl;)
3165   t << "</table>" << endl;
3166 }
3167
3168 void HtmlGenerator::startInlineMemberType()
3169 {
3170   DBG_HTML(t << "<!-- startInlineMemberType -->" << endl;)
3171   t << "<tr><td class=\"fieldtype\">" << endl;
3172 }
3173
3174 void HtmlGenerator::endInlineMemberType()
3175 {
3176   DBG_HTML(t << "<!-- endInlineMemberType -->" << endl;)
3177   t << "</td>" << endl;
3178 }
3179
3180 void HtmlGenerator::startInlineMemberName()
3181 {
3182   DBG_HTML(t << "<!-- startInlineMemberName -->" << endl;)
3183   t << "<td class=\"fieldname\">" << endl;
3184 }
3185
3186 void HtmlGenerator::endInlineMemberName()
3187 {
3188   DBG_HTML(t << "<!-- endInlineMemberName -->" << endl;)
3189   t << "</td>" << endl;
3190 }
3191
3192 void HtmlGenerator::startInlineMemberDoc()
3193 {
3194   DBG_HTML(t << "<!-- startInlineMemberDoc -->" << endl;)
3195   t << "<td class=\"fielddoc\">" << endl;
3196 }
3197
3198 void HtmlGenerator::endInlineMemberDoc()
3199 {
3200   DBG_HTML(t << "<!-- endInlineMemberDoc -->" << endl;)
3201   t << "</td></tr>" << endl;
3202 }
3203
3204 void HtmlGenerator::startLabels()
3205 {
3206   DBG_HTML(t << "<!-- startLabels -->" << endl;)
3207   t << "<span class=\"mlabels\">";
3208 }
3209
3210 void HtmlGenerator::writeLabel(const char *l,bool /*isLast*/)
3211 {
3212   DBG_HTML(t << "<!-- writeLabel(" << l << ") -->" << endl;)
3213   //t << "<tt>[" << l << "]</tt>";
3214   //if (!isLast) t << ", ";
3215   t << "<span class=\"mlabel\">" << l << "</span>";
3216 }
3217
3218 void HtmlGenerator::endLabels()
3219 {
3220   DBG_HTML(t << "<!-- endLabels -->" << endl;)
3221   t << "</span>";
3222 }
3223
3224 void HtmlGenerator::writeInheritedSectionTitle(
3225                   const char *id,    const char *ref, 
3226                   const char *file,  const char *anchor,
3227                   const char *title, const char *name)
3228 {
3229   DBG_HTML(t << "<!-- writeInheritedSectionTitle -->" << endl;)
3230   QCString a = anchor;
3231   if (!a.isEmpty()) a.prepend("#");
3232   QCString classLink = QCString("<a class=\"el\" href=\"");
3233   if (ref)
3234   {
3235     classLink+= externalLinkTarget() + externalRef(relPath,ref,TRUE);
3236   }
3237   else
3238   {
3239     classLink+=relPath;
3240   }
3241   classLink+=file+Doxygen::htmlFileExtension+a;
3242   classLink+=QCString("\">")+convertToHtml(name,FALSE)+"</a>";
3243   t << "<tr class=\"inherit_header " << id << "\">"
3244     << "<td colspan=\"2\" onclick=\"javascript:toggleInherit('" << id << "')\">"
3245     << "<img src=\"" << relPath << "closed.png\" alt=\"-\"/>&#160;" 
3246     << theTranslator->trInheritedFrom(convertToHtml(title,FALSE),classLink)
3247     << "</td></tr>" << endl;
3248 }
3249
3250 void HtmlGenerator::writeSummaryLink(const char *file,const char *anchor,const char *title,bool first)
3251 {
3252   if (first)
3253   {
3254     t << "  <div class=\"summary\">\n";
3255   }
3256   else
3257   {
3258     t << " &#124;\n";
3259   }
3260   t << "<a href=\"";
3261   if (file)
3262   {
3263     t << relPath << file;
3264     t << Doxygen::htmlFileExtension;
3265   }
3266   else
3267   {
3268     t << "#";
3269     t << anchor;
3270   }
3271   t << "\">";
3272   t << title;
3273   t << "</a>";
3274 }
3275
3276 void HtmlGenerator::endMemberDeclaration(const char *anchor,const char *inheritId)
3277 {
3278   t << "<tr class=\"separator:" << anchor;
3279   if (inheritId)
3280   {
3281     t << " inherit " << inheritId;
3282   }
3283   t << "\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n";
3284 }
3285