From a1528245b280f1068daad8cd850ea345a3f8b568 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 3 Jun 2010 09:24:48 +0000 Subject: Release-1.6.3-20100603 --- Doxyfile | 118 ++-- INSTALL | 4 +- README | 4 +- addon/doxywizard/Makefile.in | 2 +- addon/doxywizard/doxywizard.cpp | 9 +- addon/doxywizard/doxywizard.ico | Bin 0 -> 84070 bytes addon/doxywizard/doxywizard.pro.in | 1 + addon/doxywizard/doxywizard.rc | 1 + configure | 15 +- doc/config.doc | 28 + doc/install.doc | 20 +- doc/language.doc | 77 +-- doc/maintainers.txt | 116 ++-- doc/translator.py | 68 +- doc/translator_report.txt | 103 +-- qtools/Doxyfile | 8 +- qtools/qgcache.cpp | 4 +- qtools/qgdict.cpp | 8 +- qtools/qmutex.cpp | 96 +++ qtools/qmutex.h | 83 +++ qtools/qmutex_p.h | 90 +++ qtools/qmutex_unix.cpp | 117 ++++ qtools/qmutex_win32.cpp | 108 ++++ qtools/qthread.cpp | 85 +++ qtools/qthread.h | 77 +++ qtools/qthread_p.h | 85 +++ qtools/qthread_unix.cpp | 218 +++++++ qtools/qthread_win32.cpp | 158 +++++ qtools/qtools.pro.in | 22 +- qtools/qwaitcondition.h | 68 ++ qtools/qwaitcondition_unix.cpp | 133 ++++ qtools/qwaitcondition_win32.cpp | 186 ++++++ qtools/qxml.cpp | 4 +- src/config.xml | 17 +- src/configoptions.cpp | 24 +- src/diagram.cpp | 16 +- src/docparser.cpp | 2 + src/doctokenizer.l | 25 +- src/dot.cpp | 1220 ++++++++++++++++++++++------------- src/dot.h | 100 ++- src/doxygen.cpp | 78 ++- src/doxygen.css | 28 +- src/doxygen.pro.in | 6 +- src/doxygen_css.h | 28 +- src/formula.cpp | 8 + src/ftvhelp.cpp | 10 +- src/htags.cpp | 2 + src/htmldocvisitor.cpp | 25 +- src/htmlgen.cpp | 69 +- src/htmlhelp.cpp | 1 + src/index.cpp | 53 +- src/language.cpp | 6 +- src/latexgen.cpp | 16 +- src/latexgen.h | 2 +- src/memberdef.cpp | 27 +- src/message.cpp | 10 - src/message.h | 1 - src/msc.cpp | 16 +- src/outputgen.cpp | 3 +- src/outputgen.h | 1 + src/portable.cpp | 24 +- src/portable.h | 3 + src/rtfgen.cpp | 22 +- src/translator_br.h | 67 +- src/translator_cz.h | 61 +- src/translator_es.h | 62 +- src/translator_gr.h | 900 ++++++++++++++++---------- src/translator_hr.h | 61 +- src/util.cpp | 32 +- src/util.h | 3 + tmake/lib/macosx-c++/tmake.conf | 4 +- tmake/lib/macosx-uni-c++/tmake.conf | 8 +- winbuild/Doxygen.sln | 4 +- winbuild/Doxygen.vcproj | 13 +- winbuild/Doxytag.vcproj | 13 +- winbuild/Doxywizard.vcproj | 23 +- winbuild/qtools.vcproj | 43 +- 77 files changed, 3880 insertions(+), 1373 deletions(-) create mode 100644 addon/doxywizard/doxywizard.ico create mode 100644 addon/doxywizard/doxywizard.rc create mode 100644 qtools/qmutex.cpp create mode 100644 qtools/qmutex.h create mode 100644 qtools/qmutex_p.h create mode 100644 qtools/qmutex_unix.cpp create mode 100644 qtools/qmutex_win32.cpp create mode 100644 qtools/qthread.cpp create mode 100644 qtools/qthread.h create mode 100644 qtools/qthread_p.h create mode 100644 qtools/qthread_unix.cpp create mode 100644 qtools/qthread_win32.cpp create mode 100644 qtools/qwaitcondition.h create mode 100644 qtools/qwaitcondition_unix.cpp create mode 100644 qtools/qwaitcondition_win32.cpp diff --git a/Doxyfile b/Doxyfile index 9638f25..def6ede 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,22 +1,22 @@ -# Doxyfile 1.5.9 +# Doxyfile 1.6.3 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = Doxygen -PROJECT_NUMBER = +PROJECT_NUMBER = OUTPUT_DIRECTORY = doxygen_docs CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES QT_AUTOBRIEF = NO @@ -24,12 +24,12 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 -ALIASES = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = +EXTENSION_MAPPING = BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO @@ -55,6 +55,7 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES +FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO @@ -65,13 +66,14 @@ GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES SHOW_FILES = YES SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = +FILE_VERSION_FILTER = +LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -81,7 +83,7 @@ WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text " -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- @@ -115,14 +117,14 @@ EXCLUDE = src/code.cpp \ src/vhdlscanner.cpp \ src/vhdlcode.cpp EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing @@ -140,54 +142,64 @@ VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES -HTML_OUTPUT = +HTML_OUTPUT = HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = YES GENERATE_DOCSET = YES DOCSET_FEEDNAME = "Doxygen docs" DOCSET_BUNDLE_ID = org.doxygen.Doxygen +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO GENERATE_QHP = NO -QCH_FILE = +QCH_FILE = QHP_NAMESPACE = org.doxygen.Project QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = YES USE_INLINE_TREES = YES TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = YES FORMULA_FONTSIZE = 10 SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO -LATEX_OUTPUT = +LATEX_OUTPUT = LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = PDF_HYPERLINKS = YES USE_PDFLATEX = NO LATEX_BATCHMODE = NO @@ -197,16 +209,16 @@ LATEX_SOURCE_CODE = NO # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO -RTF_OUTPUT = +RTF_OUTPUT = COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO -MAN_OUTPUT = +MAN_OUTPUT = MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- @@ -214,8 +226,8 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = +XML_SCHEMA = +XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output @@ -227,37 +239,37 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = qtools_docs/qtools.tag=../../qtools_docs/html -GENERATE_TAGFILE = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO -MSCGEN_PATH = +MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_FONTNAME = FreeSans DOT_FONTSIZE = 10 -DOT_FONTPATH = +DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES @@ -270,8 +282,8 @@ CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = +DOT_PATH = +DOTFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff --git a/INSTALL b/INSTALL index b69fafd..1ecaac2 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.6.3-20100507 +DOXYGEN Version 1.6.3-20100603 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (07 May 2010) +Dimitri van Heesch (03 June 2010) diff --git a/README b/README index 2cb931b..45fd5b1 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.6.3_20100507 +DOXYGEN Version 1.6.3_20100603 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) (07 May 2010) +Dimitri van Heesch (dimitri@stack.nl) (03 June 2010) diff --git a/addon/doxywizard/Makefile.in b/addon/doxywizard/Makefile.in index 75a3a6d..6f7c4bd 100644 --- a/addon/doxywizard/Makefile.in +++ b/addon/doxywizard/Makefile.in @@ -10,7 +10,7 @@ # See the GNU General Public License for more details. # -QMAKE=qmake +QMAKE=qmake $(MKSPECS) all: Makefile.doxywizard $(MAKE) -f Makefile.doxywizard diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 329f60e..5299c10 100644 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -4,6 +4,10 @@ #include "expert.h" #include "wizard.h" +#ifdef WIN32 +#include +#endif + #define MAX_RECENT_FILES 10 const int messageTimeout = 5000; //!< status bar message timeout in millisec. @@ -520,12 +524,13 @@ void MainWindow::showHtmlOutput() QFileInfo fi(indexFile); // TODO: the following doesn't seem to work with IE #ifdef WIN32 - QString indexUrl(QString::fromAscii("file:///")); + //QString indexUrl(QString::fromAscii("file:///")); + ShellExecute(NULL, L"open", fi.absoluteFilePath().utf16(), NULL, NULL, SW_SHOWNORMAL); #else QString indexUrl(QString::fromAscii("file://")); -#endif indexUrl+=fi.absoluteFilePath(); QDesktopServices::openUrl(QUrl(indexUrl)); +#endif } void MainWindow::saveLog() diff --git a/addon/doxywizard/doxywizard.ico b/addon/doxywizard/doxywizard.ico new file mode 100644 index 0000000..d91f219 Binary files /dev/null and b/addon/doxywizard/doxywizard.ico differ diff --git a/addon/doxywizard/doxywizard.pro.in b/addon/doxywizard/doxywizard.pro.in index b9f8f70..3b40576 100644 --- a/addon/doxywizard/doxywizard.pro.in +++ b/addon/doxywizard/doxywizard.pro.in @@ -25,3 +25,4 @@ SOURCES += doxywizard.cpp ../../src/version.cpp expert.cpp wizard.cpp \ inputbool.cpp inputstring.cpp inputint.cpp inputstrlist.cpp LEXSOURCES += config.l RESOURCES += doxywizard.qrc +win32:RC_FILE += doxywizard.rc diff --git a/addon/doxywizard/doxywizard.rc b/addon/doxywizard/doxywizard.rc new file mode 100644 index 0000000..7f5327c --- /dev/null +++ b/addon/doxywizard/doxywizard.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "doxywizard.ico" diff --git a/configure b/configure index ced9687..f1d483a 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=6 doxygen_version_revision=3 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20100507 +doxygen_version_mmn=20100603 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` @@ -268,7 +268,7 @@ if test "$f_wizard" = YES; then if test -z "$QTDIR"; then echo " QTDIR environment variable not set!" echo -n " Checking for Qt..." - for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4}; do + for d in /usr /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4}; do if test -x "$d/bin/qmake"; then QTDIR=$d fi @@ -499,6 +499,17 @@ TMAKE += -unix EOF fi +if test "$f_platform" = "macosx-c++"; then + cat >> .makeconfig <> .makeconfig <com.mycompany.MyDocSet. Doxygen will append .docset to the name. +\anchor cfg_docset_publisher_id +
\c DOCSET_PUBLISHER_ID
+When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +the documentation publisher. This should be a reverse domain-name style +string, e.g. com.mycompany.MyDocSet.documentation. + +\anchor cfg_docset_publisher_name +
\c DOCSET_PUBLISHER_NAME
+The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. \anchor cfg_generate_htmlhelp
\c GENERATE_HTMLHELP
@@ -1561,6 +1574,12 @@ and Class Hierarchy pages using a tree view instead of an ordered list. used to set the initial width (in pixels) of the frame in which the tree is shown. +\anchor cfg_ext_links_in_window +
\c EXT_LINKS_IN_WINDOW
+ \addindex EXT_LINKS_IN_WINDOW + When the \c EXT_LINKS_IN_WINDOW option is set to \c YES doxygen will open + links to external symbols imported via tag files in a separate window. + \anchor cfg_formula_fontsize
\c FORMULA_FONTSIZE
\addindex FORMULA_FONTSIZE @@ -2036,6 +2055,15 @@ TAGFILES = file1=loc1 "file2 = loc2" ... visualization toolkit from AT\&T and Lucent Bell Labs. The other options in this section have no effect if this option is set to \c NO (the default) +\anchor cfg_dot_num_threads +
\c DOT_NUM_THREADS
+ \addindex DOT_NUM_THREADS + The \c DOT_NUM_THREADS specifies the number of dot invocations doxygen is + allowed to run in parallel. When set to 0 (the default) doxygen will + base this on the number of processors available in the system. You can set it + explicitly to a value larger than 0 to get control over the balance + between CPU load and processing speed. + \anchor cfg_dot_fontname
\c DOT_FONTNAME
\addindex DOT_FONTNAME diff --git a/doc/install.doc b/doc/install.doc index e1a6a29..b213555 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -56,8 +56,8 @@ tools should be installed.
  • Qt Software's GUI toolkit - Qt - \latexonly(see {\tt http://www.trolltech.com/products/qt.html})\endlatexonly + Qt + \latexonly(see {\tt http://qt.nokia.com/})\endlatexonly \addindex Qt version 4.3 or higher. This is needed to build the GUI front-end doxywizard. @@ -410,7 +410,7 @@ You can now build the Release or Debug flavor of Doxygen and Doxytag by right-cl the project in the solutions explorer, and selecting Build. Note that compiling Doxywizard currently requires Qt version 4 -(see http://www.trolltech.com/products/qt/qt3). +(see http://qt.nokia.com/products/platform/qt-for-windows). If you do not have a commercial license, you can build Doxywizard with the open source version (see http://qtwin.sourceforge.net/qt3-win32/compile-msvc-2005.php), but I have not tried this myself. @@ -497,17 +497,11 @@ Here is what is required: steps.
  • From Doxygen-1.2.2-20001015 onwards, the distribution includes the part - of Qt-2.x.y that is needed for to compile doxygen and doxytag, + of Qt that is needed for to compile doxygen and doxytag, The Windows specific part were also created. - As a result doxygen can be compiled on systems without X11 or the - commerical version of Qt. - - For doxywizard, a complete Qt library is - still a requirement however. A commercial license to build - doxywizard with the latest Qt library was kindly donated to me - by the nice people at Qt Software. - See doxygen download page for a link. - + As a result doxygen (without the wizard) can be compiled on systems + without X11 or the (commerical) version of Qt. +
  • If you used WinZip to extract the tar archive it will (apparently) not create empty folders, so you have to add the folders objects and bin manually in the root of the diff --git a/doc/language.doc b/doc/language.doc index a26d36f..b61b9f4 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -68,12 +68,12 @@ when the translator was updated. Brazilian Portuguese Fabio "FJTC" Jun Takada Chino jun-chino at uol dot com dot br - 1.6.3 + up-to-date Catalan Maximiliano Pin
    Albert Mora - max.pin at bitroit dot com
    amora at iua dot upf dot es + max.pin at bitroit dot com
    [unreachable] 1.6.3 @@ -91,8 +91,8 @@ when the translator was updated. Croatian Boris Bralo - boris.bralo at zg dot htnet dot hr - 1.6.3 + boris.bralo at gmail dot com + up-to-date Czech @@ -145,13 +145,13 @@ when the translator was updated. Greek Paul Gessos - nickreserved at yahoo dot com - 1.5.4 + gessos.paul at yahoo dot gr + up-to-date Hungarian Ákos Kiss
    Földvári György - akiss at users dot sourceforge dot net
    foldvari lost at cyberspace + akiss at users dot sourceforge dot net
    [unreachable] 1.4.6 @@ -169,7 +169,7 @@ when the translator was updated. Japanese Hiroki Iseri
    Ryunosuke Satoh
    Kenji Nagamatsu
    Iwasa Kazmi - goyoki at gmail dot com
    sun594 at hotmail dot com
    naga at joyful dot club dot ne dot jp
    iwasa at cosmo-system dot jp + goyoki at gmail dot com
    sun594 at hotmail dot com
    naga at joyful dot club dot ne dot jp
    [unreachable] 1.6.0 @@ -181,7 +181,7 @@ when the translator was updated. Korean Kim Taedong
    SooYoung Jung
    Richard Kim - fly1004 at gmail dot com
    jung5000 at gmail dot com
    ryk at dspwiz dot com + fly1004 at gmail dot com
    jung5000 at gmail dot com
    [unreachable] 1.6.3 @@ -192,8 +192,8 @@ when the translator was updated. Lithuanian - Tomas Simonaitis
    Mindaugas Radzius
    Aidas Berukstis - haden at homelan dot lt
    mindaugasradzius at takas dot lt
    aidasber at takas dot lt + Tomas Simonaitis
    Mindaugas Radzius
    Aidas Berukstis
    -- contact lost -- + [unreachable]
    [unreachable]
    [unreachable]
    1.4.6 @@ -217,13 +217,13 @@ when the translator was updated. Polish Piotr Kaminski
    Grzegorz Kowal
    Krzysztof Kral - Piotr.Kaminski at ctm dot gdynia dot pl
    g_kowal at poczta dot onet dot pl
    krzysztof.kral at gmail dot com + [unreachable]
    [unreachable]
    krzysztof.kral at gmail dot com 1.6.3 Portuguese Rui Godinho Lopes - ruiglopes at yahoo dot com + [unreachable] 1.3.3 @@ -241,7 +241,7 @@ when the translator was updated. Serbian Dejan Milosavljevic - dmilos at email dot com + [unreachable] 1.6.0 @@ -252,8 +252,8 @@ when the translator was updated. Slovak - Stanislav Kudláč - skudlac at pobox dot sk + -- searching for the maintainer -- + 1.2.18 @@ -265,8 +265,8 @@ when the translator was updated. Spanish Bartomeu
    Francisco Oltra Thennet
    David Vaquero - bartomeu at loteria3cornella dot com
    foltra at puc dot cl
    david at grupoikusnet dot com - 1.6.3 + bartomeu at loteria3cornella dot com
    [unreachable]
    david at grupoikusnet dot com + up-to-date Swedish @@ -282,8 +282,8 @@ when the translator was updated. Ukrainian - Olexij Tkatchenko - olexij.tkatchenko at parcs dot de + -- searching for the maintainer -- + 1.4.1 @@ -311,10 +311,10 @@ 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.3 \\ + 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.3 \\ - ~ & Albert Mora & {\tt\tiny amora@iua.upf.es} & ~ \\ + ~ & Albert Mora & {\tt\tiny [unreachable] amora@iua.upf.es} & ~ \\ \hline Chinese & Li Daobing & {\tt\tiny lidaobing@gmail.com} & 1.6.0 \\ ~ & Wei Liu & {\tt\tiny liuwei@asiainfo.com} & ~ \\ @@ -322,7 +322,7 @@ when the translator was updated. Chinese Traditional & Daniel YC Lin & {\tt\tiny dlin.tw@gmail.com} & 1.6.0 \\ ~ & Gary Lee & {\tt\tiny garywlee@gmail.com} & ~ \\ \hline - Croatian & Boris Bralo & {\tt\tiny boris.bralo@zg.htnet.hr} & 1.6.3 \\ + Croatian & Boris Bralo & {\tt\tiny boris.bralo@gmail.com} & up-to-date \\ \hline Czech & Petr P\v{r}ikryl & {\tt\tiny prikrylp@skil.cz} & 1.6.3 \\ \hline @@ -340,10 +340,10 @@ when the translator was updated. \hline German & Jens Seidel & {\tt\tiny jensseidel@users.sf.net} & 1.6.3 \\ \hline - Greek & Paul Gessos & {\tt\tiny nickreserved@yahoo.com} & 1.5.4 \\ + Greek & Paul Gessos & {\tt\tiny gessos.paul@yahoo.gr} & up-to-date \\ \hline Hungarian & \'{A}kos Kiss & {\tt\tiny akiss@users.sourceforge.net} & 1.4.6 \\ - ~ & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt\tiny foldvari lost@cyberspace} & ~ \\ + ~ & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt\tiny [unreachable] foldvari lost@cyberspace} & ~ \\ \hline Indonesian & Hendy Irawan & {\tt\tiny ceefour@gauldong.net} & 1.4.6 \\ \hline @@ -353,19 +353,20 @@ when the translator was updated. Japanese & Hiroki Iseri & {\tt\tiny goyoki@gmail.com} & 1.6.0 \\ ~ & Ryunosuke Satoh & {\tt\tiny sun594@hotmail.com} & ~ \\ ~ & Kenji Nagamatsu & {\tt\tiny naga@joyful.club.ne.jp} & ~ \\ - ~ & Iwasa Kazmi & {\tt\tiny iwasa@cosmo-system.jp} & ~ \\ + ~ & Iwasa Kazmi & {\tt\tiny [unreachable] iwasa@cosmo-system.jp} & ~ \\ \hline JapaneseEn & see the Japanese language & {\tt\tiny ~} & English based \\ \hline Korean & Kim Taedong & {\tt\tiny fly1004@gmail.com} & 1.6.3 \\ ~ & SooYoung Jung & {\tt\tiny jung5000@gmail.com} & ~ \\ - ~ & Richard Kim & {\tt\tiny ryk@dspwiz.com} & ~ \\ + ~ & Richard Kim & {\tt\tiny [unreachable] ryk@dspwiz.com} & ~ \\ \hline KoreanEn & see the Korean language & {\tt\tiny ~} & English based \\ \hline - Lithuanian & Tomas Simonaitis & {\tt\tiny haden@homelan.lt} & 1.4.6 \\ - ~ & Mindaugas Radzius & {\tt\tiny mindaugasradzius@takas.lt} & ~ \\ - ~ & Aidas Berukstis & {\tt\tiny aidasber@takas.lt} & ~ \\ + Lithuanian & Tomas Simonaitis & {\tt\tiny [unreachable] haden@homelan.lt} & 1.4.6 \\ + ~ & Mindaugas Radzius & {\tt\tiny [unreachable] mindaugasradzius@takas.lt} & ~ \\ + ~ & Aidas Berukstis & {\tt\tiny [unreachable] aidasber@takas.lt} & ~ \\ + ~ & -- contact lost -- & {\tt\tiny } & ~ \\ \hline Macedonian & Slave Jovanovski & {\tt\tiny slavejovanovski@yahoo.com} & 1.6.0 \\ \hline @@ -373,34 +374,34 @@ when the translator was updated. \hline Persian & Ali Nadalizadeh & {\tt\tiny nadalizadeh@gmail.com} & 1.6.0 \\ \hline - Polish & Piotr Kaminski & {\tt\tiny Piotr.Kaminski@ctm.gdynia.pl} & 1.6.3 \\ - ~ & Grzegorz Kowal & {\tt\tiny g\_kowal@poczta.onet.pl} & ~ \\ + Polish & Piotr Kaminski & {\tt\tiny [unreachable] Piotr.Kaminski@ctm.gdynia.pl} & 1.6.3 \\ + ~ & Grzegorz Kowal & {\tt\tiny [unreachable] g\_kowal@poczta.onet.pl} & ~ \\ ~ & Krzysztof Kral & {\tt\tiny krzysztof.kral@gmail.com} & ~ \\ \hline - Portuguese & Rui Godinho Lopes & {\tt\tiny ruiglopes@yahoo.com} & 1.3.3 \\ + Portuguese & Rui Godinho Lopes & {\tt\tiny [unreachable] ruiglopes@yahoo.com} & 1.3.3 \\ \hline Romanian & Ionut Dumitrascu & {\tt\tiny reddumy@yahoo.com} & 1.6.0 \\ ~ & Alexandru Iosup & {\tt\tiny aiosup@yahoo.com} & ~ \\ \hline Russian & Alexandr Chelpanov & {\tt\tiny cav@cryptopro.ru} & 1.6.0 \\ \hline - Serbian & Dejan Milosavljevic & {\tt\tiny dmilos@email.com} & 1.6.0 \\ + Serbian & Dejan Milosavljevic & {\tt\tiny [unreachable] dmilos@email.com} & 1.6.0 \\ \hline SerbianCyrilic & Nedeljko Stefanovic & {\tt\tiny stenedjo@yahoo.com} & 1.6.0 \\ \hline - Slovak & Stanislav Kudl\'{a}\v{c} & {\tt\tiny skudlac@pobox.sk} & 1.2.18 \\ + Slovak & -- searching for the maintainer -- & {\tt\tiny } & 1.2.18 \\ \hline Slovene & Matja\v{z} Ostrover\v{s}nik & {\tt\tiny matjaz.ostroversnik@ostri.org} & 1.4.6 \\ \hline - Spanish & Bartomeu & {\tt\tiny bartomeu@loteria3cornella.com} & 1.6.3 \\ - ~ & Francisco Oltra Thennet & {\tt\tiny foltra@puc.cl} & ~ \\ + Spanish & Bartomeu & {\tt\tiny bartomeu@loteria3cornella.com} & up-to-date \\ + ~ & Francisco Oltra Thennet & {\tt\tiny [unreachable] foltra@puc.cl} & ~ \\ ~ & David Vaquero & {\tt\tiny david@grupoikusnet.com} & ~ \\ \hline Swedish & Mikael Hallin & {\tt\tiny mikaelhallin@yahoo.se} & 1.6.0 \\ \hline Turkish & Emin Ilker Cetinbas & {\tt\tiny niw3@yahoo.com} & 1.6.0 \\ \hline - Ukrainian & Olexij Tkatchenko & {\tt\tiny olexij.tkatchenko@parcs.de} & 1.4.1 \\ + Ukrainian & -- searching for the maintainer -- & {\tt\tiny } & 1.4.1 \\ \hline Vietnamese & Dang Minh Tuan & {\tt\tiny tuanvietkey@gmail.com} & 1.6.0 \\ \hline diff --git a/doc/maintainers.txt b/doc/maintainers.txt index 754cb1b..e7a1028 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -8,135 +8,141 @@ % The following one or more lines contain information about % the maintainer(s) for the language (one line, one maintainer) % in the form: +% If the is prefixed [unreachable] it is not displayed in the table +% of maintainers in the Doxygen documentation, nor it is used when building +% the mailto.txt by translator.py. TranslatorAfrikaans -Johan Prinsloo: johan@zippysnoek.com +Johan Prinsloo: johan at zippysnoek dot com TranslatorArabic -Moaz Reyad: moazreyad@yahoo.com +Moaz Reyad: moazreyad at yahoo dot com TranslatorBrazilian -Fabio "FJTC" Jun Takada Chino: jun-chino@uol.com.br +Fabio "FJTC" Jun Takada Chino: jun-chino at uol dot com dot br TranslatorCatalan -Maximiliano Pin: max.pin@bitroit.com -Albert Mora: amora@iua.upf.es +Maximiliano Pin: max dot pin at bitroit dot com +Albert Mora: [unreachable] amora at iua dot upf dot es TranslatorChinese -Li Daobing: lidaobing@gmail.com -Wei Liu: liuwei@asiainfo.com +Li Daobing: lidaobing at gmail dot com +Wei Liu: liuwei at asiainfo dot com TranslatorChinesetraditional -Daniel YC Lin: dlin.tw@gmail.com -Gary Lee: garywlee@gmail.com +Daniel YC Lin: dlin dot tw at gmail dot com +Gary Lee: garywlee at gmail dot com TranslatorCroatian -Boris Bralo: boris.bralo@zg.htnet.hr +Boris Bralo: boris dot bralo at gmail dot com TranslatorCzech -Petr Přikryl: prikrylp@skil.cz +Petr Přikryl: prikrylp at skil dot cz TranslatorDanish -Erik Søe Sørensen: eriksoe+doxygen@daimi.au.dk +Erik Søe Sørensen: eriksoe+doxygen at daimi dot au dot dk TranslatorDutch -Dimitri van Heesch: dimitri@stack.nl +Dimitri van Heesch: dimitri at stack dot nl TranslatorEnglish -Dimitri van Heesch: dimitri@stack.nl +Dimitri van Heesch: dimitri at stack dot nl TranslatorEsperanto -Ander Martinez: dwarfnauko@gmail.com +Ander Martinez: dwarfnauko at gmail dot com TranslatorFinnish -Antti Laine: antti.a.laine@tut.fi +Antti Laine: antti dot a dot laine at tut dot fi TranslatorFrench -Xavier Outhier: xouthier@yahoo.fr +Xavier Outhier: xouthier at yahoo dot fr TranslatorGerman -Jens Seidel: jensseidel@users.sf.net +Jens Seidel: jensseidel at users dot sf dot net TranslatorGreek -Paul Gessos: nickreserved@yahoo.com +Paul Gessos: gessos dot paul at yahoo dot gr TranslatorHungarian -Ákos Kiss: akiss@users.sourceforge.net -Földvári György: foldvari lost@cyberspace +Ákos Kiss: akiss at users dot sourceforge dot net +Földvári György: [unreachable] foldvari lost at cyberspace TranslatorIndonesian -Hendy Irawan: ceefour@gauldong.net +Hendy Irawan: ceefour at gauldong dot net TranslatorItalian -Alessandro Falappa: alessandro@falappa.net -Ahmed Aldo Faisal: aaf23@cam.ac.uk +Alessandro Falappa: alessandro at falappa dot net +Ahmed Aldo Faisal: aaf23 at cam dot ac dot uk TranslatorJapanese -Hiroki Iseri: goyoki@gmail.com -Ryunosuke Satoh: sun594@hotmail.com -Kenji Nagamatsu: naga@joyful.club.ne.jp -Iwasa Kazmi: iwasa@cosmo-system.jp +Hiroki Iseri: goyoki at gmail dot com +Ryunosuke Satoh: sun594 at hotmail dot com +Kenji Nagamatsu: naga at joyful dot club dot ne dot jp +Iwasa Kazmi: [unreachable] iwasa at cosmo-system dot jp TranslatorKorean -Kim Taedong: fly1004@gmail.com -SooYoung Jung: jung5000@gmail.com -Richard Kim: ryk@dspwiz.com +Kim Taedong: fly1004 at gmail dot com +SooYoung Jung: jung5000 at gmail dot com +Richard Kim: [unreachable] ryk at dspwiz dot com TranslatorLithuanian -Tomas Simonaitis: haden@homelan.lt -Mindaugas Radzius: mindaugasradzius@takas.lt -Aidas Berukstis: aidasber@takas.lt +Tomas Simonaitis: [unreachable] haden at homelan dot lt +Mindaugas Radzius: [unreachable] mindaugasradzius at takas dot lt +Aidas Berukstis: [unreachable] aidasber at takas dot lt +-- contact lost --: TranslatorNorwegian -Lars Erik Jordet: lejordet@gmail.com +Lars Erik Jordet: lejordet at gmail dot com TranslatorMacedonian -Slave Jovanovski: slavejovanovski@yahoo.com +Slave Jovanovski: slavejovanovski at yahoo dot com TranslatorPersian -Ali Nadalizadeh: nadalizadeh@gmail.com +Ali Nadalizadeh: nadalizadeh at gmail dot com TranslatorPolish -Piotr Kaminski: Piotr.Kaminski@ctm.gdynia.pl -Grzegorz Kowal: g_kowal@poczta.onet.pl -Krzysztof Kral: krzysztof.kral@gmail.com +Piotr Kaminski: [unreachable] Piotr dot Kaminski at ctm dot gdynia dot pl +Grzegorz Kowal: [unreachable] g_kowal at poczta dot onet dot pl +Krzysztof Kral: krzysztof dot kral at gmail dot com TranslatorPortuguese -Rui Godinho Lopes: ruiglopes@yahoo.com +Rui Godinho Lopes: [unreachable] ruiglopes at yahoo dot com TranslatorRomanian -Ionut Dumitrascu: reddumy@yahoo.com -Alexandru Iosup: aiosup@yahoo.com +Ionut Dumitrascu: reddumy at yahoo dot com +Alexandru Iosup: aiosup at yahoo dot com TranslatorRussian -Alexandr Chelpanov: cav@cryptopro.ru +Alexandr Chelpanov: cav at cryptopro dot ru TranslatorSerbian -Dejan Milosavljevic: dmilos@email.com +Dejan Milosavljevic: [unreachable] dmilos at email dot com TranslatorSerbianCyrilic -Nedeljko Stefanovic: stenedjo@yahoo.com +Nedeljko Stefanovic: stenedjo at yahoo dot com TranslatorSlovak -Stanislav Kudláč: skudlac@pobox.sk +% Stanislav Kudláč: [unreachable] skudlac at pobox dot sk +-- searching for the maintainer --: TranslatorSlovene -Matjaž Ostroveršnik: matjaz.ostroversnik@ostri.org +Matjaž Ostroveršnik: matjaz dot ostroversnik at ostri dot org TranslatorSpanish -Bartomeu: bartomeu@loteria3cornella.com -Francisco Oltra Thennet: foltra@puc.cl -David Vaquero: david@grupoikusnet.com +Bartomeu: bartomeu at loteria3cornella dot com +Francisco Oltra Thennet: [unreachable] foltra at puc dot cl +David Vaquero: david at grupoikusnet dot com TranslatorSwedish -Mikael Hallin: mikaelhallin@yahoo.se +Mikael Hallin: mikaelhallin at yahoo dot se TranslatorUkrainian -Olexij Tkatchenko: olexij.tkatchenko@parcs.de +% (resigned) Olexij Tkatchenko: olexij at tkatchenko dot com +-- searching for the maintainer --: TranslatorVietnamese -Dang Minh Tuan: tuanvietkey@gmail.com +Dang Minh Tuan: tuanvietkey at gmail dot com TranslatorTurkish -Emin Ilker Cetinbas: niw3@yahoo.com +Emin Ilker Cetinbas: niw3 at yahoo dot com diff --git a/doc/translator.py b/doc/translator.py index 409b9ec..dd8fa00 100644 --- a/doc/translator.py +++ b/doc/translator.py @@ -52,6 +52,10 @@ 2008/06/09 - Warning when the MAX_DOT_GRAPH_HEIGHT is still part of trLegendDocs(). 2009/05/09 - Changed HTML output to fit it with XHTML DTD 2009/09/02 - Added percentage info to the report (implemented / to be implemented). + 2010/02/09 - Added checking/suggestion 'Reimplementation using UTF-8 suggested. + 2010/03/03 - Added [unreachable] prefix used in maintainers.txt. + 2010/05/28 - BOM skipped; minor code cleaning. + 2010/05/31 - e-mail mangled already in maintainers.txt """ from __future__ import generators @@ -223,7 +227,7 @@ class Transl: # Open the file for reading and extracting tokens until the eof. # Initialize the finite automaton. - f = file(self.fname) + f = open(self.fname) lineNo = 0 line = '' # init -- see the pos initialization below linelen = 0 # init @@ -242,9 +246,11 @@ class Transl: else: lineNo += 1 line = f.readline() + if line.startswith('\xef\xbb\xbf'): + line = line[3:] # skip the BOM linelen = len(line) pos = 0 - if line == '': # eof + if line == '': # eof status = 777 else: c = line[pos] @@ -1439,7 +1445,7 @@ class TrManager: self.numLang -= 1 # the couple will be counted as one # Extract the version of Doxygen. - f = file(os.path.join(self.doxy_path, 'VERSION')) + f = open(os.path.join(self.doxy_path, 'VERSION')) self.doxVersion = f.readline().strip() f.close() @@ -1487,7 +1493,7 @@ class TrManager: # Read content of the file as one string. assert os.path.isfile(fname) - f = file(fname) + f = open(fname) cont = f.read() f.close() @@ -1525,11 +1531,19 @@ class TrManager: return trdic - + def __emails(self, classId): + """Returns the list of maintainer emails. - def __email(self, classId): - """Returns the first maintainer for the translator class""" - return self.__maintainersDic[classId][0][1] + The method returns the list of e-mail adresses for the translator + class, but only the addresses that were not marked as [unreachable].""" + lst = [] + for m in self.__maintainersDic[classId]: + if not m[1].startswith('[unreachable]'): + email = m[1] + email = email.replace(' at ', '@') # Unmangle the mangled e-mail + email = email.replace(' dot ', '.') + lst.append(email) + return lst def generateTranslatorReport(self): @@ -1538,7 +1552,7 @@ class TrManager: output = os.path.join(self.doc_path, self.translatorReportFileName) # Open the textual report file for the output. - f = file(output, 'w') + f = open(output, 'w') # Output the information about the version. f.write('(' + self.doxVersion + ')\n\n') @@ -1566,7 +1580,7 @@ class TrManager: # The e-mail addresses of the maintainers will be collected to # the auxiliary file in the order of translator classes listed # in the translator report. - fmail = file('mailto.txt', 'w') + fmail = open('mailto.txt', 'w') # Write the list of up-to-date translator classes. if self.upToDateIdLst: @@ -1586,7 +1600,7 @@ class TrManager: if obj.note: f.write(' -- ' + obj.note) f.write('\n') - mailtoLst.append(self.__email(obj.classId)) + mailtoLst.extend(self.__emails(obj.classId)) fmail.write('up-to-date\n') fmail.write('; '.join(mailtoLst)) @@ -1620,7 +1634,7 @@ class TrManager: if obj.note: f.write('\n\tNote: ' + obj.note + '\n') f.write('\n') - mailtoLst.append(self.__email(obj.classId)) # to maintainer + mailtoLst.extend(self.__emails(obj.classId)) # to maintainer # Check the level of required adapter classes. if obj.status != '0.0.00' and obj.status < adaptMinVersion: @@ -1723,7 +1737,7 @@ class TrManager: self.lastModificationTime = tim # Process the content of the maintainers file. - f = file(fname) + f = open(fname) inside = False # inside the record for the language lineReady = True classId = None @@ -1753,7 +1767,8 @@ class TrManager: self.__maintainersDic[classId] = [] # Split the information about the maintainer and append - # the tuple. + # the tuple. The address may be prefixed '[unreachable]'. + # This will be processed later. lst = line.split(':', 1) assert(len(lst) == 2) t = (lst[0].strip(), lst[1].strip()) @@ -1786,7 +1801,7 @@ class TrManager: # # Read the template of the documentation, and remove the first # attention lines. - f = file(fTplName) + f = open(fTplName) line = f.readline() while line[0] != '/': line = f.readline() @@ -1862,20 +1877,17 @@ class TrManager: if not mm and self.__maintainersDic.has_key(obj.classId): lm = [ m[0] for m in self.__maintainersDic[obj.classId] ] mm = '
    '.join(lm) - le = [ m[1] for m in self.__maintainersDic[obj.classId] ] + + # Unreachable adresses will not be displayed at all. + le = [] + for m in self.__maintainersDic[obj.classId]: + address = m[1] + if address.startswith('[unreachable]'): + address = '[unreachable]' + le.append(address) ee = '
    '.join(le) - # Mangle the e-mail and replace the entity references. - if ee and ee != ' ': - # More than one maintainer address separated by
    can be used. - emails = ee.split('
    ') - mangled_list = [] - for email in emails: - name, domain = email.split('@') - domain = domain.replace('.', ' dot ') - mangled_list.append(name + ' at ' + domain) - ee = '
    '.join(mangled_list) - + # Replace the entity references. if mm: mm = mm.replace('č', 'č') mm = mm.replace('ř', 'ř') @@ -1973,7 +1985,7 @@ class TrManager: tplDic['informationTable'] = htmlTable + '\n' + latexTable # Insert the symbols into the document template and write it down. - f = file(fDocName, 'w') + f = open(fDocName, 'w') f.write(doctpl % tplDic) f.close() diff --git a/doc/translator_report.txt b/doc/translator_report.txt index e2d9cc8..9501c7d 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -10,7 +10,7 @@ Persian, Polish, Portuguese, Romanian, Russian, Serbian, SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese. -Of them, 2 translators are up-to-date, 36 translators are based on +Of them, 6 translators are up-to-date, 32 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -19,8 +19,12 @@ alphabetically). This means that they derive from the Translator class and they implement all 225 of the required methods. Anyway, there still may be some details listed even for them: + TranslatorBrazilian + TranslatorCroatian TranslatorDutch TranslatorEnglish + TranslatorGreek + TranslatorSpanish -- The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs() ---------------------------------------------------------------------- The following translator classes need some maintenance (the most @@ -28,7 +32,6 @@ obsolete at the end). The other info shows the estimation of Doxygen version when the class was last updated and number of methods that must be implemented to become up-to-date: - TranslatorSpanish 1.6.3 4 methods to implement (1 %) TranslatorPolish 1.6.3 4 methods to implement (1 %) TranslatorKorean 1.6.3 4 methods to implement (1 %) Note: Reimplementation using UTF-8 suggested. @@ -39,11 +42,7 @@ must be implemented to become up-to-date: TranslatorEsperanto 1.6.3 4 methods to implement (1 %) TranslatorCzech 1.6.3 4 methods to implement (1 %) - TranslatorCroatian 1.6.3 4 methods to implement (1 %) TranslatorCatalan 1.6.3 4 methods to implement (1 %) - TranslatorBrazilian 1.6.3 4 methods to implement (1 %) - Note: Reimplementation using UTF-8 suggested. - TranslatorVietnamese 1.6.0 9 methods to implement (4 %) TranslatorTurkish 1.6.0 9 methods to implement (4 %) TranslatorSwedish 1.6.0 9 methods to implement (4 %) @@ -77,9 +76,6 @@ must be implemented to become up-to-date: TranslatorAfrikaans 1.6.0 9 methods to implement (4 %) Note: Reimplementation using UTF-8 suggested. - TranslatorGreek 1.5.4 31 methods to implement (13 %) - Note: Reimplementation using UTF-8 suggested. - TranslatorDanish 1.5.4 31 methods to implement (13 %) Note: Reimplementation using UTF-8 suggested. @@ -209,19 +205,6 @@ TranslatorArabic (TranslatorAdapter_1_4_6) 32 methods to implement (14 %) virtual QCString trNoDescriptionAvailable() -TranslatorBrazilian (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) -------------------- - - Implements 221 of the required methods (98 %). - - Missing methods (should be implemented): - - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trFileIn(const char * name) - virtual QCString trDirDependency(const char * name) - virtual QCString trIncludesFileIn(const char * name) - - TranslatorCatalan (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) ----------------- @@ -271,19 +254,6 @@ TranslatorChinesetraditional (TranslatorAdapter_1_6_0) 9 methods to implement virtual QCString trIncludesFileIn(const char * name) -TranslatorCroatian (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) ------------------- - - Implements 221 of the required methods (98 %). - - Missing methods (should be implemented): - - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trFileIn(const char * name) - virtual QCString trDirDependency(const char * name) - virtual QCString trIncludesFileIn(const char * name) - - TranslatorCzech (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) --------------- @@ -394,58 +364,6 @@ TranslatorGerman (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) virtual QCString trIncludesFileIn(const char * name) -TranslatorGreek (TranslatorAdapter_1_5_4) 31 methods to implement (13 %) ---------------- - - Implements 194 of the required methods (86 %). - - Missing methods (should be implemented): - - virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) - virtual QCString trSearching() - virtual QCString trNoMatches() - virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, bool single) - virtual QCString trLoading() - virtual QCString trSubprograms() - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trModulesListDescription(bool extractAll) - virtual QCString trModulesList() - virtual QCString trTypeConstraints() - virtual QCString trFileIn(const char * name) - virtual QCString trGlobalNamespace() - virtual QCString trMemberFunctionDocumentationFortran() - virtual QCString trCompoundListDescriptionFortran() - virtual QCString trTypeDocumentation() - virtual QCString trModuleReference(const char * namespaceName) - virtual QCString trModulesMemberDescription(bool extractAll) - virtual QCString trModulesMembers() - virtual QCString trModulesIndex() - virtual QCString trDirRelation(const char * name) - virtual QCString trCompoundListFortran() - virtual QCString trDataTypes() - virtual QCString trDirDependency(const char * name) - virtual QCString trIncludesFileIn(const char * name) - virtual QCString trCompoundIndexFortran() - virtual QCString trSubprogram(bool first_capital, bool singular) - virtual QCString trCompoundReferenceFortran(const char * clName, ClassDef::CompoundType compType, bool isTemplate) - virtual QCString trType(bool first_capital, bool singular) - virtual QCString trModule(bool first_capital, bool singular) - virtual QCString trCompoundMembersFortran() - virtual QCString trSubprogramDocumentation() - - Obsolete methods (should be removed, never used): - - virtual QCString trHeaderFilesDescription() - virtual QCString trField(bool first_capital, bool singular) - virtual QCString trPackageDocumentation() - virtual QCString trSources() - virtual QCString trReimplementedForInternalReasons() - virtual QCString trInterfaces() - virtual QCString trHeaderFiles() - virtual QCString trBugsAndLimitations() - virtual QCString trNoDescriptionAvailable() - - TranslatorHungarian (TranslatorAdapter_1_4_6) 33 methods to implement (14 %) ------------------- @@ -1039,17 +957,10 @@ TranslatorSlovene (TranslatorAdapter_1_4_6) 33 methods to implement (14 %) virtual QCString trSubprogramDocumentation() -TranslatorSpanish (TranslatorAdapter_1_6_3) 4 methods to implement (1 %) +TranslatorSpanish (Translator) ----------------- - Implements 221 of the required methods (98 %). - - Missing methods (should be implemented): - - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trFileIn(const char * name) - virtual QCString trDirDependency(const char * name) - virtual QCString trIncludesFileIn(const char * name) + Implements 225 of the required methods (100 %). TranslatorSwedish (TranslatorAdapter_1_6_0) 9 methods to implement (4 %) diff --git a/qtools/Doxyfile b/qtools/Doxyfile index 61f9093..bf28583 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -131,8 +131,8 @@ HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_COLORSTYLE_HUE = 220 -HTML_COLORSTYLE_SAT = 70 -HTML_COLORSTYLE_GAMMA = 60 +HTML_COLORSTYLE_SAT = 80 +HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = NO @@ -163,6 +163,7 @@ ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = YES USE_INLINE_TREES = NO TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 SEARCHENGINE = YES SERVER_BASED_SEARCH = NO @@ -244,7 +245,8 @@ CLASS_DIAGRAMS = YES MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES -DOT_FONTNAME = FreeSans +DOT_NUM_THREADS = 0 +DOT_FONTNAME = FreeSans.ttf DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = YES diff --git a/qtools/qgcache.cpp b/qtools/qgcache.cpp index 1fd876d..89282c7 100644 --- a/qtools/qgcache.cpp +++ b/qtools/qgcache.cpp @@ -630,7 +630,7 @@ void QGCache::statistics() const #if defined(DEBUG) QString line; line.fill( '*', 80 ); - qDebug( line.ascii() ); + qDebug( "%s",line.ascii() ); qDebug( "CACHE STATISTICS:" ); qDebug( "cache contains %d item%s, with a total cost of %d", count(), count() != 1 ? "s" : "", tCost ); @@ -651,7 +651,7 @@ void QGCache::statistics() const lruList->dumps != 1 ? "have" : "has", lruList->dumpCosts ); qDebug( "Statistics from internal dictionary class:" ); dict->statistics(); - qDebug( line.ascii() ); + qDebug( "%s",line.ascii() ); #endif } diff --git a/qtools/qgdict.cpp b/qtools/qgdict.cpp index e55d059..e51b9c1 100644 --- a/qtools/qgdict.cpp +++ b/qtools/qgdict.cpp @@ -907,11 +907,11 @@ void QGDict::statistics() const QString line; line.fill( '-', 60 ); double real, ideal; - qDebug( line.ascii() ); + qDebug( "%s",line.ascii() ); qDebug( "DICTIONARY STATISTICS:" ); if ( count() == 0 ) { qDebug( "Empty!" ); - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); return; } real = 0.0; @@ -932,7 +932,7 @@ void QGDict::statistics() const while ( b-- ) *pbuf++ = '*'; *pbuf = '\0'; - qDebug( buf ); + qDebug( "%s", buf ); i++; } qDebug( "Array size = %d", size() ); @@ -940,7 +940,7 @@ void QGDict::statistics() const qDebug( "Real dist = %g", real ); qDebug( "Rand dist = %g", ideal ); qDebug( "Real/Rand = %g", real/ideal ); - qDebug( line.ascii() ); + qDebug( "%s",line.ascii() ); #endif // DEBUG } diff --git a/qtools/qmutex.cpp b/qtools/qmutex.cpp new file mode 100644 index 0000000..fda5f07 --- /dev/null +++ b/qtools/qmutex.cpp @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qglobal.h" + +#include "qmutex.h" +#include "qmutex_p.h" + +QMutex::QMutex() : d(new QMutexPrivate()) +{ +} + +QMutex::~QMutex() +{ + delete d; +} + +void QMutex::lock() +{ + //printf("%p: QMutex::lock(): enter\n",this); + bool isLocked; + isLocked = d->contenders == 0 && d->contenders.testAndSet(0, 1); + if (!isLocked) + { + isLocked = d->contenders.fetchAndAdd(1)==0; + if (!isLocked) + { + // didn't get the lock, wait for it + //printf("%p: QMutex::lock(): wait() %d\n",this,(int)d->contenders); + d->wait(); + + // release lock + d->contenders.fetchAndAdd(-1); + } + } + //printf("%p: QMutex::lock(): leave\n",this); +} + +bool QMutex::tryLock() +{ + bool isLocked = d->contenders == 0 && + d->contenders.testAndSet(0, 1); + return isLocked; +} + +void QMutex::unlock() +{ + //printf("%p: QMutex::unlock(): enter %d\n",this,(int)d->contenders); + if (!d->contenders.testAndSet(1, 0)) + { + //printf("%p: QMutex::unlock(): wakeUp()\n",this); + d->wakeUp(); + } + //printf("%p: QMutex::unlock(): leave\n",this); +} + diff --git a/qtools/qmutex.h b/qtools/qmutex.h new file mode 100644 index 0000000..d3d2ac0 --- /dev/null +++ b/qtools/qmutex.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMUTEX_H +#define QMUTEX_H + +#include "qglobal.h" + +class QMutexPrivate; + +class QMutex +{ +public: + QMutex(); + ~QMutex(); + + void lock(); + bool tryLock(); + void unlock(); + +private: + QMutex(const QMutex &); + QMutex &operator=(const QMutex &); + + QMutexPrivate *d; +}; + +class QMutexLocker +{ + public: + QMutexLocker(QMutex *m) : m_mutex(m) + { + m_mutex->lock(); + } + ~QMutexLocker() + { + m_mutex->unlock(); + } + QMutex *mutex() const { return m_mutex; } + + private: + QMutex *m_mutex; +}; + +#endif // QMUTEX_H diff --git a/qtools/qmutex_p.h b/qtools/qmutex_p.h new file mode 100644 index 0000000..a47b407 --- /dev/null +++ b/qtools/qmutex_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMUTEX_P_H +#define QMUTEX_P_H + +#include "qglobal.h" + +#if defined(_OS_UNIX_) || defined(_OS_MAC_) +#include +#elif defined(_OS_WIN32_) +#include +#endif + +class QAtomicInt +{ + public: + QAtomicInt(int v=0) : m_value(v) {} + bool testAndSet(int expectedValue,int newValue); + int fetchAndAdd(int valueToAdd); + operator int () const { return m_value; } + bool operator==(int value) const { return m_value == value; } + bool operator!=(int value) const { return m_value != value; } + bool operator!() const { return m_value == 0; } + + private: + volatile int m_value; +}; + +class QMutexPrivate +{ +public: + QMutexPrivate(); + ~QMutexPrivate(); + + void wait(); + void wakeUp(); + + QAtomicInt contenders; + +#if defined(_OS_UNIX_) || defined(_OS_MAC_) + volatile bool wakeup; + pthread_mutex_t mutex; + pthread_cond_t cond; +#elif defined(_OS_WIN32_) + HANDLE event; +#else +#error "unsupported platform" +#endif +}; + +#endif // QMUTEX_P_H diff --git a/qtools/qmutex_unix.cpp b/qtools/qmutex_unix.cpp new file mode 100644 index 0000000..4fe9a58 --- /dev/null +++ b/qtools/qmutex_unix.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include "qglobal.h" +#include "qmutex.h" +#include "qmutex_p.h" + +static pthread_mutex_t qAtomicMutex = PTHREAD_MUTEX_INITIALIZER; + +static void report_error(int code, const char *where, const char *what) +{ + if (code != 0) + qWarning("%s: %s failure: %d", where, what, code); +} + + +QMutexPrivate::QMutexPrivate() + : contenders(0), wakeup(FALSE) +{ + report_error(pthread_mutex_init(&mutex, NULL), "QMutex", "mutex init"); + report_error(pthread_cond_init(&cond, NULL), "QMutex", "cv init"); +} + +QMutexPrivate::~QMutexPrivate() +{ + report_error(pthread_cond_destroy(&cond), "QMutex", "cv destroy"); + report_error(pthread_mutex_destroy(&mutex), "QMutex", "mutex destroy"); +} + +void QMutexPrivate::wait() +{ + report_error(pthread_mutex_lock(&mutex), "QMutex::lock", "mutex lock"); + int errorCode = 0; + while (!wakeup) + { + errorCode = pthread_cond_wait(&cond, &mutex); + if (errorCode) + { + report_error(errorCode, "QMutex::lock()", "cv wait"); + } + } + wakeup = FALSE; + report_error(pthread_mutex_unlock(&mutex), "QMutex::lock", "mutex unlock"); +} + +void QMutexPrivate::wakeUp() +{ + report_error(pthread_mutex_lock(&mutex), "QMutex::unlock", "mutex lock"); + wakeup = TRUE; + report_error(pthread_cond_signal(&cond), "QMutex::unlock", "cv signal"); + report_error(pthread_mutex_unlock(&mutex), "QMutex::unlock", "mutex unlock"); +} + +bool QAtomicInt::testAndSet(int expectedValue,int newValue) +{ + bool returnValue = false; + pthread_mutex_lock(&qAtomicMutex); + if (m_value == expectedValue) + { + m_value = newValue; + returnValue = true; + } + pthread_mutex_unlock(&qAtomicMutex); + return returnValue; +} + +int QAtomicInt::fetchAndAdd(int valueToAdd) +{ + int returnValue; + pthread_mutex_lock(&qAtomicMutex); + returnValue = m_value; + m_value += valueToAdd; + pthread_mutex_unlock(&qAtomicMutex); + return returnValue; +} + diff --git a/qtools/qmutex_win32.cpp b/qtools/qmutex_win32.cpp new file mode 100644 index 0000000..2d662ea --- /dev/null +++ b/qtools/qmutex_win32.cpp @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qmutex.h" +#include "qmutex_p.h" + +QMutexPrivate::QMutexPrivate() + : contenders(0) +{ + event = CreateEvent(0, FALSE, FALSE, 0); + if (!event) + qWarning("QMutexPrivate::QMutexPrivate: Cannot create event"); +} + +QMutexPrivate::~QMutexPrivate() +{ + CloseHandle(event); +} + +void QMutexPrivate::wait() +{ + WaitForSingleObject(event, INFINITE); +} + +void QMutexPrivate::wakeUp() +{ + SetEvent(event); +} + +//---------------------------------------------------------------------- + +class QCriticalSection +{ + public: + QCriticalSection() { InitializeCriticalSection(§ion); } + ~QCriticalSection() { DeleteCriticalSection(§ion); } + void lock() { EnterCriticalSection(§ion); } + void unlock() { LeaveCriticalSection(§ion); } + + private: + CRITICAL_SECTION section; +}; + +static QCriticalSection qAtomicCriticalSection; + +bool QAtomicInt::testAndSet(int expectedValue,int newValue) +{ + bool returnValue = false; + qAtomicCriticalSection.lock(); + if (m_value == expectedValue) + { + m_value = newValue; + returnValue = true; + } + qAtomicCriticalSection.unlock(); + return returnValue; +} + +int QAtomicInt::fetchAndAdd(int valueToAdd) +{ + int returnValue; + qAtomicCriticalSection.lock(); + returnValue = m_value; + m_value += valueToAdd; + qAtomicCriticalSection.unlock(); + return returnValue; +} + diff --git a/qtools/qthread.cpp b/qtools/qthread.cpp new file mode 100644 index 0000000..db2a0de --- /dev/null +++ b/qtools/qthread.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qthread.h" +#include "qthread_p.h" + +QThread::QThread() + : d(new QThreadPrivate) +{ +} + +QThread::~QThread() +{ + QMutexLocker locker(&d->mutex); + if (d->running && !d->finished) + qWarning("QThread: Destroyed while thread is still running"); +} + +bool QThread::isFinished() const +{ + QMutexLocker locker(&d->mutex); + return d->finished; +} + +bool QThread::isRunning() const +{ + QMutexLocker locker(&d->mutex); + return d->running; +} + +void QThread::setStackSize(unsigned int stackSize) +{ + QMutexLocker locker(&d->mutex); + if (d->running) + { + qWarning("QThread: Cannot change stack size while thread is running!"); + return; + } + d->stackSize = stackSize; +} + +unsigned int QThread::stackSize() const +{ + QMutexLocker locker(&d->mutex); + return d->stackSize; +} + diff --git a/qtools/qthread.h b/qtools/qthread.h new file mode 100644 index 0000000..81868bd --- /dev/null +++ b/qtools/qthread.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTHREAD_H +#define QTHREAD_H + +class QThreadPrivate; + +class QThread +{ + public: + explicit QThread(); + virtual ~QThread(); + + bool isFinished() const; + bool isRunning() const; + + void start(); + void terminate(); + void wait(); + void setStackSize(unsigned int stackSize); + unsigned int stackSize() const; + static int idealThreadCount(); + +protected: + // events + virtual void started() {} + virtual void finished() {} + virtual void terminated() {} + + // main loop + virtual void run() {} + +private: + QThreadPrivate *d; + friend class QThreadPrivate; +}; + +#endif // QTHREAD_H diff --git a/qtools/qthread_p.h b/qtools/qthread_p.h new file mode 100644 index 0000000..87692aa --- /dev/null +++ b/qtools/qthread_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTHREAD_P_H +#define QTHREAD_P_H + +#include "qglobal.h" + +#if defined(_OS_UNIX_) || defined(_OS_MAC_) +#include +#elif defined(_OS_WIN32_) +#include +#endif + +#include "qthread.h" +#include "qmutex.h" +#include "qwaitcondition.h" + +class QThreadPrivate +{ +public: + QThreadPrivate(); + ~QThreadPrivate(); + + mutable QMutex mutex; + + bool running; + bool finished; + bool terminated; + uint stackSize; + +#if defined(_OS_UNIX_) || defined(_OS_MAC_) + pthread_t thread_id; + QWaitCondition thread_done; + static void *start(void *arg); + static void finish(void *arg); +#elif defined(_OS_WIN32_) + HANDLE handle; + static unsigned int __stdcall start(void *); + static void finish(void *,bool lockAnyway=TRUE); + int waiters; +#else +#error "unsupported platform!" +#endif +}; + +#endif // QTHREAD_P_H diff --git a/qtools/qthread_unix.cpp b/qtools/qthread_unix.cpp new file mode 100644 index 0000000..53242cc --- /dev/null +++ b/qtools/qthread_unix.cpp @@ -0,0 +1,218 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qglobal.h" + +#if defined(_OS_HPUX_) +#include +#elif defined(_OS_MAC_) +#undef DEBUG +#include +#elif defined(_OS_BSDI_) +#include +#include +#include +#include +#endif +#include + +#include "qthread.h" +#include "qthread_p.h" + + +/************************************************************************** + ** QThreadPrivate + *************************************************************************/ + +QThreadPrivate::QThreadPrivate() : + running(FALSE), finished(FALSE), terminated(FALSE), stackSize(0) +{ + thread_id = 0; +} + +QThreadPrivate::~QThreadPrivate() +{ +} + +void *QThreadPrivate::start(void *arg) +{ + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); + pthread_cleanup_push(QThreadPrivate::finish, arg); + + QThread *thr = reinterpret_cast(arg); + + thr->started(); + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + pthread_testcancel(); + thr->run(); + + pthread_cleanup_pop(1); + return 0; +} + +void QThreadPrivate::finish(void *arg) +{ + QThread *thr = reinterpret_cast(arg); + QThreadPrivate *d = thr->d; + QMutexLocker locker(&d->mutex); + + d->running = FALSE; + d->finished = TRUE; + if (d->terminated) + thr->terminated(); + d->terminated = FALSE; + thr->finished(); + + d->thread_id = 0; + d->thread_done.wakeAll(); +} + + + + +/************************************************************************** + ** QThread + *************************************************************************/ + +void QThread::start() +{ + QMutexLocker locker(&d->mutex); + if (d->running) return; + + d->running = TRUE; + d->finished = FALSE; + + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); + pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); + if (d->stackSize>0) + { +#if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0>0) + pthread_attr_setstacksize(&attr,d->stackSize); +#endif + } + int code = pthread_create(&d->thread_id, &attr, QThreadPrivate::start, this); + pthread_attr_destroy(&attr); + + if (code) + { + qWarning("QThread::start: Thread creation error: %d", code); + + d->running = FALSE; + d->finished = FALSE; + d->thread_id = 0; + } +} + +void QThread::terminate() +{ + QMutexLocker locker(&d->mutex); + + if (!d->thread_id) return; + + int code = pthread_cancel(d->thread_id); + if (code) + { + qWarning("QThread::start: Thread termination error: %d", code); + } + else + { + d->terminated = TRUE; + } +} + +void QThread::wait() +{ + QMutexLocker locker(&d->mutex); + if (d->finished || !d->running) return; + + while (d->running) + { + d->thread_done.wait(locker.mutex()); + } +} + +#if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN) +// LSB doesn't define _SC_NPROCESSORS_ONLN. +# define _SC_NPROCESSORS_ONLN 84 +#endif + +int QThread::idealThreadCount() +{ + int cores = -1; +#if defined(_OS_MAC_) + // Mac OS X + cores = MPProcessorsScheduled(); +#elif defined(_OS_HPUX_) + // HP-UX + struct pst_dynamic psd; + if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) + { + perror("pstat_getdynamic"); + cores = -1; + } + else + { + cores = (int)psd.psd_proc_cnt; + } +#elif defined(_OS_BSDI_) + // FreeBSD, OpenBSD, NetBSD, BSD/OS + size_t len = sizeof(cores); + int mib[2]; + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + + if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0) + { + perror("sysctl"); + cores = -1; + } +#elif defined(_OS_IRIX_) + // IRIX + cores = (int)sysconf(_SC_NPROC_ONLN); +#else + // the rest: Linux, Solaris, AIX, Tru64 + cores = (int)sysconf(_SC_NPROCESSORS_ONLN); +#endif + return cores; +} + diff --git a/qtools/qthread_win32.cpp b/qtools/qthread_win32.cpp new file mode 100644 index 0000000..2c62e93 --- /dev/null +++ b/qtools/qthread_win32.cpp @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qthread.h" +#include "qthread_p.h" + +/************************************************************************** + ** QThreadPrivate + *************************************************************************/ + +QThreadPrivate::QThreadPrivate() : + running(FALSE), finished(FALSE), terminated(FALSE), stackSize(0) +{ + handle = NULL; + waiters = 0; +} + +QThreadPrivate::~QThreadPrivate() +{ +} + +unsigned int __stdcall QThreadPrivate::start(void *arg) +{ + QThread *thr = reinterpret_cast(arg); + thr->started(); + thr->run(); + finish(arg); + return 0; +} + +void QThreadPrivate::finish(void *arg,bool lockAnyway) +{ + QThread *thr = reinterpret_cast(arg); + QThreadPrivate *d = thr->d; + + if (lockAnyway) d->mutex.lock(); + + d->running = FALSE; + d->finished = TRUE; + if (d->terminated) thr->terminated(); + d->terminated = FALSE; + thr->finished(); + + if (!d->waiters) + { + CloseHandle(d->handle); + d->handle = 0; + } + + if (lockAnyway) d->mutex.unlock(); +} + +/************************************************************************** + ** QThread + *************************************************************************/ + +void QThread::start() +{ + QMutexLocker locker(&d->mutex); + + if (d->running) return; + + d->running = TRUE; + d->finished = FALSE; + d->terminated = FALSE; + + d->handle = CreateThread(NULL,d->stackSize, + (LPTHREAD_START_ROUTINE)QThreadPrivate::start,this,0,NULL); + + if (!d->handle) + { + qWarning("QThread::start: Failed to create thread: errno=%d",errno); + d->running = FALSE; + d->finished = TRUE; + return; + } +} + +void QThread::terminate() +{ + QMutexLocker locker(&d->mutex); + if (!d->running) return; + TerminateThread(d->handle, 0); + d->terminated = TRUE; + QThreadPrivate::finish(this); +} + +void QThread::wait() +{ + QMutexLocker locker(&d->mutex); + if (d->finished || !d->running) return; + + ++d->waiters; + locker.mutex()->unlock(); + + WaitForSingleObject(d->handle,INFINITE); + + locker.mutex()->lock(); + --d->waiters; + if (!d->finished) // thread was terminated by someone else + { + d->terminated = TRUE; + QThreadPrivate::finish(this); + } + + if (d->finished && d->waiters) + { + CloseHandle(d->handle); + d->handle = 0; + } +} + +int QThread::idealThreadCount() +{ + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + return sysinfo.dwNumberOfProcessors; +} + + diff --git a/qtools/qtools.pro.in b/qtools/qtools.pro.in index d2550f6..f0a1ffa 100644 --- a/qtools/qtools.pro.in +++ b/qtools/qtools.pro.in @@ -44,7 +44,13 @@ HEADERS = qarray.h \ qxml.h \ qvaluestack.h \ qmap.h \ - qmodules.h + qmodules.h \ + qthread.h \ + qthread_p.h \ + qmutex.h \ + qmutex_p.h \ + qwaitcondition.h + SOURCES = qbuffer.cpp \ qcollection.cpp \ scstring.cpp \ @@ -67,15 +73,23 @@ SOURCES = qbuffer.cpp \ qtextcodec.cpp \ qstringlist.cpp \ qxml.cpp \ - qmap.cpp + qmap.cpp \ + qthread.cpp \ + qmutex.cpp unix:SOURCES += qfile_unix.cpp \ qdir_unix.cpp \ - qfileinfo_unix.cpp + qfileinfo_unix.cpp \ + qthread_unix.cpp \ + qmutex_unix.cpp \ + qwaitcondition_unix.cpp win32:SOURCES += qfile_win32.cpp \ qdir_win32.cpp \ - qfileinfo_win32.cpp + qfileinfo_win32.cpp \ + qthread_win32.cpp \ + qmutex_win32.cpp \ + qwaitcondition_win32.cpp INCLUDEPATH = . TMAKE_CXXFLAGS += -DQT_NO_CODECS -DQT_LITE_UNICODE diff --git a/qtools/qwaitcondition.h b/qtools/qwaitcondition.h new file mode 100644 index 0000000..4d5b3bd --- /dev/null +++ b/qtools/qwaitcondition.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAITCONDITION_H +#define QWAITCONDITION_H + +#include "qglobal.h" + +class QWaitConditionPrivate; +class QMutex; + +class QWaitCondition +{ +public: + QWaitCondition(); + ~QWaitCondition(); + + void wait(QMutex *mutex); + + void wakeOne(); + void wakeAll(); + +private: + QWaitCondition(const QWaitCondition &); + QWaitCondition &operator=(const QWaitCondition &); + + QWaitConditionPrivate * d; +}; + +#endif // QWAITCONDITION_H diff --git a/qtools/qwaitcondition_unix.cpp b/qtools/qwaitcondition_unix.cpp new file mode 100644 index 0000000..aa22a4b --- /dev/null +++ b/qtools/qwaitcondition_unix.cpp @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qwaitcondition.h" +#include "qmutex.h" +#include + +#define MIN(a,b) ((a)<(b)?(a):(b)) + +static void report_error(int code, const char *where, const char *what) +{ + if (code != 0) + qWarning("%s: %s failure: %d", where, what, code); +} + +struct QWaitConditionPrivate +{ + pthread_mutex_t mutex; + pthread_cond_t cond; + int waiters; + int wakeups; + + void wait() + { + int code; + for (;;) + { + code = pthread_cond_wait(&cond, &mutex); + if (code == 0 && wakeups == 0) + { + // many vendors warn of spurios wakeups from + // pthread_cond_wait(), especially after signal delivery, + // even though POSIX doesn't allow for it... sigh + continue; + } + break; + } + + --waiters; + if (code == 0) + { + --wakeups; + } + else + { + report_error(code, "QWaitCondition::wait()", "cv wait"); + } + report_error(pthread_mutex_unlock(&mutex), "QWaitCondition::wait()", "mutex unlock"); + } +}; + + +QWaitCondition::QWaitCondition() +{ + d = new QWaitConditionPrivate; + report_error(pthread_mutex_init(&d->mutex, NULL), "QWaitCondition", "mutex init"); + report_error(pthread_cond_init(&d->cond, NULL), "QWaitCondition", "cv init"); + d->waiters = d->wakeups = 0; +} + + +QWaitCondition::~QWaitCondition() +{ + report_error(pthread_cond_destroy(&d->cond), "QWaitCondition", "cv destroy"); + report_error(pthread_mutex_destroy(&d->mutex), "QWaitCondition", "mutex destroy"); + delete d; +} + +void QWaitCondition::wakeOne() +{ + report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wakeOne()", "mutex lock"); + d->wakeups = MIN(d->wakeups + 1, d->waiters); + report_error(pthread_cond_signal(&d->cond), "QWaitCondition::wakeOne()", "cv signal"); + report_error(pthread_mutex_unlock(&d->mutex), "QWaitCondition::wakeOne()", "mutex unlock"); +} + +void QWaitCondition::wakeAll() +{ + report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wakeAll()", "mutex lock"); + d->wakeups = d->waiters; + report_error(pthread_cond_broadcast(&d->cond), "QWaitCondition::wakeAll()", "cv broadcast"); + report_error(pthread_mutex_unlock(&d->mutex), "QWaitCondition::wakeAll()", "mutex unlock"); +} + +void QWaitCondition::wait(QMutex *mutex) +{ + if (!mutex) return; + + report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wait()", "mutex lock"); + ++d->waiters; + mutex->unlock(); + d->wait(); + mutex->lock(); +} + diff --git a/qtools/qwaitcondition_win32.cpp b/qtools/qwaitcondition_win32.cpp new file mode 100644 index 0000000..77eb039 --- /dev/null +++ b/qtools/qwaitcondition_win32.cpp @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "qwaitcondition.h" +#include "qmutex.h" +#include "qlist.h" + +//*********************************************************************** +// QWaitConditionPrivate +// ********************************************************************** + +class QWaitConditionEvent +{ +public: + QWaitConditionEvent() : priority(0), wokenUp(false) + { + event = CreateEvent(NULL, TRUE, FALSE, NULL); + } + ~QWaitConditionEvent() { CloseHandle(event); } + int priority; + bool wokenUp; + HANDLE event; +}; + +class EventQueue : public QList +{ + public: + EventQueue() { setAutoDelete(TRUE); } + ~EventQueue() {} +}; + +class QWaitConditionPrivate +{ +public: + QMutex mtx; + EventQueue queue; + EventQueue freeQueue; + + QWaitConditionEvent *pre(); + void wait(QWaitConditionEvent *wce); + void post(QWaitConditionEvent *wce); +}; + +QWaitConditionEvent *QWaitConditionPrivate::pre() +{ + mtx.lock(); + QWaitConditionEvent *wce = + freeQueue.isEmpty() ? new QWaitConditionEvent : freeQueue.take(0); + wce->priority = GetThreadPriority(GetCurrentThread()); + wce->wokenUp = FALSE; + + // insert 'wce' into the queue (sorted by priority) + uint index = 0; + for (; index < queue.count(); ++index) + { + QWaitConditionEvent *current = queue.at(index); + if (current->priority < wce->priority) + break; + } + queue.insert(index, wce); + mtx.unlock(); + + return wce; +} + +void QWaitConditionPrivate::wait(QWaitConditionEvent *wce) +{ + WaitForSingleObject(wce->event, INFINITE); +} + +void QWaitConditionPrivate::post(QWaitConditionEvent *wce) +{ + mtx.lock(); + + // remove 'wce' from the queue + int idx = queue.find(wce); + ASSERT(idx!=-1); + queue.take(idx); + ResetEvent(wce->event); + freeQueue.append(wce); + + // wakeups delivered after the timeout should be forwarded to the next waiter + if (wce->wokenUp && !queue.isEmpty()) + { + QWaitConditionEvent *other = queue.getFirst(); + SetEvent(other->event); + other->wokenUp = TRUE; + } + + mtx.unlock(); +} + +//*********************************************************************** +// QWaitCondition implementation +//*********************************************************************** + +QWaitCondition::QWaitCondition() +{ + d = new QWaitConditionPrivate; +} + +QWaitCondition::~QWaitCondition() +{ + if (!d->queue.isEmpty()) + { + qWarning("QWaitCondition: Destroyed while threads are still waiting"); + } + delete d; +} + +void QWaitCondition::wait(QMutex *mutex) +{ + if (!mutex) return; + + QWaitConditionEvent *wce = d->pre(); + mutex->unlock(); + d->wait(wce); + mutex->lock(); + d->post(wce); +} + +void QWaitCondition::wakeOne() +{ + // wake up the first waiting thread in the queue + QMutexLocker locker(&d->mtx); + for (uint i = 0; i < d->queue.count(); ++i) + { + QWaitConditionEvent *current = d->queue.at(i); + if (current->wokenUp) continue; + SetEvent(current->event); + current->wokenUp = TRUE; + break; + } +} + +void QWaitCondition::wakeAll() +{ + // wake up the all threads in the queue + QMutexLocker locker(&d->mtx); + for (uint i = 0; i < d->queue.count(); ++i) + { + QWaitConditionEvent *current = d->queue.at(i); + SetEvent(current->event); + current->wokenUp = TRUE; + } +} + diff --git a/qtools/qxml.cpp b/qtools/qxml.cpp index c05ab88..9a24c1b 100644 --- a/qtools/qxml.cpp +++ b/qtools/qxml.cpp @@ -1944,7 +1944,7 @@ bool QXmlSimpleReader::feature( const QString& name, bool *ok ) const } else if ( name == "http://trolltech.com/xml/features/report-whitespace-only-CharData" ) { return d->reportWhitespaceCharData; } else { - qWarning( "Unknown feature " + name ); + qWarning( "Unknown feature %s", name.ascii() ); if ( ok != 0 ) *ok = FALSE; } @@ -1978,7 +1978,7 @@ void QXmlSimpleReader::setFeature( const QString& name, bool value ) } else if ( name == "http://trolltech.com/xml/features/report-whitespace-only-CharData" ) { d->reportWhitespaceCharData = value; } else { - qWarning( "Unknown feature " + name ); + qWarning( "Unknown feature %s", name.ascii() ); } } diff --git a/src/config.xml b/src/config.xml index b360841..f78a620 100644 --- a/src/config.xml +++ b/src/config.xml @@ -833,12 +833,12 @@ reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen will append .docset to the name. ' defval='org.doxygen.Project' depends='GENERATE_DOCSET'/>