Commit e3256753 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.6.1-20091222

parent 6f2abee1
......@@ -224,7 +224,7 @@ GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
GENERATE_PERLMOD = YES
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
......
DOXYGEN Version 1.6.1-20091027
DOXYGEN Version 1.6.1-20091222
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.
--------
Dimitri van Heesch (27 October 2009)
Dimitri van Heesch (22 December 2009)
DOXYGEN Version 1.6.1_20091027
DOXYGEN Version 1.6.1_20091222
Please read INSTALL for compilation instructions.
......@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (27 October 2009)
Dimitri van Heesch (dimitri@stack.nl) (22 December 2009)
......@@ -20,7 +20,7 @@ doxygen_version_minor=6
doxygen_version_revision=1
#NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
doxygen_version_mmn=20091027
doxygen_version_mmn=20091222
bin_dirs=`echo $PATH | sed -e "s/:/ /g"`
......
......@@ -33,7 +33,8 @@ CASE_SENSE_NAMES = NO
IMAGE_PATH = .
INPUT = index.doc install.doc starting.doc docblocks.doc lists.doc \
grouping.doc formulas.doc diagrams.doc preprocessing.doc \
autolink.doc output.doc customize.doc custcmd.doc external.doc faq.doc trouble.doc history.doc features.doc \
autolink.doc output.doc searching.doc customize.doc custcmd.doc \
external.doc faq.doc trouble.doc history.doc features.doc \
doxygen_usage.doc doxytag_usage.doc \
doxywizard_usage.doc installdox_usage.doc \
config.doc commands.doc htmlcmds.doc xmlcmds.doc language.doc \
......
......@@ -466,10 +466,34 @@ Structural indicators
The \<header-name\> argument can be used to overwrite the
name of the link that is used in the class documentation to something other
than \<header-file\>. This can be useful if the include name is not located
on the default include path (like \<X11/X.h\>). With the \<header-name\>
on the default include path (like \<X11/X.h\>).
With the \<header-name\>
argument you can also specify how the include statement should look like,
by adding either quotes or sharp brackets around the name.
Sharp brackets are used if just the name is given.
by adding either double quotes or sharp brackets around the name.
By default sharp brackets are used if just the name is given.
If a pair of double quotes is given for either the header-file or
header-name argument, the current file (in which the command was found)
will be used but with quotes. So for a comment block with a \\headerfile
command inside a file test.h, the following three commands are equivalent:
\verbatim
\headerfile test.h "test.h"
\headerfile test.h ""
\headerfile "" \endverbatim
To get sharp brackets you do not need to specify anything,
but if you want to be explicit you could use any of the following:
\verbatim
\headerfile test.h <test.h>
\headerfile test.h <>
\headerfile <> \endverbatim
To globally reverse the default include representation to
local includes you can set
\ref cfg_force_local_includes "FORCE_LOCAL_INCLUDES" to \c YES.
To disable the include information altogether set
\ref cfg_show_include_files "SHOW_INCLUDE_FILES" to \c NO.
<hr>
\section cmdhideinitializer \\hideinitializer
......@@ -2467,12 +2491,12 @@ class Receiver
prevent auto-linking to word that is also a documented class or struct.
<hr>
\section cmdquot \\\"
\section cmdquot \\"
\addindex \\\"
This command writes the \" character to the output. This
character has to be escaped in some cases, because it is used to
prevent auto-linking to word that is also a documented class or struct.
character has to be escaped in some cases, because it is used in pairs
to indicate an unformated text fragment.
<hr>
\htmlonly <center> \endhtmlonly
......
......@@ -115,6 +115,7 @@ followed by the descriptions of the tags grouped by category.
\refitem cfg_file_version_filter FILE_VERSION_FILTER
\refitem cfg_filter_patterns FILTER_PATTERNS
\refitem cfg_filter_source_files FILTER_SOURCE_FILES
\refitem cfg_force_local_includes FORCE_LOCAL_INCLUDES
\refitem cfg_formula_fontsize FORMULA_FONTSIZE
\refitem cfg_full_path_names FULL_PATH_NAMES
\refitem cfg_generate_autogen_def GENERATE_AUTOGEN_DEF
......@@ -152,6 +153,7 @@ followed by the descriptions of the tags grouped by category.
\refitem cfg_html_header HTML_HEADER
\refitem cfg_html_output HTML_OUTPUT
\refitem cfg_html_stylesheet HTML_STYLESHEET
\refitem cfg_html_timestamp HTML_TIMESTAMP
\refitem cfg_idl_property_support IDL_PROPERTY_SUPPORT
\refitem cfg_ignore_prefix IGNORE_PREFIX
\refitem cfg_image_path IMAGE_PATH
......@@ -217,6 +219,7 @@ followed by the descriptions of the tags grouped by category.
\refitem cfg_search_includes SEARCH_INCLUDES
\refitem cfg_searchengine SEARCHENGINE
\refitem cfg_separate_member_pages SEPARATE_MEMBER_PAGES
\refitem cfg_server_based_search SERVER_BASED_SEARCH
\refitem cfg_short_names SHORT_NAMES
\refitem cfg_show_dirs SHOW_DIRECTORIES
\refitem cfg_show_files SHOW_FILES
......@@ -708,10 +711,17 @@ function's detailed documentation block.
\anchor cfg_show_include_files
<dt>\c SHOW_INCLUDE_FILES <dd>
\addindex SHOW_INCLUDE_FILES
If the SHOW_INCLUDE_FILES tag is set to YES (the default) then doxygen
If the SHOW_INCLUDE_FILES tag is set to \c YES (the default) then doxygen
will put a list of the files that are included by a file in the documentation
of that file.
\anchor cfg_force_local_includes
<dt>\c FORCE_LOCAL_INCLUDES <dd>
\addindex FORCE_LOCAL_INCLUDES
If the \c FORCE_LOCAL_INCLUDES tag is set to \c YES then Doxygen
will list include files with double quotes in the documentation
rather than with sharp brackets.
\anchor cfg_inline_info
<dt>\c INLINE_INFO <dd>
\addindex INLINE_INFO
......@@ -1280,6 +1290,14 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
See also section \ref doxygen_usage for information on how to generate
the style sheet that doxygen normally uses.
\anchor cfg_html_timestamp
<dt>\c HTML_TIMESTAMP <dd>
\addindex HTML_TIMESTAMP
If the \c HTML_TIMESTAMP tag is set to \c YES then the footer of
each generated HTML page will contain the date and time when the page
was generated. Setting this to NO can help when comparing the output of
multiple runs.
\anchor cfg_html_align_members
<dt>\c HTML_ALIGN_MEMBERS <dd>
\addindex HTML_ALIGN_MEMBERS
......@@ -1440,12 +1458,17 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
\anchor cfg_searchengine
<dt>\c SEARCHENGINE <dd>
\addindex SEARCHENGINE
The \c SEARCHENGINE tag specifies whether or not the HTML output should
contain a search function. Possible values are \c YES and \c NO.
If set to YES, doxygen will produce a search index, and a search box at
the top of each page (or in the side bar in case GENERATE_TREE is enabled).
The search engine is implemented using javascript and DHTML and should
work on any modern browser.
When the \c SEARCHENGINE tag is enabled doxygen will generate a search box
for the HTML output. The underlying search engine uses javascript
and DHTML and should work on any modern browser. Note that when using
HTML help (\ref cfg_generate_htmlhelp "GENERATE_HTMLHELP"),
Qt help (\ref cfg_generate_qhp "GENERATE_QHP"), or docsets
(\ref cfg_generate_docset "GENERATE_DOCSET") there is already a search
function so this one should typically be disabled. For large projects
the javascript based search engine can be slow, then enabling
\ref cfg_server_based_search "SERVER_BASED_SEARCH" may provide a
better solution.
It is possible to search using the keyboard;
to jump to the search box use access key + S (what the access key is
......@@ -1457,29 +1480,17 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
by pressing Shift+cursor down. Also here use the cursor keys to
select a filter and enter or escape to activate or cancel the filter option.
<!--
\anchor cfg_qthelp_file
<dt>\c QTHELP_FILE <dd>
\addindex QTHELP_FILE
If the \c GENERATE_HTMLHELP tag is set to \c YES, the \c QTHELP_FILE tag can
be used to specify the file name of the resulting .(qch|qhp) file.
You can add a path in front of the file if the result should not be
written to the html output directory.
\anchor cfg_qthelp_config
<dt>\c QTHELP_CONFIG <dd>
\addindex QTHELP_CONFIG
If \c DOXYGEN2QTHELP_LOC is set, \c QTHELP_CONFIG must specify the file name
of a config file to pass to doxygen2qthelp.
\anchor cfg_doxygen2qthelp_loc
<dt>\c DOXYGEN2QTHELP_LOC <dd>
\addindex DOXYGEN2QTHELP_LOC
If the \c GENERATE_HTMLHELP tag is set to \c YES, the \c DOXYGEN2QTHELP_LOC tag
can be used to specify the location (absolute path including file name) of
the doxygen2qthelp tool. If non-empty doxygen will try to run doxygen2qthelp
on the generated index.hhp.
-->
\anchor cfg_server_based_search
<dt>\c SERVER_BASED_SEARCH <dd>
\addindex SERVER_BASED_SEARCH
When the SERVER_BASED_SEARCH tag is enabled the search engine will be
implemented using a PHP enabled web server instead of at the web client
using Javascript. Doxygen will generate the search PHP script and index
file to put on the web server. The advantage of the server
based approach is that it scales better to large projects and also allows
full text search. The disadvances is that it is more difficult to setup
and does not have live searching capabilities.
\anchor cfg_disable_index
<dt>\c DISABLE_INDEX <dd>
......
......@@ -60,6 +60,7 @@ Written by Dimitri van Heesch\\[2ex]
\chapter{Preprocessing}\label{preprocessing}\hypertarget{preprocessing}{}\input{preprocessing}
\chapter{Automatic link generation}\label{autolink}\hypertarget{autolink}{}\input{autolink}
\chapter{Output Formats}\label{output}\hypertarget{output}{}\input{output}
\chapter{Searching}\label{searching}\hypertarget{searching}{}\input{searching}
\chapter{Customizing the Output}\label{customize}\hypertarget{customize}{}\input{customize}
\chapter{Custom Commands}\label{custcmd}\hypertarget{custcmd}{}\input{custcmd}
\chapter{Link to external documentation}\label{external}\hypertarget{external}{}\input{external}
......@@ -68,10 +69,10 @@ Written by Dimitri van Heesch\\[2ex]
\part{Reference Manual}
\chapter{Features}\label{features}\hypertarget{features}{}\input{features}
\chapter{Doxygen History}\label{history}\hypertarget{history}{}\input{history}
\chapter{Doxygen usage}\label{doxygen_usage}\hypertarget{doxygen_usage}{}\input{doxygen_usage}
\chapter{Doxytag usage}\label{doxytag_usage}\hypertarget{doxytag_usage}{}\input{doxytag_usage}
\chapter{Doxywizard usage}\label{doxywizard_usage}\hypertarget{doxywizard_usage}{}\input{doxywizard_usage}
\chapter{Installdox usage}\label{installdox_usage}\hypertarget{installdox_usage}{}\input{installdox_usage}
\chapter{Doxygen usage}\label{doxygen__usage}\hypertarget{doxygen__usage}{}\input{doxygen__usage}
\chapter{Doxytag usage}\label{doxytag__usage}\hypertarget{doxytag__usage}{}\input{doxytag__usage}
\chapter{Doxywizard usage}\label{doxywizard__usage}\hypertarget{doxywizard__usage}{}\input{doxywizard__usage}
\chapter{Installdox usage}\label{installdox__usage}\hypertarget{installdox__usage}{}\input{installdox__usage}
\chapter{Configuration}\label{config}\hypertarget{config}{}\input{config}
\chapter{Special Commands}\label{commands}\hypertarget{commands}{}\input{commands}
\chapter{HTML commands}\label{htmlcmds}\hypertarget{htmlcmds}{}\input{htmlcmds}
......
......@@ -74,6 +74,7 @@ The first part forms a user manual:
and members in the documentation.
<li>Section \ref output shows how to generate the various output formats
supported by doxygen.
<li>Section \ref searching shows various ways to search in the HTML documentation.
<li>Section \ref customize explains how you can customize the output generated
by doxygen.
<li>Section \ref custcmd show how to define and use custom commands in your comments.
......
......@@ -68,7 +68,7 @@ when the translator was updated.
<td>Brazilian Portuguese</td>
<td>Fabio "FJTC" Jun Takada Chino</td>
<td>jun-chino at uol dot com dot br</td>
<td>1.6.0</td>
<td>up-to-date</td>
</tr>
<tr bgcolor="#ffffff">
<td>Catalan</td>
......@@ -311,7 +311,7 @@ when the translator was updated.
\hline
Arabic & Moaz Reyad & {\tt\tiny moazreyad@yahoo.com} & 1.4.6 \\
\hline
Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt\tiny jun-chino@uol.com.br} & 1.6.0 \\
Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt\tiny jun-chino@uol.com.br} & up-to-date \\
\hline
Catalan & Maximiliano Pin & {\tt\tiny max.pin@bitroit.com} & 1.6.0 \\
~ & Albert Mora & {\tt\tiny amora@iua.upf.es} & ~ \\
......
/******************************************************************************
*
*
*
* Copyright (C) 1997-2009 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
/*! \page searching Searching
Doxygen indexes your source code in various ways to make it easier
to navigate and find what you are looking for.
There are also situations however where you want to
search for something by keyword rather than browse for it.
HTML browsers by default have no search capabilities that work across multiple
pages, so either doxygen or external tools need to help to facilitate
this feature.
Doxygen has 5 different ways to add searching to the HTML output, each of which
has its own advantages and disadvantages:
<h2>1. Client side searching</h2>
The easiest way to enable searching is to enable the built-in client
side search engine. This engine is implemented using Javascript and DHTML
only and runs entirely on the clients browser. So no additional tooling is
required to make it work.
To enable it set
\ref cfg_searchengine "SEARCHENGINE" to \c YES in the config file
and make sure \ref cfg_server_based_search "SERVER_BASED_SEARCH" is set
to \c NO.
An additional advantage of this method is that it provides live
searching, i.e. the search results are presented and adapted as you type.
This method also has its drawbacks: it is limited to searching for symbols
only. It does not provide full text search capabilities, and it does not
scale well to very large projects (then searching becomes very slow).
<h2>2. Server side searching</h2>
If you plan to put the HTML documentation on a web server, and that
web server has the capability to process PHP code, then you can also use
doxygen's built-in server side search engine.
To enable this set both
\ref cfg_searchengine "SEARCHENGINE" and
\ref cfg_server_based_search "SERVER_BASED_SEARCH" to \c YES in the config
file.
Advantages over the client side search engine are that it provides full
text search and it scales well to large projects.
Disadvantages are that it does not work locally (i.e. using a file:// URL)
and that it does not provide live search capabilities.
<h2>3. Windows Compiled HTML Help</h2>
If you are running doxygen on Windows, then you can make a
compiled HTML Help file (.chm) out of the HTML files produced by doxygen.
This is a single file containing all HTML files and it also includes a
search index. There are viewers for this format on many platforms,
and Windows even supports it natively.
To enable this set \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP" to \c YES
in the config file. To let doxygen compile the HTML Help file for you,
you also need to specify the path to the HTML compiler (hhc.exe) using the
\ref cfg_hhc_location "HHC_LOCATION" config option and the name of the
resulting CHM file using \ref cfg_chm_file "CHM_FILE".
An advantage of this method is that the result is a single file that can
easily be distributed. It also provides full text search.
Disadvantages are that compiling the CHM file only works on Windows
and requires Microsoft's HTML compiler, which is not very actively supported
by Microsoft. Although the tool works fine for most people, it can
sometimes crash for no apparent reason (how typical).
<h2>4. Mac OS X Doc Sets</h2>
If you are running doxygen on Mac OS X 10.5 or higher,
then you can make a "doc set" out of the HTML files produced by doxygen.
A doc set consists of a single directory with a special structure
containing the HTML files along with a precompiled search index.
A doc set can be embedded in Xcode (the integrated development environment
provided by Apple).
To enable the creation of doc sets set \ref cfg_generate_docset "GENERATE_DOCSET"
to \c YES in the config file. There are a couple of other doc set related
options you may want to set. After doxygen has finished you will find
a Makefile in the HTML output directory. Running "make install" on this
Makefile will compile and install the doc set.
See <a href="http://developer.apple.com/tools/creatingdocsetswithdoxygen.html">this
article</a> for more info.
Advantage of this method is that it nicely integrates with the Xcode
development environment, allowing for instance to click on an identifier
in the editor and jump to the corresponding section in the doxygen
documentation.
Disadvantage is that it only works in combination with Xcode on MacOSX.
<h2>5. Qt Compressed Help</h2>
If you develop for or want to install the Qt application framework,
you will get an application
called <a href="http://doc.trolltech.com/4.6/assistant-manual.html">Qt assistant</a>.
This is a help viewer for Qt Compressed Help files (.qch).
To enable this feature set \ref cfg_generate_qhp "GENERATE_QHP" to \c YES.
You also need to fill in the other Qt help related options, such as
\ref cfg_qhp_namespace "QHP_NAMESPACE",
\ref cfg_qhg_location "QHG_LOCATION",
\ref cfg_qhp_virtual_folder "QHP_VIRTUAL_FOLDER".
See <a href="http://doc.trolltech.com/qq/qq28-qthelp.html#htmlfilesandhelpprojects">this article</a>
for more info.
Feature wise the Qt compressed help feature is comparable with the CHM
output, with the additional advantage that compiling the QCH file is
not limited to Windows.
Disadvantage is that it requires setting up a Qt 4.5 (or better) for
each user, or distributing the Qt help assistant along with
the documentation, which is complicated by the fact that it is not
available as a separate package at this moment.
*/
......@@ -10,7 +10,7 @@ Persian, Polish, Portuguese, Romanian, Russian, Serbian,
SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian,
and Vietnamese.
Of them, 6 translators are up-to-date, 32 translators are based on
Of them, 7 translators are up-to-date, 31 translators are based on
some adapter class, and 2 are English based.
----------------------------------------------------------------------
......@@ -19,6 +19,7 @@ alphabetically). This means that they derive from the Translator class
and they implement all 221 of the required methods. Anyway, there
still may be some details listed even for them:
TranslatorBrazilian
TranslatorCzech
TranslatorDutch
TranslatorEnglish
......@@ -51,7 +52,6 @@ must be implemented to become up-to-date:
TranslatorChinese 1.6.0 5 methods to implement (2 %)
TranslatorChinesetraditional 1.6.0 5 methods to implement (2 %)
TranslatorCatalan 1.6.0 5 methods to implement (2 %)
TranslatorBrazilian 1.6.0 5 methods to implement (2 %)
TranslatorAfrikaans 1.6.0 5 methods to implement (2 %)
TranslatorGreek 1.5.4 27 methods to implement (12 %)
TranslatorDanish 1.5.4 27 methods to implement (12 %)
......@@ -154,20 +154,6 @@ TranslatorArabic (TranslatorAdapter_1_4_6) 28 methods to implement (12 %)
virtual QCString trNoDescriptionAvailable()
TranslatorBrazilian (TranslatorAdapter_1_6_0) 5 methods to implement (2 %)
-------------------
Implements 216 of the required methods (97 %).
Missing methods (should be implemented):
virtual QCString trSearching()
virtual QCString trNoMatches()
virtual QCString trLoading()
virtual QCString trGlobalNamespace()
virtual QCString trDirRelation(const char * name)
TranslatorCatalan (TranslatorAdapter_1_6_0) 5 methods to implement (2 %)
-----------------
......
......@@ -231,7 +231,7 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
......
......@@ -93,6 +93,13 @@ class BufStr
{
return m_writeOffset;
}
void dropFromStart(uint bytes)
{
if (bytes>m_size) bytes=m_size;
if (bytes>0) qmemmove(m_buf,m_buf+bytes,m_size-bytes);
m_size-=bytes;
m_writeOffset-=bytes;
}
private:
void makeRoomFor(uint size)
{
......
......@@ -1444,11 +1444,11 @@ void ClassDef::writeDocumentation(OutputList &ol)
}
}
//if (Config_getBool("SEARCHENGINE"))
//{
// Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
// Doxygen::searchIndex->addWord(localName(),TRUE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
bool exampleFlag=hasExamples();
//---------------------------------------- start flexible part -------------------------------
......
......@@ -410,26 +410,18 @@ static void popScope()
static void setCurrentDoc(const QCString &name,const QCString &base,const QCString &anchor="")
{
(void)name;
(void)base;
(void)anchor;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE") &&
// Config_getBool("SOURCE_BROWSER");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
}
}
static void addToSearchIndex(const char *text)
{
(void)text;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE") &&
// Config_getBool("SOURCE_BROWSER");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->addWord(text,FALSE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->addWord(text,FALSE);
}
}
static void setClassScope(const QCString &name)
......@@ -525,6 +517,7 @@ static void startCodeLine()
static void endFontClass();
static void startFontClass(const char *s);
static void endCodeLine()
{
......@@ -532,6 +525,17 @@ static void endCodeLine()
g_code->endCodeLine();
}
static void nextCodeLine()
{
const char * fc = g_currentFontClass;
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
g_currentFontClass = fc;
startCodeLine();
}
}
/*! write a code fragment `text' that may span multiple lines, inserting
* line numbers for each line.
*/
......@@ -550,11 +554,7 @@ static void codifyLines(char *text)
g_yyLineNr++;
*(p-1)='\0';
g_code->codify(sp);
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -586,11 +586,7 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol,
*(p-1)='\0';
//printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
ol.writeCodeLink(ref,file,anchor,sp,tooltip);
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -3022,11 +3018,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
}
<RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)? {
g_yyLineNr+=QCString(yytext).contains('\n');
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
if (g_lastSpecialCContext==SkipCxxComment)
{ // force end of C++ comment here
endFontClass();
......@@ -3054,11 +3046,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
if (Config_getBool("STRIP_CODE_COMMENTS"))
{
g_yyLineNr+=((QCString)yytext).contains('\n');
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -3081,11 +3069,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
if (Config_getBool("STRIP_CODE_COMMENTS"))
{
g_yyLineNr+=2;
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -3122,11 +3106,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
if (Config_getBool("STRIP_CODE_COMMENTS"))
{
g_yyLineNr++;
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -3157,11 +3137,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
if (Config_getBool("STRIP_CODE_COMMENTS"))
{
g_yyLineNr++;
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......
......@@ -807,7 +807,7 @@ LC "\\"{B}*"\n"
NW [^a-z_A-Z0-9]
FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+]
FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+]
FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]+"\"")
FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
......@@ -920,6 +920,10 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
}
<Comment>"</remarks>" { // end of a brief or detailed description
}
<Comment>{RCSTAG} { // RCS tag which end a brief description
setOutput(OutputDoc);
REJECT;
}
<Comment>"<!--" {
BEGIN(HtmlComment);
}
......@@ -1192,8 +1196,8 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<ClassDocArg1,CategoryDocArg1>. { // ignore other stuff
}
<ClassDocArg2>{FILE} { // second argument; include file
current->includeFile = stripQuotes(yytext);
<ClassDocArg2>{FILE}|"<>" { // second argument; include file
current->includeFile = yytext;
BEGIN( ClassDocArg3 );
}
<ClassDocArg2>{LC} { // line continuation
......@@ -1208,7 +1212,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<ClassDocArg2>. { // ignore other stuff
}
<ClassDocArg3>[<]?{FILE}[>]? { // third argument; include file name
<ClassDocArg3>[<]?{FILE}?[>]? { // third argument; include file name
current->includeName = yytext;
BEGIN( Comment );
}
......@@ -2515,9 +2519,10 @@ void groupEnterCompound(const char *fileName,int line,const char *name)
{
g_compoundName=fileName;
}
//printf("groupEnterCompound(%s)\n",name);
}
void groupLeaveCompound(const char *,int,const char *)
void groupLeaveCompound(const char *,int,const char * /*name*/)
{
//printf("groupLeaveCompound(%s)\n",name);
//if (g_memberGroupId!=DOX_NOGROUP)
......@@ -2538,7 +2543,8 @@ static int findExistingGroup(int &groupId,const MemberGroupInfo *info)
for (di.toFirst();(mi=di.current());++di)
{
if (g_compoundName==mi->compoundName && // same file or scope
stricmp(mi->header,info->header)==0 // same header
!mi->header.isEmpty() && // not a nameless group
stricmp(mi->header,info->header)==0 // same header name
)
{
//printf("Found it!\n");
......@@ -2551,14 +2557,15 @@ static int findExistingGroup(int &groupId,const MemberGroupInfo *info)
void openGroup(Entry *e,const char *,int)
{
//printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
// e->name.data(),e->section,g_autoGroupStack.count());
if (e->section==Entry::GROUPDOC_SEC) // auto group
{
g_autoGroupStack.push(new Grouping(e->name,e->groupingPri()));
//printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
// e->name.data(),e->section,g_autoGroupStack.count());
}
else // start of a member group
{
//printf(" membergroup id=%d\n",g_memberGroupId);
if (g_memberGroupId==DOX_NOGROUP) // no group started yet
{
static int curGroupId=0;
......@@ -2567,6 +2574,7 @@ void openGroup(Entry *e,const char *,int)
info->header = g_memberGroupHeader.stripWhiteSpace();
info->compoundName = g_compoundName;
g_memberGroupId = findExistingGroup(curGroupId,info);
//printf(" use membergroup %d\n",g_memberGroupId);
Doxygen::memGrpInfoDict.insert(g_memberGroupId,info);
g_memberGroupRelates = e->relates;
......
......@@ -100,7 +100,8 @@
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="kindref" type="DoxRefKind" />
<xsd:attribute name="external" type="xsd:string" />
<xsd:attribute name="external" type="xsd:string" use="optional"/>
<xsd:attribute name="tooltip" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
......@@ -464,7 +465,10 @@
<xsd:complexType name="docSimpleSectType">
<xsd:sequence>
<xsd:element name="title" type="docTitleType" minOccurs="0" />
<xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="para" type="docParaType" minOccurs="1" maxOccurs="unbounded" />
<xsd:element name="simplesectsep" type="docEmptyType" minOccurs="0"/>
</xsd:sequence>
</xsd:sequence>
<xsd:attribute name="kind" type="DoxSimpleSectKind" />
</xsd:complexType>
......
......@@ -100,7 +100,8 @@
" <xsd:extension base=\"xsd:string\">\n"
" <xsd:attribute name=\"refid\" type=\"xsd:string\" />\n"
" <xsd:attribute name=\"kindref\" type=\"DoxRefKind\" />\n"
" <xsd:attribute name=\"external\" type=\"xsd:string\" />\n"
" <xsd:attribute name=\"external\" type=\"xsd:string\" use=\"optional\"/>\n"
" <xsd:attribute name=\"tooltip\" type=\"xsd:string\" use=\"optional\"/>\n"
" </xsd:extension>\n"
" </xsd:simpleContent>\n"
" </xsd:complexType>\n"
......@@ -464,7 +465,10 @@
" <xsd:complexType name=\"docSimpleSectType\">\n"
" <xsd:sequence>\n"
" <xsd:element name=\"title\" type=\"docTitleType\" minOccurs=\"0\" />\n"
" <xsd:element name=\"para\" type=\"docParaType\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\n"
" <xsd:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">\n"
" <xsd:element name=\"para\" type=\"docParaType\" minOccurs=\"1\" maxOccurs=\"unbounded\" />\n"
" <xsd:element name=\"simplesectsep\" type=\"docEmptyType\" minOccurs=\"0\"/>\n"
" </xsd:sequence>\n"
" </xsd:sequence>\n"
" <xsd:attribute name=\"kind\" type=\"DoxSimpleSectKind\" />\n"
" </xsd:complexType>\n"
......
......@@ -1193,11 +1193,11 @@ void Config::check()
{
dotImageFormat = "png";
}
else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
{
config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
dotImageFormat = "png";
}
//else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
//{
// config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
// dotImageFormat = "png";
//}
// check dot path
......
......@@ -377,6 +377,11 @@ If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
will put a list of the files that are included by a file in the documentation
of that file.
' defval='1'/>
<option type='bool' id='FORCE_LOCAL_INCLUDES' docs='
If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
will list include files with double quotes in the documentation
rather than with sharp brackets.
' defval='0'/>
<option type='bool' id='INLINE_INFO' docs='
If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
is inserted in the documentation for inline members.
......@@ -764,6 +769,11 @@ will generate a default style sheet. Note that doxygen will try to copy
the style sheet file to the HTML output directory, so don&apos;t put your own
stylesheet in the HTML output directory as well, or it will be erased!
' defval='' depends='GENERATE_HTML'/>
<option type='bool' id='HTML_TIMESTAMP' docs='
If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
page will contain the date and time when the page was generated. Setting
this to NO can help when comparing the output of multiple runs.
' defval='0' depends='GENERATE_HTML'/>
<option type='bool' id='HTML_ALIGN_MEMBERS' docs='
If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
files or namespaces will be aligned in HTML using tables. If set to
......@@ -912,13 +922,23 @@ to manually remove any form_*.png images from the HTML output directory
to force them to be regenerated.
' minval='8' maxval='50' defval='10' depends='GENERATE_HTML'/>
<option type='bool' id='SEARCHENGINE' docs='
When the SEARCHENGINE tag is enable doxygen will generate a search box
When the SEARCHENGINE tag is enabled doxygen will generate a search box
for the HTML output. The underlying search engine uses javascript
and DHTML and should work on any modern browser. Note that when using
HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
there is already a search function so this one should typically
be disabled.
HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
(GENERATE_DOCSET) there is already a search function so this one should
typically be disabled. For large projects the javascript based search engine
can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
' defval='1' depends='GENERATE_HTML'/>
<option type='bool' id='SERVER_BASED_SEARCH' docs='
When the SERVER_BASED_SEARCH tag is enabled the search engine will be
implemented using a PHP enabled web server instead of at the web client
using Javascript. Doxygen will generate the search PHP script and index
file to put on the web server. The advantage of the server
based approach is that it scales better to large projects and allows
full text search. The disadvances is that it is more difficult to setup
and does not have live searching capabilities.
' defval='0' depends='SEARCHENGINE'/>
</group>
<group name='LaTeX' docs='configuration options related to the LaTeX output'>
<option type='bool' id='GENERATE_LATEX' docs='
......
......@@ -534,6 +534,14 @@ void addConfigOptions(Config *cfg)
TRUE
);
//----
cb = cfg->addBool(
"FORCE_LOCAL_INCLUDES",
"If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen\n"
"will list include files with double quotes in the documentation\n"
"rather than with sharp brackets.",
FALSE
);
//----
cb = cfg->addBool(
"INLINE_INFO",
"If the INLINE_INFO tag is set to YES (the default) then a tag [inline]\n"
......@@ -1092,6 +1100,15 @@ void addConfigOptions(Config *cfg)
cs->setWidgetType(ConfigString::File);
cs->addDependency("GENERATE_HTML");
//----
cb = cfg->addBool(
"HTML_TIMESTAMP",
"If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n"
"page will contain the date and time when the page was generated. Setting\n"
"this to NO can help when comparing the output of multiple runs.",
FALSE
);
cb->addDependency("GENERATE_HTML");
//----
cb = cfg->addBool(
"HTML_ALIGN_MEMBERS",
"If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,\n"
......@@ -1340,13 +1357,22 @@ void addConfigOptions(Config *cfg)
//----
cb = cfg->addBool(
"SEARCHENGINE",
"When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript\n"
"and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)\n"
"there is already a search function so this one should typically\n"
"be disabled.",
"When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript\n"
"and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should\n"
"typically be disabled. For large projects the javascript based search engine\n"
"can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.",
TRUE
);
cb->addDependency("GENERATE_HTML");
//----
cb = cfg->addBool(
"SERVER_BASED_SEARCH",
"When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index\n"
"file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup\n"
"and does not have live searching capabilities.",
FALSE
);
cb->addDependency("SEARCHENGINE");
//---------------------------------------------------------------------------
cfg->addInfo("LaTeX","configuration options related to the LaTeX output");
//---------------------------------------------------------------------------
......
......@@ -600,7 +600,11 @@ static bool readCodeFragment(const char *fileName,
}
// copy until end of line
result+=c;
if (c==':') result+=cn;
if (c==':')
{
result+=cn;
if (cn=='\n') lineNr++;
}
startLine=lineNr;
const int maxLineLength=4096;
char lineStr[maxLineLength];
......@@ -617,9 +621,10 @@ static bool readCodeFragment(const char *fileName,
{
size_read=qstrlen(p);
}
else
else // nothing read
{
size_read=-1;
lineStr[0]='\0';
}
result+=lineStr;
} while (size_read == (maxLineLength-1));
......
......@@ -1289,7 +1289,7 @@ void ClassDiagram::writeImage(QTextStream &t,const char *path,
base->drawConnectors(t,&image,TRUE,TRUE,baseRows,superRows,cellWidth,cellHeight);
super->drawConnectors(t,&image,FALSE,TRUE,baseRows,superRows,cellWidth,cellHeight);
#define IMAGE_EXT ".gif"
#define IMAGE_EXT ".png"
image.save((QCString)path+"/"+fileName+IMAGE_EXT);
Doxygen::indexList.addImageFile(QCString(fileName)+IMAGE_EXT);
......
......@@ -1551,10 +1551,10 @@ DocWord::DocWord(DocNode *parent,const QString &word) :
m_parent(parent), m_word(word)
{
//printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
//if (!g_searchUrl.isEmpty())
//{
// Doxygen::searchIndex->addWord(word,FALSE);
//}
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word,FALSE);
}
}
//---------------------------------------------------------------------------
......@@ -1567,10 +1567,10 @@ DocLinkedWord::DocLinkedWord(DocNode *parent,const QString &word,
m_tooltip(tooltip)
{
//printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
//if (!g_searchUrl.isEmpty())
//{
// Doxygen::searchIndex->addWord(word,FALSE);
//}
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word,FALSE);
}
}
//---------------------------------------------------------------------------
......@@ -6082,7 +6082,7 @@ void DocRoot::parse()
DocNode *validatingParseDoc(const char *fileName,int startLine,
Definition *ctx,MemberDef *md,
const char *input,bool /*indexWords*/,
const char *input,bool indexWords,
bool isExample, const char *exampleName,
bool singleLine, bool linkFromIndex)
{
......@@ -6094,7 +6094,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
//g_token = new TokenInfo;
// store parser state so we can re-enter this function if needed
//bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
docParserPushContext();
if (ctx &&
......@@ -6122,8 +6122,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
g_scope = ctx;
//printf("g_context=%s\n",g_context.data());
#if 0 // needed for PHP based search engine, now obsolete
if (indexWords && md && Config_getBool("SEARCHENGINE"))
if (indexWords && md && Doxygen::searchIndex)
{
g_searchUrl=md->getOutputFileBase();
Doxygen::searchIndex->setCurrentDoc(
......@@ -6131,7 +6130,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
g_searchUrl,
md->anchor());
}
else if (indexWords && ctx && Config_getBool("SEARCHENGINE"))
else if (indexWords && ctx && Doxygen::searchIndex)
{
g_searchUrl=ctx->getOutputFileBase();
QCString name = ctx->qualifiedName();
......@@ -6198,7 +6197,6 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
{
g_searchUrl="";
}
#endif
g_fileName = fileName;
g_relPath = (!linkFromIndex && ctx) ?
......@@ -6320,18 +6318,20 @@ void docFindSections(const char *input,
void initDocParser()
{
// if (Config_getBool("SEARCHENGINE"))
// {
// Doxygen::searchIndex = new SearchIndex;
// }
// else
// {
// Doxygen::searchIndex = 0;
// }
static bool searchEngine = Config_getBool("SEARCHENGINE");
static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
if (searchEngine && serverBasedSearch)
{
Doxygen::searchIndex = new SearchIndex;
}
else // no search engine or pure javascript based search function
{
Doxygen::searchIndex = 0;
}
}
void finializeDocParser()
{
// delete Doxygen::searchIndex;
delete Doxygen::searchIndex;
}
......@@ -339,7 +339,8 @@ HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"
HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"
HTMLKEYW {HTMLKEYL}|{HTMLKEYU}
LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
REFWORD ("#"|"::")?({ID}{TEMPLPART}?("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCARG}?
REFWORD2 ("#"|"::")?({ID}{TEMPLPART}?("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCARG}?
REFWORD {LABELID}|{REFWORD2}
%option noyywrap
%option yylineno
......
......@@ -125,7 +125,7 @@ NamespaceDef *Doxygen::globalScope = 0;
QDict<RefList> *Doxygen::xrefLists = new QDict<RefList>; // dictionary of cross-referenced item lists
bool Doxygen::parseSourcesNeeded = FALSE;
QTime Doxygen::runningTime;
//SearchIndex * Doxygen::searchIndex=0;
SearchIndex * Doxygen::searchIndex=0;
QDict<DefinitionIntf> *Doxygen::symbolMap;
bool Doxygen::outputToWizard=FALSE;
QDict<int> * Doxygen::htmlDirMap = 0;
......@@ -712,18 +712,31 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root)
{
//printf(">>>>>> includeFile=%s\n",root->includeFile.data());
bool local=Config_getBool("FORCE_LOCAL_INCLUDES");
QCString includeFile = root->includeFile;
if (!includeFile.isEmpty() && includeFile.at(0)=='"')
{
local = TRUE;
includeFile=includeFile.mid(1,includeFile.length()-2);
}
else if (!includeFile.isEmpty() && includeFile.at(0)=='<')
{
local = FALSE;
includeFile=includeFile.mid(1,includeFile.length()-2);
}
bool ambig;
FileDef *fd=0;
// see if we need to include a verbatim copy of the header file
//printf("root->includeFile=%s\n",root->includeFile.data());
if (!root->includeFile.isEmpty() &&
(fd=findFileDef(Doxygen::inputNameDict,root->includeFile,ambig))==0
if (!includeFile.isEmpty() &&
(fd=findFileDef(Doxygen::inputNameDict,includeFile,ambig))==0
)
{ // explicit request
QCString text;
text.sprintf("Warning: the name `%s' supplied as "
"the argument of the \\class, \\struct, \\union, or \\include command ",
root->includeFile.data()
includeFile.data()
);
if (ambig) // name is ambigious
{
......@@ -738,7 +751,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root)
}
warn(root->fileName,root->startLine,text);
}
else if (root->includeFile.isEmpty() && ifd &&
else if (includeFile.isEmpty() && ifd &&
// see if the file extension makes sense
guessSection(ifd->name())==Entry::HEADER_SEC)
{ // implicit assumption
......@@ -749,15 +762,18 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root)
if (fd)
{
QCString iName = !root->includeName.isEmpty() ?
root->includeName.data() : root->includeFile.data();
bool local=FALSE;
root->includeName : includeFile;
if (!iName.isEmpty()) // user specified include file
{
local = iName.at(0)=='"'; // is it a local include file
if (local || iName.at(0)=='<')
if (iName.at(0)=='<') local=FALSE; // explicit override
if (iName.at(0)=='"' || iName.at(0)=='<')
{
iName=iName.mid(1,iName.length()-2); // strip quotes or brackets
}
if (iName.isEmpty())
{
iName=fd->name();
}
}
else if (!Config_getList("STRIP_FROM_INC_PATH").isEmpty())
{
......@@ -4237,8 +4253,15 @@ static bool findClassRelation(
// relations.
if (!templSpec.isEmpty() && mode==TemplateInstances)
{
//printf(" => findTemplateInstanceRelation\n");
findTemplateInstanceRelation(root,context,baseClass,templSpec,templateNames,isArtificial);
// if baseClass is actually a typedef then we should not
// instantiate it, since typedefs are in a different namespace
// see bug531637 for an example where this would otherwise hang
// doxygen
if (baseClassTypeDef==0)
{
//printf(" => findTemplateInstanceRelation: %p\n",baseClassTypeDef);
findTemplateInstanceRelation(root,context,baseClass,templSpec,templateNames,isArtificial);
}
}
else if (mode==DocumentedOnly || mode==Undocumented)
{
......@@ -8466,6 +8489,7 @@ static void copyStyleSheet()
//! parse the list of input files
static void parseFiles(Entry *root,EntryNav *rootNav)
{
#if 0
void *cd = 0;
QCString inpEncoding = Config_getString("INPUT_ENCODING");
bool needsTranscoding = !inpEncoding.isEmpty();
......@@ -8477,6 +8501,7 @@ static void parseFiles(Entry *root,EntryNav *rootNav)
exit(1);
}
}
#endif
QCString *s=g_inputFiles.first();
while (s)
......@@ -10256,16 +10281,30 @@ void generateOutput()
g_outputList->writeStyleInfo(4); // write last part
g_outputList->enableAll();
static bool searchEngine = Config_getBool("SEARCHENGINE");
static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
// generate search indices (need to do this before writing other HTML
// pages as these contain a drop down menu with options depending on
// what categories we find in this function.
if (Config_getBool("SEARCHENGINE"))
if (searchEngine)
{
writeSearchIndex();
Doxygen::indexList.addImageFile("search/close.png");
Doxygen::indexList.addImageFile("search/search.png");
Doxygen::indexList.addStyleSheetFile("search/search.css");
Doxygen::indexList.addStyleSheetFile("search/search.js");
QCString searchDirName = Config_getString("HTML_OUTPUT")+"/search";
QDir searchDir(searchDirName);
if (!searchDir.exists() && !searchDir.mkdir(searchDirName))
{
err("Could not create search results directory '%s/search'\n",searchDirName.data());
return;
}
HtmlGenerator::writeSearchData(searchDirName);
writeSearchStyleSheet();
if (serverBasedSearch)
{
}
else
{
writeJavascriptSearchIndex();
}
}
//statistics();
......@@ -10433,14 +10472,12 @@ void generateOutput()
QDir::setCurrent(oldDir);
}
#if 0 // old PHP based search engine
if (Config_getBool("SEARCHENGINE"))
if (Config_getBool("GENERATE_HTML") && searchEngine && serverBasedSearch)
{
msg("Generating search index\n");
HtmlGenerator::writeSearchPage();
Doxygen::searchIndex->write(Config_getString("HTML_OUTPUT")+"/search.idx");
Doxygen::searchIndex->write(Config_getString("HTML_OUTPUT")+"/search/search.idx");
}
#endif
if (Debug::isFlagSet(Debug::Time))
{
......
......@@ -54,6 +54,11 @@ span.legend {
text-align: center;
}
h3.version {
font-size: 90%;
text-align: center;
}
div.qindex, div.navtab{
background-color: #e8eef2;
border: 1px solid #84b0c7;
......
......@@ -112,7 +112,7 @@ class Doxygen
static QCString htmlFileExtension;
static bool parseSourcesNeeded;
static QTime runningTime;
//static SearchIndex *searchIndex;
static SearchIndex *searchIndex;
static QDict<DefinitionIntf> *symbolMap;
static bool outputToWizard;
static QDict<int> *htmlDirMap;
......
......@@ -54,6 +54,11 @@
" text-align: center;\n"
"}\n"
"\n"
"h3.version {\n"
" font-size: 90%;\n"
" text-align: center;\n"
"}\n"
"\n"
"div.qindex, div.navtab{\n"
" background-color: #e8eef2;\n"
" border: 1px solid #84b0c7;\n"
......
......@@ -80,62 +80,80 @@ Entry::Entry(const Entry &e)
//printf("Entry::Entry(%p):copy\n",this);
num++;
section = e.section;
type = e.type;
name = e.name;
tagInfo = e.tagInfo;
protection = e.protection;
mtype = e.mtype;
spec = e.spec;
initLines = e.initLines;
stat = e.stat;
explicitExternal = e.explicitExternal;
proto = e.proto;
subGrouping = e.subGrouping;
callGraph = e.callGraph;
callerGraph = e.callerGraph;
virt = e.virt;
m_parent = e.m_parent;
type = e.type.copy();
name = e.name.copy();
args = e.args;
bitfields = e.bitfields.copy();
exception = e.exception.copy();
bitfields = e.bitfields;
argList = new ArgumentList;
argList->setAutoDelete(TRUE);
tArgLists = 0;
program = e.program;
includeFile = e.includeFile.copy();
includeName = e.includeFile.copy();
doc = e.doc.copy();
initializer = e.initializer;
includeFile = e.includeFile;
includeName = e.includeName;
doc = e.doc;
docLine = e.docLine;
docFile = e.docFile.copy();
relates = e.relates.copy();
relatesType = e.relatesType;
read = e.read.copy();
write = e.write.copy();
brief = e.brief.copy();
docFile = e.docFile;
brief = e.brief;
briefLine = e.briefLine;
briefFile = e.briefFile.copy();
inbodyDocs = e.inbodyDocs.copy();
briefFile = e.briefFile;
inbodyDocs = e.inbodyDocs;
inbodyLine = e.inbodyLine;
inbodyFile = e.inbodyFile.copy();
inside = e.inside.copy();
fileName = e.fileName.copy();
startLine = e.startLine;
mGrpId = e.mGrpId;
inbodyFile = e.inbodyFile;
relates = e.relates;
relatesType = e.relatesType;
read = e.read;
write = e.write;
inside = e.inside;
exception = e.exception;
typeConstr = new ArgumentList;
typeConstr->setAutoDelete(TRUE);
bodyLine = e.bodyLine;
endBodyLine = e.endBodyLine;
spec = e.spec;
initializer = e.initializer;
initLines = e.initLines;
callGraph = e.callGraph;
callerGraph = e.callerGraph;
objc = e.objc;
tagInfo = e.tagInfo;
hidden = e.hidden;
artificial = e.artificial;
m_sublist = new QList<Entry>;
m_sublist->setAutoDelete(TRUE);
mGrpId = e.mGrpId;
extends = new QList<BaseInfo>;
extends->setAutoDelete(TRUE);
groups = new QList<Grouping>;
groups->setAutoDelete(TRUE);
anchors = new QList<SectionInfo>;
argList = new ArgumentList;
argList->setAutoDelete(TRUE);
typeConstr = new ArgumentList;
typeConstr->setAutoDelete(TRUE);
tArgLists = 0;
fileName = e.fileName;
startLine = e.startLine;
if (e.sli)
{
sli = new QList<ListItemInfo>;
sli->setAutoDelete(TRUE);
QListIterator<ListItemInfo> slii(*e.sli);
ListItemInfo *ili;
for (slii.toFirst();(ili=slii.current());++slii)
{
sli->append(new ListItemInfo(*ili));
}
}
else
{
sli=0;
}
objc = e.objc;
hidden = e.hidden;
artificial = e.artificial;
groupDocType = e.groupDocType;
m_parent = e.m_parent;
m_sublist = new QList<Entry>;
m_sublist->setAutoDelete(TRUE);
// deep copy of the child entry list
QListIterator<Entry> eli(*e.m_sublist);
Entry *cur;
......@@ -194,21 +212,6 @@ Entry::Entry(const Entry &e)
tArgLists = copyArgumentLists(e.tArgLists);
}
if (e.sli)
{
sli = new QList<ListItemInfo>;
sli->setAutoDelete(TRUE);
QListIterator<ListItemInfo> slii(*e.sli);
ListItemInfo *ili;
for (slii.toFirst();(ili=slii.current());++slii)
{
sli->append(new ListItemInfo(*ili));
}
}
else
{
sli=0;
}
}
Entry::~Entry()
......
......@@ -514,11 +514,11 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.enableAll();
}
//if (Config_getBool("SEARCHENGINE"))
//{
// Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
// Doxygen::searchIndex->addWord(localName(),TRUE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{
......
......@@ -84,7 +84,7 @@ void FormulaList::generateBitmaps(const char *path)
for (fli.toFirst();(formula=fli.current());++fli)
{
QCString resultName;
resultName.sprintf("form_%d.gif",formula->getId());
resultName.sprintf("form_%d.png",formula->getId());
// only formulas for which no image exists are generated
QFileInfo fi(resultName);
if (!fi.exists())
......@@ -119,7 +119,7 @@ void FormulaList::generateBitmaps(const char *path)
for (;(pagePtr=pli.current());++pli,++pageIndex)
{
int pageNum=*pagePtr;
msg("Generating image form_%d.gif for formula\n",pageNum);
msg("Generating image form_%d.png for formula\n",pageNum);
char dviArgs[4096];
QCString formBase;
formBase.sprintf("_form%d",pageNum);
......@@ -266,9 +266,9 @@ void FormulaList::generateBitmaps(const char *path)
dstImage.setPixel(x,y,QMIN(15,(c*15)/(16*10)));
}
}
// save the result as a png
// save the result as a bitmap
QCString resultName;
resultName.sprintf("form_%d.gif",pageNum);
resultName.sprintf("form_%d.png",pageNum);
// the option parameter 1 is used here as a temporary hack
// to select the right color palette!
dstImage.save(resultName,1);
......@@ -289,8 +289,8 @@ void FormulaList::generateBitmaps(const char *path)
// remove the latex file itself
if (!formulaError) thisDir.remove("_formulas.tex");
// write/update the formula repository so we know what text the
// generated pngs represent (we use this next time to avoid regeneration
// of the pngs, and to avoid forcing the user to delete all pngs in order
// generated images represent (we use this next time to avoid regeneration
// of the images, and to avoid forcing the user to delete all images in order
// to let a browser refresh the images).
f.setName("formula.repository");
if (f.open(IO_WriteOnly))
......
......@@ -183,24 +183,18 @@ static void startFontClass(const char *s)
static void setCurrentDoc(const QCString &name,const QCString &base,const QCString &anchor="")
{
(void)name;
(void)base;
(void)anchor;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
}
}
static void addToSearchIndex(const char *text)
{
(void)text;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->addWord(text,FALSE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->addWord(text,FALSE);
}
}
/*! start a new line of code, inserting a line number if g_sourceFileDef
......
/******************************************************************************
* ftvhelp.cpp,v 1.0 2000/09/06 16:09:00
*
* Copyright (C) 1997-2008 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
* Contributed by Kenney Wong <kwong@ea.com>
* Modified by Dimitri van Heesch (c) 2003
* Modified by Dimitri van Heesch
*
* Folder Tree View for offline help on browsers that do not support HTML Help.
*/
......@@ -568,6 +579,7 @@ void FTVHelp::generateTreeView(QString* OutString)
QCString fileName;
QFile f;
static bool searchEngine = Config_getBool("SEARCHENGINE");
static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
generateTreeViewImages();
......@@ -719,7 +731,7 @@ void FTVHelp::generateTreeView(QString* OutString)
t << " </head>\n";
t << "\n";
t << " <body class=\"ftvtree\"";
if (searchEngine)
if (searchEngine && !serverBasedSearch)
{
t << " onload='searchBox.OnSelectItem(0);'";
}
......@@ -730,23 +742,39 @@ void FTVHelp::generateTreeView(QString* OutString)
t << " var searchBox = new SearchBox(\"searchBox\", \"search\", true, '"
<< theTranslator->trSearch() << "');\n";
t << " --></script>\n";
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <div class=\"MSearchBoxRow\"><span class=\"MSearchBoxLeft\">\n";
t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
<< "<img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n";
t << " <input type=\"text\" id=\"MSearchField\" value=\""
<< theTranslator->trSearch() << "\" accesskey=\"S\"\n";
t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
t << " onblur=\"searchBox.OnSearchFieldFocus(false)\" \n";
t << " onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n";
t << " </span><span class=\"MSearchBoxRight\">\n";
t << " <img id=\"MSearchSelect\" src=\"search/search.png\"\n";
t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
t << " alt=\"\"/>\n";
t << " </span></div><div class=\"MSearchBoxSpacer\">&nbsp;</div>\n";
t << " </div>\n";
HtmlGenerator::writeSearchFooter(t,QCString());
if (!serverBasedSearch)
{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <div class=\"MSearchBoxRow\"><span class=\"MSearchBoxLeft\">\n";
t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
<< "<img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n";
t << " <input type=\"text\" id=\"MSearchField\" value=\""
<< theTranslator->trSearch() << "\" accesskey=\"S\"\n";
t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
t << " onblur=\"searchBox.OnSearchFieldFocus(false)\" \n";
t << " onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n";
t << " </span><span class=\"MSearchBoxRight\">\n";
t << " <img id=\"MSearchSelect\" src=\"search/search.png\"\n";
t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n";
t << " alt=\"\"/>\n";
t << " </span></div><div class=\"MSearchBoxSpacer\">&nbsp;</div>\n";
t << " </div>\n";
HtmlGenerator::writeSearchFooter(t,QCString());
}
else
{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <form id=\"FSearchBox\" action=\"search.php\" method=\"get\" target=\"basefrm\">\n";
t << " <img id=\"MSearchSelect\" src=\"search/search.png\" alt=\"\"/>\n";
t << " <input type=\"text\" id=\"MSearchField\" name=\"query\" value=\""
<< theTranslator->trSearch() << "\" size=\"20\" accesskey=\"S\" \n";
t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
t << " onblur=\"searchBox.OnSearchFieldFocus(false)\"/>\n";
t << " </form>\n";
t << " <div class=\"MSearchBoxSpacer\">&nbsp;</div>\n";
t << " </div>\n";
}
}
t << " <div class=\"directory\">\n";
t << " <h3 class=\"swap\"><span>";
......
......@@ -812,11 +812,10 @@ void GroupDef::writeDocumentation(OutputList &ol)
addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),title);
#if 0
if (Config_getBool("SEARCHENGINE"))
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(title,getOutputFileBase());
static QRegExp we("[a-zA-Z_][a-zA-Z_0-9]*");
static QRegExp we("[a-zA-Z_][-a-zA-Z_0-9]*");
int i=0,p=0,l=0;
while ((i=we.match(title,p,&l))!=-1) // foreach word in the title
{
......@@ -824,7 +823,8 @@ void GroupDef::writeDocumentation(OutputList &ol)
p=i+l;
}
}
#endif
Doxygen::indexList.addIndexItem(this,0,0,title);
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{
......
......@@ -490,7 +490,7 @@ void HtmlDocVisitor::visit(DocFormula *f)
m_t << "\"";
/// @todo cache image dimensions on formula generation and give height/width
/// for faster preloading and better rendering of the page
m_t << " src=\"" << f->relPath() << f->name() << ".gif\"/>";
m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>";
if (bDisplay)
{
m_t << endl << "</p>" << endl;
......
This diff is collapsed.
......@@ -35,6 +35,7 @@ class HtmlGenerator : public OutputGenerator
static void writeStyleSheetFile(QFile &f);
static void writeHeaderFile(QFile &f);
static void writeFooterFile(QFile &f);
static void writeSearchPage();
void enable()
{ if (genStack->top()) active=*genStack->top(); else active=TRUE; }
......
......@@ -18,8 +18,19 @@
#include "qtbc.h"
#include "image.h"
#include "gifenc.h"
//#include "gifenc.h"
#include <qfile.h>
#include "lodepng.h"
typedef unsigned char Byte;
struct Color
{
Byte red;
Byte green;
Byte blue;
Byte alpha;
};
const int charSetWidth=80;
const int charHeight=12;
......@@ -143,16 +154,17 @@ unsigned char fontRaw[charSetWidth*charHeight] = {
static Color palette[] =
{
{ 0xff, 0xff, 0xff },
{ 0x00, 0x00, 0x00 },
{ 0xff, 0xff, 0xc0 },
{ 0x9f, 0x9f, 0x60 },
{ 0x90, 0x00, 0x00 },
{ 0x00, 0x90, 0x00 },
{ 0x00, 0x00, 0x90 },
{ 0xc0, 0xc0, 0xc0 }
{ 0xff, 0xff, 0xff, 0x00 },
{ 0x00, 0x00, 0x00, 0xff },
{ 0xff, 0xff, 0xc0, 0xff },
{ 0x9f, 0x9f, 0x60, 0xff },
{ 0x90, 0x00, 0x00, 0xff },
{ 0x00, 0x90, 0x00, 0xff },
{ 0x00, 0x00, 0x90, 0xff },
{ 0xc0, 0xc0, 0xc0, 0xff }
};
#if 0
static Color palette2[] =
{
{ 0xff, 0xff, 0xff },
......@@ -172,6 +184,28 @@ static Color palette2[] =
{ 0x10, 0x10, 0x10 },
{ 0x00, 0x00, 0x00 }
};
#endif
// for alpha we use x^(1/1.3)
static Color palette2[] =
{
{ 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x2e },
{ 0x00, 0x00, 0x00, 0x48 },
{ 0x00, 0x00, 0x00, 0x5d },
{ 0x00, 0x00, 0x00, 0x6f },
{ 0x00, 0x00, 0x00, 0x80 },
{ 0x00, 0x00, 0x00, 0x8f },
{ 0x00, 0x00, 0x00, 0x9e },
{ 0x00, 0x00, 0x00, 0xac },
{ 0x00, 0x00, 0x00, 0xb9 },
{ 0x00, 0x00, 0x00, 0xc5 },
{ 0x00, 0x00, 0x00, 0xd2 },
{ 0x00, 0x00, 0x00, 0xdd },
{ 0x00, 0x00, 0x00, 0xe9 },
{ 0x00, 0x00, 0x00, 0xf4 },
{ 0x00, 0x00, 0x00, 0xff }
};
Image::Image(int w,int h)
{
......@@ -321,6 +355,7 @@ void Image::fillRect(int x,int y,int lwidth,int lheight,uchar colIndex,uint mask
bool Image::save(const char *fileName,int mode)
{
#if 0
GifEncoder gifenc(data,
mode==0 ? palette : palette2,
width,height,
......@@ -336,5 +371,25 @@ bool Image::save(const char *fileName,int mode)
{
return FALSE;
}
#endif
uchar* buffer;
size_t bufferSize;
LodePNG_Encoder encoder;
LodePNG_Encoder_init(&encoder);
int numCols = mode==0 ? 8 : 16;
Color *pPal = mode==0 ? palette : palette2;
int i;
for (i=0;i<numCols;i++,pPal++)
{
LodePNG_InfoColor_addPalette(&encoder.infoPng.color,
pPal->red,pPal->green,pPal->blue,pPal->alpha);
}
encoder.infoPng.color.colorType = 3;
encoder.infoRaw.color.colorType = 3;
LodePNG_encode(&encoder, &buffer, &bufferSize, data, width, height);
LodePNG_saveFile(buffer, bufferSize, fileName);
free(buffer);
LodePNG_Encoder_cleanup(&encoder);
return TRUE;
}
......@@ -81,13 +81,16 @@ void countRelatedPages(int &docPages,int &indexPages);
void countDataStructures()
{
annotatedClasses = countAnnotatedClasses();
hierarchyClasses = countClassHierarchy();
countFiles(documentedHtmlFiles,documentedFiles);
countRelatedPages(documentedPages,indexedPages);
documentedGroups = countGroups();
documentedNamespaces = countNamespaces();
documentedDirs = countDirs();
annotatedClasses = countAnnotatedClasses(); // "classes" + "annotated"
hierarchyClasses = countClassHierarchy(); // "hierarchy"
countFiles(documentedHtmlFiles,documentedFiles); // "files"
countRelatedPages(documentedPages,indexedPages); // "pages"
documentedGroups = countGroups(); // "modules"
documentedNamespaces = countNamespaces(); // "namespaces"
documentedDirs = countDirs(); // "dirs"
// "globals"
// "namespacemembers"
// "functions"
}
static void startIndexHierarchy(OutputList &ol,int level)
......@@ -1573,8 +1576,8 @@ void addClassMemberNameToIndex(MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
int charCode = n.at(index);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)n.at(index);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (!n.isEmpty())
{
bool isFriendToHide = hideFriendCompounds &&
......@@ -1654,8 +1657,8 @@ void addNamespaceMemberNameToIndex(MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
int charCode = n.at(index);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)n.at(index);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (!n.isEmpty())
{
g_namespaceIndexLetterUsed[NMHL_All][letter].append(md);
......@@ -1713,8 +1716,8 @@ void addFileMemberNameToIndex(MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
int charCode = n.at(index);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)n.at(index);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (!n.isEmpty())
{
g_fileIndexLetterUsed[FMHL_All][letter].append(md);
......@@ -2202,7 +2205,10 @@ void writeNamespaceMemberIndex(OutputList &ol)
class SearchIndexList : public SDict< QList<Definition> >
{
public:
SearchIndexList(int size=17) : SDict< QList<Definition> >(size,FALSE) {}
SearchIndexList(int size=17) : SDict< QList<Definition> >(size,FALSE)
{
setAutoDelete(TRUE);
}
~SearchIndexList() {}
void append(Definition *d)
{
......@@ -2240,8 +2246,8 @@ static void addMemberToSearchIndex(
cd->templateMaster()==0)
{
QCString n = md->name();
int charCode = n.at(0);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)n.at(0);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (!n.isEmpty())
{
bool isFriendToHide = hideFriendCompounds &&
......@@ -2303,8 +2309,8 @@ static void addMemberToSearchIndex(
)
{
QCString n = md->name();
int charCode = n.at(0);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)n.at(0);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (!n.isEmpty())
{
symbols[SEARCH_INDEX_ALL][letter].append(md);
......@@ -2408,7 +2414,7 @@ class SearchIndexCategoryMapping
QString categoryLabel[NUM_SEARCH_INDICES];
};
void writeSearchIndex()
void writeJavascriptSearchIndex()
{
if (!Config_getBool("GENERATE_HTML")) return;
static bool treeView = Config_getBool("GENERATE_TREEVIEW");
......@@ -2417,8 +2423,8 @@ void writeSearchIndex()
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
int charCode = cd->localName().at(0);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)cd->localName().at(0);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (cd->isLinkable() && isId(letter))
{
g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(cd);
......@@ -2431,8 +2437,8 @@ void writeSearchIndex()
NamespaceDef *nd;
for (;(nd=nli.current());++nli)
{
int charCode = nd->name().at(0);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)nd->name().at(0);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (nd->isLinkable() && isId(letter))
{
g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(nd);
......@@ -2449,8 +2455,8 @@ void writeSearchIndex()
FileDef *fd;
for (;(fd=fni.current());++fni)
{
int charCode = fd->name().at(0);
int letter = charCode<128 ? tolower(charCode) : charCode;
uchar charCode = (uchar)fd->name().at(0);
uint letter = charCode<128 ? tolower(charCode) : charCode;
if (fd->isLinkable() && isId(letter))
{
g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(fd);
......@@ -2503,17 +2509,7 @@ void writeSearchIndex()
}
}
//ol.pushGeneratorState();
//ol.disableAllBut(OutputGenerator::Html);
QCString htmlDirName = Config_getString("HTML_OUTPUT")+"/search";
QDir htmlDir(htmlDirName);
if (!htmlDir.exists() && !htmlDir.mkdir(htmlDirName))
{
err("Could not create search results directory '%s/search'\n",htmlDirName.data());
return;
}
HtmlGenerator::writeSearchData(htmlDirName);
QCString searchDirName = Config_getString("HTML_OUTPUT")+"/search";
for (i=0;i<NUM_SEARCH_INDICES;i++)
{
......@@ -2523,7 +2519,7 @@ void writeSearchIndex()
{
QCString fileName;
fileName.sprintf("/%s_%02x.html",g_searchIndexName[i],p);
fileName.prepend(htmlDirName);
fileName.prepend(searchDirName);
QFile outFile(fileName);
if (outFile.open(IO_WriteOnly))
{
......@@ -2761,7 +2757,7 @@ void writeSearchIndex()
//ol.popGeneratorState();
{
QFile f(htmlDirName+"/search.js");
QFile f(searchDirName+"/search.js");
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
......@@ -2811,15 +2807,7 @@ void writeSearchIndex()
}
}
{
QFile f(htmlDirName+"/search.css");
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
t << search_styleSheet;
}
}
{
QFile f(htmlDirName+"/nomatches.html");
QFile f(searchDirName+"/nomatches.html");
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
......@@ -2839,6 +2827,19 @@ void writeSearchIndex()
t << "</html>" << endl;
}
}
Doxygen::indexList.addStyleSheetFile("search/search.js");
}
void writeSearchStyleSheet()
{
QCString searchDirName = Config_getString("HTML_OUTPUT")+"/search";
QFile f(searchDirName+"/search.css");
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
t << search_styleSheet;
}
Doxygen::indexList.addStyleSheetFile("search/search.css");
}
void writeSearchCategories(QTextStream &t)
......
......@@ -267,7 +267,8 @@ void addFileMemberNameToIndex(MemberDef *md);
void addNamespaceMemberNameToIndex(MemberDef *md);
// search engine
void writeSearchIndex();
void writeJavascriptSearchIndex();
void writeSearchCategories(QTextStream &t);
void writeSearchStyleSheet();
#endif
......@@ -592,7 +592,9 @@ void LatexDocVisitor::visitPre(DocSimpleSect *s)
case DocSimpleSect::User:
m_t << "\\begin{DoxyParagraph}{";
break;
case DocSimpleSect::Rcs: break;
case DocSimpleSect::Rcs:
m_t << "\\begin{DoxyParagraph}{";
break;
case DocSimpleSect::Unknown: break;
}
......@@ -657,6 +659,9 @@ void LatexDocVisitor::visitPost(DocSimpleSect *s)
case DocSimpleSect::User:
m_t << "\n\\end{DoxyParagraph}\n";
break;
case DocSimpleSect::Rcs:
m_t << "\n\\end{DoxyParagraph}\n";
break;
default:
break;
}
......
......@@ -48,7 +48,6 @@ HEADERS = bufstr.h \
filename.h \
formula.h \
ftvhelp.h \
gifenc.h \
groupdef.h \
htags.h \
htmlattrib.h \
......@@ -82,6 +81,7 @@ HEADERS = bufstr.h \
outputlist.h \
pagedef.h \
perlmodgen.h \
lodepng.h \
pre.h \
printdocvisitor.h \
pycode.h \
......@@ -98,8 +98,9 @@ HEADERS = bufstr.h \
rtfstyle.h \
scanner.h \
searchindex.h \
search_js.h \
search_css.h \
search_js.h \
search_php.h \
section.h \
sortdict.h \
store.h \
......@@ -179,7 +180,6 @@ SOURCES = ce_lex.cpp \
ftvhelp.cpp \
fortrancode.cpp \
fortranscanner.cpp \
gifenc.cpp \
groupdef.cpp \
htags.cpp \
htmldocvisitor.cpp \
......@@ -193,6 +193,7 @@ SOURCES = ce_lex.cpp \
latexdocvisitor.cpp \
latexgen.cpp \
layout.cpp \
lodepng.cpp \
logos.cpp \
mandocvisitor.cpp \
mangen.cpp \
......
......@@ -108,6 +108,9 @@ compound_xsd.h: compound.xsd
layout_default.h: layout_default.xml
cat layout_default.xml | $(TO_C_CMD) >layout_default.h
search_php.h: search.php
cat search.php | $(TO_C_CMD) >search_php.h
search_js.h: search.js
cat search.js | $(TO_C_CMD) >search_js.h
......
This diff is collapsed.
This diff is collapsed.
......@@ -1197,12 +1197,12 @@ void MemberDef::writeDeclaration(OutputList &ol,
}
// write search index info
//if (Config_getBool("SEARCHENGINE") && !isReference())
//{
// Doxygen::searchIndex->setCurrentDoc(qualifiedName(),getOutputFileBase(),anchor());
// Doxygen::searchIndex->addWord(localName(),TRUE);
// Doxygen::searchIndex->addWord(qualifiedName(),FALSE);
//}
if (Doxygen::searchIndex && isLinkableInProject())
{
Doxygen::searchIndex->setCurrentDoc(qualifiedName(),getOutputFileBase(),anchor());
Doxygen::searchIndex->addWord(localName(),TRUE);
Doxygen::searchIndex->addWord(qualifiedName(),FALSE);
}
QCString cname = d->name();
QCString cfname = getOutputFileBase();
......
......@@ -401,11 +401,11 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),displayName());
//if (Config_getBool("SEARCHENGINE"))
//{
// Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
// Doxygen::searchIndex->addWord(localName(),TRUE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
bool generateTagFile = !Config_getString("GENERATE_TAGFILE").isEmpty();
if (generateTagFile)
......
......@@ -155,6 +155,8 @@ void PageDef::writeDocumentation(OutputList &ol)
Doxygen::tagFile << " </compound>" << endl;
}
}
Doxygen::indexList.addIndexItem(this,0,0,title());
}
void PageDef::writePageDocumentation(OutputList &ol)
......
......@@ -473,6 +473,7 @@ void PerlModDocVisitor::singleItem(const char *name)
void PerlModDocVisitor::openSubBlock(const char *s)
{
leaveText();
m_output.openList(s);
m_textblockstart = true;
}
......
......@@ -1407,7 +1407,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputArray(yytext,yyleng);
BEGIN(CopyLine);
}
<Start>^{B}*[_A-Z][_A-Z0-9]*"("[^\)\n]*")"/{BN}{1,10}*[:{] { // constructors?
<Start>^{B}*[_A-Z][_A-Z0-9]*{B}*"("[^\)\n]*")"/{BN}{1,10}*[:{] { // constructors?
int i;
for (i=yyleng-1;i>=0;i--)
{
......@@ -2013,8 +2013,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(g_lastCContext);
}
}
<SkipCComment>"//" {
outputChar('/');outputChar('/');
<SkipCComment>"//"("/")* {
outputArray(yytext,yyleng);
}
<SkipCComment>"/*" {
outputChar('/');outputChar('*');
......
......@@ -281,24 +281,18 @@ static int countLines()
static void setCurrentDoc(const QCString &name,const QCString &base,const QCString &anchor="")
{
(void)name;
(void)base;
(void)anchor;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
}
}
static void addToSearchIndex(const char *text)
{
(void)text;
//static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
//if (searchEngineEnabled)
//{
// Doxygen::searchIndex->addWord(text,FALSE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->addWord(text,FALSE);
}
}
......@@ -406,6 +400,18 @@ static void endCodeLine()
g_code->endCodeLine();
}
static void nextCodeLine()
{
const char *fc = g_currentFontClass;
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
g_currentFontClass = fc;
startCodeLine();
}
}
/*! writes a link to a fragment \a text that may span multiple lines, inserting
* line numbers for each line. If \a text contains newlines, the link will be
* split into multiple links with the same destination, one for each line.
......@@ -428,11 +434,7 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol,
*(p-1)='\0';
//printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
ol.writeCodeLink(ref,file,anchor,sp,tooltip);
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -459,12 +461,7 @@ static void codifyLines(char *text)
g_yyLineNr++;
*(p-1)='\0';
g_code->codify(sp);
endCodeLine();
if (g_yyLineNr<g_inputLines)
{
// Re-enable sometime
startCodeLine();
}
nextCodeLine();
}
else
{
......@@ -1443,8 +1440,7 @@ void parsePythonCode(CodeOutputInterface &od,const char *className,
if (g_needsTermination)
{
endFontClass();
g_code->endCodeLine();
endCodeLine();
}
return;
}
......
......@@ -44,6 +44,7 @@ RefList::~RefList()
{
delete m_dictIterator;
delete m_dict;
delete m_itemList;
}
/*! Adds a new item to the list.
......
......@@ -2002,7 +2002,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
<TryFunctionBlock>.
<TryFunctionBlockEnd>"catch" { BEGIN(TryFunctionBlock); }
<TryFunctionBlockEnd>. { unput(*yytext);
<TryFunctionBlockEnd>\n { unput(*yytext); // added to fix bug id 601138
BEGIN( FindMembers );
}
<TryFunctionBlockEnd>. { unput(*yytext);
BEGIN( FindMembers );
}
<EndCppQuote>")" {
......@@ -2024,13 +2027,18 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
yyLineNr = atoi(&yytext[1]);
//printf("setting line number to %d\n",yyLineNr);
lastPreLineCtrlContext = YY_START;
current->program+=yytext;
BEGIN( PreLineCtrl );
}
<PreLineCtrl>"\""[^\n\"]*"\"" {
yyFileName = stripQuotes(yytext);
current->program+=yytext;
}
<PreLineCtrl>. {}
<PreLineCtrl>. {
current->program+=yytext;
}
<PreLineCtrl>\n {
current->program+=yytext;
yyLineNr++;
BEGIN( lastPreLineCtrlContext );
}
......@@ -3306,8 +3314,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
<ReadBody,ReadNSBody,ReadBodyIntf>. { current->program += yytext ; }
<FindMembers>"("/{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
<FindMembers>("("({BN}*{TSCOPE}{BN}*"::")*({BN}*[*&]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[] */
<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[] */
if (insidePHP) // reference parameter
{
REJECT
......@@ -3565,6 +3573,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
}
/* a non-special comment */
<ReadFuncArgType,ReadTempArgs>"/**/" { /* empty comment */ }
<ReadFuncArgType,ReadTempArgs>"/*" {
lastCContext = YY_START;
BEGIN( SkipComment );
......@@ -4536,6 +4545,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
BEGIN( FindMembers );
}
}
<CSConstraintType,CSConstraintName>"/**/" { /* empty comment */ }
<CSConstraintType,CSConstraintName>("/*"[*!]|"//"[/!])("<"?) { // special comment
fullArgString.resize(0);
lastCopyArgChar='#'; // end marker
......
/*---------------- Search Box */
#FSearchBox {
float: left;
}
#MSearchBox {
padding: 0px;
margin: 0px;
......
function readInt($file)
{
$b1 = ord(fgetc($file)); $b2 = ord(fgetc($file));
$b3 = ord(fgetc($file)); $b4 = ord(fgetc($file));
return ($b1<<24)|($b2<<16)|($b3<<8)|$b4;
}
function readString($file)
{
$result="";
while (ord($c=fgetc($file))) $result.=$c;
return $result;
}
function readHeader($file)
{
$header =fgetc($file); $header.=fgetc($file);
$header.=fgetc($file); $header.=fgetc($file);
return $header;
}
function computeIndex($word)
{
// Simple hashing that allows for substring search
if (strlen($word)<2) return -1;
// high char of the index
$hi = ord($word{0});
if ($hi==0) return -1;
// low char of the index
$lo = ord($word{1});
if ($lo==0) return -1;
// return index
return $hi*256+$lo;
}
function search($file,$word,&$statsList)
{
$index = computeIndex($word);
if ($index!=-1) // found a valid index
{
fseek($file,$index*4+4); // 4 bytes per entry, skip header
$index = readInt($file);
if ($index) // found words matching the hash key
{
$start=sizeof($statsList);
$count=$start;
fseek($file,$index);
$w = readString($file);
while ($w)
{
$statIdx = readInt($file);
if ($word==substr($w,0,strlen($word)))
{ // found word that matches (as substring)
$statsList[$count++]=array(
"word"=>$word,
"match"=>$w,
"index"=>$statIdx,
"full"=>strlen($w)==strlen($word),
"docs"=>array()
);
}
$w = readString($file);
}
$totalHi=0;
$totalFreqHi=0;
$totalFreqLo=0;
for ($count=$start;$count<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
fseek($file,$statInfo["index"]);
$numDocs = readInt($file);
$docInfo = array();
// read docs info + occurrence frequency of the word
for ($i=0;$i<$numDocs;$i++)
{
$idx=readInt($file);
$freq=readInt($file);
$docInfo[$i]=array("idx" => $idx,
"freq" => $freq>>1,
"rank" => 0.0,
"hi" => $freq&1
);
if ($freq&1) // word occurs in high priority doc
{
$totalHi++;
$totalFreqHi+=$freq*$multiplier;
}
else // word occurs in low priority doc
{
$totalFreqLo+=$freq*$multiplier;
}
}
// read name and url info for the doc
for ($i=0;$i<$numDocs;$i++)
{
fseek($file,$docInfo[$i]["idx"]);
$docInfo[$i]["name"]=readString($file);
$docInfo[$i]["url"]=readString($file);
}
$statInfo["docs"]=$docInfo;
}
$totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi;
for ($count=$start;$count<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
for ($i=0;$i<sizeof($statInfo["docs"]);$i++)
{
$docInfo = &$statInfo["docs"];
// compute frequency rank of the word in each doc
$freq=$docInfo[$i]["freq"];
if ($docInfo[$i]["hi"])
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier+$totalFreqLo)/$totalFreq;
}
else
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier)/$totalFreq;
}
}
}
}
}
return $statsList;
}
function combine_results($results,&$docs)
{
foreach ($results as $wordInfo)
{
$docsList = &$wordInfo["docs"];
foreach ($docsList as $di)
{
$key=$di["url"];
$rank=$di["rank"];
if (in_array($key, array_keys($docs)))
{
$docs[$key]["rank"]+=$rank;
}
else
{
$docs[$key] = array("url"=>$key,
"name"=>$di["name"],
"rank"=>$rank
);
}
$docs[$key]["words"][] = array(
"word"=>$wordInfo["word"],
"match"=>$wordInfo["match"],
"freq"=>$di["freq"]
);
}
}
return $docs;
}
function filter_results($docs,&$requiredWords,&$forbiddenWords)
{
$filteredDocs=array();
while (list ($key, $val) = each ($docs))
{
$words = &$docs[$key]["words"];
$copy=1; // copy entry by default
if (sizeof($requiredWords)>0)
{
foreach ($requiredWords as $reqWord)
{
$found=0;
foreach ($words as $wordInfo)
{
$found = $wordInfo["word"]==$reqWord;
if ($found) break;
}
if (!$found)
{
$copy=0; // document contains none of the required words
break;
}
}
}
if (sizeof($forbiddenWords)>0)
{
foreach ($words as $wordInfo)
{
if (in_array($wordInfo["word"],$forbiddenWords))
{
$copy=0; // document contains a forbidden word
break;
}
}
}
if ($copy) $filteredDocs[$key]=$docs[$key];
}
return $filteredDocs;
}
function compare_rank($a,$b)
{
if ($a["rank"] == $b["rank"])
{
return 0;
}
return ($a["rank"]>$b["rank"]) ? -1 : 1;
}
function sort_results($docs,&$sorted)
{
$sorted = $docs;
usort($sorted,"compare_rank");
return $sorted;
}
function report_results(&$docs)
{
echo "<table cellspacing=\"2\">\n";
echo " <tr>\n";
echo " <td colspan=\"2\"><h2>".search_results()."</h2></td>\n";
echo " </tr>\n";
$numDocs = sizeof($docs);
if ($numDocs==0)
{
echo " <tr>\n";
echo " <td colspan=\"2\">".matches_text(0)."</td>\n";
echo " </tr>\n";
}
else
{
echo " <tr>\n";
echo " <td colspan=\"2\">".matches_text($numDocs);
echo "\n";
echo " </td>\n";
echo " </tr>\n";
$num=1;
foreach ($docs as $doc)
{
echo " <tr>\n";
echo " <td align=\"right\">$num.</td>";
echo "<td><a class=\"el\" href=\"".$doc["url"]."\">".$doc["name"]."</a></td>\n";
echo " <tr>\n";
echo " <td></td><td class=\"tiny\">".report_matches()." ";
foreach ($doc["words"] as $wordInfo)
{
$word = $wordInfo["word"];
$matchRight = substr($wordInfo["match"],strlen($word));
echo "<b>$word</b>$matchRight(".$wordInfo["freq"].") ";
}
echo " </td>\n";
echo " </tr>\n";
$num++;
}
}
echo "</table>\n";
}
function main()
{
if(strcmp('4.1.0', phpversion()) > 0)
{
die("Error: PHP version 4.1.0 or above required!");
}
if (!($file=fopen("search/search.idx","rb")))
{
die("Error: Search index file could NOT be opened!");
}
if (readHeader($file)!="DOXS")
{
die("Error: Header of index file is invalid!");
}
$query="";
if (array_key_exists("query", $_GET))
{
$query=$_GET["query"];
}
end_form(preg_replace("/[^a-zA-Z0-9\-\_\.]/i", " ", $query ));
echo "&nbsp;\n<div class=\"searchresults\">\n";
$results = array();
$requiredWords = array();
$forbiddenWords = array();
$foundWords = array();
$word=strtok($query," ");
while ($word) // for each word in the search query
{
if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; }
if (($word{0}=='-')) { $word=substr($word,1); $forbiddenWords[]=$word; }
if (!in_array($word,$foundWords))
{
$foundWords[]=$word;
search($file,strtolower($word),$results);
}
$word=strtok(" ");
}
$docs = array();
combine_results($results,$docs);
// filter out documents with forbidden word or that do not contain
// required words
$filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords);
// sort the results based on rank
$sorted = array();
sort_results($filteredDocs,$sorted);
// report results to the user
report_results($sorted);
echo "</div>\n";
fclose($file);
}
main();
"/*---------------- Search Box */\n"
"\n"
"#FSearchBox {\n"
" float: left;\n"
"}\n"
"#MSearchBox {\n"
" padding: 0px;\n"
" margin: 0px;\n"
......
"function readInt($file)\n"
"{\n"
" $b1 = ord(fgetc($file)); $b2 = ord(fgetc($file));\n"
" $b3 = ord(fgetc($file)); $b4 = ord(fgetc($file));\n"
" return ($b1<<24)|($b2<<16)|($b3<<8)|$b4;\n"
"}\n"
"\n"
"function readString($file)\n"
"{\n"
" $result=\"\";\n"
" while (ord($c=fgetc($file))) $result.=$c;\n"
" return $result;\n"
"}\n"
"\n"
"function readHeader($file)\n"
"{\n"
" $header =fgetc($file); $header.=fgetc($file);\n"
" $header.=fgetc($file); $header.=fgetc($file);\n"
" return $header;\n"
"}\n"
"\n"
"function computeIndex($word)\n"
"{\n"
" // Simple hashing that allows for substring search\n"
" if (strlen($word)<2) return -1;\n"
" // high char of the index\n"
" $hi = ord($word{0});\n"
" if ($hi==0) return -1;\n"
" // low char of the index\n"
" $lo = ord($word{1});\n"
" if ($lo==0) return -1;\n"
" // return index\n"
" return $hi*256+$lo;\n"
"}\n"
"\n"
"function search($file,$word,&$statsList)\n"
"{\n"
" $index = computeIndex($word);\n"
" if ($index!=-1) // found a valid index\n"
" {\n"
" fseek($file,$index*4+4); // 4 bytes per entry, skip header\n"
" $index = readInt($file);\n"
" if ($index) // found words matching the hash key\n"
" {\n"
" $start=sizeof($statsList);\n"
" $count=$start;\n"
" fseek($file,$index);\n"
" $w = readString($file);\n"
" while ($w)\n"
" {\n"
" $statIdx = readInt($file);\n"
" if ($word==substr($w,0,strlen($word)))\n"
" { // found word that matches (as substring)\n"
" $statsList[$count++]=array(\n"
" \"word\"=>$word,\n"
" \"match\"=>$w,\n"
" \"index\"=>$statIdx,\n"
" \"full\"=>strlen($w)==strlen($word),\n"
" \"docs\"=>array()\n"
" );\n"
" }\n"
" $w = readString($file);\n"
" }\n"
" $totalHi=0;\n"
" $totalFreqHi=0;\n"
" $totalFreqLo=0;\n"
" for ($count=$start;$count<sizeof($statsList);$count++)\n"
" {\n"
" $statInfo = &$statsList[$count];\n"
" $multiplier = 1;\n"
" // whole word matches have a double weight\n"
" if ($statInfo[\"full\"]) $multiplier=2;\n"
" fseek($file,$statInfo[\"index\"]); \n"
" $numDocs = readInt($file);\n"
" $docInfo = array();\n"
" // read docs info + occurrence frequency of the word\n"
" for ($i=0;$i<$numDocs;$i++)\n"
" {\n"
" $idx=readInt($file); \n"
" $freq=readInt($file); \n"
" $docInfo[$i]=array(\"idx\" => $idx,\n"
" \"freq\" => $freq>>1,\n"
" \"rank\" => 0.0,\n"
" \"hi\" => $freq&1\n"
" );\n"
" if ($freq&1) // word occurs in high priority doc\n"
" {\n"
" $totalHi++;\n"
" $totalFreqHi+=$freq*$multiplier;\n"
" }\n"
" else // word occurs in low priority doc\n"
" {\n"
" $totalFreqLo+=$freq*$multiplier;\n"
" }\n"
" }\n"
" // read name and url info for the doc\n"
" for ($i=0;$i<$numDocs;$i++)\n"
" {\n"
" fseek($file,$docInfo[$i][\"idx\"]);\n"
" $docInfo[$i][\"name\"]=readString($file);\n"
" $docInfo[$i][\"url\"]=readString($file);\n"
" }\n"
" $statInfo[\"docs\"]=$docInfo;\n"
" }\n"
" $totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi;\n"
" for ($count=$start;$count<sizeof($statsList);$count++)\n"
" {\n"
" $statInfo = &$statsList[$count];\n"
" $multiplier = 1;\n"
" // whole word matches have a double weight\n"
" if ($statInfo[\"full\"]) $multiplier=2;\n"
" for ($i=0;$i<sizeof($statInfo[\"docs\"]);$i++)\n"
" {\n"
" $docInfo = &$statInfo[\"docs\"];\n"
" // compute frequency rank of the word in each doc\n"
" $freq=$docInfo[$i][\"freq\"];\n"
" if ($docInfo[$i][\"hi\"])\n"
" {\n"
" $statInfo[\"docs\"][$i][\"rank\"]=\n"
" (float)($freq*$multiplier+$totalFreqLo)/$totalFreq;\n"
" }\n"
" else\n"
" {\n"
" $statInfo[\"docs\"][$i][\"rank\"]=\n"
" (float)($freq*$multiplier)/$totalFreq;\n"
" }\n"
" }\n"
" }\n"
" }\n"
" }\n"
" return $statsList;\n"
"}\n"
"\n"
"function combine_results($results,&$docs)\n"
"{\n"
" foreach ($results as $wordInfo)\n"
" {\n"
" $docsList = &$wordInfo[\"docs\"];\n"
" foreach ($docsList as $di)\n"
" {\n"
" $key=$di[\"url\"];\n"
" $rank=$di[\"rank\"];\n"
" if (in_array($key, array_keys($docs)))\n"
" {\n"
" $docs[$key][\"rank\"]+=$rank;\n"
" }\n"
" else\n"
" {\n"
" $docs[$key] = array(\"url\"=>$key,\n"
" \"name\"=>$di[\"name\"],\n"
" \"rank\"=>$rank\n"
" );\n"
" }\n"
" $docs[$key][\"words\"][] = array(\n"
" \"word\"=>$wordInfo[\"word\"],\n"
" \"match\"=>$wordInfo[\"match\"],\n"
" \"freq\"=>$di[\"freq\"]\n"
" );\n"
" }\n"
" }\n"
" return $docs;\n"
"}\n"
"\n"
"function filter_results($docs,&$requiredWords,&$forbiddenWords)\n"
"{\n"
" $filteredDocs=array();\n"
" while (list ($key, $val) = each ($docs)) \n"
" {\n"
" $words = &$docs[$key][\"words\"];\n"
" $copy=1; // copy entry by default\n"
" if (sizeof($requiredWords)>0)\n"
" {\n"
" foreach ($requiredWords as $reqWord)\n"
" {\n"
" $found=0;\n"
" foreach ($words as $wordInfo)\n"
" { \n"
" $found = $wordInfo[\"word\"]==$reqWord;\n"
" if ($found) break;\n"
" }\n"
" if (!$found) \n"
" {\n"
" $copy=0; // document contains none of the required words\n"
" break;\n"
" }\n"
" }\n"
" }\n"
" if (sizeof($forbiddenWords)>0)\n"
" {\n"
" foreach ($words as $wordInfo)\n"
" {\n"
" if (in_array($wordInfo[\"word\"],$forbiddenWords))\n"
" {\n"
" $copy=0; // document contains a forbidden word\n"
" break;\n"
" }\n"
" }\n"
" }\n"
" if ($copy) $filteredDocs[$key]=$docs[$key];\n"
" }\n"
" return $filteredDocs;\n"
"}\n"
"\n"
"function compare_rank($a,$b)\n"
"{\n"
" if ($a[\"rank\"] == $b[\"rank\"]) \n"
" {\n"
" return 0;\n"
" }\n"
" return ($a[\"rank\"]>$b[\"rank\"]) ? -1 : 1; \n"
"}\n"
"\n"
"function sort_results($docs,&$sorted)\n"
"{\n"
" $sorted = $docs;\n"
" usort($sorted,\"compare_rank\");\n"
" return $sorted;\n"
"}\n"
"\n"
"function report_results(&$docs)\n"
"{\n"
" echo \"<table cellspacing=\\\"2\\\">\\n\";\n"
" echo \" <tr>\\n\";\n"
" echo \" <td colspan=\\\"2\\\"><h2>\".search_results().\"</h2></td>\\n\";\n"
" echo \" </tr>\\n\";\n"
" $numDocs = sizeof($docs);\n"
" if ($numDocs==0)\n"
" {\n"
" echo \" <tr>\\n\";\n"
" echo \" <td colspan=\\\"2\\\">\".matches_text(0).\"</td>\\n\";\n"
" echo \" </tr>\\n\";\n"
" }\n"
" else\n"
" {\n"
" echo \" <tr>\\n\";\n"
" echo \" <td colspan=\\\"2\\\">\".matches_text($numDocs);\n"
" echo \"\\n\";\n"
" echo \" </td>\\n\";\n"
" echo \" </tr>\\n\";\n"
" $num=1;\n"
" foreach ($docs as $doc)\n"
" {\n"
" echo \" <tr>\\n\";\n"
" echo \" <td align=\\\"right\\\">$num.</td>\";\n"
" echo \"<td><a class=\\\"el\\\" href=\\\"\".$doc[\"url\"].\"\\\">\".$doc[\"name\"].\"</a></td>\\n\";\n"
" echo \" <tr>\\n\";\n"
" echo \" <td></td><td class=\\\"tiny\\\">\".report_matches().\" \";\n"
" foreach ($doc[\"words\"] as $wordInfo)\n"
" {\n"
" $word = $wordInfo[\"word\"];\n"
" $matchRight = substr($wordInfo[\"match\"],strlen($word));\n"
" echo \"<b>$word</b>$matchRight(\".$wordInfo[\"freq\"].\") \";\n"
" }\n"
" echo \" </td>\\n\";\n"
" echo \" </tr>\\n\";\n"
" $num++;\n"
" }\n"
" }\n"
" echo \"</table>\\n\";\n"
"}\n"
"\n"
"function main()\n"
"{\n"
" if(strcmp('4.1.0', phpversion()) > 0) \n"
" {\n"
" die(\"Error: PHP version 4.1.0 or above required!\");\n"
" }\n"
" if (!($file=fopen(\"search/search.idx\",\"rb\"))) \n"
" {\n"
" die(\"Error: Search index file could NOT be opened!\");\n"
" }\n"
" if (readHeader($file)!=\"DOXS\")\n"
" {\n"
" die(\"Error: Header of index file is invalid!\");\n"
" }\n"
" $query=\"\";\n"
" if (array_key_exists(\"query\", $_GET))\n"
" {\n"
" $query=$_GET[\"query\"];\n"
" }\n"
" end_form(preg_replace(\"/[^a-zA-Z0-9\\-\\_\\.]/i\", \" \", $query ));\n"
" echo \"&nbsp;\\n<div class=\\\"searchresults\\\">\\n\";\n"
" $results = array();\n"
" $requiredWords = array();\n"
" $forbiddenWords = array();\n"
" $foundWords = array();\n"
" $word=strtok($query,\" \");\n"
" while ($word) // for each word in the search query\n"
" {\n"
" if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; }\n"
" if (($word{0}=='-')) { $word=substr($word,1); $forbiddenWords[]=$word; }\n"
" if (!in_array($word,$foundWords))\n"
" {\n"
" $foundWords[]=$word;\n"
" search($file,strtolower($word),$results);\n"
" }\n"
" $word=strtok(\" \");\n"
" }\n"
" $docs = array();\n"
" combine_results($results,$docs);\n"
" // filter out documents with forbidden word or that do not contain\n"
" // required words\n"
" $filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords);\n"
" // sort the results based on rank\n"
" $sorted = array();\n"
" sort_results($filteredDocs,$sorted);\n"
" // report results to the user\n"
" report_results($sorted);\n"
" echo \"</div>\\n\";\n"
" fclose($file);\n"
"}\n"
"\n"
"main();\n"
"\n"
......@@ -18,8 +18,10 @@
#include "qtbc.h"
#include "searchindex.h"
#include "config.h"
#include "util.h"
#include <qfile.h>
#include <ctype.h>
#include <qregexp.h>
// file format: (all multi-byte values are stored in big endian format)
......@@ -100,10 +102,10 @@ static int charsToIndex(const char *word)
return c1*256+c2;
}
void SearchIndex::addWord(const char *word,bool hiPriority)
void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
{
static QRegExp nextPart("[_a-z:][A-Z]");
//printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority);
//QString wStr=QString(word).lower();
QString wStr(word);
if (wStr.isEmpty()) return;
wStr=wStr.lower();
......@@ -118,6 +120,24 @@ void SearchIndex::addWord(const char *word,bool hiPriority)
m_words.insert(wStr,w);
}
w->addUrlIndex(m_urlIndex,hiPriority);
int i;
bool found=FALSE;
if (!recurse) // the first time we check if we can strip the prefix
{
i=getPrefixIndex(word);
if (i>0)
{
addWord(word+i,hiPriority,TRUE);
found=TRUE;
}
}
if (!found) // no prefix stripped
{
if ((i=nextPart.match(word))>=1)
{
addWord(word+i+1,hiPriority,TRUE);
}
}
}
......
......@@ -58,7 +58,7 @@ class SearchIndex
public:
SearchIndex();
void setCurrentDoc(const char *name,const char *baseName,const char *anchor=0);
void addWord(const char *word,bool hiPriority);
void addWord(const char *word,bool hiPriority,bool recurse=FALSE);
void write(const char *file);
private:
QDict<IndexWord> m_words;
......
/******************************************************************************
* Copyright (C) 1997-2008 by Dimitri van Heesch.
* Copyright (C) 1997-2009 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
......@@ -7,14 +7,18 @@
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* Documents produced by Doxygen are derivative workns derived from the
* input used in their production; they are not affected by this license.
*
* Brazilian Portuguese translation version 20071216
* Brazilian Portuguese translation version 20091215
* Maintainer: Fabio "FJTC" Jun Takada Chino <jun-chino at uol.com.br>
* Thanks to Jorge Ramos and others for their contributions.
* Thanks to Jorge Ramos, Fernando Carijo and others for their contributions.
*
* History:
* 20091218:
* - Updated to 1.6.1;
* - Copyright year updated;
* - Translation updates suggested by Fernando Carijó added;
* 20080709:
* - References to MAX_DOT_GRAPH_HEIGHT removed from trLegendDocs().
* 20080206:
......@@ -26,15 +30,12 @@
* - Revision number changed from doxygen version to a date string.
* - History cleanup
* - Latex babel package fixed.
* 1.4.6
* - trCallerGraph() added.
* - trEnumerationValueDocumentation() added.
* Previous history removed from this version.
*/
#ifndef TRANSLATOR_BR_H
#define TRANSLATOR_BR_H
class TranslatorBrazilian : public TranslatorAdapter_1_6_0
class TranslatorBrazilian : public Translator
{
public:
......@@ -99,11 +100,11 @@ class TranslatorBrazilian : public TranslatorAdapter_1_6_0
{
if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C"))
{
return "Campos e Atributos";
return "Campos";
}
else
{
return "Constantes";
return "Atributos";
}
}
......@@ -235,7 +236,7 @@ class TranslatorBrazilian : public TranslatorAdapter_1_6_0
if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C"))
{
return "Aqui estão as estruturas de dados e suas respectivas descrições:";
return "Aqui estão as estruturas de dados, uniões e suas respectivas descrições:";
}
else
{
......@@ -1430,7 +1431,7 @@ class TranslatorBrazilian : public TranslatorAdapter_1_6_0
/*! Put in front of the call graph for a function. */
virtual QCString trCallGraph()
{
return "Este é o grafo de chamadas para esta função:";
return "Este é o diagrama das funções utilizadas por esta função:";
}
//////////////////////////////////////////////////////////////////////////
......@@ -1563,7 +1564,7 @@ class TranslatorBrazilian : public TranslatorAdapter_1_6_0
/*! This is used to introduce a caller (or called-by) graph */
virtual QCString trCallerGraph()
{
return "Este é o diagrama de chamadas para esta função:";
return "Este é o diagrama das funções que utilizam esta função:";
}
/*! This is used in the documentation of a file/namespace before the list
......@@ -1774,5 +1775,41 @@ class TranslatorBrazilian : public TranslatorAdapter_1_6_0
{
return "Restrições do Tipo";
}
//////////////////////////////////////////////////////////////////////////
// new since 1.6.0 (mainly for the new search engine)
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name
* \todo
*/
virtual QCString trDirRelation(const char *name)
{
return "Relação " + QCString(name);
}
/*! Loading message shown when loading search results */
virtual QCString trLoading()
{
return "Carregando...";
}
/*! Label used for search results in the global namespace */
virtual QCString trGlobalNamespace()
{
return "Namespace global";
}
/*! Message shown while searching */
virtual QCString trSearching()
{
return "Procurando...";
}
/*! Text shown when no search results are found */
virtual QCString trNoMatches()
{
return "Nenhuma entrada encontrada";
}
};
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -1872,12 +1872,12 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol,
}
// write search index info
//if (Config_getBool("SEARCHENGINE"))
//{
// Doxygen::searchIndex->setCurrentDoc(mdef->qualifiedName(),mdef->getOutputFileBase(),mdef->anchor());
// Doxygen::searchIndex->addWord(mdef->localName(),TRUE);
// Doxygen::searchIndex->addWord(mdef->qualifiedName(),FALSE);
//}
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(mdef->qualifiedName(),mdef->getOutputFileBase(),mdef->anchor());
Doxygen::searchIndex->addWord(mdef->localName(),TRUE);
Doxygen::searchIndex->addWord(mdef->qualifiedName(),FALSE);
}
QCString cname = d->name();
QCString cfname = mdef->getOutputFileBase();
......
......@@ -12,7 +12,7 @@ TMAKE_CFLAGS = -pipe
TMAKE_CFLAGS_WARN_ON = -Wall -W
TMAKE_CFLAGS_WARN_OFF =
TMAKE_CFLAGS_RELEASE = -O2
TMAKE_CFLAGS_DEBUG = -g
TMAKE_CFLAGS_DEBUG = -g -fstack-protector
TMAKE_CFLAGS_SHLIB = -fPIC
TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment